From 4161401956a0c6954c354e6abe821c92d071eb52 Mon Sep 17 00:00:00 2001 From: Pablo Date: Mon, 10 Nov 2025 06:39:09 +0100 Subject: [PATCH 1/3] add sbe generated --- v2/sbe/README.md | 14 + v2/sbe/spot_3_1/AccountAllocationsResponse.go | 1253 ++++++ v2/sbe/spot_3_1/AccountCommissionResponse.go | 1142 +++++ .../spot_3_1/AccountOrderRateLimitResponse.go | 408 ++ .../AccountPreventedMatchesResponse.go | 892 ++++ v2/sbe/spot_3_1/AccountResponse.go | 1427 ++++++ v2/sbe/spot_3_1/AccountTradesResponse.go | 1033 +++++ v2/sbe/spot_3_1/AccountType.go | 86 + v2/sbe/spot_3_1/AggTradesResponse.go | 698 +++ v2/sbe/spot_3_1/AllocationType.go | 86 + .../AllowedSelfTradePreventionModes.go | 120 + v2/sbe/spot_3_1/AveragePriceResponse.go | 300 ++ v2/sbe/spot_3_1/BalanceUpdateEvent.go | 418 ++ v2/sbe/spot_3_1/BookTickerResponse.go | 560 +++ v2/sbe/spot_3_1/BookTickerSymbolResponse.go | 476 ++ v2/sbe/spot_3_1/BoolEnum.go | 73 + v2/sbe/spot_3_1/CancelOpenOrdersResponse.go | 203 + v2/sbe/spot_3_1/CancelOrderListResponse.go | 2473 ++++++++++ v2/sbe/spot_3_1/CancelOrderResponse.go | 1773 ++++++++ v2/sbe/spot_3_1/CancelReplaceOrderResponse.go | 258 ++ v2/sbe/spot_3_1/CancelReplaceStatus.go | 99 + v2/sbe/spot_3_1/ContingencyType.go | 86 + v2/sbe/spot_3_1/DepthResponse.go | 640 +++ v2/sbe/spot_3_1/ErrorResponse.go | 357 ++ v2/sbe/spot_3_1/EventStreamTerminatedEvent.go | 183 + v2/sbe/spot_3_1/ExchangeInfoResponse.go | 2212 +++++++++ .../ExchangeMaxNumAlgoOrdersFilter.go | 160 + .../ExchangeMaxNumIcebergOrdersFilter.go | 160 + .../ExchangeMaxNumOrderListsFilter.go | 160 + v2/sbe/spot_3_1/ExchangeMaxNumOrdersFilter.go | 160 + v2/sbe/spot_3_1/ExecutionReportEvent.go | 3269 ++++++++++++++ v2/sbe/spot_3_1/ExecutionType.go | 164 + v2/sbe/spot_3_1/ExternalLockUpdateEvent.go | 417 ++ v2/sbe/spot_3_1/FilterType.go | 333 ++ v2/sbe/spot_3_1/Floor.go | 99 + v2/sbe/spot_3_1/GroupSize16Encoding.go | 112 + v2/sbe/spot_3_1/GroupSizeEncoding.go | 112 + v2/sbe/spot_3_1/IcebergPartsFilter.go | 160 + v2/sbe/spot_3_1/KlinesResponse.go | 920 ++++ v2/sbe/spot_3_1/ListOrderStatus.go | 112 + v2/sbe/spot_3_1/ListStatusEvent.go | 859 ++++ v2/sbe/spot_3_1/ListStatusType.go | 112 + v2/sbe/spot_3_1/LotSizeFilter.go | 334 ++ v2/sbe/spot_3_1/MarketLotSizeFilter.go | 334 ++ v2/sbe/spot_3_1/MatchType.go | 86 + v2/sbe/spot_3_1/MaxAssetFilter.go | 278 ++ v2/sbe/spot_3_1/MaxNumAlgoOrdersFilter.go | 160 + v2/sbe/spot_3_1/MaxNumIcebergOrdersFilter.go | 160 + v2/sbe/spot_3_1/MaxNumOrderAmendsFilter.go | 160 + v2/sbe/spot_3_1/MaxNumOrderListsFilter.go | 160 + v2/sbe/spot_3_1/MaxNumOrdersFilter.go | 160 + v2/sbe/spot_3_1/MaxPositionFilter.go | 218 + v2/sbe/spot_3_1/MessageData.go | 112 + v2/sbe/spot_3_1/MessageData16.go | 112 + v2/sbe/spot_3_1/MessageData8.go | 112 + v2/sbe/spot_3_1/MessageHeader.go | 192 + v2/sbe/spot_3_1/MinNotionalFilter.go | 318 ++ v2/sbe/spot_3_1/MyFiltersResponse.go | 481 ++ v2/sbe/spot_3_1/NewOrderAckResponse.go | 359 ++ v2/sbe/spot_3_1/NewOrderFullResponse.go | 2803 ++++++++++++ v2/sbe/spot_3_1/NewOrderListAckResponse.go | 1059 +++++ v2/sbe/spot_3_1/NewOrderListFullResponse.go | 3503 +++++++++++++++ v2/sbe/spot_3_1/NewOrderListResultResponse.go | 2533 +++++++++++ v2/sbe/spot_3_1/NewOrderResultResponse.go | 1833 ++++++++ v2/sbe/spot_3_1/NonRepresentableMessage.go | 64 + v2/sbe/spot_3_1/NotionalFilter.go | 418 ++ v2/sbe/spot_3_1/OptionalMessageData.go | 112 + v2/sbe/spot_3_1/OptionalMessageData16.go | 112 + v2/sbe/spot_3_1/OptionalVarString.go | 112 + v2/sbe/spot_3_1/OptionalVarString8.go | 112 + .../OrderAmendKeepPriorityResponse.go | 3990 +++++++++++++++++ v2/sbe/spot_3_1/OrderAmendmentsResponse.go | 674 +++ v2/sbe/spot_3_1/OrderCapacity.go | 86 + v2/sbe/spot_3_1/OrderListResponse.go | 684 +++ v2/sbe/spot_3_1/OrderListsResponse.go | 768 ++++ v2/sbe/spot_3_1/OrderResponse.go | 1933 ++++++++ v2/sbe/spot_3_1/OrderSide.go | 86 + v2/sbe/spot_3_1/OrderStatus.go | 190 + v2/sbe/spot_3_1/OrderTestResponse.go | 64 + .../OrderTestWithCommissionsResponse.go | 734 +++ v2/sbe/spot_3_1/OrderType.go | 151 + v2/sbe/spot_3_1/OrderTypes.go | 146 + v2/sbe/spot_3_1/OrdersResponse.go | 2017 +++++++++ .../spot_3_1/OutboundAccountPositionEvent.go | 559 +++ v2/sbe/spot_3_1/PegOffsetType.go | 73 + v2/sbe/spot_3_1/PegPriceType.go | 86 + v2/sbe/spot_3_1/PercentPriceBySideFilter.go | 450 ++ v2/sbe/spot_3_1/PercentPriceFilter.go | 334 ++ v2/sbe/spot_3_1/PingResponse.go | 64 + v2/sbe/spot_3_1/PriceFilter.go | 334 ++ v2/sbe/spot_3_1/PriceTickerResponse.go | 327 ++ v2/sbe/spot_3_1/PriceTickerSymbolResponse.go | 243 + v2/sbe/spot_3_1/RateLimitInterval.go | 112 + v2/sbe/spot_3_1/RateLimitType.go | 112 + v2/sbe/spot_3_1/SbeMarshalling.go | 283 ++ v2/sbe/spot_3_1/SelfTradePreventionMode.go | 125 + v2/sbe/spot_3_1/ServerTimeResponse.go | 124 + v2/sbe/spot_3_1/SymbolStatus.go | 112 + v2/sbe/spot_3_1/TPlusSellFilter.go | 161 + v2/sbe/spot_3_1/Ticker24hFullResponse.go | 1510 +++++++ v2/sbe/spot_3_1/Ticker24hMiniResponse.go | 978 ++++ .../spot_3_1/Ticker24hSymbolFullResponse.go | 1426 ++++++ .../spot_3_1/Ticker24hSymbolMiniResponse.go | 894 ++++ v2/sbe/spot_3_1/TickerFullResponse.go | 1155 +++++ v2/sbe/spot_3_1/TickerMiniResponse.go | 978 ++++ v2/sbe/spot_3_1/TickerSymbolFullResponse.go | 1071 +++++ v2/sbe/spot_3_1/TickerSymbolMiniResponse.go | 894 ++++ v2/sbe/spot_3_1/TimeInForce.go | 99 + v2/sbe/spot_3_1/TradesResponse.go | 640 +++ v2/sbe/spot_3_1/TrailingDeltaFilter.go | 334 ++ v2/sbe/spot_3_1/UserDataStreamPingResponse.go | 64 + .../spot_3_1/UserDataStreamStartResponse.go | 124 + v2/sbe/spot_3_1/UserDataStreamStopResponse.go | 64 + ...rDataStreamSubscribeListenTokenResponse.go | 182 + .../UserDataStreamSubscribeResponse.go | 125 + .../UserDataStreamUnsubscribeResponse.go | 64 + v2/sbe/spot_3_1/VarString.go | 112 + v2/sbe/spot_3_1/VarString8.go | 112 + v2/sbe/spot_3_1/WebSocketResponse.go | 623 +++ .../spot_3_1/WebSocketSessionLogonResponse.go | 384 ++ .../WebSocketSessionLogoutResponse.go | 385 ++ .../WebSocketSessionStatusResponse.go | 385 ++ .../WebSocketSessionSubscriptionsResponse.go | 267 ++ 123 files changed, 68868 insertions(+) create mode 100644 v2/sbe/README.md create mode 100644 v2/sbe/spot_3_1/AccountAllocationsResponse.go create mode 100644 v2/sbe/spot_3_1/AccountCommissionResponse.go create mode 100644 v2/sbe/spot_3_1/AccountOrderRateLimitResponse.go create mode 100644 v2/sbe/spot_3_1/AccountPreventedMatchesResponse.go create mode 100644 v2/sbe/spot_3_1/AccountResponse.go create mode 100644 v2/sbe/spot_3_1/AccountTradesResponse.go create mode 100644 v2/sbe/spot_3_1/AccountType.go create mode 100644 v2/sbe/spot_3_1/AggTradesResponse.go create mode 100644 v2/sbe/spot_3_1/AllocationType.go create mode 100644 v2/sbe/spot_3_1/AllowedSelfTradePreventionModes.go create mode 100644 v2/sbe/spot_3_1/AveragePriceResponse.go create mode 100644 v2/sbe/spot_3_1/BalanceUpdateEvent.go create mode 100644 v2/sbe/spot_3_1/BookTickerResponse.go create mode 100644 v2/sbe/spot_3_1/BookTickerSymbolResponse.go create mode 100644 v2/sbe/spot_3_1/BoolEnum.go create mode 100644 v2/sbe/spot_3_1/CancelOpenOrdersResponse.go create mode 100644 v2/sbe/spot_3_1/CancelOrderListResponse.go create mode 100644 v2/sbe/spot_3_1/CancelOrderResponse.go create mode 100644 v2/sbe/spot_3_1/CancelReplaceOrderResponse.go create mode 100644 v2/sbe/spot_3_1/CancelReplaceStatus.go create mode 100644 v2/sbe/spot_3_1/ContingencyType.go create mode 100644 v2/sbe/spot_3_1/DepthResponse.go create mode 100644 v2/sbe/spot_3_1/ErrorResponse.go create mode 100644 v2/sbe/spot_3_1/EventStreamTerminatedEvent.go create mode 100644 v2/sbe/spot_3_1/ExchangeInfoResponse.go create mode 100644 v2/sbe/spot_3_1/ExchangeMaxNumAlgoOrdersFilter.go create mode 100644 v2/sbe/spot_3_1/ExchangeMaxNumIcebergOrdersFilter.go create mode 100644 v2/sbe/spot_3_1/ExchangeMaxNumOrderListsFilter.go create mode 100644 v2/sbe/spot_3_1/ExchangeMaxNumOrdersFilter.go create mode 100644 v2/sbe/spot_3_1/ExecutionReportEvent.go create mode 100644 v2/sbe/spot_3_1/ExecutionType.go create mode 100644 v2/sbe/spot_3_1/ExternalLockUpdateEvent.go create mode 100644 v2/sbe/spot_3_1/FilterType.go create mode 100644 v2/sbe/spot_3_1/Floor.go create mode 100644 v2/sbe/spot_3_1/GroupSize16Encoding.go create mode 100644 v2/sbe/spot_3_1/GroupSizeEncoding.go create mode 100644 v2/sbe/spot_3_1/IcebergPartsFilter.go create mode 100644 v2/sbe/spot_3_1/KlinesResponse.go create mode 100644 v2/sbe/spot_3_1/ListOrderStatus.go create mode 100644 v2/sbe/spot_3_1/ListStatusEvent.go create mode 100644 v2/sbe/spot_3_1/ListStatusType.go create mode 100644 v2/sbe/spot_3_1/LotSizeFilter.go create mode 100644 v2/sbe/spot_3_1/MarketLotSizeFilter.go create mode 100644 v2/sbe/spot_3_1/MatchType.go create mode 100644 v2/sbe/spot_3_1/MaxAssetFilter.go create mode 100644 v2/sbe/spot_3_1/MaxNumAlgoOrdersFilter.go create mode 100644 v2/sbe/spot_3_1/MaxNumIcebergOrdersFilter.go create mode 100644 v2/sbe/spot_3_1/MaxNumOrderAmendsFilter.go create mode 100644 v2/sbe/spot_3_1/MaxNumOrderListsFilter.go create mode 100644 v2/sbe/spot_3_1/MaxNumOrdersFilter.go create mode 100644 v2/sbe/spot_3_1/MaxPositionFilter.go create mode 100644 v2/sbe/spot_3_1/MessageData.go create mode 100644 v2/sbe/spot_3_1/MessageData16.go create mode 100644 v2/sbe/spot_3_1/MessageData8.go create mode 100644 v2/sbe/spot_3_1/MessageHeader.go create mode 100644 v2/sbe/spot_3_1/MinNotionalFilter.go create mode 100644 v2/sbe/spot_3_1/MyFiltersResponse.go create mode 100644 v2/sbe/spot_3_1/NewOrderAckResponse.go create mode 100644 v2/sbe/spot_3_1/NewOrderFullResponse.go create mode 100644 v2/sbe/spot_3_1/NewOrderListAckResponse.go create mode 100644 v2/sbe/spot_3_1/NewOrderListFullResponse.go create mode 100644 v2/sbe/spot_3_1/NewOrderListResultResponse.go create mode 100644 v2/sbe/spot_3_1/NewOrderResultResponse.go create mode 100644 v2/sbe/spot_3_1/NonRepresentableMessage.go create mode 100644 v2/sbe/spot_3_1/NotionalFilter.go create mode 100644 v2/sbe/spot_3_1/OptionalMessageData.go create mode 100644 v2/sbe/spot_3_1/OptionalMessageData16.go create mode 100644 v2/sbe/spot_3_1/OptionalVarString.go create mode 100644 v2/sbe/spot_3_1/OptionalVarString8.go create mode 100644 v2/sbe/spot_3_1/OrderAmendKeepPriorityResponse.go create mode 100644 v2/sbe/spot_3_1/OrderAmendmentsResponse.go create mode 100644 v2/sbe/spot_3_1/OrderCapacity.go create mode 100644 v2/sbe/spot_3_1/OrderListResponse.go create mode 100644 v2/sbe/spot_3_1/OrderListsResponse.go create mode 100644 v2/sbe/spot_3_1/OrderResponse.go create mode 100644 v2/sbe/spot_3_1/OrderSide.go create mode 100644 v2/sbe/spot_3_1/OrderStatus.go create mode 100644 v2/sbe/spot_3_1/OrderTestResponse.go create mode 100644 v2/sbe/spot_3_1/OrderTestWithCommissionsResponse.go create mode 100644 v2/sbe/spot_3_1/OrderType.go create mode 100644 v2/sbe/spot_3_1/OrderTypes.go create mode 100644 v2/sbe/spot_3_1/OrdersResponse.go create mode 100644 v2/sbe/spot_3_1/OutboundAccountPositionEvent.go create mode 100644 v2/sbe/spot_3_1/PegOffsetType.go create mode 100644 v2/sbe/spot_3_1/PegPriceType.go create mode 100644 v2/sbe/spot_3_1/PercentPriceBySideFilter.go create mode 100644 v2/sbe/spot_3_1/PercentPriceFilter.go create mode 100644 v2/sbe/spot_3_1/PingResponse.go create mode 100644 v2/sbe/spot_3_1/PriceFilter.go create mode 100644 v2/sbe/spot_3_1/PriceTickerResponse.go create mode 100644 v2/sbe/spot_3_1/PriceTickerSymbolResponse.go create mode 100644 v2/sbe/spot_3_1/RateLimitInterval.go create mode 100644 v2/sbe/spot_3_1/RateLimitType.go create mode 100644 v2/sbe/spot_3_1/SbeMarshalling.go create mode 100644 v2/sbe/spot_3_1/SelfTradePreventionMode.go create mode 100644 v2/sbe/spot_3_1/ServerTimeResponse.go create mode 100644 v2/sbe/spot_3_1/SymbolStatus.go create mode 100644 v2/sbe/spot_3_1/TPlusSellFilter.go create mode 100644 v2/sbe/spot_3_1/Ticker24hFullResponse.go create mode 100644 v2/sbe/spot_3_1/Ticker24hMiniResponse.go create mode 100644 v2/sbe/spot_3_1/Ticker24hSymbolFullResponse.go create mode 100644 v2/sbe/spot_3_1/Ticker24hSymbolMiniResponse.go create mode 100644 v2/sbe/spot_3_1/TickerFullResponse.go create mode 100644 v2/sbe/spot_3_1/TickerMiniResponse.go create mode 100644 v2/sbe/spot_3_1/TickerSymbolFullResponse.go create mode 100644 v2/sbe/spot_3_1/TickerSymbolMiniResponse.go create mode 100644 v2/sbe/spot_3_1/TimeInForce.go create mode 100644 v2/sbe/spot_3_1/TradesResponse.go create mode 100644 v2/sbe/spot_3_1/TrailingDeltaFilter.go create mode 100644 v2/sbe/spot_3_1/UserDataStreamPingResponse.go create mode 100644 v2/sbe/spot_3_1/UserDataStreamStartResponse.go create mode 100644 v2/sbe/spot_3_1/UserDataStreamStopResponse.go create mode 100644 v2/sbe/spot_3_1/UserDataStreamSubscribeListenTokenResponse.go create mode 100644 v2/sbe/spot_3_1/UserDataStreamSubscribeResponse.go create mode 100644 v2/sbe/spot_3_1/UserDataStreamUnsubscribeResponse.go create mode 100644 v2/sbe/spot_3_1/VarString.go create mode 100644 v2/sbe/spot_3_1/VarString8.go create mode 100644 v2/sbe/spot_3_1/WebSocketResponse.go create mode 100644 v2/sbe/spot_3_1/WebSocketSessionLogonResponse.go create mode 100644 v2/sbe/spot_3_1/WebSocketSessionLogoutResponse.go create mode 100644 v2/sbe/spot_3_1/WebSocketSessionStatusResponse.go create mode 100644 v2/sbe/spot_3_1/WebSocketSessionSubscriptionsResponse.go diff --git a/v2/sbe/README.md b/v2/sbe/README.md new file mode 100644 index 00000000..20d14c1e --- /dev/null +++ b/v2/sbe/README.md @@ -0,0 +1,14 @@ +## Generate SBE code +- Install Java +- Download latest sbe schema +```bash +git clone https://github.com/aeron-io/simple-binary-encoding.git +cd simple-binary-encoding +./gradlew +``` +Run following command to generate golang code: +```bash +java --add-opens java.base/jdk.internal.misc=ALL-UNNAMED -Dsbe.generate.ir=true -Dsbe.target.language=Cpp -Dsbe.target.namespace=sbe -Dsbe.output.dir=include/gen -Dsbe.errorLog=yes -jar sbe-all/build/libs/sbe-all-${SBE_TOOL_VERSION}.jar {SBE_SCHEMA}.xml +``` + + diff --git a/v2/sbe/spot_3_1/AccountAllocationsResponse.go b/v2/sbe/spot_3_1/AccountAllocationsResponse.go new file mode 100644 index 00000000..079e19a3 --- /dev/null +++ b/v2/sbe/spot_3_1/AccountAllocationsResponse.go @@ -0,0 +1,1253 @@ +// Generated SBE (Simple Binary Encoding) message codec + +package sbe + +import ( + "errors" + "fmt" + "io" + "io/ioutil" + "math" + "unicode/utf8" +) + +type AccountAllocationsResponse struct { + Allocations []AccountAllocationsResponseAllocations +} +type AccountAllocationsResponseAllocations struct { + PriceExponent int8 + QtyExponent int8 + CommissionExponent int8 + AllocationId int64 + AllocationType AllocationTypeEnum + OrderId int64 + OrderListId int64 + SourceTradeId int64 + SourceAllocationId int64 + Price int64 + Qty int64 + QuoteQty int64 + Commission int64 + Time int64 + IsBuyer BoolEnumEnum + IsMaker BoolEnumEnum + IsAllocator BoolEnumEnum + Symbol []uint8 + CommissionAsset []uint8 + SourceSymbol []uint8 +} + +func (a *AccountAllocationsResponse) Encode(_m *SbeGoMarshaller, _w io.Writer, doRangeCheck bool) error { + if doRangeCheck { + if err := a.RangeCheck(a.SbeSchemaVersion(), a.SbeSchemaVersion()); err != nil { + return err + } + } + var AllocationsBlockLength uint16 = 87 + if err := _m.WriteUint16(_w, AllocationsBlockLength); err != nil { + return err + } + var AllocationsNumInGroup uint32 = uint32(len(a.Allocations)) + if err := _m.WriteUint32(_w, AllocationsNumInGroup); err != nil { + return err + } + for i := range a.Allocations { + if err := a.Allocations[i].Encode(_m, _w); err != nil { + return err + } + } + return nil +} + +func (a *AccountAllocationsResponse) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint16, doRangeCheck bool) error { + if actingVersion > a.SbeSchemaVersion() && blockLength > a.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-a.SbeBlockLength())) + } + + if a.AllocationsInActingVersion(actingVersion) { + var AllocationsBlockLength uint16 + if err := _m.ReadUint16(_r, &AllocationsBlockLength); err != nil { + return err + } + var AllocationsNumInGroup uint32 + if err := _m.ReadUint32(_r, &AllocationsNumInGroup); err != nil { + return err + } + if cap(a.Allocations) < int(AllocationsNumInGroup) { + a.Allocations = make([]AccountAllocationsResponseAllocations, AllocationsNumInGroup) + } + a.Allocations = a.Allocations[:AllocationsNumInGroup] + for i := range a.Allocations { + if err := a.Allocations[i].Decode(_m, _r, actingVersion, uint(AllocationsBlockLength)); err != nil { + return err + } + } + } + if doRangeCheck { + if err := a.RangeCheck(actingVersion, a.SbeSchemaVersion()); err != nil { + return err + } + } + return nil +} + +func (a *AccountAllocationsResponse) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + for i := range a.Allocations { + if err := a.Allocations[i].RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + } + return nil +} + +func AccountAllocationsResponseInit(a *AccountAllocationsResponse) { + return +} + +func (a *AccountAllocationsResponseAllocations) Encode(_m *SbeGoMarshaller, _w io.Writer) error { + if err := _m.WriteInt8(_w, a.PriceExponent); err != nil { + return err + } + if err := _m.WriteInt8(_w, a.QtyExponent); err != nil { + return err + } + if err := _m.WriteInt8(_w, a.CommissionExponent); err != nil { + return err + } + if err := _m.WriteInt64(_w, a.AllocationId); err != nil { + return err + } + if err := a.AllocationType.Encode(_m, _w); err != nil { + return err + } + if err := _m.WriteInt64(_w, a.OrderId); err != nil { + return err + } + if err := _m.WriteInt64(_w, a.OrderListId); err != nil { + return err + } + if err := _m.WriteInt64(_w, a.SourceTradeId); err != nil { + return err + } + if err := _m.WriteInt64(_w, a.SourceAllocationId); err != nil { + return err + } + if err := _m.WriteInt64(_w, a.Price); err != nil { + return err + } + if err := _m.WriteInt64(_w, a.Qty); err != nil { + return err + } + if err := _m.WriteInt64(_w, a.QuoteQty); err != nil { + return err + } + if err := _m.WriteInt64(_w, a.Commission); err != nil { + return err + } + if err := _m.WriteInt64(_w, a.Time); err != nil { + return err + } + if err := a.IsBuyer.Encode(_m, _w); err != nil { + return err + } + if err := a.IsMaker.Encode(_m, _w); err != nil { + return err + } + if err := a.IsAllocator.Encode(_m, _w); err != nil { + return err + } + if err := _m.WriteUint8(_w, uint8(len(a.Symbol))); err != nil { + return err + } + if err := _m.WriteBytes(_w, a.Symbol); err != nil { + return err + } + if err := _m.WriteUint8(_w, uint8(len(a.CommissionAsset))); err != nil { + return err + } + if err := _m.WriteBytes(_w, a.CommissionAsset); err != nil { + return err + } + if err := _m.WriteUint8(_w, uint8(len(a.SourceSymbol))); err != nil { + return err + } + if err := _m.WriteBytes(_w, a.SourceSymbol); err != nil { + return err + } + return nil +} + +func (a *AccountAllocationsResponseAllocations) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint) error { + if !a.PriceExponentInActingVersion(actingVersion) { + a.PriceExponent = a.PriceExponentNullValue() + } else { + if err := _m.ReadInt8(_r, &a.PriceExponent); err != nil { + return err + } + } + if !a.QtyExponentInActingVersion(actingVersion) { + a.QtyExponent = a.QtyExponentNullValue() + } else { + if err := _m.ReadInt8(_r, &a.QtyExponent); err != nil { + return err + } + } + if !a.CommissionExponentInActingVersion(actingVersion) { + a.CommissionExponent = a.CommissionExponentNullValue() + } else { + if err := _m.ReadInt8(_r, &a.CommissionExponent); err != nil { + return err + } + } + if !a.AllocationIdInActingVersion(actingVersion) { + a.AllocationId = a.AllocationIdNullValue() + } else { + if err := _m.ReadInt64(_r, &a.AllocationId); err != nil { + return err + } + } + if a.AllocationTypeInActingVersion(actingVersion) { + if err := a.AllocationType.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if !a.OrderIdInActingVersion(actingVersion) { + a.OrderId = a.OrderIdNullValue() + } else { + if err := _m.ReadInt64(_r, &a.OrderId); err != nil { + return err + } + } + if !a.OrderListIdInActingVersion(actingVersion) { + a.OrderListId = a.OrderListIdNullValue() + } else { + if err := _m.ReadInt64(_r, &a.OrderListId); err != nil { + return err + } + } + if !a.SourceTradeIdInActingVersion(actingVersion) { + a.SourceTradeId = a.SourceTradeIdNullValue() + } else { + if err := _m.ReadInt64(_r, &a.SourceTradeId); err != nil { + return err + } + } + if !a.SourceAllocationIdInActingVersion(actingVersion) { + a.SourceAllocationId = a.SourceAllocationIdNullValue() + } else { + if err := _m.ReadInt64(_r, &a.SourceAllocationId); err != nil { + return err + } + } + if !a.PriceInActingVersion(actingVersion) { + a.Price = a.PriceNullValue() + } else { + if err := _m.ReadInt64(_r, &a.Price); err != nil { + return err + } + } + if !a.QtyInActingVersion(actingVersion) { + a.Qty = a.QtyNullValue() + } else { + if err := _m.ReadInt64(_r, &a.Qty); err != nil { + return err + } + } + if !a.QuoteQtyInActingVersion(actingVersion) { + a.QuoteQty = a.QuoteQtyNullValue() + } else { + if err := _m.ReadInt64(_r, &a.QuoteQty); err != nil { + return err + } + } + if !a.CommissionInActingVersion(actingVersion) { + a.Commission = a.CommissionNullValue() + } else { + if err := _m.ReadInt64(_r, &a.Commission); err != nil { + return err + } + } + if !a.TimeInActingVersion(actingVersion) { + a.Time = a.TimeNullValue() + } else { + if err := _m.ReadInt64(_r, &a.Time); err != nil { + return err + } + } + if a.IsBuyerInActingVersion(actingVersion) { + if err := a.IsBuyer.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if a.IsMakerInActingVersion(actingVersion) { + if err := a.IsMaker.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if a.IsAllocatorInActingVersion(actingVersion) { + if err := a.IsAllocator.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if actingVersion > a.SbeSchemaVersion() && blockLength > a.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-a.SbeBlockLength())) + } + + if a.SymbolInActingVersion(actingVersion) { + var SymbolLength uint8 + if err := _m.ReadUint8(_r, &SymbolLength); err != nil { + return err + } + if cap(a.Symbol) < int(SymbolLength) { + a.Symbol = make([]uint8, SymbolLength) + } + a.Symbol = a.Symbol[:SymbolLength] + if err := _m.ReadBytes(_r, a.Symbol); err != nil { + return err + } + } + + if a.CommissionAssetInActingVersion(actingVersion) { + var CommissionAssetLength uint8 + if err := _m.ReadUint8(_r, &CommissionAssetLength); err != nil { + return err + } + if cap(a.CommissionAsset) < int(CommissionAssetLength) { + a.CommissionAsset = make([]uint8, CommissionAssetLength) + } + a.CommissionAsset = a.CommissionAsset[:CommissionAssetLength] + if err := _m.ReadBytes(_r, a.CommissionAsset); err != nil { + return err + } + } + + if a.SourceSymbolInActingVersion(actingVersion) { + var SourceSymbolLength uint8 + if err := _m.ReadUint8(_r, &SourceSymbolLength); err != nil { + return err + } + if cap(a.SourceSymbol) < int(SourceSymbolLength) { + a.SourceSymbol = make([]uint8, SourceSymbolLength) + } + a.SourceSymbol = a.SourceSymbol[:SourceSymbolLength] + if err := _m.ReadBytes(_r, a.SourceSymbol); err != nil { + return err + } + } + return nil +} + +func (a *AccountAllocationsResponseAllocations) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if a.PriceExponentInActingVersion(actingVersion) { + if a.PriceExponent < a.PriceExponentMinValue() || a.PriceExponent > a.PriceExponentMaxValue() { + return fmt.Errorf("Range check failed on a.PriceExponent (%v < %v > %v)", a.PriceExponentMinValue(), a.PriceExponent, a.PriceExponentMaxValue()) + } + } + if a.QtyExponentInActingVersion(actingVersion) { + if a.QtyExponent < a.QtyExponentMinValue() || a.QtyExponent > a.QtyExponentMaxValue() { + return fmt.Errorf("Range check failed on a.QtyExponent (%v < %v > %v)", a.QtyExponentMinValue(), a.QtyExponent, a.QtyExponentMaxValue()) + } + } + if a.CommissionExponentInActingVersion(actingVersion) { + if a.CommissionExponent != a.CommissionExponentNullValue() && (a.CommissionExponent < a.CommissionExponentMinValue() || a.CommissionExponent > a.CommissionExponentMaxValue()) { + return fmt.Errorf("Range check failed on a.CommissionExponent (%v < %v > %v)", a.CommissionExponentMinValue(), a.CommissionExponent, a.CommissionExponentMaxValue()) + } + } + if a.AllocationIdInActingVersion(actingVersion) { + if a.AllocationId < a.AllocationIdMinValue() || a.AllocationId > a.AllocationIdMaxValue() { + return fmt.Errorf("Range check failed on a.AllocationId (%v < %v > %v)", a.AllocationIdMinValue(), a.AllocationId, a.AllocationIdMaxValue()) + } + } + if err := a.AllocationType.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if a.OrderIdInActingVersion(actingVersion) { + if a.OrderId < a.OrderIdMinValue() || a.OrderId > a.OrderIdMaxValue() { + return fmt.Errorf("Range check failed on a.OrderId (%v < %v > %v)", a.OrderIdMinValue(), a.OrderId, a.OrderIdMaxValue()) + } + } + if a.OrderListIdInActingVersion(actingVersion) { + if a.OrderListId != a.OrderListIdNullValue() && (a.OrderListId < a.OrderListIdMinValue() || a.OrderListId > a.OrderListIdMaxValue()) { + return fmt.Errorf("Range check failed on a.OrderListId (%v < %v > %v)", a.OrderListIdMinValue(), a.OrderListId, a.OrderListIdMaxValue()) + } + } + if a.SourceTradeIdInActingVersion(actingVersion) { + if a.SourceTradeId != a.SourceTradeIdNullValue() && (a.SourceTradeId < a.SourceTradeIdMinValue() || a.SourceTradeId > a.SourceTradeIdMaxValue()) { + return fmt.Errorf("Range check failed on a.SourceTradeId (%v < %v > %v)", a.SourceTradeIdMinValue(), a.SourceTradeId, a.SourceTradeIdMaxValue()) + } + } + if a.SourceAllocationIdInActingVersion(actingVersion) { + if a.SourceAllocationId != a.SourceAllocationIdNullValue() && (a.SourceAllocationId < a.SourceAllocationIdMinValue() || a.SourceAllocationId > a.SourceAllocationIdMaxValue()) { + return fmt.Errorf("Range check failed on a.SourceAllocationId (%v < %v > %v)", a.SourceAllocationIdMinValue(), a.SourceAllocationId, a.SourceAllocationIdMaxValue()) + } + } + if a.PriceInActingVersion(actingVersion) { + if a.Price < a.PriceMinValue() || a.Price > a.PriceMaxValue() { + return fmt.Errorf("Range check failed on a.Price (%v < %v > %v)", a.PriceMinValue(), a.Price, a.PriceMaxValue()) + } + } + if a.QtyInActingVersion(actingVersion) { + if a.Qty < a.QtyMinValue() || a.Qty > a.QtyMaxValue() { + return fmt.Errorf("Range check failed on a.Qty (%v < %v > %v)", a.QtyMinValue(), a.Qty, a.QtyMaxValue()) + } + } + if a.QuoteQtyInActingVersion(actingVersion) { + if a.QuoteQty < a.QuoteQtyMinValue() || a.QuoteQty > a.QuoteQtyMaxValue() { + return fmt.Errorf("Range check failed on a.QuoteQty (%v < %v > %v)", a.QuoteQtyMinValue(), a.QuoteQty, a.QuoteQtyMaxValue()) + } + } + if a.CommissionInActingVersion(actingVersion) { + if a.Commission != a.CommissionNullValue() && (a.Commission < a.CommissionMinValue() || a.Commission > a.CommissionMaxValue()) { + return fmt.Errorf("Range check failed on a.Commission (%v < %v > %v)", a.CommissionMinValue(), a.Commission, a.CommissionMaxValue()) + } + } + if a.TimeInActingVersion(actingVersion) { + if a.Time < a.TimeMinValue() || a.Time > a.TimeMaxValue() { + return fmt.Errorf("Range check failed on a.Time (%v < %v > %v)", a.TimeMinValue(), a.Time, a.TimeMaxValue()) + } + } + if err := a.IsBuyer.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if err := a.IsMaker.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if err := a.IsAllocator.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if !utf8.Valid(a.Symbol[:]) { + return errors.New("a.Symbol failed UTF-8 validation") + } + if !utf8.Valid(a.CommissionAsset[:]) { + return errors.New("a.CommissionAsset failed UTF-8 validation") + } + if !utf8.Valid(a.SourceSymbol[:]) { + return errors.New("a.SourceSymbol failed UTF-8 validation") + } + return nil +} + +func AccountAllocationsResponseAllocationsInit(a *AccountAllocationsResponseAllocations) { + a.CommissionExponent = math.MinInt8 + a.OrderListId = math.MinInt64 + a.SourceTradeId = math.MinInt64 + a.SourceAllocationId = math.MinInt64 + a.Commission = math.MinInt64 + return +} + +func (*AccountAllocationsResponse) SbeBlockLength() (blockLength uint16) { + return 0 +} + +func (*AccountAllocationsResponse) SbeTemplateId() (templateId uint16) { + return 404 +} + +func (*AccountAllocationsResponse) SbeSchemaId() (schemaId uint16) { + return 3 +} + +func (*AccountAllocationsResponse) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} + +func (*AccountAllocationsResponse) SbeSemanticType() (semanticType []byte) { + return []byte("") +} + +func (*AccountAllocationsResponse) SbeSemanticVersion() (semanticVersion string) { + return "5.2" +} + +func (*AccountAllocationsResponseAllocations) PriceExponentId() uint16 { + return 1 +} + +func (*AccountAllocationsResponseAllocations) PriceExponentSinceVersion() uint16 { + return 0 +} + +func (a *AccountAllocationsResponseAllocations) PriceExponentInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.PriceExponentSinceVersion() +} + +func (*AccountAllocationsResponseAllocations) PriceExponentDeprecated() uint16 { + return 0 +} + +func (*AccountAllocationsResponseAllocations) PriceExponentMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*AccountAllocationsResponseAllocations) PriceExponentMinValue() int8 { + return math.MinInt8 + 1 +} + +func (*AccountAllocationsResponseAllocations) PriceExponentMaxValue() int8 { + return math.MaxInt8 +} + +func (*AccountAllocationsResponseAllocations) PriceExponentNullValue() int8 { + return math.MinInt8 +} + +func (*AccountAllocationsResponseAllocations) QtyExponentId() uint16 { + return 2 +} + +func (*AccountAllocationsResponseAllocations) QtyExponentSinceVersion() uint16 { + return 0 +} + +func (a *AccountAllocationsResponseAllocations) QtyExponentInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.QtyExponentSinceVersion() +} + +func (*AccountAllocationsResponseAllocations) QtyExponentDeprecated() uint16 { + return 0 +} + +func (*AccountAllocationsResponseAllocations) QtyExponentMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*AccountAllocationsResponseAllocations) QtyExponentMinValue() int8 { + return math.MinInt8 + 1 +} + +func (*AccountAllocationsResponseAllocations) QtyExponentMaxValue() int8 { + return math.MaxInt8 +} + +func (*AccountAllocationsResponseAllocations) QtyExponentNullValue() int8 { + return math.MinInt8 +} + +func (*AccountAllocationsResponseAllocations) CommissionExponentId() uint16 { + return 3 +} + +func (*AccountAllocationsResponseAllocations) CommissionExponentSinceVersion() uint16 { + return 0 +} + +func (a *AccountAllocationsResponseAllocations) CommissionExponentInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.CommissionExponentSinceVersion() +} + +func (*AccountAllocationsResponseAllocations) CommissionExponentDeprecated() uint16 { + return 0 +} + +func (*AccountAllocationsResponseAllocations) CommissionExponentMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*AccountAllocationsResponseAllocations) CommissionExponentMinValue() int8 { + return math.MinInt8 + 1 +} + +func (*AccountAllocationsResponseAllocations) CommissionExponentMaxValue() int8 { + return math.MaxInt8 +} + +func (*AccountAllocationsResponseAllocations) CommissionExponentNullValue() int8 { + return math.MinInt8 +} + +func (*AccountAllocationsResponseAllocations) AllocationIdId() uint16 { + return 4 +} + +func (*AccountAllocationsResponseAllocations) AllocationIdSinceVersion() uint16 { + return 0 +} + +func (a *AccountAllocationsResponseAllocations) AllocationIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.AllocationIdSinceVersion() +} + +func (*AccountAllocationsResponseAllocations) AllocationIdDeprecated() uint16 { + return 0 +} + +func (*AccountAllocationsResponseAllocations) AllocationIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*AccountAllocationsResponseAllocations) AllocationIdMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*AccountAllocationsResponseAllocations) AllocationIdMaxValue() int64 { + return math.MaxInt64 +} + +func (*AccountAllocationsResponseAllocations) AllocationIdNullValue() int64 { + return math.MinInt64 +} + +func (*AccountAllocationsResponseAllocations) AllocationTypeId() uint16 { + return 5 +} + +func (*AccountAllocationsResponseAllocations) AllocationTypeSinceVersion() uint16 { + return 0 +} + +func (a *AccountAllocationsResponseAllocations) AllocationTypeInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.AllocationTypeSinceVersion() +} + +func (*AccountAllocationsResponseAllocations) AllocationTypeDeprecated() uint16 { + return 0 +} + +func (*AccountAllocationsResponseAllocations) AllocationTypeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*AccountAllocationsResponseAllocations) OrderIdId() uint16 { + return 6 +} + +func (*AccountAllocationsResponseAllocations) OrderIdSinceVersion() uint16 { + return 0 +} + +func (a *AccountAllocationsResponseAllocations) OrderIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.OrderIdSinceVersion() +} + +func (*AccountAllocationsResponseAllocations) OrderIdDeprecated() uint16 { + return 0 +} + +func (*AccountAllocationsResponseAllocations) OrderIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*AccountAllocationsResponseAllocations) OrderIdMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*AccountAllocationsResponseAllocations) OrderIdMaxValue() int64 { + return math.MaxInt64 +} + +func (*AccountAllocationsResponseAllocations) OrderIdNullValue() int64 { + return math.MinInt64 +} + +func (*AccountAllocationsResponseAllocations) OrderListIdId() uint16 { + return 7 +} + +func (*AccountAllocationsResponseAllocations) OrderListIdSinceVersion() uint16 { + return 0 +} + +func (a *AccountAllocationsResponseAllocations) OrderListIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.OrderListIdSinceVersion() +} + +func (*AccountAllocationsResponseAllocations) OrderListIdDeprecated() uint16 { + return 0 +} + +func (*AccountAllocationsResponseAllocations) OrderListIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*AccountAllocationsResponseAllocations) OrderListIdMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*AccountAllocationsResponseAllocations) OrderListIdMaxValue() int64 { + return math.MaxInt64 +} + +func (*AccountAllocationsResponseAllocations) OrderListIdNullValue() int64 { + return math.MinInt64 +} + +func (*AccountAllocationsResponseAllocations) SourceTradeIdId() uint16 { + return 8 +} + +func (*AccountAllocationsResponseAllocations) SourceTradeIdSinceVersion() uint16 { + return 0 +} + +func (a *AccountAllocationsResponseAllocations) SourceTradeIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.SourceTradeIdSinceVersion() +} + +func (*AccountAllocationsResponseAllocations) SourceTradeIdDeprecated() uint16 { + return 0 +} + +func (*AccountAllocationsResponseAllocations) SourceTradeIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*AccountAllocationsResponseAllocations) SourceTradeIdMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*AccountAllocationsResponseAllocations) SourceTradeIdMaxValue() int64 { + return math.MaxInt64 +} + +func (*AccountAllocationsResponseAllocations) SourceTradeIdNullValue() int64 { + return math.MinInt64 +} + +func (*AccountAllocationsResponseAllocations) SourceAllocationIdId() uint16 { + return 9 +} + +func (*AccountAllocationsResponseAllocations) SourceAllocationIdSinceVersion() uint16 { + return 0 +} + +func (a *AccountAllocationsResponseAllocations) SourceAllocationIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.SourceAllocationIdSinceVersion() +} + +func (*AccountAllocationsResponseAllocations) SourceAllocationIdDeprecated() uint16 { + return 0 +} + +func (*AccountAllocationsResponseAllocations) SourceAllocationIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*AccountAllocationsResponseAllocations) SourceAllocationIdMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*AccountAllocationsResponseAllocations) SourceAllocationIdMaxValue() int64 { + return math.MaxInt64 +} + +func (*AccountAllocationsResponseAllocations) SourceAllocationIdNullValue() int64 { + return math.MinInt64 +} + +func (*AccountAllocationsResponseAllocations) PriceId() uint16 { + return 10 +} + +func (*AccountAllocationsResponseAllocations) PriceSinceVersion() uint16 { + return 0 +} + +func (a *AccountAllocationsResponseAllocations) PriceInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.PriceSinceVersion() +} + +func (*AccountAllocationsResponseAllocations) PriceDeprecated() uint16 { + return 0 +} + +func (*AccountAllocationsResponseAllocations) PriceMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*AccountAllocationsResponseAllocations) PriceMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*AccountAllocationsResponseAllocations) PriceMaxValue() int64 { + return math.MaxInt64 +} + +func (*AccountAllocationsResponseAllocations) PriceNullValue() int64 { + return math.MinInt64 +} + +func (*AccountAllocationsResponseAllocations) QtyId() uint16 { + return 11 +} + +func (*AccountAllocationsResponseAllocations) QtySinceVersion() uint16 { + return 0 +} + +func (a *AccountAllocationsResponseAllocations) QtyInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.QtySinceVersion() +} + +func (*AccountAllocationsResponseAllocations) QtyDeprecated() uint16 { + return 0 +} + +func (*AccountAllocationsResponseAllocations) QtyMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*AccountAllocationsResponseAllocations) QtyMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*AccountAllocationsResponseAllocations) QtyMaxValue() int64 { + return math.MaxInt64 +} + +func (*AccountAllocationsResponseAllocations) QtyNullValue() int64 { + return math.MinInt64 +} + +func (*AccountAllocationsResponseAllocations) QuoteQtyId() uint16 { + return 12 +} + +func (*AccountAllocationsResponseAllocations) QuoteQtySinceVersion() uint16 { + return 0 +} + +func (a *AccountAllocationsResponseAllocations) QuoteQtyInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.QuoteQtySinceVersion() +} + +func (*AccountAllocationsResponseAllocations) QuoteQtyDeprecated() uint16 { + return 0 +} + +func (*AccountAllocationsResponseAllocations) QuoteQtyMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*AccountAllocationsResponseAllocations) QuoteQtyMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*AccountAllocationsResponseAllocations) QuoteQtyMaxValue() int64 { + return math.MaxInt64 +} + +func (*AccountAllocationsResponseAllocations) QuoteQtyNullValue() int64 { + return math.MinInt64 +} + +func (*AccountAllocationsResponseAllocations) CommissionId() uint16 { + return 13 +} + +func (*AccountAllocationsResponseAllocations) CommissionSinceVersion() uint16 { + return 0 +} + +func (a *AccountAllocationsResponseAllocations) CommissionInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.CommissionSinceVersion() +} + +func (*AccountAllocationsResponseAllocations) CommissionDeprecated() uint16 { + return 0 +} + +func (*AccountAllocationsResponseAllocations) CommissionMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*AccountAllocationsResponseAllocations) CommissionMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*AccountAllocationsResponseAllocations) CommissionMaxValue() int64 { + return math.MaxInt64 +} + +func (*AccountAllocationsResponseAllocations) CommissionNullValue() int64 { + return math.MinInt64 +} + +func (*AccountAllocationsResponseAllocations) TimeId() uint16 { + return 14 +} + +func (*AccountAllocationsResponseAllocations) TimeSinceVersion() uint16 { + return 0 +} + +func (a *AccountAllocationsResponseAllocations) TimeInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.TimeSinceVersion() +} + +func (*AccountAllocationsResponseAllocations) TimeDeprecated() uint16 { + return 0 +} + +func (*AccountAllocationsResponseAllocations) TimeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*AccountAllocationsResponseAllocations) TimeMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*AccountAllocationsResponseAllocations) TimeMaxValue() int64 { + return math.MaxInt64 +} + +func (*AccountAllocationsResponseAllocations) TimeNullValue() int64 { + return math.MinInt64 +} + +func (*AccountAllocationsResponseAllocations) IsBuyerId() uint16 { + return 15 +} + +func (*AccountAllocationsResponseAllocations) IsBuyerSinceVersion() uint16 { + return 0 +} + +func (a *AccountAllocationsResponseAllocations) IsBuyerInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.IsBuyerSinceVersion() +} + +func (*AccountAllocationsResponseAllocations) IsBuyerDeprecated() uint16 { + return 0 +} + +func (*AccountAllocationsResponseAllocations) IsBuyerMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*AccountAllocationsResponseAllocations) IsMakerId() uint16 { + return 16 +} + +func (*AccountAllocationsResponseAllocations) IsMakerSinceVersion() uint16 { + return 0 +} + +func (a *AccountAllocationsResponseAllocations) IsMakerInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.IsMakerSinceVersion() +} + +func (*AccountAllocationsResponseAllocations) IsMakerDeprecated() uint16 { + return 0 +} + +func (*AccountAllocationsResponseAllocations) IsMakerMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*AccountAllocationsResponseAllocations) IsAllocatorId() uint16 { + return 17 +} + +func (*AccountAllocationsResponseAllocations) IsAllocatorSinceVersion() uint16 { + return 0 +} + +func (a *AccountAllocationsResponseAllocations) IsAllocatorInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.IsAllocatorSinceVersion() +} + +func (*AccountAllocationsResponseAllocations) IsAllocatorDeprecated() uint16 { + return 0 +} + +func (*AccountAllocationsResponseAllocations) IsAllocatorMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*AccountAllocationsResponseAllocations) SymbolMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*AccountAllocationsResponseAllocations) SymbolSinceVersion() uint16 { + return 0 +} + +func (a *AccountAllocationsResponseAllocations) SymbolInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.SymbolSinceVersion() +} + +func (*AccountAllocationsResponseAllocations) SymbolDeprecated() uint16 { + return 0 +} + +func (AccountAllocationsResponseAllocations) SymbolCharacterEncoding() string { + return "UTF-8" +} + +func (AccountAllocationsResponseAllocations) SymbolHeaderLength() uint64 { + return 1 +} + +func (*AccountAllocationsResponseAllocations) CommissionAssetMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*AccountAllocationsResponseAllocations) CommissionAssetSinceVersion() uint16 { + return 0 +} + +func (a *AccountAllocationsResponseAllocations) CommissionAssetInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.CommissionAssetSinceVersion() +} + +func (*AccountAllocationsResponseAllocations) CommissionAssetDeprecated() uint16 { + return 0 +} + +func (AccountAllocationsResponseAllocations) CommissionAssetCharacterEncoding() string { + return "UTF-8" +} + +func (AccountAllocationsResponseAllocations) CommissionAssetHeaderLength() uint64 { + return 1 +} + +func (*AccountAllocationsResponseAllocations) SourceSymbolMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*AccountAllocationsResponseAllocations) SourceSymbolSinceVersion() uint16 { + return 0 +} + +func (a *AccountAllocationsResponseAllocations) SourceSymbolInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.SourceSymbolSinceVersion() +} + +func (*AccountAllocationsResponseAllocations) SourceSymbolDeprecated() uint16 { + return 0 +} + +func (AccountAllocationsResponseAllocations) SourceSymbolCharacterEncoding() string { + return "UTF-8" +} + +func (AccountAllocationsResponseAllocations) SourceSymbolHeaderLength() uint64 { + return 1 +} + +func (*AccountAllocationsResponse) AllocationsId() uint16 { + return 100 +} + +func (*AccountAllocationsResponse) AllocationsSinceVersion() uint16 { + return 0 +} + +func (a *AccountAllocationsResponse) AllocationsInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.AllocationsSinceVersion() +} + +func (*AccountAllocationsResponse) AllocationsDeprecated() uint16 { + return 0 +} + +func (*AccountAllocationsResponseAllocations) SbeBlockLength() (blockLength uint) { + return 87 +} + +func (*AccountAllocationsResponseAllocations) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} diff --git a/v2/sbe/spot_3_1/AccountCommissionResponse.go b/v2/sbe/spot_3_1/AccountCommissionResponse.go new file mode 100644 index 00000000..ab677203 --- /dev/null +++ b/v2/sbe/spot_3_1/AccountCommissionResponse.go @@ -0,0 +1,1142 @@ +// Generated SBE (Simple Binary Encoding) message codec + +package sbe + +import ( + "errors" + "fmt" + "io" + "io/ioutil" + "math" + "unicode/utf8" +) + +type AccountCommissionResponse struct { + CommissionExponent int8 + DiscountExponent int8 + StandardCommissionMaker int64 + StandardCommissionTaker int64 + StandardCommissionBuyer int64 + StandardCommissionSeller int64 + TaxCommissionMaker int64 + TaxCommissionTaker int64 + TaxCommissionBuyer int64 + TaxCommissionSeller int64 + DiscountEnabledForAccount BoolEnumEnum + DiscountEnabledForSymbol BoolEnumEnum + Discount int64 + SpecialCommissionMaker int64 + SpecialCommissionTaker int64 + SpecialCommissionBuyer int64 + SpecialCommissionSeller int64 + Symbol []uint8 + DiscountAsset []uint8 +} + +func (a *AccountCommissionResponse) Encode(_m *SbeGoMarshaller, _w io.Writer, doRangeCheck bool) error { + if doRangeCheck { + if err := a.RangeCheck(a.SbeSchemaVersion(), a.SbeSchemaVersion()); err != nil { + return err + } + } + if err := _m.WriteInt8(_w, a.CommissionExponent); err != nil { + return err + } + if err := _m.WriteInt8(_w, a.DiscountExponent); err != nil { + return err + } + if err := _m.WriteInt64(_w, a.StandardCommissionMaker); err != nil { + return err + } + if err := _m.WriteInt64(_w, a.StandardCommissionTaker); err != nil { + return err + } + if err := _m.WriteInt64(_w, a.StandardCommissionBuyer); err != nil { + return err + } + if err := _m.WriteInt64(_w, a.StandardCommissionSeller); err != nil { + return err + } + if err := _m.WriteInt64(_w, a.TaxCommissionMaker); err != nil { + return err + } + if err := _m.WriteInt64(_w, a.TaxCommissionTaker); err != nil { + return err + } + if err := _m.WriteInt64(_w, a.TaxCommissionBuyer); err != nil { + return err + } + if err := _m.WriteInt64(_w, a.TaxCommissionSeller); err != nil { + return err + } + if err := a.DiscountEnabledForAccount.Encode(_m, _w); err != nil { + return err + } + if err := a.DiscountEnabledForSymbol.Encode(_m, _w); err != nil { + return err + } + if err := _m.WriteInt64(_w, a.Discount); err != nil { + return err + } + if err := _m.WriteInt64(_w, a.SpecialCommissionMaker); err != nil { + return err + } + if err := _m.WriteInt64(_w, a.SpecialCommissionTaker); err != nil { + return err + } + if err := _m.WriteInt64(_w, a.SpecialCommissionBuyer); err != nil { + return err + } + if err := _m.WriteInt64(_w, a.SpecialCommissionSeller); err != nil { + return err + } + if err := _m.WriteUint8(_w, uint8(len(a.Symbol))); err != nil { + return err + } + if err := _m.WriteBytes(_w, a.Symbol); err != nil { + return err + } + if err := _m.WriteUint8(_w, uint8(len(a.DiscountAsset))); err != nil { + return err + } + if err := _m.WriteBytes(_w, a.DiscountAsset); err != nil { + return err + } + return nil +} + +func (a *AccountCommissionResponse) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint16, doRangeCheck bool) error { + if !a.CommissionExponentInActingVersion(actingVersion) { + a.CommissionExponent = a.CommissionExponentNullValue() + } else { + if err := _m.ReadInt8(_r, &a.CommissionExponent); err != nil { + return err + } + } + if !a.DiscountExponentInActingVersion(actingVersion) { + a.DiscountExponent = a.DiscountExponentNullValue() + } else { + if err := _m.ReadInt8(_r, &a.DiscountExponent); err != nil { + return err + } + } + if !a.StandardCommissionMakerInActingVersion(actingVersion) { + a.StandardCommissionMaker = a.StandardCommissionMakerNullValue() + } else { + if err := _m.ReadInt64(_r, &a.StandardCommissionMaker); err != nil { + return err + } + } + if !a.StandardCommissionTakerInActingVersion(actingVersion) { + a.StandardCommissionTaker = a.StandardCommissionTakerNullValue() + } else { + if err := _m.ReadInt64(_r, &a.StandardCommissionTaker); err != nil { + return err + } + } + if !a.StandardCommissionBuyerInActingVersion(actingVersion) { + a.StandardCommissionBuyer = a.StandardCommissionBuyerNullValue() + } else { + if err := _m.ReadInt64(_r, &a.StandardCommissionBuyer); err != nil { + return err + } + } + if !a.StandardCommissionSellerInActingVersion(actingVersion) { + a.StandardCommissionSeller = a.StandardCommissionSellerNullValue() + } else { + if err := _m.ReadInt64(_r, &a.StandardCommissionSeller); err != nil { + return err + } + } + if !a.TaxCommissionMakerInActingVersion(actingVersion) { + a.TaxCommissionMaker = a.TaxCommissionMakerNullValue() + } else { + if err := _m.ReadInt64(_r, &a.TaxCommissionMaker); err != nil { + return err + } + } + if !a.TaxCommissionTakerInActingVersion(actingVersion) { + a.TaxCommissionTaker = a.TaxCommissionTakerNullValue() + } else { + if err := _m.ReadInt64(_r, &a.TaxCommissionTaker); err != nil { + return err + } + } + if !a.TaxCommissionBuyerInActingVersion(actingVersion) { + a.TaxCommissionBuyer = a.TaxCommissionBuyerNullValue() + } else { + if err := _m.ReadInt64(_r, &a.TaxCommissionBuyer); err != nil { + return err + } + } + if !a.TaxCommissionSellerInActingVersion(actingVersion) { + a.TaxCommissionSeller = a.TaxCommissionSellerNullValue() + } else { + if err := _m.ReadInt64(_r, &a.TaxCommissionSeller); err != nil { + return err + } + } + if a.DiscountEnabledForAccountInActingVersion(actingVersion) { + if err := a.DiscountEnabledForAccount.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if a.DiscountEnabledForSymbolInActingVersion(actingVersion) { + if err := a.DiscountEnabledForSymbol.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if !a.DiscountInActingVersion(actingVersion) { + a.Discount = a.DiscountNullValue() + } else { + if err := _m.ReadInt64(_r, &a.Discount); err != nil { + return err + } + } + if !a.SpecialCommissionMakerInActingVersion(actingVersion) { + a.SpecialCommissionMaker = a.SpecialCommissionMakerNullValue() + } else { + if err := _m.ReadInt64(_r, &a.SpecialCommissionMaker); err != nil { + return err + } + } + if !a.SpecialCommissionTakerInActingVersion(actingVersion) { + a.SpecialCommissionTaker = a.SpecialCommissionTakerNullValue() + } else { + if err := _m.ReadInt64(_r, &a.SpecialCommissionTaker); err != nil { + return err + } + } + if !a.SpecialCommissionBuyerInActingVersion(actingVersion) { + a.SpecialCommissionBuyer = a.SpecialCommissionBuyerNullValue() + } else { + if err := _m.ReadInt64(_r, &a.SpecialCommissionBuyer); err != nil { + return err + } + } + if !a.SpecialCommissionSellerInActingVersion(actingVersion) { + a.SpecialCommissionSeller = a.SpecialCommissionSellerNullValue() + } else { + if err := _m.ReadInt64(_r, &a.SpecialCommissionSeller); err != nil { + return err + } + } + if actingVersion > a.SbeSchemaVersion() && blockLength > a.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-a.SbeBlockLength())) + } + + if a.SymbolInActingVersion(actingVersion) { + var SymbolLength uint8 + if err := _m.ReadUint8(_r, &SymbolLength); err != nil { + return err + } + if cap(a.Symbol) < int(SymbolLength) { + a.Symbol = make([]uint8, SymbolLength) + } + a.Symbol = a.Symbol[:SymbolLength] + if err := _m.ReadBytes(_r, a.Symbol); err != nil { + return err + } + } + + if a.DiscountAssetInActingVersion(actingVersion) { + var DiscountAssetLength uint8 + if err := _m.ReadUint8(_r, &DiscountAssetLength); err != nil { + return err + } + if cap(a.DiscountAsset) < int(DiscountAssetLength) { + a.DiscountAsset = make([]uint8, DiscountAssetLength) + } + a.DiscountAsset = a.DiscountAsset[:DiscountAssetLength] + if err := _m.ReadBytes(_r, a.DiscountAsset); err != nil { + return err + } + } + if doRangeCheck { + if err := a.RangeCheck(actingVersion, a.SbeSchemaVersion()); err != nil { + return err + } + } + return nil +} + +func (a *AccountCommissionResponse) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if a.CommissionExponentInActingVersion(actingVersion) { + if a.CommissionExponent < a.CommissionExponentMinValue() || a.CommissionExponent > a.CommissionExponentMaxValue() { + return fmt.Errorf("Range check failed on a.CommissionExponent (%v < %v > %v)", a.CommissionExponentMinValue(), a.CommissionExponent, a.CommissionExponentMaxValue()) + } + } + if a.DiscountExponentInActingVersion(actingVersion) { + if a.DiscountExponent < a.DiscountExponentMinValue() || a.DiscountExponent > a.DiscountExponentMaxValue() { + return fmt.Errorf("Range check failed on a.DiscountExponent (%v < %v > %v)", a.DiscountExponentMinValue(), a.DiscountExponent, a.DiscountExponentMaxValue()) + } + } + if a.StandardCommissionMakerInActingVersion(actingVersion) { + if a.StandardCommissionMaker < a.StandardCommissionMakerMinValue() || a.StandardCommissionMaker > a.StandardCommissionMakerMaxValue() { + return fmt.Errorf("Range check failed on a.StandardCommissionMaker (%v < %v > %v)", a.StandardCommissionMakerMinValue(), a.StandardCommissionMaker, a.StandardCommissionMakerMaxValue()) + } + } + if a.StandardCommissionTakerInActingVersion(actingVersion) { + if a.StandardCommissionTaker < a.StandardCommissionTakerMinValue() || a.StandardCommissionTaker > a.StandardCommissionTakerMaxValue() { + return fmt.Errorf("Range check failed on a.StandardCommissionTaker (%v < %v > %v)", a.StandardCommissionTakerMinValue(), a.StandardCommissionTaker, a.StandardCommissionTakerMaxValue()) + } + } + if a.StandardCommissionBuyerInActingVersion(actingVersion) { + if a.StandardCommissionBuyer < a.StandardCommissionBuyerMinValue() || a.StandardCommissionBuyer > a.StandardCommissionBuyerMaxValue() { + return fmt.Errorf("Range check failed on a.StandardCommissionBuyer (%v < %v > %v)", a.StandardCommissionBuyerMinValue(), a.StandardCommissionBuyer, a.StandardCommissionBuyerMaxValue()) + } + } + if a.StandardCommissionSellerInActingVersion(actingVersion) { + if a.StandardCommissionSeller < a.StandardCommissionSellerMinValue() || a.StandardCommissionSeller > a.StandardCommissionSellerMaxValue() { + return fmt.Errorf("Range check failed on a.StandardCommissionSeller (%v < %v > %v)", a.StandardCommissionSellerMinValue(), a.StandardCommissionSeller, a.StandardCommissionSellerMaxValue()) + } + } + if a.TaxCommissionMakerInActingVersion(actingVersion) { + if a.TaxCommissionMaker < a.TaxCommissionMakerMinValue() || a.TaxCommissionMaker > a.TaxCommissionMakerMaxValue() { + return fmt.Errorf("Range check failed on a.TaxCommissionMaker (%v < %v > %v)", a.TaxCommissionMakerMinValue(), a.TaxCommissionMaker, a.TaxCommissionMakerMaxValue()) + } + } + if a.TaxCommissionTakerInActingVersion(actingVersion) { + if a.TaxCommissionTaker < a.TaxCommissionTakerMinValue() || a.TaxCommissionTaker > a.TaxCommissionTakerMaxValue() { + return fmt.Errorf("Range check failed on a.TaxCommissionTaker (%v < %v > %v)", a.TaxCommissionTakerMinValue(), a.TaxCommissionTaker, a.TaxCommissionTakerMaxValue()) + } + } + if a.TaxCommissionBuyerInActingVersion(actingVersion) { + if a.TaxCommissionBuyer < a.TaxCommissionBuyerMinValue() || a.TaxCommissionBuyer > a.TaxCommissionBuyerMaxValue() { + return fmt.Errorf("Range check failed on a.TaxCommissionBuyer (%v < %v > %v)", a.TaxCommissionBuyerMinValue(), a.TaxCommissionBuyer, a.TaxCommissionBuyerMaxValue()) + } + } + if a.TaxCommissionSellerInActingVersion(actingVersion) { + if a.TaxCommissionSeller < a.TaxCommissionSellerMinValue() || a.TaxCommissionSeller > a.TaxCommissionSellerMaxValue() { + return fmt.Errorf("Range check failed on a.TaxCommissionSeller (%v < %v > %v)", a.TaxCommissionSellerMinValue(), a.TaxCommissionSeller, a.TaxCommissionSellerMaxValue()) + } + } + if err := a.DiscountEnabledForAccount.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if err := a.DiscountEnabledForSymbol.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if a.DiscountInActingVersion(actingVersion) { + if a.Discount < a.DiscountMinValue() || a.Discount > a.DiscountMaxValue() { + return fmt.Errorf("Range check failed on a.Discount (%v < %v > %v)", a.DiscountMinValue(), a.Discount, a.DiscountMaxValue()) + } + } + if a.SpecialCommissionMakerInActingVersion(actingVersion) { + if a.SpecialCommissionMaker != a.SpecialCommissionMakerNullValue() && (a.SpecialCommissionMaker < a.SpecialCommissionMakerMinValue() || a.SpecialCommissionMaker > a.SpecialCommissionMakerMaxValue()) { + return fmt.Errorf("Range check failed on a.SpecialCommissionMaker (%v < %v > %v)", a.SpecialCommissionMakerMinValue(), a.SpecialCommissionMaker, a.SpecialCommissionMakerMaxValue()) + } + } + if a.SpecialCommissionTakerInActingVersion(actingVersion) { + if a.SpecialCommissionTaker != a.SpecialCommissionTakerNullValue() && (a.SpecialCommissionTaker < a.SpecialCommissionTakerMinValue() || a.SpecialCommissionTaker > a.SpecialCommissionTakerMaxValue()) { + return fmt.Errorf("Range check failed on a.SpecialCommissionTaker (%v < %v > %v)", a.SpecialCommissionTakerMinValue(), a.SpecialCommissionTaker, a.SpecialCommissionTakerMaxValue()) + } + } + if a.SpecialCommissionBuyerInActingVersion(actingVersion) { + if a.SpecialCommissionBuyer != a.SpecialCommissionBuyerNullValue() && (a.SpecialCommissionBuyer < a.SpecialCommissionBuyerMinValue() || a.SpecialCommissionBuyer > a.SpecialCommissionBuyerMaxValue()) { + return fmt.Errorf("Range check failed on a.SpecialCommissionBuyer (%v < %v > %v)", a.SpecialCommissionBuyerMinValue(), a.SpecialCommissionBuyer, a.SpecialCommissionBuyerMaxValue()) + } + } + if a.SpecialCommissionSellerInActingVersion(actingVersion) { + if a.SpecialCommissionSeller != a.SpecialCommissionSellerNullValue() && (a.SpecialCommissionSeller < a.SpecialCommissionSellerMinValue() || a.SpecialCommissionSeller > a.SpecialCommissionSellerMaxValue()) { + return fmt.Errorf("Range check failed on a.SpecialCommissionSeller (%v < %v > %v)", a.SpecialCommissionSellerMinValue(), a.SpecialCommissionSeller, a.SpecialCommissionSellerMaxValue()) + } + } + if !utf8.Valid(a.Symbol[:]) { + return errors.New("a.Symbol failed UTF-8 validation") + } + if !utf8.Valid(a.DiscountAsset[:]) { + return errors.New("a.DiscountAsset failed UTF-8 validation") + } + return nil +} + +func AccountCommissionResponseInit(a *AccountCommissionResponse) { + a.SpecialCommissionMaker = math.MinInt64 + a.SpecialCommissionTaker = math.MinInt64 + a.SpecialCommissionBuyer = math.MinInt64 + a.SpecialCommissionSeller = math.MinInt64 + return +} + +func (*AccountCommissionResponse) SbeBlockLength() (blockLength uint16) { + return 108 +} + +func (*AccountCommissionResponse) SbeTemplateId() (templateId uint16) { + return 405 +} + +func (*AccountCommissionResponse) SbeSchemaId() (schemaId uint16) { + return 3 +} + +func (*AccountCommissionResponse) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} + +func (*AccountCommissionResponse) SbeSemanticType() (semanticType []byte) { + return []byte("") +} + +func (*AccountCommissionResponse) SbeSemanticVersion() (semanticVersion string) { + return "5.2" +} + +func (*AccountCommissionResponse) CommissionExponentId() uint16 { + return 1 +} + +func (*AccountCommissionResponse) CommissionExponentSinceVersion() uint16 { + return 0 +} + +func (a *AccountCommissionResponse) CommissionExponentInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.CommissionExponentSinceVersion() +} + +func (*AccountCommissionResponse) CommissionExponentDeprecated() uint16 { + return 0 +} + +func (*AccountCommissionResponse) CommissionExponentMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*AccountCommissionResponse) CommissionExponentMinValue() int8 { + return math.MinInt8 + 1 +} + +func (*AccountCommissionResponse) CommissionExponentMaxValue() int8 { + return math.MaxInt8 +} + +func (*AccountCommissionResponse) CommissionExponentNullValue() int8 { + return math.MinInt8 +} + +func (*AccountCommissionResponse) DiscountExponentId() uint16 { + return 2 +} + +func (*AccountCommissionResponse) DiscountExponentSinceVersion() uint16 { + return 0 +} + +func (a *AccountCommissionResponse) DiscountExponentInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.DiscountExponentSinceVersion() +} + +func (*AccountCommissionResponse) DiscountExponentDeprecated() uint16 { + return 0 +} + +func (*AccountCommissionResponse) DiscountExponentMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*AccountCommissionResponse) DiscountExponentMinValue() int8 { + return math.MinInt8 + 1 +} + +func (*AccountCommissionResponse) DiscountExponentMaxValue() int8 { + return math.MaxInt8 +} + +func (*AccountCommissionResponse) DiscountExponentNullValue() int8 { + return math.MinInt8 +} + +func (*AccountCommissionResponse) StandardCommissionMakerId() uint16 { + return 3 +} + +func (*AccountCommissionResponse) StandardCommissionMakerSinceVersion() uint16 { + return 0 +} + +func (a *AccountCommissionResponse) StandardCommissionMakerInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.StandardCommissionMakerSinceVersion() +} + +func (*AccountCommissionResponse) StandardCommissionMakerDeprecated() uint16 { + return 0 +} + +func (*AccountCommissionResponse) StandardCommissionMakerMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*AccountCommissionResponse) StandardCommissionMakerMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*AccountCommissionResponse) StandardCommissionMakerMaxValue() int64 { + return math.MaxInt64 +} + +func (*AccountCommissionResponse) StandardCommissionMakerNullValue() int64 { + return math.MinInt64 +} + +func (*AccountCommissionResponse) StandardCommissionTakerId() uint16 { + return 4 +} + +func (*AccountCommissionResponse) StandardCommissionTakerSinceVersion() uint16 { + return 0 +} + +func (a *AccountCommissionResponse) StandardCommissionTakerInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.StandardCommissionTakerSinceVersion() +} + +func (*AccountCommissionResponse) StandardCommissionTakerDeprecated() uint16 { + return 0 +} + +func (*AccountCommissionResponse) StandardCommissionTakerMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*AccountCommissionResponse) StandardCommissionTakerMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*AccountCommissionResponse) StandardCommissionTakerMaxValue() int64 { + return math.MaxInt64 +} + +func (*AccountCommissionResponse) StandardCommissionTakerNullValue() int64 { + return math.MinInt64 +} + +func (*AccountCommissionResponse) StandardCommissionBuyerId() uint16 { + return 5 +} + +func (*AccountCommissionResponse) StandardCommissionBuyerSinceVersion() uint16 { + return 0 +} + +func (a *AccountCommissionResponse) StandardCommissionBuyerInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.StandardCommissionBuyerSinceVersion() +} + +func (*AccountCommissionResponse) StandardCommissionBuyerDeprecated() uint16 { + return 0 +} + +func (*AccountCommissionResponse) StandardCommissionBuyerMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*AccountCommissionResponse) StandardCommissionBuyerMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*AccountCommissionResponse) StandardCommissionBuyerMaxValue() int64 { + return math.MaxInt64 +} + +func (*AccountCommissionResponse) StandardCommissionBuyerNullValue() int64 { + return math.MinInt64 +} + +func (*AccountCommissionResponse) StandardCommissionSellerId() uint16 { + return 6 +} + +func (*AccountCommissionResponse) StandardCommissionSellerSinceVersion() uint16 { + return 0 +} + +func (a *AccountCommissionResponse) StandardCommissionSellerInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.StandardCommissionSellerSinceVersion() +} + +func (*AccountCommissionResponse) StandardCommissionSellerDeprecated() uint16 { + return 0 +} + +func (*AccountCommissionResponse) StandardCommissionSellerMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*AccountCommissionResponse) StandardCommissionSellerMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*AccountCommissionResponse) StandardCommissionSellerMaxValue() int64 { + return math.MaxInt64 +} + +func (*AccountCommissionResponse) StandardCommissionSellerNullValue() int64 { + return math.MinInt64 +} + +func (*AccountCommissionResponse) TaxCommissionMakerId() uint16 { + return 7 +} + +func (*AccountCommissionResponse) TaxCommissionMakerSinceVersion() uint16 { + return 0 +} + +func (a *AccountCommissionResponse) TaxCommissionMakerInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.TaxCommissionMakerSinceVersion() +} + +func (*AccountCommissionResponse) TaxCommissionMakerDeprecated() uint16 { + return 0 +} + +func (*AccountCommissionResponse) TaxCommissionMakerMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*AccountCommissionResponse) TaxCommissionMakerMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*AccountCommissionResponse) TaxCommissionMakerMaxValue() int64 { + return math.MaxInt64 +} + +func (*AccountCommissionResponse) TaxCommissionMakerNullValue() int64 { + return math.MinInt64 +} + +func (*AccountCommissionResponse) TaxCommissionTakerId() uint16 { + return 8 +} + +func (*AccountCommissionResponse) TaxCommissionTakerSinceVersion() uint16 { + return 0 +} + +func (a *AccountCommissionResponse) TaxCommissionTakerInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.TaxCommissionTakerSinceVersion() +} + +func (*AccountCommissionResponse) TaxCommissionTakerDeprecated() uint16 { + return 0 +} + +func (*AccountCommissionResponse) TaxCommissionTakerMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*AccountCommissionResponse) TaxCommissionTakerMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*AccountCommissionResponse) TaxCommissionTakerMaxValue() int64 { + return math.MaxInt64 +} + +func (*AccountCommissionResponse) TaxCommissionTakerNullValue() int64 { + return math.MinInt64 +} + +func (*AccountCommissionResponse) TaxCommissionBuyerId() uint16 { + return 9 +} + +func (*AccountCommissionResponse) TaxCommissionBuyerSinceVersion() uint16 { + return 0 +} + +func (a *AccountCommissionResponse) TaxCommissionBuyerInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.TaxCommissionBuyerSinceVersion() +} + +func (*AccountCommissionResponse) TaxCommissionBuyerDeprecated() uint16 { + return 0 +} + +func (*AccountCommissionResponse) TaxCommissionBuyerMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*AccountCommissionResponse) TaxCommissionBuyerMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*AccountCommissionResponse) TaxCommissionBuyerMaxValue() int64 { + return math.MaxInt64 +} + +func (*AccountCommissionResponse) TaxCommissionBuyerNullValue() int64 { + return math.MinInt64 +} + +func (*AccountCommissionResponse) TaxCommissionSellerId() uint16 { + return 10 +} + +func (*AccountCommissionResponse) TaxCommissionSellerSinceVersion() uint16 { + return 0 +} + +func (a *AccountCommissionResponse) TaxCommissionSellerInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.TaxCommissionSellerSinceVersion() +} + +func (*AccountCommissionResponse) TaxCommissionSellerDeprecated() uint16 { + return 0 +} + +func (*AccountCommissionResponse) TaxCommissionSellerMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*AccountCommissionResponse) TaxCommissionSellerMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*AccountCommissionResponse) TaxCommissionSellerMaxValue() int64 { + return math.MaxInt64 +} + +func (*AccountCommissionResponse) TaxCommissionSellerNullValue() int64 { + return math.MinInt64 +} + +func (*AccountCommissionResponse) DiscountEnabledForAccountId() uint16 { + return 11 +} + +func (*AccountCommissionResponse) DiscountEnabledForAccountSinceVersion() uint16 { + return 0 +} + +func (a *AccountCommissionResponse) DiscountEnabledForAccountInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.DiscountEnabledForAccountSinceVersion() +} + +func (*AccountCommissionResponse) DiscountEnabledForAccountDeprecated() uint16 { + return 0 +} + +func (*AccountCommissionResponse) DiscountEnabledForAccountMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*AccountCommissionResponse) DiscountEnabledForSymbolId() uint16 { + return 12 +} + +func (*AccountCommissionResponse) DiscountEnabledForSymbolSinceVersion() uint16 { + return 0 +} + +func (a *AccountCommissionResponse) DiscountEnabledForSymbolInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.DiscountEnabledForSymbolSinceVersion() +} + +func (*AccountCommissionResponse) DiscountEnabledForSymbolDeprecated() uint16 { + return 0 +} + +func (*AccountCommissionResponse) DiscountEnabledForSymbolMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*AccountCommissionResponse) DiscountId() uint16 { + return 13 +} + +func (*AccountCommissionResponse) DiscountSinceVersion() uint16 { + return 0 +} + +func (a *AccountCommissionResponse) DiscountInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.DiscountSinceVersion() +} + +func (*AccountCommissionResponse) DiscountDeprecated() uint16 { + return 0 +} + +func (*AccountCommissionResponse) DiscountMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*AccountCommissionResponse) DiscountMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*AccountCommissionResponse) DiscountMaxValue() int64 { + return math.MaxInt64 +} + +func (*AccountCommissionResponse) DiscountNullValue() int64 { + return math.MinInt64 +} + +func (*AccountCommissionResponse) SpecialCommissionMakerId() uint16 { + return 14 +} + +func (*AccountCommissionResponse) SpecialCommissionMakerSinceVersion() uint16 { + return 1 +} + +func (a *AccountCommissionResponse) SpecialCommissionMakerInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.SpecialCommissionMakerSinceVersion() +} + +func (*AccountCommissionResponse) SpecialCommissionMakerDeprecated() uint16 { + return 0 +} + +func (*AccountCommissionResponse) SpecialCommissionMakerMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*AccountCommissionResponse) SpecialCommissionMakerMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*AccountCommissionResponse) SpecialCommissionMakerMaxValue() int64 { + return math.MaxInt64 +} + +func (*AccountCommissionResponse) SpecialCommissionMakerNullValue() int64 { + return math.MinInt64 +} + +func (*AccountCommissionResponse) SpecialCommissionTakerId() uint16 { + return 15 +} + +func (*AccountCommissionResponse) SpecialCommissionTakerSinceVersion() uint16 { + return 1 +} + +func (a *AccountCommissionResponse) SpecialCommissionTakerInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.SpecialCommissionTakerSinceVersion() +} + +func (*AccountCommissionResponse) SpecialCommissionTakerDeprecated() uint16 { + return 0 +} + +func (*AccountCommissionResponse) SpecialCommissionTakerMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*AccountCommissionResponse) SpecialCommissionTakerMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*AccountCommissionResponse) SpecialCommissionTakerMaxValue() int64 { + return math.MaxInt64 +} + +func (*AccountCommissionResponse) SpecialCommissionTakerNullValue() int64 { + return math.MinInt64 +} + +func (*AccountCommissionResponse) SpecialCommissionBuyerId() uint16 { + return 16 +} + +func (*AccountCommissionResponse) SpecialCommissionBuyerSinceVersion() uint16 { + return 1 +} + +func (a *AccountCommissionResponse) SpecialCommissionBuyerInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.SpecialCommissionBuyerSinceVersion() +} + +func (*AccountCommissionResponse) SpecialCommissionBuyerDeprecated() uint16 { + return 0 +} + +func (*AccountCommissionResponse) SpecialCommissionBuyerMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*AccountCommissionResponse) SpecialCommissionBuyerMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*AccountCommissionResponse) SpecialCommissionBuyerMaxValue() int64 { + return math.MaxInt64 +} + +func (*AccountCommissionResponse) SpecialCommissionBuyerNullValue() int64 { + return math.MinInt64 +} + +func (*AccountCommissionResponse) SpecialCommissionSellerId() uint16 { + return 17 +} + +func (*AccountCommissionResponse) SpecialCommissionSellerSinceVersion() uint16 { + return 1 +} + +func (a *AccountCommissionResponse) SpecialCommissionSellerInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.SpecialCommissionSellerSinceVersion() +} + +func (*AccountCommissionResponse) SpecialCommissionSellerDeprecated() uint16 { + return 0 +} + +func (*AccountCommissionResponse) SpecialCommissionSellerMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*AccountCommissionResponse) SpecialCommissionSellerMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*AccountCommissionResponse) SpecialCommissionSellerMaxValue() int64 { + return math.MaxInt64 +} + +func (*AccountCommissionResponse) SpecialCommissionSellerNullValue() int64 { + return math.MinInt64 +} + +func (*AccountCommissionResponse) SymbolMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*AccountCommissionResponse) SymbolSinceVersion() uint16 { + return 0 +} + +func (a *AccountCommissionResponse) SymbolInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.SymbolSinceVersion() +} + +func (*AccountCommissionResponse) SymbolDeprecated() uint16 { + return 0 +} + +func (AccountCommissionResponse) SymbolCharacterEncoding() string { + return "UTF-8" +} + +func (AccountCommissionResponse) SymbolHeaderLength() uint64 { + return 1 +} + +func (*AccountCommissionResponse) DiscountAssetMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*AccountCommissionResponse) DiscountAssetSinceVersion() uint16 { + return 0 +} + +func (a *AccountCommissionResponse) DiscountAssetInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.DiscountAssetSinceVersion() +} + +func (*AccountCommissionResponse) DiscountAssetDeprecated() uint16 { + return 0 +} + +func (AccountCommissionResponse) DiscountAssetCharacterEncoding() string { + return "UTF-8" +} + +func (AccountCommissionResponse) DiscountAssetHeaderLength() uint64 { + return 1 +} diff --git a/v2/sbe/spot_3_1/AccountOrderRateLimitResponse.go b/v2/sbe/spot_3_1/AccountOrderRateLimitResponse.go new file mode 100644 index 00000000..b917168e --- /dev/null +++ b/v2/sbe/spot_3_1/AccountOrderRateLimitResponse.go @@ -0,0 +1,408 @@ +// Generated SBE (Simple Binary Encoding) message codec + +package sbe + +import ( + "fmt" + "io" + "io/ioutil" + "math" +) + +type AccountOrderRateLimitResponse struct { + RateLimits []AccountOrderRateLimitResponseRateLimits +} +type AccountOrderRateLimitResponseRateLimits struct { + RateLimitType RateLimitTypeEnum + Interval RateLimitIntervalEnum + IntervalNum uint8 + RateLimit int64 + NumOrders int64 +} + +func (a *AccountOrderRateLimitResponse) Encode(_m *SbeGoMarshaller, _w io.Writer, doRangeCheck bool) error { + if doRangeCheck { + if err := a.RangeCheck(a.SbeSchemaVersion(), a.SbeSchemaVersion()); err != nil { + return err + } + } + var RateLimitsBlockLength uint16 = 19 + if err := _m.WriteUint16(_w, RateLimitsBlockLength); err != nil { + return err + } + var RateLimitsNumInGroup uint32 = uint32(len(a.RateLimits)) + if err := _m.WriteUint32(_w, RateLimitsNumInGroup); err != nil { + return err + } + for i := range a.RateLimits { + if err := a.RateLimits[i].Encode(_m, _w); err != nil { + return err + } + } + return nil +} + +func (a *AccountOrderRateLimitResponse) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint16, doRangeCheck bool) error { + if actingVersion > a.SbeSchemaVersion() && blockLength > a.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-a.SbeBlockLength())) + } + + if a.RateLimitsInActingVersion(actingVersion) { + var RateLimitsBlockLength uint16 + if err := _m.ReadUint16(_r, &RateLimitsBlockLength); err != nil { + return err + } + var RateLimitsNumInGroup uint32 + if err := _m.ReadUint32(_r, &RateLimitsNumInGroup); err != nil { + return err + } + if cap(a.RateLimits) < int(RateLimitsNumInGroup) { + a.RateLimits = make([]AccountOrderRateLimitResponseRateLimits, RateLimitsNumInGroup) + } + a.RateLimits = a.RateLimits[:RateLimitsNumInGroup] + for i := range a.RateLimits { + if err := a.RateLimits[i].Decode(_m, _r, actingVersion, uint(RateLimitsBlockLength)); err != nil { + return err + } + } + } + if doRangeCheck { + if err := a.RangeCheck(actingVersion, a.SbeSchemaVersion()); err != nil { + return err + } + } + return nil +} + +func (a *AccountOrderRateLimitResponse) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + for i := range a.RateLimits { + if err := a.RateLimits[i].RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + } + return nil +} + +func AccountOrderRateLimitResponseInit(a *AccountOrderRateLimitResponse) { + return +} + +func (a *AccountOrderRateLimitResponseRateLimits) Encode(_m *SbeGoMarshaller, _w io.Writer) error { + if err := a.RateLimitType.Encode(_m, _w); err != nil { + return err + } + if err := a.Interval.Encode(_m, _w); err != nil { + return err + } + if err := _m.WriteUint8(_w, a.IntervalNum); err != nil { + return err + } + if err := _m.WriteInt64(_w, a.RateLimit); err != nil { + return err + } + if err := _m.WriteInt64(_w, a.NumOrders); err != nil { + return err + } + return nil +} + +func (a *AccountOrderRateLimitResponseRateLimits) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint) error { + if a.RateLimitTypeInActingVersion(actingVersion) { + if err := a.RateLimitType.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if a.IntervalInActingVersion(actingVersion) { + if err := a.Interval.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if !a.IntervalNumInActingVersion(actingVersion) { + a.IntervalNum = a.IntervalNumNullValue() + } else { + if err := _m.ReadUint8(_r, &a.IntervalNum); err != nil { + return err + } + } + if !a.RateLimitInActingVersion(actingVersion) { + a.RateLimit = a.RateLimitNullValue() + } else { + if err := _m.ReadInt64(_r, &a.RateLimit); err != nil { + return err + } + } + if !a.NumOrdersInActingVersion(actingVersion) { + a.NumOrders = a.NumOrdersNullValue() + } else { + if err := _m.ReadInt64(_r, &a.NumOrders); err != nil { + return err + } + } + if actingVersion > a.SbeSchemaVersion() && blockLength > a.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-a.SbeBlockLength())) + } + return nil +} + +func (a *AccountOrderRateLimitResponseRateLimits) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if err := a.RateLimitType.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if err := a.Interval.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if a.IntervalNumInActingVersion(actingVersion) { + if a.IntervalNum < a.IntervalNumMinValue() || a.IntervalNum > a.IntervalNumMaxValue() { + return fmt.Errorf("Range check failed on a.IntervalNum (%v < %v > %v)", a.IntervalNumMinValue(), a.IntervalNum, a.IntervalNumMaxValue()) + } + } + if a.RateLimitInActingVersion(actingVersion) { + if a.RateLimit < a.RateLimitMinValue() || a.RateLimit > a.RateLimitMaxValue() { + return fmt.Errorf("Range check failed on a.RateLimit (%v < %v > %v)", a.RateLimitMinValue(), a.RateLimit, a.RateLimitMaxValue()) + } + } + if a.NumOrdersInActingVersion(actingVersion) { + if a.NumOrders < a.NumOrdersMinValue() || a.NumOrders > a.NumOrdersMaxValue() { + return fmt.Errorf("Range check failed on a.NumOrders (%v < %v > %v)", a.NumOrdersMinValue(), a.NumOrders, a.NumOrdersMaxValue()) + } + } + return nil +} + +func AccountOrderRateLimitResponseRateLimitsInit(a *AccountOrderRateLimitResponseRateLimits) { + return +} + +func (*AccountOrderRateLimitResponse) SbeBlockLength() (blockLength uint16) { + return 0 +} + +func (*AccountOrderRateLimitResponse) SbeTemplateId() (templateId uint16) { + return 402 +} + +func (*AccountOrderRateLimitResponse) SbeSchemaId() (schemaId uint16) { + return 3 +} + +func (*AccountOrderRateLimitResponse) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} + +func (*AccountOrderRateLimitResponse) SbeSemanticType() (semanticType []byte) { + return []byte("") +} + +func (*AccountOrderRateLimitResponse) SbeSemanticVersion() (semanticVersion string) { + return "5.2" +} + +func (*AccountOrderRateLimitResponseRateLimits) RateLimitTypeId() uint16 { + return 1 +} + +func (*AccountOrderRateLimitResponseRateLimits) RateLimitTypeSinceVersion() uint16 { + return 0 +} + +func (a *AccountOrderRateLimitResponseRateLimits) RateLimitTypeInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.RateLimitTypeSinceVersion() +} + +func (*AccountOrderRateLimitResponseRateLimits) RateLimitTypeDeprecated() uint16 { + return 0 +} + +func (*AccountOrderRateLimitResponseRateLimits) RateLimitTypeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*AccountOrderRateLimitResponseRateLimits) IntervalId() uint16 { + return 2 +} + +func (*AccountOrderRateLimitResponseRateLimits) IntervalSinceVersion() uint16 { + return 0 +} + +func (a *AccountOrderRateLimitResponseRateLimits) IntervalInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.IntervalSinceVersion() +} + +func (*AccountOrderRateLimitResponseRateLimits) IntervalDeprecated() uint16 { + return 0 +} + +func (*AccountOrderRateLimitResponseRateLimits) IntervalMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*AccountOrderRateLimitResponseRateLimits) IntervalNumId() uint16 { + return 3 +} + +func (*AccountOrderRateLimitResponseRateLimits) IntervalNumSinceVersion() uint16 { + return 0 +} + +func (a *AccountOrderRateLimitResponseRateLimits) IntervalNumInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.IntervalNumSinceVersion() +} + +func (*AccountOrderRateLimitResponseRateLimits) IntervalNumDeprecated() uint16 { + return 0 +} + +func (*AccountOrderRateLimitResponseRateLimits) IntervalNumMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*AccountOrderRateLimitResponseRateLimits) IntervalNumMinValue() uint8 { + return 0 +} + +func (*AccountOrderRateLimitResponseRateLimits) IntervalNumMaxValue() uint8 { + return math.MaxUint8 - 1 +} + +func (*AccountOrderRateLimitResponseRateLimits) IntervalNumNullValue() uint8 { + return math.MaxUint8 +} + +func (*AccountOrderRateLimitResponseRateLimits) RateLimitId() uint16 { + return 4 +} + +func (*AccountOrderRateLimitResponseRateLimits) RateLimitSinceVersion() uint16 { + return 0 +} + +func (a *AccountOrderRateLimitResponseRateLimits) RateLimitInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.RateLimitSinceVersion() +} + +func (*AccountOrderRateLimitResponseRateLimits) RateLimitDeprecated() uint16 { + return 0 +} + +func (*AccountOrderRateLimitResponseRateLimits) RateLimitMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*AccountOrderRateLimitResponseRateLimits) RateLimitMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*AccountOrderRateLimitResponseRateLimits) RateLimitMaxValue() int64 { + return math.MaxInt64 +} + +func (*AccountOrderRateLimitResponseRateLimits) RateLimitNullValue() int64 { + return math.MinInt64 +} + +func (*AccountOrderRateLimitResponseRateLimits) NumOrdersId() uint16 { + return 5 +} + +func (*AccountOrderRateLimitResponseRateLimits) NumOrdersSinceVersion() uint16 { + return 0 +} + +func (a *AccountOrderRateLimitResponseRateLimits) NumOrdersInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.NumOrdersSinceVersion() +} + +func (*AccountOrderRateLimitResponseRateLimits) NumOrdersDeprecated() uint16 { + return 0 +} + +func (*AccountOrderRateLimitResponseRateLimits) NumOrdersMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*AccountOrderRateLimitResponseRateLimits) NumOrdersMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*AccountOrderRateLimitResponseRateLimits) NumOrdersMaxValue() int64 { + return math.MaxInt64 +} + +func (*AccountOrderRateLimitResponseRateLimits) NumOrdersNullValue() int64 { + return math.MinInt64 +} + +func (*AccountOrderRateLimitResponse) RateLimitsId() uint16 { + return 100 +} + +func (*AccountOrderRateLimitResponse) RateLimitsSinceVersion() uint16 { + return 0 +} + +func (a *AccountOrderRateLimitResponse) RateLimitsInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.RateLimitsSinceVersion() +} + +func (*AccountOrderRateLimitResponse) RateLimitsDeprecated() uint16 { + return 0 +} + +func (*AccountOrderRateLimitResponseRateLimits) SbeBlockLength() (blockLength uint) { + return 19 +} + +func (*AccountOrderRateLimitResponseRateLimits) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} diff --git a/v2/sbe/spot_3_1/AccountPreventedMatchesResponse.go b/v2/sbe/spot_3_1/AccountPreventedMatchesResponse.go new file mode 100644 index 00000000..18069ebf --- /dev/null +++ b/v2/sbe/spot_3_1/AccountPreventedMatchesResponse.go @@ -0,0 +1,892 @@ +// Generated SBE (Simple Binary Encoding) message codec + +package sbe + +import ( + "errors" + "fmt" + "io" + "io/ioutil" + "math" + "unicode/utf8" +) + +type AccountPreventedMatchesResponse struct { + PreventedMatches []AccountPreventedMatchesResponsePreventedMatches +} +type AccountPreventedMatchesResponsePreventedMatches struct { + PriceExponent int8 + QtyExponent int8 + PreventedMatchId int64 + TakerOrderId int64 + MakerOrderId int64 + TradeGroupId int64 + SelfTradePreventionMode SelfTradePreventionModeEnum + Price int64 + TakerPreventedQuantity int64 + MakerPreventedQuantity int64 + TransactTime int64 + Symbol []uint8 + MakerSymbol []uint8 +} + +func (a *AccountPreventedMatchesResponse) Encode(_m *SbeGoMarshaller, _w io.Writer, doRangeCheck bool) error { + if doRangeCheck { + if err := a.RangeCheck(a.SbeSchemaVersion(), a.SbeSchemaVersion()); err != nil { + return err + } + } + var PreventedMatchesBlockLength uint16 = 67 + if err := _m.WriteUint16(_w, PreventedMatchesBlockLength); err != nil { + return err + } + var PreventedMatchesNumInGroup uint32 = uint32(len(a.PreventedMatches)) + if err := _m.WriteUint32(_w, PreventedMatchesNumInGroup); err != nil { + return err + } + for i := range a.PreventedMatches { + if err := a.PreventedMatches[i].Encode(_m, _w); err != nil { + return err + } + } + return nil +} + +func (a *AccountPreventedMatchesResponse) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint16, doRangeCheck bool) error { + if actingVersion > a.SbeSchemaVersion() && blockLength > a.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-a.SbeBlockLength())) + } + + if a.PreventedMatchesInActingVersion(actingVersion) { + var PreventedMatchesBlockLength uint16 + if err := _m.ReadUint16(_r, &PreventedMatchesBlockLength); err != nil { + return err + } + var PreventedMatchesNumInGroup uint32 + if err := _m.ReadUint32(_r, &PreventedMatchesNumInGroup); err != nil { + return err + } + if cap(a.PreventedMatches) < int(PreventedMatchesNumInGroup) { + a.PreventedMatches = make([]AccountPreventedMatchesResponsePreventedMatches, PreventedMatchesNumInGroup) + } + a.PreventedMatches = a.PreventedMatches[:PreventedMatchesNumInGroup] + for i := range a.PreventedMatches { + if err := a.PreventedMatches[i].Decode(_m, _r, actingVersion, uint(PreventedMatchesBlockLength)); err != nil { + return err + } + } + } + if doRangeCheck { + if err := a.RangeCheck(actingVersion, a.SbeSchemaVersion()); err != nil { + return err + } + } + return nil +} + +func (a *AccountPreventedMatchesResponse) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + for i := range a.PreventedMatches { + if err := a.PreventedMatches[i].RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + } + return nil +} + +func AccountPreventedMatchesResponseInit(a *AccountPreventedMatchesResponse) { + return +} + +func (a *AccountPreventedMatchesResponsePreventedMatches) Encode(_m *SbeGoMarshaller, _w io.Writer) error { + if err := _m.WriteInt8(_w, a.PriceExponent); err != nil { + return err + } + if err := _m.WriteInt8(_w, a.QtyExponent); err != nil { + return err + } + if err := _m.WriteInt64(_w, a.PreventedMatchId); err != nil { + return err + } + if err := _m.WriteInt64(_w, a.TakerOrderId); err != nil { + return err + } + if err := _m.WriteInt64(_w, a.MakerOrderId); err != nil { + return err + } + if err := _m.WriteInt64(_w, a.TradeGroupId); err != nil { + return err + } + if err := a.SelfTradePreventionMode.Encode(_m, _w); err != nil { + return err + } + if err := _m.WriteInt64(_w, a.Price); err != nil { + return err + } + if err := _m.WriteInt64(_w, a.TakerPreventedQuantity); err != nil { + return err + } + if err := _m.WriteInt64(_w, a.MakerPreventedQuantity); err != nil { + return err + } + if err := _m.WriteInt64(_w, a.TransactTime); err != nil { + return err + } + if err := _m.WriteUint8(_w, uint8(len(a.Symbol))); err != nil { + return err + } + if err := _m.WriteBytes(_w, a.Symbol); err != nil { + return err + } + if err := _m.WriteUint8(_w, uint8(len(a.MakerSymbol))); err != nil { + return err + } + if err := _m.WriteBytes(_w, a.MakerSymbol); err != nil { + return err + } + return nil +} + +func (a *AccountPreventedMatchesResponsePreventedMatches) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint) error { + if !a.PriceExponentInActingVersion(actingVersion) { + a.PriceExponent = a.PriceExponentNullValue() + } else { + if err := _m.ReadInt8(_r, &a.PriceExponent); err != nil { + return err + } + } + if !a.QtyExponentInActingVersion(actingVersion) { + a.QtyExponent = a.QtyExponentNullValue() + } else { + if err := _m.ReadInt8(_r, &a.QtyExponent); err != nil { + return err + } + } + if !a.PreventedMatchIdInActingVersion(actingVersion) { + a.PreventedMatchId = a.PreventedMatchIdNullValue() + } else { + if err := _m.ReadInt64(_r, &a.PreventedMatchId); err != nil { + return err + } + } + if !a.TakerOrderIdInActingVersion(actingVersion) { + a.TakerOrderId = a.TakerOrderIdNullValue() + } else { + if err := _m.ReadInt64(_r, &a.TakerOrderId); err != nil { + return err + } + } + if !a.MakerOrderIdInActingVersion(actingVersion) { + a.MakerOrderId = a.MakerOrderIdNullValue() + } else { + if err := _m.ReadInt64(_r, &a.MakerOrderId); err != nil { + return err + } + } + if !a.TradeGroupIdInActingVersion(actingVersion) { + a.TradeGroupId = a.TradeGroupIdNullValue() + } else { + if err := _m.ReadInt64(_r, &a.TradeGroupId); err != nil { + return err + } + } + if a.SelfTradePreventionModeInActingVersion(actingVersion) { + if err := a.SelfTradePreventionMode.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if !a.PriceInActingVersion(actingVersion) { + a.Price = a.PriceNullValue() + } else { + if err := _m.ReadInt64(_r, &a.Price); err != nil { + return err + } + } + if !a.TakerPreventedQuantityInActingVersion(actingVersion) { + a.TakerPreventedQuantity = a.TakerPreventedQuantityNullValue() + } else { + if err := _m.ReadInt64(_r, &a.TakerPreventedQuantity); err != nil { + return err + } + } + if !a.MakerPreventedQuantityInActingVersion(actingVersion) { + a.MakerPreventedQuantity = a.MakerPreventedQuantityNullValue() + } else { + if err := _m.ReadInt64(_r, &a.MakerPreventedQuantity); err != nil { + return err + } + } + if !a.TransactTimeInActingVersion(actingVersion) { + a.TransactTime = a.TransactTimeNullValue() + } else { + if err := _m.ReadInt64(_r, &a.TransactTime); err != nil { + return err + } + } + if actingVersion > a.SbeSchemaVersion() && blockLength > a.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-a.SbeBlockLength())) + } + + if a.SymbolInActingVersion(actingVersion) { + var SymbolLength uint8 + if err := _m.ReadUint8(_r, &SymbolLength); err != nil { + return err + } + if cap(a.Symbol) < int(SymbolLength) { + a.Symbol = make([]uint8, SymbolLength) + } + a.Symbol = a.Symbol[:SymbolLength] + if err := _m.ReadBytes(_r, a.Symbol); err != nil { + return err + } + } + + if a.MakerSymbolInActingVersion(actingVersion) { + var MakerSymbolLength uint8 + if err := _m.ReadUint8(_r, &MakerSymbolLength); err != nil { + return err + } + if cap(a.MakerSymbol) < int(MakerSymbolLength) { + a.MakerSymbol = make([]uint8, MakerSymbolLength) + } + a.MakerSymbol = a.MakerSymbol[:MakerSymbolLength] + if err := _m.ReadBytes(_r, a.MakerSymbol); err != nil { + return err + } + } + return nil +} + +func (a *AccountPreventedMatchesResponsePreventedMatches) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if a.PriceExponentInActingVersion(actingVersion) { + if a.PriceExponent < a.PriceExponentMinValue() || a.PriceExponent > a.PriceExponentMaxValue() { + return fmt.Errorf("Range check failed on a.PriceExponent (%v < %v > %v)", a.PriceExponentMinValue(), a.PriceExponent, a.PriceExponentMaxValue()) + } + } + if a.QtyExponentInActingVersion(actingVersion) { + if a.QtyExponent < a.QtyExponentMinValue() || a.QtyExponent > a.QtyExponentMaxValue() { + return fmt.Errorf("Range check failed on a.QtyExponent (%v < %v > %v)", a.QtyExponentMinValue(), a.QtyExponent, a.QtyExponentMaxValue()) + } + } + if a.PreventedMatchIdInActingVersion(actingVersion) { + if a.PreventedMatchId < a.PreventedMatchIdMinValue() || a.PreventedMatchId > a.PreventedMatchIdMaxValue() { + return fmt.Errorf("Range check failed on a.PreventedMatchId (%v < %v > %v)", a.PreventedMatchIdMinValue(), a.PreventedMatchId, a.PreventedMatchIdMaxValue()) + } + } + if a.TakerOrderIdInActingVersion(actingVersion) { + if a.TakerOrderId < a.TakerOrderIdMinValue() || a.TakerOrderId > a.TakerOrderIdMaxValue() { + return fmt.Errorf("Range check failed on a.TakerOrderId (%v < %v > %v)", a.TakerOrderIdMinValue(), a.TakerOrderId, a.TakerOrderIdMaxValue()) + } + } + if a.MakerOrderIdInActingVersion(actingVersion) { + if a.MakerOrderId < a.MakerOrderIdMinValue() || a.MakerOrderId > a.MakerOrderIdMaxValue() { + return fmt.Errorf("Range check failed on a.MakerOrderId (%v < %v > %v)", a.MakerOrderIdMinValue(), a.MakerOrderId, a.MakerOrderIdMaxValue()) + } + } + if a.TradeGroupIdInActingVersion(actingVersion) { + if a.TradeGroupId < a.TradeGroupIdMinValue() || a.TradeGroupId > a.TradeGroupIdMaxValue() { + return fmt.Errorf("Range check failed on a.TradeGroupId (%v < %v > %v)", a.TradeGroupIdMinValue(), a.TradeGroupId, a.TradeGroupIdMaxValue()) + } + } + if err := a.SelfTradePreventionMode.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if a.PriceInActingVersion(actingVersion) { + if a.Price < a.PriceMinValue() || a.Price > a.PriceMaxValue() { + return fmt.Errorf("Range check failed on a.Price (%v < %v > %v)", a.PriceMinValue(), a.Price, a.PriceMaxValue()) + } + } + if a.TakerPreventedQuantityInActingVersion(actingVersion) { + if a.TakerPreventedQuantity != a.TakerPreventedQuantityNullValue() && (a.TakerPreventedQuantity < a.TakerPreventedQuantityMinValue() || a.TakerPreventedQuantity > a.TakerPreventedQuantityMaxValue()) { + return fmt.Errorf("Range check failed on a.TakerPreventedQuantity (%v < %v > %v)", a.TakerPreventedQuantityMinValue(), a.TakerPreventedQuantity, a.TakerPreventedQuantityMaxValue()) + } + } + if a.MakerPreventedQuantityInActingVersion(actingVersion) { + if a.MakerPreventedQuantity != a.MakerPreventedQuantityNullValue() && (a.MakerPreventedQuantity < a.MakerPreventedQuantityMinValue() || a.MakerPreventedQuantity > a.MakerPreventedQuantityMaxValue()) { + return fmt.Errorf("Range check failed on a.MakerPreventedQuantity (%v < %v > %v)", a.MakerPreventedQuantityMinValue(), a.MakerPreventedQuantity, a.MakerPreventedQuantityMaxValue()) + } + } + if a.TransactTimeInActingVersion(actingVersion) { + if a.TransactTime < a.TransactTimeMinValue() || a.TransactTime > a.TransactTimeMaxValue() { + return fmt.Errorf("Range check failed on a.TransactTime (%v < %v > %v)", a.TransactTimeMinValue(), a.TransactTime, a.TransactTimeMaxValue()) + } + } + if !utf8.Valid(a.Symbol[:]) { + return errors.New("a.Symbol failed UTF-8 validation") + } + if !utf8.Valid(a.MakerSymbol[:]) { + return errors.New("a.MakerSymbol failed UTF-8 validation") + } + return nil +} + +func AccountPreventedMatchesResponsePreventedMatchesInit(a *AccountPreventedMatchesResponsePreventedMatches) { + a.TakerPreventedQuantity = math.MinInt64 + a.MakerPreventedQuantity = math.MinInt64 + return +} + +func (*AccountPreventedMatchesResponse) SbeBlockLength() (blockLength uint16) { + return 0 +} + +func (*AccountPreventedMatchesResponse) SbeTemplateId() (templateId uint16) { + return 403 +} + +func (*AccountPreventedMatchesResponse) SbeSchemaId() (schemaId uint16) { + return 3 +} + +func (*AccountPreventedMatchesResponse) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} + +func (*AccountPreventedMatchesResponse) SbeSemanticType() (semanticType []byte) { + return []byte("") +} + +func (*AccountPreventedMatchesResponse) SbeSemanticVersion() (semanticVersion string) { + return "5.2" +} + +func (*AccountPreventedMatchesResponsePreventedMatches) PriceExponentId() uint16 { + return 1 +} + +func (*AccountPreventedMatchesResponsePreventedMatches) PriceExponentSinceVersion() uint16 { + return 0 +} + +func (a *AccountPreventedMatchesResponsePreventedMatches) PriceExponentInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.PriceExponentSinceVersion() +} + +func (*AccountPreventedMatchesResponsePreventedMatches) PriceExponentDeprecated() uint16 { + return 0 +} + +func (*AccountPreventedMatchesResponsePreventedMatches) PriceExponentMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*AccountPreventedMatchesResponsePreventedMatches) PriceExponentMinValue() int8 { + return math.MinInt8 + 1 +} + +func (*AccountPreventedMatchesResponsePreventedMatches) PriceExponentMaxValue() int8 { + return math.MaxInt8 +} + +func (*AccountPreventedMatchesResponsePreventedMatches) PriceExponentNullValue() int8 { + return math.MinInt8 +} + +func (*AccountPreventedMatchesResponsePreventedMatches) QtyExponentId() uint16 { + return 2 +} + +func (*AccountPreventedMatchesResponsePreventedMatches) QtyExponentSinceVersion() uint16 { + return 0 +} + +func (a *AccountPreventedMatchesResponsePreventedMatches) QtyExponentInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.QtyExponentSinceVersion() +} + +func (*AccountPreventedMatchesResponsePreventedMatches) QtyExponentDeprecated() uint16 { + return 0 +} + +func (*AccountPreventedMatchesResponsePreventedMatches) QtyExponentMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*AccountPreventedMatchesResponsePreventedMatches) QtyExponentMinValue() int8 { + return math.MinInt8 + 1 +} + +func (*AccountPreventedMatchesResponsePreventedMatches) QtyExponentMaxValue() int8 { + return math.MaxInt8 +} + +func (*AccountPreventedMatchesResponsePreventedMatches) QtyExponentNullValue() int8 { + return math.MinInt8 +} + +func (*AccountPreventedMatchesResponsePreventedMatches) PreventedMatchIdId() uint16 { + return 3 +} + +func (*AccountPreventedMatchesResponsePreventedMatches) PreventedMatchIdSinceVersion() uint16 { + return 0 +} + +func (a *AccountPreventedMatchesResponsePreventedMatches) PreventedMatchIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.PreventedMatchIdSinceVersion() +} + +func (*AccountPreventedMatchesResponsePreventedMatches) PreventedMatchIdDeprecated() uint16 { + return 0 +} + +func (*AccountPreventedMatchesResponsePreventedMatches) PreventedMatchIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*AccountPreventedMatchesResponsePreventedMatches) PreventedMatchIdMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*AccountPreventedMatchesResponsePreventedMatches) PreventedMatchIdMaxValue() int64 { + return math.MaxInt64 +} + +func (*AccountPreventedMatchesResponsePreventedMatches) PreventedMatchIdNullValue() int64 { + return math.MinInt64 +} + +func (*AccountPreventedMatchesResponsePreventedMatches) TakerOrderIdId() uint16 { + return 4 +} + +func (*AccountPreventedMatchesResponsePreventedMatches) TakerOrderIdSinceVersion() uint16 { + return 0 +} + +func (a *AccountPreventedMatchesResponsePreventedMatches) TakerOrderIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.TakerOrderIdSinceVersion() +} + +func (*AccountPreventedMatchesResponsePreventedMatches) TakerOrderIdDeprecated() uint16 { + return 0 +} + +func (*AccountPreventedMatchesResponsePreventedMatches) TakerOrderIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*AccountPreventedMatchesResponsePreventedMatches) TakerOrderIdMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*AccountPreventedMatchesResponsePreventedMatches) TakerOrderIdMaxValue() int64 { + return math.MaxInt64 +} + +func (*AccountPreventedMatchesResponsePreventedMatches) TakerOrderIdNullValue() int64 { + return math.MinInt64 +} + +func (*AccountPreventedMatchesResponsePreventedMatches) MakerOrderIdId() uint16 { + return 5 +} + +func (*AccountPreventedMatchesResponsePreventedMatches) MakerOrderIdSinceVersion() uint16 { + return 0 +} + +func (a *AccountPreventedMatchesResponsePreventedMatches) MakerOrderIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.MakerOrderIdSinceVersion() +} + +func (*AccountPreventedMatchesResponsePreventedMatches) MakerOrderIdDeprecated() uint16 { + return 0 +} + +func (*AccountPreventedMatchesResponsePreventedMatches) MakerOrderIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*AccountPreventedMatchesResponsePreventedMatches) MakerOrderIdMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*AccountPreventedMatchesResponsePreventedMatches) MakerOrderIdMaxValue() int64 { + return math.MaxInt64 +} + +func (*AccountPreventedMatchesResponsePreventedMatches) MakerOrderIdNullValue() int64 { + return math.MinInt64 +} + +func (*AccountPreventedMatchesResponsePreventedMatches) TradeGroupIdId() uint16 { + return 6 +} + +func (*AccountPreventedMatchesResponsePreventedMatches) TradeGroupIdSinceVersion() uint16 { + return 0 +} + +func (a *AccountPreventedMatchesResponsePreventedMatches) TradeGroupIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.TradeGroupIdSinceVersion() +} + +func (*AccountPreventedMatchesResponsePreventedMatches) TradeGroupIdDeprecated() uint16 { + return 0 +} + +func (*AccountPreventedMatchesResponsePreventedMatches) TradeGroupIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*AccountPreventedMatchesResponsePreventedMatches) TradeGroupIdMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*AccountPreventedMatchesResponsePreventedMatches) TradeGroupIdMaxValue() int64 { + return math.MaxInt64 +} + +func (*AccountPreventedMatchesResponsePreventedMatches) TradeGroupIdNullValue() int64 { + return math.MinInt64 +} + +func (*AccountPreventedMatchesResponsePreventedMatches) SelfTradePreventionModeId() uint16 { + return 7 +} + +func (*AccountPreventedMatchesResponsePreventedMatches) SelfTradePreventionModeSinceVersion() uint16 { + return 0 +} + +func (a *AccountPreventedMatchesResponsePreventedMatches) SelfTradePreventionModeInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.SelfTradePreventionModeSinceVersion() +} + +func (*AccountPreventedMatchesResponsePreventedMatches) SelfTradePreventionModeDeprecated() uint16 { + return 0 +} + +func (*AccountPreventedMatchesResponsePreventedMatches) SelfTradePreventionModeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*AccountPreventedMatchesResponsePreventedMatches) PriceId() uint16 { + return 8 +} + +func (*AccountPreventedMatchesResponsePreventedMatches) PriceSinceVersion() uint16 { + return 0 +} + +func (a *AccountPreventedMatchesResponsePreventedMatches) PriceInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.PriceSinceVersion() +} + +func (*AccountPreventedMatchesResponsePreventedMatches) PriceDeprecated() uint16 { + return 0 +} + +func (*AccountPreventedMatchesResponsePreventedMatches) PriceMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*AccountPreventedMatchesResponsePreventedMatches) PriceMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*AccountPreventedMatchesResponsePreventedMatches) PriceMaxValue() int64 { + return math.MaxInt64 +} + +func (*AccountPreventedMatchesResponsePreventedMatches) PriceNullValue() int64 { + return math.MinInt64 +} + +func (*AccountPreventedMatchesResponsePreventedMatches) TakerPreventedQuantityId() uint16 { + return 9 +} + +func (*AccountPreventedMatchesResponsePreventedMatches) TakerPreventedQuantitySinceVersion() uint16 { + return 0 +} + +func (a *AccountPreventedMatchesResponsePreventedMatches) TakerPreventedQuantityInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.TakerPreventedQuantitySinceVersion() +} + +func (*AccountPreventedMatchesResponsePreventedMatches) TakerPreventedQuantityDeprecated() uint16 { + return 0 +} + +func (*AccountPreventedMatchesResponsePreventedMatches) TakerPreventedQuantityMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*AccountPreventedMatchesResponsePreventedMatches) TakerPreventedQuantityMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*AccountPreventedMatchesResponsePreventedMatches) TakerPreventedQuantityMaxValue() int64 { + return math.MaxInt64 +} + +func (*AccountPreventedMatchesResponsePreventedMatches) TakerPreventedQuantityNullValue() int64 { + return math.MinInt64 +} + +func (*AccountPreventedMatchesResponsePreventedMatches) MakerPreventedQuantityId() uint16 { + return 10 +} + +func (*AccountPreventedMatchesResponsePreventedMatches) MakerPreventedQuantitySinceVersion() uint16 { + return 0 +} + +func (a *AccountPreventedMatchesResponsePreventedMatches) MakerPreventedQuantityInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.MakerPreventedQuantitySinceVersion() +} + +func (*AccountPreventedMatchesResponsePreventedMatches) MakerPreventedQuantityDeprecated() uint16 { + return 0 +} + +func (*AccountPreventedMatchesResponsePreventedMatches) MakerPreventedQuantityMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*AccountPreventedMatchesResponsePreventedMatches) MakerPreventedQuantityMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*AccountPreventedMatchesResponsePreventedMatches) MakerPreventedQuantityMaxValue() int64 { + return math.MaxInt64 +} + +func (*AccountPreventedMatchesResponsePreventedMatches) MakerPreventedQuantityNullValue() int64 { + return math.MinInt64 +} + +func (*AccountPreventedMatchesResponsePreventedMatches) TransactTimeId() uint16 { + return 11 +} + +func (*AccountPreventedMatchesResponsePreventedMatches) TransactTimeSinceVersion() uint16 { + return 0 +} + +func (a *AccountPreventedMatchesResponsePreventedMatches) TransactTimeInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.TransactTimeSinceVersion() +} + +func (*AccountPreventedMatchesResponsePreventedMatches) TransactTimeDeprecated() uint16 { + return 0 +} + +func (*AccountPreventedMatchesResponsePreventedMatches) TransactTimeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*AccountPreventedMatchesResponsePreventedMatches) TransactTimeMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*AccountPreventedMatchesResponsePreventedMatches) TransactTimeMaxValue() int64 { + return math.MaxInt64 +} + +func (*AccountPreventedMatchesResponsePreventedMatches) TransactTimeNullValue() int64 { + return math.MinInt64 +} + +func (*AccountPreventedMatchesResponsePreventedMatches) SymbolMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*AccountPreventedMatchesResponsePreventedMatches) SymbolSinceVersion() uint16 { + return 0 +} + +func (a *AccountPreventedMatchesResponsePreventedMatches) SymbolInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.SymbolSinceVersion() +} + +func (*AccountPreventedMatchesResponsePreventedMatches) SymbolDeprecated() uint16 { + return 0 +} + +func (AccountPreventedMatchesResponsePreventedMatches) SymbolCharacterEncoding() string { + return "UTF-8" +} + +func (AccountPreventedMatchesResponsePreventedMatches) SymbolHeaderLength() uint64 { + return 1 +} + +func (*AccountPreventedMatchesResponsePreventedMatches) MakerSymbolMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*AccountPreventedMatchesResponsePreventedMatches) MakerSymbolSinceVersion() uint16 { + return 0 +} + +func (a *AccountPreventedMatchesResponsePreventedMatches) MakerSymbolInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.MakerSymbolSinceVersion() +} + +func (*AccountPreventedMatchesResponsePreventedMatches) MakerSymbolDeprecated() uint16 { + return 0 +} + +func (AccountPreventedMatchesResponsePreventedMatches) MakerSymbolCharacterEncoding() string { + return "UTF-8" +} + +func (AccountPreventedMatchesResponsePreventedMatches) MakerSymbolHeaderLength() uint64 { + return 1 +} + +func (*AccountPreventedMatchesResponse) PreventedMatchesId() uint16 { + return 100 +} + +func (*AccountPreventedMatchesResponse) PreventedMatchesSinceVersion() uint16 { + return 0 +} + +func (a *AccountPreventedMatchesResponse) PreventedMatchesInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.PreventedMatchesSinceVersion() +} + +func (*AccountPreventedMatchesResponse) PreventedMatchesDeprecated() uint16 { + return 0 +} + +func (*AccountPreventedMatchesResponsePreventedMatches) SbeBlockLength() (blockLength uint) { + return 67 +} + +func (*AccountPreventedMatchesResponsePreventedMatches) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} diff --git a/v2/sbe/spot_3_1/AccountResponse.go b/v2/sbe/spot_3_1/AccountResponse.go new file mode 100644 index 00000000..a0e545a7 --- /dev/null +++ b/v2/sbe/spot_3_1/AccountResponse.go @@ -0,0 +1,1427 @@ +// Generated SBE (Simple Binary Encoding) message codec + +package sbe + +import ( + "errors" + "fmt" + "io" + "io/ioutil" + "math" + "unicode/utf8" +) + +type AccountResponse struct { + CommissionExponent int8 + CommissionRateMaker int64 + CommissionRateTaker int64 + CommissionRateBuyer int64 + CommissionRateSeller int64 + CanTrade BoolEnumEnum + CanWithdraw BoolEnumEnum + CanDeposit BoolEnumEnum + Brokered BoolEnumEnum + RequireSelfTradePrevention BoolEnumEnum + PreventSor BoolEnumEnum + UpdateTime int64 + AccountType AccountTypeEnum + TradeGroupId int64 + Uid int64 + Balances []AccountResponseBalances + Permissions []AccountResponsePermissions + ReduceOnlyAssets []AccountResponseReduceOnlyAssets +} +type AccountResponseBalances struct { + Exponent int8 + Free int64 + Locked int64 + Asset []uint8 +} +type AccountResponsePermissions struct { + Permission []uint8 +} +type AccountResponseReduceOnlyAssets struct { + Asset []uint8 +} + +func (a *AccountResponse) Encode(_m *SbeGoMarshaller, _w io.Writer, doRangeCheck bool) error { + if doRangeCheck { + if err := a.RangeCheck(a.SbeSchemaVersion(), a.SbeSchemaVersion()); err != nil { + return err + } + } + if err := _m.WriteInt8(_w, a.CommissionExponent); err != nil { + return err + } + if err := _m.WriteInt64(_w, a.CommissionRateMaker); err != nil { + return err + } + if err := _m.WriteInt64(_w, a.CommissionRateTaker); err != nil { + return err + } + if err := _m.WriteInt64(_w, a.CommissionRateBuyer); err != nil { + return err + } + if err := _m.WriteInt64(_w, a.CommissionRateSeller); err != nil { + return err + } + if err := a.CanTrade.Encode(_m, _w); err != nil { + return err + } + if err := a.CanWithdraw.Encode(_m, _w); err != nil { + return err + } + if err := a.CanDeposit.Encode(_m, _w); err != nil { + return err + } + if err := a.Brokered.Encode(_m, _w); err != nil { + return err + } + if err := a.RequireSelfTradePrevention.Encode(_m, _w); err != nil { + return err + } + if err := a.PreventSor.Encode(_m, _w); err != nil { + return err + } + if err := _m.WriteInt64(_w, a.UpdateTime); err != nil { + return err + } + if err := a.AccountType.Encode(_m, _w); err != nil { + return err + } + if err := _m.WriteInt64(_w, a.TradeGroupId); err != nil { + return err + } + if err := _m.WriteInt64(_w, a.Uid); err != nil { + return err + } + var BalancesBlockLength uint16 = 17 + if err := _m.WriteUint16(_w, BalancesBlockLength); err != nil { + return err + } + var BalancesNumInGroup uint32 = uint32(len(a.Balances)) + if err := _m.WriteUint32(_w, BalancesNumInGroup); err != nil { + return err + } + for i := range a.Balances { + if err := a.Balances[i].Encode(_m, _w); err != nil { + return err + } + } + var PermissionsBlockLength uint16 = 0 + if err := _m.WriteUint16(_w, PermissionsBlockLength); err != nil { + return err + } + var PermissionsNumInGroup uint32 = uint32(len(a.Permissions)) + if err := _m.WriteUint32(_w, PermissionsNumInGroup); err != nil { + return err + } + for i := range a.Permissions { + if err := a.Permissions[i].Encode(_m, _w); err != nil { + return err + } + } + var ReduceOnlyAssetsBlockLength uint16 = 0 + if err := _m.WriteUint16(_w, ReduceOnlyAssetsBlockLength); err != nil { + return err + } + var ReduceOnlyAssetsNumInGroup uint32 = uint32(len(a.ReduceOnlyAssets)) + if err := _m.WriteUint32(_w, ReduceOnlyAssetsNumInGroup); err != nil { + return err + } + for i := range a.ReduceOnlyAssets { + if err := a.ReduceOnlyAssets[i].Encode(_m, _w); err != nil { + return err + } + } + return nil +} + +func (a *AccountResponse) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint16, doRangeCheck bool) error { + if !a.CommissionExponentInActingVersion(actingVersion) { + a.CommissionExponent = a.CommissionExponentNullValue() + } else { + if err := _m.ReadInt8(_r, &a.CommissionExponent); err != nil { + return err + } + } + if !a.CommissionRateMakerInActingVersion(actingVersion) { + a.CommissionRateMaker = a.CommissionRateMakerNullValue() + } else { + if err := _m.ReadInt64(_r, &a.CommissionRateMaker); err != nil { + return err + } + } + if !a.CommissionRateTakerInActingVersion(actingVersion) { + a.CommissionRateTaker = a.CommissionRateTakerNullValue() + } else { + if err := _m.ReadInt64(_r, &a.CommissionRateTaker); err != nil { + return err + } + } + if !a.CommissionRateBuyerInActingVersion(actingVersion) { + a.CommissionRateBuyer = a.CommissionRateBuyerNullValue() + } else { + if err := _m.ReadInt64(_r, &a.CommissionRateBuyer); err != nil { + return err + } + } + if !a.CommissionRateSellerInActingVersion(actingVersion) { + a.CommissionRateSeller = a.CommissionRateSellerNullValue() + } else { + if err := _m.ReadInt64(_r, &a.CommissionRateSeller); err != nil { + return err + } + } + if a.CanTradeInActingVersion(actingVersion) { + if err := a.CanTrade.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if a.CanWithdrawInActingVersion(actingVersion) { + if err := a.CanWithdraw.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if a.CanDepositInActingVersion(actingVersion) { + if err := a.CanDeposit.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if a.BrokeredInActingVersion(actingVersion) { + if err := a.Brokered.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if a.RequireSelfTradePreventionInActingVersion(actingVersion) { + if err := a.RequireSelfTradePrevention.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if a.PreventSorInActingVersion(actingVersion) { + if err := a.PreventSor.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if !a.UpdateTimeInActingVersion(actingVersion) { + a.UpdateTime = a.UpdateTimeNullValue() + } else { + if err := _m.ReadInt64(_r, &a.UpdateTime); err != nil { + return err + } + } + if a.AccountTypeInActingVersion(actingVersion) { + if err := a.AccountType.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if !a.TradeGroupIdInActingVersion(actingVersion) { + a.TradeGroupId = a.TradeGroupIdNullValue() + } else { + if err := _m.ReadInt64(_r, &a.TradeGroupId); err != nil { + return err + } + } + if !a.UidInActingVersion(actingVersion) { + a.Uid = a.UidNullValue() + } else { + if err := _m.ReadInt64(_r, &a.Uid); err != nil { + return err + } + } + if actingVersion > a.SbeSchemaVersion() && blockLength > a.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-a.SbeBlockLength())) + } + + if a.BalancesInActingVersion(actingVersion) { + var BalancesBlockLength uint16 + if err := _m.ReadUint16(_r, &BalancesBlockLength); err != nil { + return err + } + var BalancesNumInGroup uint32 + if err := _m.ReadUint32(_r, &BalancesNumInGroup); err != nil { + return err + } + if cap(a.Balances) < int(BalancesNumInGroup) { + a.Balances = make([]AccountResponseBalances, BalancesNumInGroup) + } + a.Balances = a.Balances[:BalancesNumInGroup] + for i := range a.Balances { + if err := a.Balances[i].Decode(_m, _r, actingVersion, uint(BalancesBlockLength)); err != nil { + return err + } + } + } + + if a.PermissionsInActingVersion(actingVersion) { + var PermissionsBlockLength uint16 + if err := _m.ReadUint16(_r, &PermissionsBlockLength); err != nil { + return err + } + var PermissionsNumInGroup uint32 + if err := _m.ReadUint32(_r, &PermissionsNumInGroup); err != nil { + return err + } + if cap(a.Permissions) < int(PermissionsNumInGroup) { + a.Permissions = make([]AccountResponsePermissions, PermissionsNumInGroup) + } + a.Permissions = a.Permissions[:PermissionsNumInGroup] + for i := range a.Permissions { + if err := a.Permissions[i].Decode(_m, _r, actingVersion, uint(PermissionsBlockLength)); err != nil { + return err + } + } + } + + if a.ReduceOnlyAssetsInActingVersion(actingVersion) { + var ReduceOnlyAssetsBlockLength uint16 + if err := _m.ReadUint16(_r, &ReduceOnlyAssetsBlockLength); err != nil { + return err + } + var ReduceOnlyAssetsNumInGroup uint32 + if err := _m.ReadUint32(_r, &ReduceOnlyAssetsNumInGroup); err != nil { + return err + } + if cap(a.ReduceOnlyAssets) < int(ReduceOnlyAssetsNumInGroup) { + a.ReduceOnlyAssets = make([]AccountResponseReduceOnlyAssets, ReduceOnlyAssetsNumInGroup) + } + a.ReduceOnlyAssets = a.ReduceOnlyAssets[:ReduceOnlyAssetsNumInGroup] + for i := range a.ReduceOnlyAssets { + if err := a.ReduceOnlyAssets[i].Decode(_m, _r, actingVersion, uint(ReduceOnlyAssetsBlockLength)); err != nil { + return err + } + } + } + if doRangeCheck { + if err := a.RangeCheck(actingVersion, a.SbeSchemaVersion()); err != nil { + return err + } + } + return nil +} + +func (a *AccountResponse) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if a.CommissionExponentInActingVersion(actingVersion) { + if a.CommissionExponent < a.CommissionExponentMinValue() || a.CommissionExponent > a.CommissionExponentMaxValue() { + return fmt.Errorf("Range check failed on a.CommissionExponent (%v < %v > %v)", a.CommissionExponentMinValue(), a.CommissionExponent, a.CommissionExponentMaxValue()) + } + } + if a.CommissionRateMakerInActingVersion(actingVersion) { + if a.CommissionRateMaker < a.CommissionRateMakerMinValue() || a.CommissionRateMaker > a.CommissionRateMakerMaxValue() { + return fmt.Errorf("Range check failed on a.CommissionRateMaker (%v < %v > %v)", a.CommissionRateMakerMinValue(), a.CommissionRateMaker, a.CommissionRateMakerMaxValue()) + } + } + if a.CommissionRateTakerInActingVersion(actingVersion) { + if a.CommissionRateTaker < a.CommissionRateTakerMinValue() || a.CommissionRateTaker > a.CommissionRateTakerMaxValue() { + return fmt.Errorf("Range check failed on a.CommissionRateTaker (%v < %v > %v)", a.CommissionRateTakerMinValue(), a.CommissionRateTaker, a.CommissionRateTakerMaxValue()) + } + } + if a.CommissionRateBuyerInActingVersion(actingVersion) { + if a.CommissionRateBuyer < a.CommissionRateBuyerMinValue() || a.CommissionRateBuyer > a.CommissionRateBuyerMaxValue() { + return fmt.Errorf("Range check failed on a.CommissionRateBuyer (%v < %v > %v)", a.CommissionRateBuyerMinValue(), a.CommissionRateBuyer, a.CommissionRateBuyerMaxValue()) + } + } + if a.CommissionRateSellerInActingVersion(actingVersion) { + if a.CommissionRateSeller < a.CommissionRateSellerMinValue() || a.CommissionRateSeller > a.CommissionRateSellerMaxValue() { + return fmt.Errorf("Range check failed on a.CommissionRateSeller (%v < %v > %v)", a.CommissionRateSellerMinValue(), a.CommissionRateSeller, a.CommissionRateSellerMaxValue()) + } + } + if err := a.CanTrade.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if err := a.CanWithdraw.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if err := a.CanDeposit.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if err := a.Brokered.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if err := a.RequireSelfTradePrevention.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if err := a.PreventSor.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if a.UpdateTimeInActingVersion(actingVersion) { + if a.UpdateTime < a.UpdateTimeMinValue() || a.UpdateTime > a.UpdateTimeMaxValue() { + return fmt.Errorf("Range check failed on a.UpdateTime (%v < %v > %v)", a.UpdateTimeMinValue(), a.UpdateTime, a.UpdateTimeMaxValue()) + } + } + if err := a.AccountType.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if a.TradeGroupIdInActingVersion(actingVersion) { + if a.TradeGroupId != a.TradeGroupIdNullValue() && (a.TradeGroupId < a.TradeGroupIdMinValue() || a.TradeGroupId > a.TradeGroupIdMaxValue()) { + return fmt.Errorf("Range check failed on a.TradeGroupId (%v < %v > %v)", a.TradeGroupIdMinValue(), a.TradeGroupId, a.TradeGroupIdMaxValue()) + } + } + if a.UidInActingVersion(actingVersion) { + if a.Uid < a.UidMinValue() || a.Uid > a.UidMaxValue() { + return fmt.Errorf("Range check failed on a.Uid (%v < %v > %v)", a.UidMinValue(), a.Uid, a.UidMaxValue()) + } + } + for i := range a.Balances { + if err := a.Balances[i].RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + } + for i := range a.Permissions { + if err := a.Permissions[i].RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + } + for i := range a.ReduceOnlyAssets { + if err := a.ReduceOnlyAssets[i].RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + } + return nil +} + +func AccountResponseInit(a *AccountResponse) { + a.TradeGroupId = math.MinInt64 + return +} + +func (a *AccountResponseBalances) Encode(_m *SbeGoMarshaller, _w io.Writer) error { + if err := _m.WriteInt8(_w, a.Exponent); err != nil { + return err + } + if err := _m.WriteInt64(_w, a.Free); err != nil { + return err + } + if err := _m.WriteInt64(_w, a.Locked); err != nil { + return err + } + if err := _m.WriteUint8(_w, uint8(len(a.Asset))); err != nil { + return err + } + if err := _m.WriteBytes(_w, a.Asset); err != nil { + return err + } + return nil +} + +func (a *AccountResponseBalances) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint) error { + if !a.ExponentInActingVersion(actingVersion) { + a.Exponent = a.ExponentNullValue() + } else { + if err := _m.ReadInt8(_r, &a.Exponent); err != nil { + return err + } + } + if !a.FreeInActingVersion(actingVersion) { + a.Free = a.FreeNullValue() + } else { + if err := _m.ReadInt64(_r, &a.Free); err != nil { + return err + } + } + if !a.LockedInActingVersion(actingVersion) { + a.Locked = a.LockedNullValue() + } else { + if err := _m.ReadInt64(_r, &a.Locked); err != nil { + return err + } + } + if actingVersion > a.SbeSchemaVersion() && blockLength > a.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-a.SbeBlockLength())) + } + + if a.AssetInActingVersion(actingVersion) { + var AssetLength uint8 + if err := _m.ReadUint8(_r, &AssetLength); err != nil { + return err + } + if cap(a.Asset) < int(AssetLength) { + a.Asset = make([]uint8, AssetLength) + } + a.Asset = a.Asset[:AssetLength] + if err := _m.ReadBytes(_r, a.Asset); err != nil { + return err + } + } + return nil +} + +func (a *AccountResponseBalances) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if a.ExponentInActingVersion(actingVersion) { + if a.Exponent < a.ExponentMinValue() || a.Exponent > a.ExponentMaxValue() { + return fmt.Errorf("Range check failed on a.Exponent (%v < %v > %v)", a.ExponentMinValue(), a.Exponent, a.ExponentMaxValue()) + } + } + if a.FreeInActingVersion(actingVersion) { + if a.Free < a.FreeMinValue() || a.Free > a.FreeMaxValue() { + return fmt.Errorf("Range check failed on a.Free (%v < %v > %v)", a.FreeMinValue(), a.Free, a.FreeMaxValue()) + } + } + if a.LockedInActingVersion(actingVersion) { + if a.Locked < a.LockedMinValue() || a.Locked > a.LockedMaxValue() { + return fmt.Errorf("Range check failed on a.Locked (%v < %v > %v)", a.LockedMinValue(), a.Locked, a.LockedMaxValue()) + } + } + if !utf8.Valid(a.Asset[:]) { + return errors.New("a.Asset failed UTF-8 validation") + } + return nil +} + +func AccountResponseBalancesInit(a *AccountResponseBalances) { + return +} + +func (a *AccountResponsePermissions) Encode(_m *SbeGoMarshaller, _w io.Writer) error { + if err := _m.WriteUint8(_w, uint8(len(a.Permission))); err != nil { + return err + } + if err := _m.WriteBytes(_w, a.Permission); err != nil { + return err + } + return nil +} + +func (a *AccountResponsePermissions) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint) error { + if actingVersion > a.SbeSchemaVersion() && blockLength > a.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-a.SbeBlockLength())) + } + + if a.PermissionInActingVersion(actingVersion) { + var PermissionLength uint8 + if err := _m.ReadUint8(_r, &PermissionLength); err != nil { + return err + } + if cap(a.Permission) < int(PermissionLength) { + a.Permission = make([]uint8, PermissionLength) + } + a.Permission = a.Permission[:PermissionLength] + if err := _m.ReadBytes(_r, a.Permission); err != nil { + return err + } + } + return nil +} + +func (a *AccountResponsePermissions) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if !utf8.Valid(a.Permission[:]) { + return errors.New("a.Permission failed UTF-8 validation") + } + return nil +} + +func AccountResponsePermissionsInit(a *AccountResponsePermissions) { + return +} + +func (a *AccountResponseReduceOnlyAssets) Encode(_m *SbeGoMarshaller, _w io.Writer) error { + if err := _m.WriteUint8(_w, uint8(len(a.Asset))); err != nil { + return err + } + if err := _m.WriteBytes(_w, a.Asset); err != nil { + return err + } + return nil +} + +func (a *AccountResponseReduceOnlyAssets) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint) error { + if actingVersion > a.SbeSchemaVersion() && blockLength > a.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-a.SbeBlockLength())) + } + + if a.AssetInActingVersion(actingVersion) { + var AssetLength uint8 + if err := _m.ReadUint8(_r, &AssetLength); err != nil { + return err + } + if cap(a.Asset) < int(AssetLength) { + a.Asset = make([]uint8, AssetLength) + } + a.Asset = a.Asset[:AssetLength] + if err := _m.ReadBytes(_r, a.Asset); err != nil { + return err + } + } + return nil +} + +func (a *AccountResponseReduceOnlyAssets) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if !utf8.Valid(a.Asset[:]) { + return errors.New("a.Asset failed UTF-8 validation") + } + return nil +} + +func AccountResponseReduceOnlyAssetsInit(a *AccountResponseReduceOnlyAssets) { + return +} + +func (*AccountResponse) SbeBlockLength() (blockLength uint16) { + return 64 +} + +func (*AccountResponse) SbeTemplateId() (templateId uint16) { + return 400 +} + +func (*AccountResponse) SbeSchemaId() (schemaId uint16) { + return 3 +} + +func (*AccountResponse) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} + +func (*AccountResponse) SbeSemanticType() (semanticType []byte) { + return []byte("") +} + +func (*AccountResponse) SbeSemanticVersion() (semanticVersion string) { + return "5.2" +} + +func (*AccountResponse) CommissionExponentId() uint16 { + return 1 +} + +func (*AccountResponse) CommissionExponentSinceVersion() uint16 { + return 0 +} + +func (a *AccountResponse) CommissionExponentInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.CommissionExponentSinceVersion() +} + +func (*AccountResponse) CommissionExponentDeprecated() uint16 { + return 0 +} + +func (*AccountResponse) CommissionExponentMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*AccountResponse) CommissionExponentMinValue() int8 { + return math.MinInt8 + 1 +} + +func (*AccountResponse) CommissionExponentMaxValue() int8 { + return math.MaxInt8 +} + +func (*AccountResponse) CommissionExponentNullValue() int8 { + return math.MinInt8 +} + +func (*AccountResponse) CommissionRateMakerId() uint16 { + return 2 +} + +func (*AccountResponse) CommissionRateMakerSinceVersion() uint16 { + return 0 +} + +func (a *AccountResponse) CommissionRateMakerInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.CommissionRateMakerSinceVersion() +} + +func (*AccountResponse) CommissionRateMakerDeprecated() uint16 { + return 0 +} + +func (*AccountResponse) CommissionRateMakerMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*AccountResponse) CommissionRateMakerMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*AccountResponse) CommissionRateMakerMaxValue() int64 { + return math.MaxInt64 +} + +func (*AccountResponse) CommissionRateMakerNullValue() int64 { + return math.MinInt64 +} + +func (*AccountResponse) CommissionRateTakerId() uint16 { + return 3 +} + +func (*AccountResponse) CommissionRateTakerSinceVersion() uint16 { + return 0 +} + +func (a *AccountResponse) CommissionRateTakerInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.CommissionRateTakerSinceVersion() +} + +func (*AccountResponse) CommissionRateTakerDeprecated() uint16 { + return 0 +} + +func (*AccountResponse) CommissionRateTakerMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*AccountResponse) CommissionRateTakerMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*AccountResponse) CommissionRateTakerMaxValue() int64 { + return math.MaxInt64 +} + +func (*AccountResponse) CommissionRateTakerNullValue() int64 { + return math.MinInt64 +} + +func (*AccountResponse) CommissionRateBuyerId() uint16 { + return 4 +} + +func (*AccountResponse) CommissionRateBuyerSinceVersion() uint16 { + return 0 +} + +func (a *AccountResponse) CommissionRateBuyerInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.CommissionRateBuyerSinceVersion() +} + +func (*AccountResponse) CommissionRateBuyerDeprecated() uint16 { + return 0 +} + +func (*AccountResponse) CommissionRateBuyerMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*AccountResponse) CommissionRateBuyerMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*AccountResponse) CommissionRateBuyerMaxValue() int64 { + return math.MaxInt64 +} + +func (*AccountResponse) CommissionRateBuyerNullValue() int64 { + return math.MinInt64 +} + +func (*AccountResponse) CommissionRateSellerId() uint16 { + return 5 +} + +func (*AccountResponse) CommissionRateSellerSinceVersion() uint16 { + return 0 +} + +func (a *AccountResponse) CommissionRateSellerInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.CommissionRateSellerSinceVersion() +} + +func (*AccountResponse) CommissionRateSellerDeprecated() uint16 { + return 0 +} + +func (*AccountResponse) CommissionRateSellerMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*AccountResponse) CommissionRateSellerMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*AccountResponse) CommissionRateSellerMaxValue() int64 { + return math.MaxInt64 +} + +func (*AccountResponse) CommissionRateSellerNullValue() int64 { + return math.MinInt64 +} + +func (*AccountResponse) CanTradeId() uint16 { + return 6 +} + +func (*AccountResponse) CanTradeSinceVersion() uint16 { + return 0 +} + +func (a *AccountResponse) CanTradeInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.CanTradeSinceVersion() +} + +func (*AccountResponse) CanTradeDeprecated() uint16 { + return 0 +} + +func (*AccountResponse) CanTradeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*AccountResponse) CanWithdrawId() uint16 { + return 7 +} + +func (*AccountResponse) CanWithdrawSinceVersion() uint16 { + return 0 +} + +func (a *AccountResponse) CanWithdrawInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.CanWithdrawSinceVersion() +} + +func (*AccountResponse) CanWithdrawDeprecated() uint16 { + return 0 +} + +func (*AccountResponse) CanWithdrawMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*AccountResponse) CanDepositId() uint16 { + return 8 +} + +func (*AccountResponse) CanDepositSinceVersion() uint16 { + return 0 +} + +func (a *AccountResponse) CanDepositInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.CanDepositSinceVersion() +} + +func (*AccountResponse) CanDepositDeprecated() uint16 { + return 0 +} + +func (*AccountResponse) CanDepositMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*AccountResponse) BrokeredId() uint16 { + return 9 +} + +func (*AccountResponse) BrokeredSinceVersion() uint16 { + return 0 +} + +func (a *AccountResponse) BrokeredInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.BrokeredSinceVersion() +} + +func (*AccountResponse) BrokeredDeprecated() uint16 { + return 0 +} + +func (*AccountResponse) BrokeredMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*AccountResponse) RequireSelfTradePreventionId() uint16 { + return 10 +} + +func (*AccountResponse) RequireSelfTradePreventionSinceVersion() uint16 { + return 0 +} + +func (a *AccountResponse) RequireSelfTradePreventionInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.RequireSelfTradePreventionSinceVersion() +} + +func (*AccountResponse) RequireSelfTradePreventionDeprecated() uint16 { + return 0 +} + +func (*AccountResponse) RequireSelfTradePreventionMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*AccountResponse) PreventSorId() uint16 { + return 11 +} + +func (*AccountResponse) PreventSorSinceVersion() uint16 { + return 0 +} + +func (a *AccountResponse) PreventSorInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.PreventSorSinceVersion() +} + +func (*AccountResponse) PreventSorDeprecated() uint16 { + return 0 +} + +func (*AccountResponse) PreventSorMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*AccountResponse) UpdateTimeId() uint16 { + return 12 +} + +func (*AccountResponse) UpdateTimeSinceVersion() uint16 { + return 0 +} + +func (a *AccountResponse) UpdateTimeInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.UpdateTimeSinceVersion() +} + +func (*AccountResponse) UpdateTimeDeprecated() uint16 { + return 0 +} + +func (*AccountResponse) UpdateTimeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*AccountResponse) UpdateTimeMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*AccountResponse) UpdateTimeMaxValue() int64 { + return math.MaxInt64 +} + +func (*AccountResponse) UpdateTimeNullValue() int64 { + return math.MinInt64 +} + +func (*AccountResponse) AccountTypeId() uint16 { + return 13 +} + +func (*AccountResponse) AccountTypeSinceVersion() uint16 { + return 0 +} + +func (a *AccountResponse) AccountTypeInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.AccountTypeSinceVersion() +} + +func (*AccountResponse) AccountTypeDeprecated() uint16 { + return 0 +} + +func (*AccountResponse) AccountTypeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*AccountResponse) TradeGroupIdId() uint16 { + return 14 +} + +func (*AccountResponse) TradeGroupIdSinceVersion() uint16 { + return 0 +} + +func (a *AccountResponse) TradeGroupIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.TradeGroupIdSinceVersion() +} + +func (*AccountResponse) TradeGroupIdDeprecated() uint16 { + return 0 +} + +func (*AccountResponse) TradeGroupIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*AccountResponse) TradeGroupIdMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*AccountResponse) TradeGroupIdMaxValue() int64 { + return math.MaxInt64 +} + +func (*AccountResponse) TradeGroupIdNullValue() int64 { + return math.MinInt64 +} + +func (*AccountResponse) UidId() uint16 { + return 15 +} + +func (*AccountResponse) UidSinceVersion() uint16 { + return 0 +} + +func (a *AccountResponse) UidInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.UidSinceVersion() +} + +func (*AccountResponse) UidDeprecated() uint16 { + return 0 +} + +func (*AccountResponse) UidMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*AccountResponse) UidMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*AccountResponse) UidMaxValue() int64 { + return math.MaxInt64 +} + +func (*AccountResponse) UidNullValue() int64 { + return math.MinInt64 +} + +func (*AccountResponseBalances) ExponentId() uint16 { + return 1 +} + +func (*AccountResponseBalances) ExponentSinceVersion() uint16 { + return 0 +} + +func (a *AccountResponseBalances) ExponentInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.ExponentSinceVersion() +} + +func (*AccountResponseBalances) ExponentDeprecated() uint16 { + return 0 +} + +func (*AccountResponseBalances) ExponentMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*AccountResponseBalances) ExponentMinValue() int8 { + return math.MinInt8 + 1 +} + +func (*AccountResponseBalances) ExponentMaxValue() int8 { + return math.MaxInt8 +} + +func (*AccountResponseBalances) ExponentNullValue() int8 { + return math.MinInt8 +} + +func (*AccountResponseBalances) FreeId() uint16 { + return 2 +} + +func (*AccountResponseBalances) FreeSinceVersion() uint16 { + return 0 +} + +func (a *AccountResponseBalances) FreeInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.FreeSinceVersion() +} + +func (*AccountResponseBalances) FreeDeprecated() uint16 { + return 0 +} + +func (*AccountResponseBalances) FreeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*AccountResponseBalances) FreeMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*AccountResponseBalances) FreeMaxValue() int64 { + return math.MaxInt64 +} + +func (*AccountResponseBalances) FreeNullValue() int64 { + return math.MinInt64 +} + +func (*AccountResponseBalances) LockedId() uint16 { + return 3 +} + +func (*AccountResponseBalances) LockedSinceVersion() uint16 { + return 0 +} + +func (a *AccountResponseBalances) LockedInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.LockedSinceVersion() +} + +func (*AccountResponseBalances) LockedDeprecated() uint16 { + return 0 +} + +func (*AccountResponseBalances) LockedMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*AccountResponseBalances) LockedMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*AccountResponseBalances) LockedMaxValue() int64 { + return math.MaxInt64 +} + +func (*AccountResponseBalances) LockedNullValue() int64 { + return math.MinInt64 +} + +func (*AccountResponseBalances) AssetMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*AccountResponseBalances) AssetSinceVersion() uint16 { + return 0 +} + +func (a *AccountResponseBalances) AssetInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.AssetSinceVersion() +} + +func (*AccountResponseBalances) AssetDeprecated() uint16 { + return 0 +} + +func (AccountResponseBalances) AssetCharacterEncoding() string { + return "UTF-8" +} + +func (AccountResponseBalances) AssetHeaderLength() uint64 { + return 1 +} + +func (*AccountResponsePermissions) PermissionMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*AccountResponsePermissions) PermissionSinceVersion() uint16 { + return 0 +} + +func (a *AccountResponsePermissions) PermissionInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.PermissionSinceVersion() +} + +func (*AccountResponsePermissions) PermissionDeprecated() uint16 { + return 0 +} + +func (AccountResponsePermissions) PermissionCharacterEncoding() string { + return "UTF-8" +} + +func (AccountResponsePermissions) PermissionHeaderLength() uint64 { + return 1 +} + +func (*AccountResponseReduceOnlyAssets) AssetMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*AccountResponseReduceOnlyAssets) AssetSinceVersion() uint16 { + return 0 +} + +func (a *AccountResponseReduceOnlyAssets) AssetInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.AssetSinceVersion() +} + +func (*AccountResponseReduceOnlyAssets) AssetDeprecated() uint16 { + return 0 +} + +func (AccountResponseReduceOnlyAssets) AssetCharacterEncoding() string { + return "UTF-8" +} + +func (AccountResponseReduceOnlyAssets) AssetHeaderLength() uint64 { + return 1 +} + +func (*AccountResponse) BalancesId() uint16 { + return 100 +} + +func (*AccountResponse) BalancesSinceVersion() uint16 { + return 0 +} + +func (a *AccountResponse) BalancesInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.BalancesSinceVersion() +} + +func (*AccountResponse) BalancesDeprecated() uint16 { + return 0 +} + +func (*AccountResponseBalances) SbeBlockLength() (blockLength uint) { + return 17 +} + +func (*AccountResponseBalances) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} + +func (*AccountResponse) PermissionsId() uint16 { + return 101 +} + +func (*AccountResponse) PermissionsSinceVersion() uint16 { + return 0 +} + +func (a *AccountResponse) PermissionsInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.PermissionsSinceVersion() +} + +func (*AccountResponse) PermissionsDeprecated() uint16 { + return 0 +} + +func (*AccountResponsePermissions) SbeBlockLength() (blockLength uint) { + return 0 +} + +func (*AccountResponsePermissions) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} + +func (*AccountResponse) ReduceOnlyAssetsId() uint16 { + return 102 +} + +func (*AccountResponse) ReduceOnlyAssetsSinceVersion() uint16 { + return 0 +} + +func (a *AccountResponse) ReduceOnlyAssetsInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.ReduceOnlyAssetsSinceVersion() +} + +func (*AccountResponse) ReduceOnlyAssetsDeprecated() uint16 { + return 0 +} + +func (*AccountResponseReduceOnlyAssets) SbeBlockLength() (blockLength uint) { + return 0 +} + +func (*AccountResponseReduceOnlyAssets) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} diff --git a/v2/sbe/spot_3_1/AccountTradesResponse.go b/v2/sbe/spot_3_1/AccountTradesResponse.go new file mode 100644 index 00000000..14a65da7 --- /dev/null +++ b/v2/sbe/spot_3_1/AccountTradesResponse.go @@ -0,0 +1,1033 @@ +// Generated SBE (Simple Binary Encoding) message codec + +package sbe + +import ( + "errors" + "fmt" + "io" + "io/ioutil" + "math" + "unicode/utf8" +) + +type AccountTradesResponse struct { + Trades []AccountTradesResponseTrades +} +type AccountTradesResponseTrades struct { + PriceExponent int8 + QtyExponent int8 + CommissionExponent int8 + Id int64 + OrderId int64 + OrderListId int64 + Price int64 + Qty int64 + QuoteQty int64 + Commission int64 + Time int64 + IsBuyer BoolEnumEnum + IsMaker BoolEnumEnum + IsBestMatch BoolEnumEnum + Symbol []uint8 + CommissionAsset []uint8 +} + +func (a *AccountTradesResponse) Encode(_m *SbeGoMarshaller, _w io.Writer, doRangeCheck bool) error { + if doRangeCheck { + if err := a.RangeCheck(a.SbeSchemaVersion(), a.SbeSchemaVersion()); err != nil { + return err + } + } + var TradesBlockLength uint16 = 70 + if err := _m.WriteUint16(_w, TradesBlockLength); err != nil { + return err + } + var TradesNumInGroup uint32 = uint32(len(a.Trades)) + if err := _m.WriteUint32(_w, TradesNumInGroup); err != nil { + return err + } + for i := range a.Trades { + if err := a.Trades[i].Encode(_m, _w); err != nil { + return err + } + } + return nil +} + +func (a *AccountTradesResponse) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint16, doRangeCheck bool) error { + if actingVersion > a.SbeSchemaVersion() && blockLength > a.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-a.SbeBlockLength())) + } + + if a.TradesInActingVersion(actingVersion) { + var TradesBlockLength uint16 + if err := _m.ReadUint16(_r, &TradesBlockLength); err != nil { + return err + } + var TradesNumInGroup uint32 + if err := _m.ReadUint32(_r, &TradesNumInGroup); err != nil { + return err + } + if cap(a.Trades) < int(TradesNumInGroup) { + a.Trades = make([]AccountTradesResponseTrades, TradesNumInGroup) + } + a.Trades = a.Trades[:TradesNumInGroup] + for i := range a.Trades { + if err := a.Trades[i].Decode(_m, _r, actingVersion, uint(TradesBlockLength)); err != nil { + return err + } + } + } + if doRangeCheck { + if err := a.RangeCheck(actingVersion, a.SbeSchemaVersion()); err != nil { + return err + } + } + return nil +} + +func (a *AccountTradesResponse) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + for i := range a.Trades { + if err := a.Trades[i].RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + } + return nil +} + +func AccountTradesResponseInit(a *AccountTradesResponse) { + return +} + +func (a *AccountTradesResponseTrades) Encode(_m *SbeGoMarshaller, _w io.Writer) error { + if err := _m.WriteInt8(_w, a.PriceExponent); err != nil { + return err + } + if err := _m.WriteInt8(_w, a.QtyExponent); err != nil { + return err + } + if err := _m.WriteInt8(_w, a.CommissionExponent); err != nil { + return err + } + if err := _m.WriteInt64(_w, a.Id); err != nil { + return err + } + if err := _m.WriteInt64(_w, a.OrderId); err != nil { + return err + } + if err := _m.WriteInt64(_w, a.OrderListId); err != nil { + return err + } + if err := _m.WriteInt64(_w, a.Price); err != nil { + return err + } + if err := _m.WriteInt64(_w, a.Qty); err != nil { + return err + } + if err := _m.WriteInt64(_w, a.QuoteQty); err != nil { + return err + } + if err := _m.WriteInt64(_w, a.Commission); err != nil { + return err + } + if err := _m.WriteInt64(_w, a.Time); err != nil { + return err + } + if err := a.IsBuyer.Encode(_m, _w); err != nil { + return err + } + if err := a.IsMaker.Encode(_m, _w); err != nil { + return err + } + if err := a.IsBestMatch.Encode(_m, _w); err != nil { + return err + } + if err := _m.WriteUint8(_w, uint8(len(a.Symbol))); err != nil { + return err + } + if err := _m.WriteBytes(_w, a.Symbol); err != nil { + return err + } + if err := _m.WriteUint8(_w, uint8(len(a.CommissionAsset))); err != nil { + return err + } + if err := _m.WriteBytes(_w, a.CommissionAsset); err != nil { + return err + } + return nil +} + +func (a *AccountTradesResponseTrades) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint) error { + if !a.PriceExponentInActingVersion(actingVersion) { + a.PriceExponent = a.PriceExponentNullValue() + } else { + if err := _m.ReadInt8(_r, &a.PriceExponent); err != nil { + return err + } + } + if !a.QtyExponentInActingVersion(actingVersion) { + a.QtyExponent = a.QtyExponentNullValue() + } else { + if err := _m.ReadInt8(_r, &a.QtyExponent); err != nil { + return err + } + } + if !a.CommissionExponentInActingVersion(actingVersion) { + a.CommissionExponent = a.CommissionExponentNullValue() + } else { + if err := _m.ReadInt8(_r, &a.CommissionExponent); err != nil { + return err + } + } + if !a.IdInActingVersion(actingVersion) { + a.Id = a.IdNullValue() + } else { + if err := _m.ReadInt64(_r, &a.Id); err != nil { + return err + } + } + if !a.OrderIdInActingVersion(actingVersion) { + a.OrderId = a.OrderIdNullValue() + } else { + if err := _m.ReadInt64(_r, &a.OrderId); err != nil { + return err + } + } + if !a.OrderListIdInActingVersion(actingVersion) { + a.OrderListId = a.OrderListIdNullValue() + } else { + if err := _m.ReadInt64(_r, &a.OrderListId); err != nil { + return err + } + } + if !a.PriceInActingVersion(actingVersion) { + a.Price = a.PriceNullValue() + } else { + if err := _m.ReadInt64(_r, &a.Price); err != nil { + return err + } + } + if !a.QtyInActingVersion(actingVersion) { + a.Qty = a.QtyNullValue() + } else { + if err := _m.ReadInt64(_r, &a.Qty); err != nil { + return err + } + } + if !a.QuoteQtyInActingVersion(actingVersion) { + a.QuoteQty = a.QuoteQtyNullValue() + } else { + if err := _m.ReadInt64(_r, &a.QuoteQty); err != nil { + return err + } + } + if !a.CommissionInActingVersion(actingVersion) { + a.Commission = a.CommissionNullValue() + } else { + if err := _m.ReadInt64(_r, &a.Commission); err != nil { + return err + } + } + if !a.TimeInActingVersion(actingVersion) { + a.Time = a.TimeNullValue() + } else { + if err := _m.ReadInt64(_r, &a.Time); err != nil { + return err + } + } + if a.IsBuyerInActingVersion(actingVersion) { + if err := a.IsBuyer.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if a.IsMakerInActingVersion(actingVersion) { + if err := a.IsMaker.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if a.IsBestMatchInActingVersion(actingVersion) { + if err := a.IsBestMatch.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if actingVersion > a.SbeSchemaVersion() && blockLength > a.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-a.SbeBlockLength())) + } + + if a.SymbolInActingVersion(actingVersion) { + var SymbolLength uint8 + if err := _m.ReadUint8(_r, &SymbolLength); err != nil { + return err + } + if cap(a.Symbol) < int(SymbolLength) { + a.Symbol = make([]uint8, SymbolLength) + } + a.Symbol = a.Symbol[:SymbolLength] + if err := _m.ReadBytes(_r, a.Symbol); err != nil { + return err + } + } + + if a.CommissionAssetInActingVersion(actingVersion) { + var CommissionAssetLength uint8 + if err := _m.ReadUint8(_r, &CommissionAssetLength); err != nil { + return err + } + if cap(a.CommissionAsset) < int(CommissionAssetLength) { + a.CommissionAsset = make([]uint8, CommissionAssetLength) + } + a.CommissionAsset = a.CommissionAsset[:CommissionAssetLength] + if err := _m.ReadBytes(_r, a.CommissionAsset); err != nil { + return err + } + } + return nil +} + +func (a *AccountTradesResponseTrades) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if a.PriceExponentInActingVersion(actingVersion) { + if a.PriceExponent < a.PriceExponentMinValue() || a.PriceExponent > a.PriceExponentMaxValue() { + return fmt.Errorf("Range check failed on a.PriceExponent (%v < %v > %v)", a.PriceExponentMinValue(), a.PriceExponent, a.PriceExponentMaxValue()) + } + } + if a.QtyExponentInActingVersion(actingVersion) { + if a.QtyExponent < a.QtyExponentMinValue() || a.QtyExponent > a.QtyExponentMaxValue() { + return fmt.Errorf("Range check failed on a.QtyExponent (%v < %v > %v)", a.QtyExponentMinValue(), a.QtyExponent, a.QtyExponentMaxValue()) + } + } + if a.CommissionExponentInActingVersion(actingVersion) { + if a.CommissionExponent < a.CommissionExponentMinValue() || a.CommissionExponent > a.CommissionExponentMaxValue() { + return fmt.Errorf("Range check failed on a.CommissionExponent (%v < %v > %v)", a.CommissionExponentMinValue(), a.CommissionExponent, a.CommissionExponentMaxValue()) + } + } + if a.IdInActingVersion(actingVersion) { + if a.Id < a.IdMinValue() || a.Id > a.IdMaxValue() { + return fmt.Errorf("Range check failed on a.Id (%v < %v > %v)", a.IdMinValue(), a.Id, a.IdMaxValue()) + } + } + if a.OrderIdInActingVersion(actingVersion) { + if a.OrderId < a.OrderIdMinValue() || a.OrderId > a.OrderIdMaxValue() { + return fmt.Errorf("Range check failed on a.OrderId (%v < %v > %v)", a.OrderIdMinValue(), a.OrderId, a.OrderIdMaxValue()) + } + } + if a.OrderListIdInActingVersion(actingVersion) { + if a.OrderListId != a.OrderListIdNullValue() && (a.OrderListId < a.OrderListIdMinValue() || a.OrderListId > a.OrderListIdMaxValue()) { + return fmt.Errorf("Range check failed on a.OrderListId (%v < %v > %v)", a.OrderListIdMinValue(), a.OrderListId, a.OrderListIdMaxValue()) + } + } + if a.PriceInActingVersion(actingVersion) { + if a.Price < a.PriceMinValue() || a.Price > a.PriceMaxValue() { + return fmt.Errorf("Range check failed on a.Price (%v < %v > %v)", a.PriceMinValue(), a.Price, a.PriceMaxValue()) + } + } + if a.QtyInActingVersion(actingVersion) { + if a.Qty < a.QtyMinValue() || a.Qty > a.QtyMaxValue() { + return fmt.Errorf("Range check failed on a.Qty (%v < %v > %v)", a.QtyMinValue(), a.Qty, a.QtyMaxValue()) + } + } + if a.QuoteQtyInActingVersion(actingVersion) { + if a.QuoteQty < a.QuoteQtyMinValue() || a.QuoteQty > a.QuoteQtyMaxValue() { + return fmt.Errorf("Range check failed on a.QuoteQty (%v < %v > %v)", a.QuoteQtyMinValue(), a.QuoteQty, a.QuoteQtyMaxValue()) + } + } + if a.CommissionInActingVersion(actingVersion) { + if a.Commission < a.CommissionMinValue() || a.Commission > a.CommissionMaxValue() { + return fmt.Errorf("Range check failed on a.Commission (%v < %v > %v)", a.CommissionMinValue(), a.Commission, a.CommissionMaxValue()) + } + } + if a.TimeInActingVersion(actingVersion) { + if a.Time < a.TimeMinValue() || a.Time > a.TimeMaxValue() { + return fmt.Errorf("Range check failed on a.Time (%v < %v > %v)", a.TimeMinValue(), a.Time, a.TimeMaxValue()) + } + } + if err := a.IsBuyer.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if err := a.IsMaker.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if err := a.IsBestMatch.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if !utf8.Valid(a.Symbol[:]) { + return errors.New("a.Symbol failed UTF-8 validation") + } + if !utf8.Valid(a.CommissionAsset[:]) { + return errors.New("a.CommissionAsset failed UTF-8 validation") + } + return nil +} + +func AccountTradesResponseTradesInit(a *AccountTradesResponseTrades) { + a.OrderListId = math.MinInt64 + return +} + +func (*AccountTradesResponse) SbeBlockLength() (blockLength uint16) { + return 0 +} + +func (*AccountTradesResponse) SbeTemplateId() (templateId uint16) { + return 401 +} + +func (*AccountTradesResponse) SbeSchemaId() (schemaId uint16) { + return 3 +} + +func (*AccountTradesResponse) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} + +func (*AccountTradesResponse) SbeSemanticType() (semanticType []byte) { + return []byte("") +} + +func (*AccountTradesResponse) SbeSemanticVersion() (semanticVersion string) { + return "5.2" +} + +func (*AccountTradesResponseTrades) PriceExponentId() uint16 { + return 1 +} + +func (*AccountTradesResponseTrades) PriceExponentSinceVersion() uint16 { + return 0 +} + +func (a *AccountTradesResponseTrades) PriceExponentInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.PriceExponentSinceVersion() +} + +func (*AccountTradesResponseTrades) PriceExponentDeprecated() uint16 { + return 0 +} + +func (*AccountTradesResponseTrades) PriceExponentMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*AccountTradesResponseTrades) PriceExponentMinValue() int8 { + return math.MinInt8 + 1 +} + +func (*AccountTradesResponseTrades) PriceExponentMaxValue() int8 { + return math.MaxInt8 +} + +func (*AccountTradesResponseTrades) PriceExponentNullValue() int8 { + return math.MinInt8 +} + +func (*AccountTradesResponseTrades) QtyExponentId() uint16 { + return 2 +} + +func (*AccountTradesResponseTrades) QtyExponentSinceVersion() uint16 { + return 0 +} + +func (a *AccountTradesResponseTrades) QtyExponentInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.QtyExponentSinceVersion() +} + +func (*AccountTradesResponseTrades) QtyExponentDeprecated() uint16 { + return 0 +} + +func (*AccountTradesResponseTrades) QtyExponentMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*AccountTradesResponseTrades) QtyExponentMinValue() int8 { + return math.MinInt8 + 1 +} + +func (*AccountTradesResponseTrades) QtyExponentMaxValue() int8 { + return math.MaxInt8 +} + +func (*AccountTradesResponseTrades) QtyExponentNullValue() int8 { + return math.MinInt8 +} + +func (*AccountTradesResponseTrades) CommissionExponentId() uint16 { + return 3 +} + +func (*AccountTradesResponseTrades) CommissionExponentSinceVersion() uint16 { + return 0 +} + +func (a *AccountTradesResponseTrades) CommissionExponentInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.CommissionExponentSinceVersion() +} + +func (*AccountTradesResponseTrades) CommissionExponentDeprecated() uint16 { + return 0 +} + +func (*AccountTradesResponseTrades) CommissionExponentMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*AccountTradesResponseTrades) CommissionExponentMinValue() int8 { + return math.MinInt8 + 1 +} + +func (*AccountTradesResponseTrades) CommissionExponentMaxValue() int8 { + return math.MaxInt8 +} + +func (*AccountTradesResponseTrades) CommissionExponentNullValue() int8 { + return math.MinInt8 +} + +func (*AccountTradesResponseTrades) IdId() uint16 { + return 4 +} + +func (*AccountTradesResponseTrades) IdSinceVersion() uint16 { + return 0 +} + +func (a *AccountTradesResponseTrades) IdInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.IdSinceVersion() +} + +func (*AccountTradesResponseTrades) IdDeprecated() uint16 { + return 0 +} + +func (*AccountTradesResponseTrades) IdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*AccountTradesResponseTrades) IdMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*AccountTradesResponseTrades) IdMaxValue() int64 { + return math.MaxInt64 +} + +func (*AccountTradesResponseTrades) IdNullValue() int64 { + return math.MinInt64 +} + +func (*AccountTradesResponseTrades) OrderIdId() uint16 { + return 5 +} + +func (*AccountTradesResponseTrades) OrderIdSinceVersion() uint16 { + return 0 +} + +func (a *AccountTradesResponseTrades) OrderIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.OrderIdSinceVersion() +} + +func (*AccountTradesResponseTrades) OrderIdDeprecated() uint16 { + return 0 +} + +func (*AccountTradesResponseTrades) OrderIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*AccountTradesResponseTrades) OrderIdMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*AccountTradesResponseTrades) OrderIdMaxValue() int64 { + return math.MaxInt64 +} + +func (*AccountTradesResponseTrades) OrderIdNullValue() int64 { + return math.MinInt64 +} + +func (*AccountTradesResponseTrades) OrderListIdId() uint16 { + return 6 +} + +func (*AccountTradesResponseTrades) OrderListIdSinceVersion() uint16 { + return 0 +} + +func (a *AccountTradesResponseTrades) OrderListIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.OrderListIdSinceVersion() +} + +func (*AccountTradesResponseTrades) OrderListIdDeprecated() uint16 { + return 0 +} + +func (*AccountTradesResponseTrades) OrderListIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*AccountTradesResponseTrades) OrderListIdMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*AccountTradesResponseTrades) OrderListIdMaxValue() int64 { + return math.MaxInt64 +} + +func (*AccountTradesResponseTrades) OrderListIdNullValue() int64 { + return math.MinInt64 +} + +func (*AccountTradesResponseTrades) PriceId() uint16 { + return 7 +} + +func (*AccountTradesResponseTrades) PriceSinceVersion() uint16 { + return 0 +} + +func (a *AccountTradesResponseTrades) PriceInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.PriceSinceVersion() +} + +func (*AccountTradesResponseTrades) PriceDeprecated() uint16 { + return 0 +} + +func (*AccountTradesResponseTrades) PriceMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*AccountTradesResponseTrades) PriceMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*AccountTradesResponseTrades) PriceMaxValue() int64 { + return math.MaxInt64 +} + +func (*AccountTradesResponseTrades) PriceNullValue() int64 { + return math.MinInt64 +} + +func (*AccountTradesResponseTrades) QtyId() uint16 { + return 8 +} + +func (*AccountTradesResponseTrades) QtySinceVersion() uint16 { + return 0 +} + +func (a *AccountTradesResponseTrades) QtyInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.QtySinceVersion() +} + +func (*AccountTradesResponseTrades) QtyDeprecated() uint16 { + return 0 +} + +func (*AccountTradesResponseTrades) QtyMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*AccountTradesResponseTrades) QtyMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*AccountTradesResponseTrades) QtyMaxValue() int64 { + return math.MaxInt64 +} + +func (*AccountTradesResponseTrades) QtyNullValue() int64 { + return math.MinInt64 +} + +func (*AccountTradesResponseTrades) QuoteQtyId() uint16 { + return 9 +} + +func (*AccountTradesResponseTrades) QuoteQtySinceVersion() uint16 { + return 0 +} + +func (a *AccountTradesResponseTrades) QuoteQtyInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.QuoteQtySinceVersion() +} + +func (*AccountTradesResponseTrades) QuoteQtyDeprecated() uint16 { + return 0 +} + +func (*AccountTradesResponseTrades) QuoteQtyMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*AccountTradesResponseTrades) QuoteQtyMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*AccountTradesResponseTrades) QuoteQtyMaxValue() int64 { + return math.MaxInt64 +} + +func (*AccountTradesResponseTrades) QuoteQtyNullValue() int64 { + return math.MinInt64 +} + +func (*AccountTradesResponseTrades) CommissionId() uint16 { + return 10 +} + +func (*AccountTradesResponseTrades) CommissionSinceVersion() uint16 { + return 0 +} + +func (a *AccountTradesResponseTrades) CommissionInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.CommissionSinceVersion() +} + +func (*AccountTradesResponseTrades) CommissionDeprecated() uint16 { + return 0 +} + +func (*AccountTradesResponseTrades) CommissionMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*AccountTradesResponseTrades) CommissionMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*AccountTradesResponseTrades) CommissionMaxValue() int64 { + return math.MaxInt64 +} + +func (*AccountTradesResponseTrades) CommissionNullValue() int64 { + return math.MinInt64 +} + +func (*AccountTradesResponseTrades) TimeId() uint16 { + return 11 +} + +func (*AccountTradesResponseTrades) TimeSinceVersion() uint16 { + return 0 +} + +func (a *AccountTradesResponseTrades) TimeInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.TimeSinceVersion() +} + +func (*AccountTradesResponseTrades) TimeDeprecated() uint16 { + return 0 +} + +func (*AccountTradesResponseTrades) TimeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*AccountTradesResponseTrades) TimeMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*AccountTradesResponseTrades) TimeMaxValue() int64 { + return math.MaxInt64 +} + +func (*AccountTradesResponseTrades) TimeNullValue() int64 { + return math.MinInt64 +} + +func (*AccountTradesResponseTrades) IsBuyerId() uint16 { + return 12 +} + +func (*AccountTradesResponseTrades) IsBuyerSinceVersion() uint16 { + return 0 +} + +func (a *AccountTradesResponseTrades) IsBuyerInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.IsBuyerSinceVersion() +} + +func (*AccountTradesResponseTrades) IsBuyerDeprecated() uint16 { + return 0 +} + +func (*AccountTradesResponseTrades) IsBuyerMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*AccountTradesResponseTrades) IsMakerId() uint16 { + return 13 +} + +func (*AccountTradesResponseTrades) IsMakerSinceVersion() uint16 { + return 0 +} + +func (a *AccountTradesResponseTrades) IsMakerInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.IsMakerSinceVersion() +} + +func (*AccountTradesResponseTrades) IsMakerDeprecated() uint16 { + return 0 +} + +func (*AccountTradesResponseTrades) IsMakerMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*AccountTradesResponseTrades) IsBestMatchId() uint16 { + return 14 +} + +func (*AccountTradesResponseTrades) IsBestMatchSinceVersion() uint16 { + return 0 +} + +func (a *AccountTradesResponseTrades) IsBestMatchInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.IsBestMatchSinceVersion() +} + +func (*AccountTradesResponseTrades) IsBestMatchDeprecated() uint16 { + return 0 +} + +func (*AccountTradesResponseTrades) IsBestMatchMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*AccountTradesResponseTrades) SymbolMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*AccountTradesResponseTrades) SymbolSinceVersion() uint16 { + return 0 +} + +func (a *AccountTradesResponseTrades) SymbolInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.SymbolSinceVersion() +} + +func (*AccountTradesResponseTrades) SymbolDeprecated() uint16 { + return 0 +} + +func (AccountTradesResponseTrades) SymbolCharacterEncoding() string { + return "UTF-8" +} + +func (AccountTradesResponseTrades) SymbolHeaderLength() uint64 { + return 1 +} + +func (*AccountTradesResponseTrades) CommissionAssetMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*AccountTradesResponseTrades) CommissionAssetSinceVersion() uint16 { + return 0 +} + +func (a *AccountTradesResponseTrades) CommissionAssetInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.CommissionAssetSinceVersion() +} + +func (*AccountTradesResponseTrades) CommissionAssetDeprecated() uint16 { + return 0 +} + +func (AccountTradesResponseTrades) CommissionAssetCharacterEncoding() string { + return "UTF-8" +} + +func (AccountTradesResponseTrades) CommissionAssetHeaderLength() uint64 { + return 1 +} + +func (*AccountTradesResponse) TradesId() uint16 { + return 100 +} + +func (*AccountTradesResponse) TradesSinceVersion() uint16 { + return 0 +} + +func (a *AccountTradesResponse) TradesInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.TradesSinceVersion() +} + +func (*AccountTradesResponse) TradesDeprecated() uint16 { + return 0 +} + +func (*AccountTradesResponseTrades) SbeBlockLength() (blockLength uint) { + return 70 +} + +func (*AccountTradesResponseTrades) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} diff --git a/v2/sbe/spot_3_1/AccountType.go b/v2/sbe/spot_3_1/AccountType.go new file mode 100644 index 00000000..24950328 --- /dev/null +++ b/v2/sbe/spot_3_1/AccountType.go @@ -0,0 +1,86 @@ +// Generated SBE (Simple Binary Encoding) message codec + +package sbe + +import ( + "fmt" + "io" + "reflect" +) + +type AccountTypeEnum uint8 +type AccountTypeValues struct { + Spot AccountTypeEnum + Unknown AccountTypeEnum + NonRepresentable AccountTypeEnum + NullValue AccountTypeEnum +} + +var AccountType = AccountTypeValues{0, 2, 254, 255} + +func (a AccountTypeEnum) Encode(_m *SbeGoMarshaller, _w io.Writer) error { + if err := _m.WriteUint8(_w, uint8(a)); err != nil { + return err + } + return nil +} + +func (a *AccountTypeEnum) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16) error { + if err := _m.ReadUint8(_r, (*uint8)(a)); err != nil { + return err + } + return nil +} + +func (a AccountTypeEnum) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if actingVersion > schemaVersion { + return nil + } + value := reflect.ValueOf(AccountType) + for idx := 0; idx < value.NumField(); idx++ { + if a == value.Field(idx).Interface() { + return nil + } + } + return fmt.Errorf("Range check failed on AccountType, unknown enumeration value %d", a) +} + +func (*AccountTypeEnum) EncodedLength() int64 { + return 1 +} + +func (*AccountTypeEnum) SpotSinceVersion() uint16 { + return 0 +} + +func (a *AccountTypeEnum) SpotInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.SpotSinceVersion() +} + +func (*AccountTypeEnum) SpotDeprecated() uint16 { + return 0 +} + +func (*AccountTypeEnum) UnknownSinceVersion() uint16 { + return 0 +} + +func (a *AccountTypeEnum) UnknownInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.UnknownSinceVersion() +} + +func (*AccountTypeEnum) UnknownDeprecated() uint16 { + return 0 +} + +func (*AccountTypeEnum) NonRepresentableSinceVersion() uint16 { + return 0 +} + +func (a *AccountTypeEnum) NonRepresentableInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.NonRepresentableSinceVersion() +} + +func (*AccountTypeEnum) NonRepresentableDeprecated() uint16 { + return 0 +} diff --git a/v2/sbe/spot_3_1/AggTradesResponse.go b/v2/sbe/spot_3_1/AggTradesResponse.go new file mode 100644 index 00000000..582b3f48 --- /dev/null +++ b/v2/sbe/spot_3_1/AggTradesResponse.go @@ -0,0 +1,698 @@ +// Generated SBE (Simple Binary Encoding) message codec + +package sbe + +import ( + "fmt" + "io" + "io/ioutil" + "math" +) + +type AggTradesResponse struct { + PriceExponent int8 + QtyExponent int8 + AggTrades []AggTradesResponseAggTrades +} +type AggTradesResponseAggTrades struct { + AggTradeId int64 + Price int64 + Qty int64 + FirstTradeId int64 + LastTradeId int64 + Time int64 + IsBuyerMaker BoolEnumEnum + IsBestMatch BoolEnumEnum +} + +func (a *AggTradesResponse) Encode(_m *SbeGoMarshaller, _w io.Writer, doRangeCheck bool) error { + if doRangeCheck { + if err := a.RangeCheck(a.SbeSchemaVersion(), a.SbeSchemaVersion()); err != nil { + return err + } + } + if err := _m.WriteInt8(_w, a.PriceExponent); err != nil { + return err + } + if err := _m.WriteInt8(_w, a.QtyExponent); err != nil { + return err + } + var AggTradesBlockLength uint16 = 50 + if err := _m.WriteUint16(_w, AggTradesBlockLength); err != nil { + return err + } + var AggTradesNumInGroup uint32 = uint32(len(a.AggTrades)) + if err := _m.WriteUint32(_w, AggTradesNumInGroup); err != nil { + return err + } + for i := range a.AggTrades { + if err := a.AggTrades[i].Encode(_m, _w); err != nil { + return err + } + } + return nil +} + +func (a *AggTradesResponse) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint16, doRangeCheck bool) error { + if !a.PriceExponentInActingVersion(actingVersion) { + a.PriceExponent = a.PriceExponentNullValue() + } else { + if err := _m.ReadInt8(_r, &a.PriceExponent); err != nil { + return err + } + } + if !a.QtyExponentInActingVersion(actingVersion) { + a.QtyExponent = a.QtyExponentNullValue() + } else { + if err := _m.ReadInt8(_r, &a.QtyExponent); err != nil { + return err + } + } + if actingVersion > a.SbeSchemaVersion() && blockLength > a.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-a.SbeBlockLength())) + } + + if a.AggTradesInActingVersion(actingVersion) { + var AggTradesBlockLength uint16 + if err := _m.ReadUint16(_r, &AggTradesBlockLength); err != nil { + return err + } + var AggTradesNumInGroup uint32 + if err := _m.ReadUint32(_r, &AggTradesNumInGroup); err != nil { + return err + } + if cap(a.AggTrades) < int(AggTradesNumInGroup) { + a.AggTrades = make([]AggTradesResponseAggTrades, AggTradesNumInGroup) + } + a.AggTrades = a.AggTrades[:AggTradesNumInGroup] + for i := range a.AggTrades { + if err := a.AggTrades[i].Decode(_m, _r, actingVersion, uint(AggTradesBlockLength)); err != nil { + return err + } + } + } + if doRangeCheck { + if err := a.RangeCheck(actingVersion, a.SbeSchemaVersion()); err != nil { + return err + } + } + return nil +} + +func (a *AggTradesResponse) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if a.PriceExponentInActingVersion(actingVersion) { + if a.PriceExponent < a.PriceExponentMinValue() || a.PriceExponent > a.PriceExponentMaxValue() { + return fmt.Errorf("Range check failed on a.PriceExponent (%v < %v > %v)", a.PriceExponentMinValue(), a.PriceExponent, a.PriceExponentMaxValue()) + } + } + if a.QtyExponentInActingVersion(actingVersion) { + if a.QtyExponent < a.QtyExponentMinValue() || a.QtyExponent > a.QtyExponentMaxValue() { + return fmt.Errorf("Range check failed on a.QtyExponent (%v < %v > %v)", a.QtyExponentMinValue(), a.QtyExponent, a.QtyExponentMaxValue()) + } + } + for i := range a.AggTrades { + if err := a.AggTrades[i].RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + } + return nil +} + +func AggTradesResponseInit(a *AggTradesResponse) { + return +} + +func (a *AggTradesResponseAggTrades) Encode(_m *SbeGoMarshaller, _w io.Writer) error { + if err := _m.WriteInt64(_w, a.AggTradeId); err != nil { + return err + } + if err := _m.WriteInt64(_w, a.Price); err != nil { + return err + } + if err := _m.WriteInt64(_w, a.Qty); err != nil { + return err + } + if err := _m.WriteInt64(_w, a.FirstTradeId); err != nil { + return err + } + if err := _m.WriteInt64(_w, a.LastTradeId); err != nil { + return err + } + if err := _m.WriteInt64(_w, a.Time); err != nil { + return err + } + if err := a.IsBuyerMaker.Encode(_m, _w); err != nil { + return err + } + if err := a.IsBestMatch.Encode(_m, _w); err != nil { + return err + } + return nil +} + +func (a *AggTradesResponseAggTrades) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint) error { + if !a.AggTradeIdInActingVersion(actingVersion) { + a.AggTradeId = a.AggTradeIdNullValue() + } else { + if err := _m.ReadInt64(_r, &a.AggTradeId); err != nil { + return err + } + } + if !a.PriceInActingVersion(actingVersion) { + a.Price = a.PriceNullValue() + } else { + if err := _m.ReadInt64(_r, &a.Price); err != nil { + return err + } + } + if !a.QtyInActingVersion(actingVersion) { + a.Qty = a.QtyNullValue() + } else { + if err := _m.ReadInt64(_r, &a.Qty); err != nil { + return err + } + } + if !a.FirstTradeIdInActingVersion(actingVersion) { + a.FirstTradeId = a.FirstTradeIdNullValue() + } else { + if err := _m.ReadInt64(_r, &a.FirstTradeId); err != nil { + return err + } + } + if !a.LastTradeIdInActingVersion(actingVersion) { + a.LastTradeId = a.LastTradeIdNullValue() + } else { + if err := _m.ReadInt64(_r, &a.LastTradeId); err != nil { + return err + } + } + if !a.TimeInActingVersion(actingVersion) { + a.Time = a.TimeNullValue() + } else { + if err := _m.ReadInt64(_r, &a.Time); err != nil { + return err + } + } + if a.IsBuyerMakerInActingVersion(actingVersion) { + if err := a.IsBuyerMaker.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if a.IsBestMatchInActingVersion(actingVersion) { + if err := a.IsBestMatch.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if actingVersion > a.SbeSchemaVersion() && blockLength > a.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-a.SbeBlockLength())) + } + return nil +} + +func (a *AggTradesResponseAggTrades) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if a.AggTradeIdInActingVersion(actingVersion) { + if a.AggTradeId < a.AggTradeIdMinValue() || a.AggTradeId > a.AggTradeIdMaxValue() { + return fmt.Errorf("Range check failed on a.AggTradeId (%v < %v > %v)", a.AggTradeIdMinValue(), a.AggTradeId, a.AggTradeIdMaxValue()) + } + } + if a.PriceInActingVersion(actingVersion) { + if a.Price < a.PriceMinValue() || a.Price > a.PriceMaxValue() { + return fmt.Errorf("Range check failed on a.Price (%v < %v > %v)", a.PriceMinValue(), a.Price, a.PriceMaxValue()) + } + } + if a.QtyInActingVersion(actingVersion) { + if a.Qty < a.QtyMinValue() || a.Qty > a.QtyMaxValue() { + return fmt.Errorf("Range check failed on a.Qty (%v < %v > %v)", a.QtyMinValue(), a.Qty, a.QtyMaxValue()) + } + } + if a.FirstTradeIdInActingVersion(actingVersion) { + if a.FirstTradeId < a.FirstTradeIdMinValue() || a.FirstTradeId > a.FirstTradeIdMaxValue() { + return fmt.Errorf("Range check failed on a.FirstTradeId (%v < %v > %v)", a.FirstTradeIdMinValue(), a.FirstTradeId, a.FirstTradeIdMaxValue()) + } + } + if a.LastTradeIdInActingVersion(actingVersion) { + if a.LastTradeId < a.LastTradeIdMinValue() || a.LastTradeId > a.LastTradeIdMaxValue() { + return fmt.Errorf("Range check failed on a.LastTradeId (%v < %v > %v)", a.LastTradeIdMinValue(), a.LastTradeId, a.LastTradeIdMaxValue()) + } + } + if a.TimeInActingVersion(actingVersion) { + if a.Time < a.TimeMinValue() || a.Time > a.TimeMaxValue() { + return fmt.Errorf("Range check failed on a.Time (%v < %v > %v)", a.TimeMinValue(), a.Time, a.TimeMaxValue()) + } + } + if err := a.IsBuyerMaker.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if err := a.IsBestMatch.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + return nil +} + +func AggTradesResponseAggTradesInit(a *AggTradesResponseAggTrades) { + return +} + +func (*AggTradesResponse) SbeBlockLength() (blockLength uint16) { + return 2 +} + +func (*AggTradesResponse) SbeTemplateId() (templateId uint16) { + return 202 +} + +func (*AggTradesResponse) SbeSchemaId() (schemaId uint16) { + return 3 +} + +func (*AggTradesResponse) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} + +func (*AggTradesResponse) SbeSemanticType() (semanticType []byte) { + return []byte("") +} + +func (*AggTradesResponse) SbeSemanticVersion() (semanticVersion string) { + return "5.2" +} + +func (*AggTradesResponse) PriceExponentId() uint16 { + return 1 +} + +func (*AggTradesResponse) PriceExponentSinceVersion() uint16 { + return 0 +} + +func (a *AggTradesResponse) PriceExponentInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.PriceExponentSinceVersion() +} + +func (*AggTradesResponse) PriceExponentDeprecated() uint16 { + return 0 +} + +func (*AggTradesResponse) PriceExponentMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*AggTradesResponse) PriceExponentMinValue() int8 { + return math.MinInt8 + 1 +} + +func (*AggTradesResponse) PriceExponentMaxValue() int8 { + return math.MaxInt8 +} + +func (*AggTradesResponse) PriceExponentNullValue() int8 { + return math.MinInt8 +} + +func (*AggTradesResponse) QtyExponentId() uint16 { + return 2 +} + +func (*AggTradesResponse) QtyExponentSinceVersion() uint16 { + return 0 +} + +func (a *AggTradesResponse) QtyExponentInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.QtyExponentSinceVersion() +} + +func (*AggTradesResponse) QtyExponentDeprecated() uint16 { + return 0 +} + +func (*AggTradesResponse) QtyExponentMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*AggTradesResponse) QtyExponentMinValue() int8 { + return math.MinInt8 + 1 +} + +func (*AggTradesResponse) QtyExponentMaxValue() int8 { + return math.MaxInt8 +} + +func (*AggTradesResponse) QtyExponentNullValue() int8 { + return math.MinInt8 +} + +func (*AggTradesResponseAggTrades) AggTradeIdId() uint16 { + return 1 +} + +func (*AggTradesResponseAggTrades) AggTradeIdSinceVersion() uint16 { + return 0 +} + +func (a *AggTradesResponseAggTrades) AggTradeIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.AggTradeIdSinceVersion() +} + +func (*AggTradesResponseAggTrades) AggTradeIdDeprecated() uint16 { + return 0 +} + +func (*AggTradesResponseAggTrades) AggTradeIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*AggTradesResponseAggTrades) AggTradeIdMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*AggTradesResponseAggTrades) AggTradeIdMaxValue() int64 { + return math.MaxInt64 +} + +func (*AggTradesResponseAggTrades) AggTradeIdNullValue() int64 { + return math.MinInt64 +} + +func (*AggTradesResponseAggTrades) PriceId() uint16 { + return 2 +} + +func (*AggTradesResponseAggTrades) PriceSinceVersion() uint16 { + return 0 +} + +func (a *AggTradesResponseAggTrades) PriceInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.PriceSinceVersion() +} + +func (*AggTradesResponseAggTrades) PriceDeprecated() uint16 { + return 0 +} + +func (*AggTradesResponseAggTrades) PriceMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*AggTradesResponseAggTrades) PriceMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*AggTradesResponseAggTrades) PriceMaxValue() int64 { + return math.MaxInt64 +} + +func (*AggTradesResponseAggTrades) PriceNullValue() int64 { + return math.MinInt64 +} + +func (*AggTradesResponseAggTrades) QtyId() uint16 { + return 3 +} + +func (*AggTradesResponseAggTrades) QtySinceVersion() uint16 { + return 0 +} + +func (a *AggTradesResponseAggTrades) QtyInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.QtySinceVersion() +} + +func (*AggTradesResponseAggTrades) QtyDeprecated() uint16 { + return 0 +} + +func (*AggTradesResponseAggTrades) QtyMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*AggTradesResponseAggTrades) QtyMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*AggTradesResponseAggTrades) QtyMaxValue() int64 { + return math.MaxInt64 +} + +func (*AggTradesResponseAggTrades) QtyNullValue() int64 { + return math.MinInt64 +} + +func (*AggTradesResponseAggTrades) FirstTradeIdId() uint16 { + return 4 +} + +func (*AggTradesResponseAggTrades) FirstTradeIdSinceVersion() uint16 { + return 0 +} + +func (a *AggTradesResponseAggTrades) FirstTradeIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.FirstTradeIdSinceVersion() +} + +func (*AggTradesResponseAggTrades) FirstTradeIdDeprecated() uint16 { + return 0 +} + +func (*AggTradesResponseAggTrades) FirstTradeIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*AggTradesResponseAggTrades) FirstTradeIdMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*AggTradesResponseAggTrades) FirstTradeIdMaxValue() int64 { + return math.MaxInt64 +} + +func (*AggTradesResponseAggTrades) FirstTradeIdNullValue() int64 { + return math.MinInt64 +} + +func (*AggTradesResponseAggTrades) LastTradeIdId() uint16 { + return 5 +} + +func (*AggTradesResponseAggTrades) LastTradeIdSinceVersion() uint16 { + return 0 +} + +func (a *AggTradesResponseAggTrades) LastTradeIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.LastTradeIdSinceVersion() +} + +func (*AggTradesResponseAggTrades) LastTradeIdDeprecated() uint16 { + return 0 +} + +func (*AggTradesResponseAggTrades) LastTradeIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*AggTradesResponseAggTrades) LastTradeIdMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*AggTradesResponseAggTrades) LastTradeIdMaxValue() int64 { + return math.MaxInt64 +} + +func (*AggTradesResponseAggTrades) LastTradeIdNullValue() int64 { + return math.MinInt64 +} + +func (*AggTradesResponseAggTrades) TimeId() uint16 { + return 7 +} + +func (*AggTradesResponseAggTrades) TimeSinceVersion() uint16 { + return 0 +} + +func (a *AggTradesResponseAggTrades) TimeInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.TimeSinceVersion() +} + +func (*AggTradesResponseAggTrades) TimeDeprecated() uint16 { + return 0 +} + +func (*AggTradesResponseAggTrades) TimeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*AggTradesResponseAggTrades) TimeMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*AggTradesResponseAggTrades) TimeMaxValue() int64 { + return math.MaxInt64 +} + +func (*AggTradesResponseAggTrades) TimeNullValue() int64 { + return math.MinInt64 +} + +func (*AggTradesResponseAggTrades) IsBuyerMakerId() uint16 { + return 8 +} + +func (*AggTradesResponseAggTrades) IsBuyerMakerSinceVersion() uint16 { + return 0 +} + +func (a *AggTradesResponseAggTrades) IsBuyerMakerInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.IsBuyerMakerSinceVersion() +} + +func (*AggTradesResponseAggTrades) IsBuyerMakerDeprecated() uint16 { + return 0 +} + +func (*AggTradesResponseAggTrades) IsBuyerMakerMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*AggTradesResponseAggTrades) IsBestMatchId() uint16 { + return 9 +} + +func (*AggTradesResponseAggTrades) IsBestMatchSinceVersion() uint16 { + return 0 +} + +func (a *AggTradesResponseAggTrades) IsBestMatchInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.IsBestMatchSinceVersion() +} + +func (*AggTradesResponseAggTrades) IsBestMatchDeprecated() uint16 { + return 0 +} + +func (*AggTradesResponseAggTrades) IsBestMatchMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*AggTradesResponse) AggTradesId() uint16 { + return 100 +} + +func (*AggTradesResponse) AggTradesSinceVersion() uint16 { + return 0 +} + +func (a *AggTradesResponse) AggTradesInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.AggTradesSinceVersion() +} + +func (*AggTradesResponse) AggTradesDeprecated() uint16 { + return 0 +} + +func (*AggTradesResponseAggTrades) SbeBlockLength() (blockLength uint) { + return 50 +} + +func (*AggTradesResponseAggTrades) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} diff --git a/v2/sbe/spot_3_1/AllocationType.go b/v2/sbe/spot_3_1/AllocationType.go new file mode 100644 index 00000000..78a59434 --- /dev/null +++ b/v2/sbe/spot_3_1/AllocationType.go @@ -0,0 +1,86 @@ +// Generated SBE (Simple Binary Encoding) message codec + +package sbe + +import ( + "fmt" + "io" + "reflect" +) + +type AllocationTypeEnum uint8 +type AllocationTypeValues struct { + Unknown AllocationTypeEnum + Sor AllocationTypeEnum + NonRepresentable AllocationTypeEnum + NullValue AllocationTypeEnum +} + +var AllocationType = AllocationTypeValues{0, 2, 254, 255} + +func (a AllocationTypeEnum) Encode(_m *SbeGoMarshaller, _w io.Writer) error { + if err := _m.WriteUint8(_w, uint8(a)); err != nil { + return err + } + return nil +} + +func (a *AllocationTypeEnum) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16) error { + if err := _m.ReadUint8(_r, (*uint8)(a)); err != nil { + return err + } + return nil +} + +func (a AllocationTypeEnum) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if actingVersion > schemaVersion { + return nil + } + value := reflect.ValueOf(AllocationType) + for idx := 0; idx < value.NumField(); idx++ { + if a == value.Field(idx).Interface() { + return nil + } + } + return fmt.Errorf("Range check failed on AllocationType, unknown enumeration value %d", a) +} + +func (*AllocationTypeEnum) EncodedLength() int64 { + return 1 +} + +func (*AllocationTypeEnum) UnknownSinceVersion() uint16 { + return 0 +} + +func (a *AllocationTypeEnum) UnknownInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.UnknownSinceVersion() +} + +func (*AllocationTypeEnum) UnknownDeprecated() uint16 { + return 0 +} + +func (*AllocationTypeEnum) SorSinceVersion() uint16 { + return 0 +} + +func (a *AllocationTypeEnum) SorInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.SorSinceVersion() +} + +func (*AllocationTypeEnum) SorDeprecated() uint16 { + return 0 +} + +func (*AllocationTypeEnum) NonRepresentableSinceVersion() uint16 { + return 0 +} + +func (a *AllocationTypeEnum) NonRepresentableInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.NonRepresentableSinceVersion() +} + +func (*AllocationTypeEnum) NonRepresentableDeprecated() uint16 { + return 0 +} diff --git a/v2/sbe/spot_3_1/AllowedSelfTradePreventionModes.go b/v2/sbe/spot_3_1/AllowedSelfTradePreventionModes.go new file mode 100644 index 00000000..416d873d --- /dev/null +++ b/v2/sbe/spot_3_1/AllowedSelfTradePreventionModes.go @@ -0,0 +1,120 @@ +// Generated SBE (Simple Binary Encoding) message codec + +package sbe + +import ( + "io" +) + +type AllowedSelfTradePreventionModes [8]bool +type AllowedSelfTradePreventionModesChoiceValue uint8 +type AllowedSelfTradePreventionModesChoiceValues struct { + None AllowedSelfTradePreventionModesChoiceValue + ExpireTaker AllowedSelfTradePreventionModesChoiceValue + ExpireMaker AllowedSelfTradePreventionModesChoiceValue + ExpireBoth AllowedSelfTradePreventionModesChoiceValue + Decrement AllowedSelfTradePreventionModesChoiceValue + NonRepresentable AllowedSelfTradePreventionModesChoiceValue +} + +var AllowedSelfTradePreventionModesChoice = AllowedSelfTradePreventionModesChoiceValues{0, 1, 2, 3, 4, 7} + +func (a *AllowedSelfTradePreventionModes) Encode(_m *SbeGoMarshaller, _w io.Writer) error { + var wireval uint8 = 0 + for k, v := range a { + if v { + wireval |= (1 << uint(k)) + } + } + return _m.WriteUint8(_w, wireval) +} + +func (a *AllowedSelfTradePreventionModes) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16) error { + var wireval uint8 + + if err := _m.ReadUint8(_r, &wireval); err != nil { + return err + } + + var idx uint + for idx = 0; idx < 8; idx++ { + a[idx] = (wireval & (1 << idx)) > 0 + } + return nil +} + +func (AllowedSelfTradePreventionModes) EncodedLength() int64 { + return 1 +} + +func (*AllowedSelfTradePreventionModes) NoneSinceVersion() uint16 { + return 0 +} + +func (a *AllowedSelfTradePreventionModes) NoneInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.NoneSinceVersion() +} + +func (*AllowedSelfTradePreventionModes) NoneDeprecated() uint16 { + return 0 +} + +func (*AllowedSelfTradePreventionModes) ExpireTakerSinceVersion() uint16 { + return 0 +} + +func (a *AllowedSelfTradePreventionModes) ExpireTakerInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.ExpireTakerSinceVersion() +} + +func (*AllowedSelfTradePreventionModes) ExpireTakerDeprecated() uint16 { + return 0 +} + +func (*AllowedSelfTradePreventionModes) ExpireMakerSinceVersion() uint16 { + return 0 +} + +func (a *AllowedSelfTradePreventionModes) ExpireMakerInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.ExpireMakerSinceVersion() +} + +func (*AllowedSelfTradePreventionModes) ExpireMakerDeprecated() uint16 { + return 0 +} + +func (*AllowedSelfTradePreventionModes) ExpireBothSinceVersion() uint16 { + return 0 +} + +func (a *AllowedSelfTradePreventionModes) ExpireBothInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.ExpireBothSinceVersion() +} + +func (*AllowedSelfTradePreventionModes) ExpireBothDeprecated() uint16 { + return 0 +} + +func (*AllowedSelfTradePreventionModes) DecrementSinceVersion() uint16 { + return 0 +} + +func (a *AllowedSelfTradePreventionModes) DecrementInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.DecrementSinceVersion() +} + +func (*AllowedSelfTradePreventionModes) DecrementDeprecated() uint16 { + return 0 +} + +func (*AllowedSelfTradePreventionModes) NonRepresentableSinceVersion() uint16 { + return 0 +} + +func (a *AllowedSelfTradePreventionModes) NonRepresentableInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.NonRepresentableSinceVersion() +} + +func (*AllowedSelfTradePreventionModes) NonRepresentableDeprecated() uint16 { + return 0 +} diff --git a/v2/sbe/spot_3_1/AveragePriceResponse.go b/v2/sbe/spot_3_1/AveragePriceResponse.go new file mode 100644 index 00000000..5bca2060 --- /dev/null +++ b/v2/sbe/spot_3_1/AveragePriceResponse.go @@ -0,0 +1,300 @@ +// Generated SBE (Simple Binary Encoding) message codec + +package sbe + +import ( + "fmt" + "io" + "io/ioutil" + "math" +) + +type AveragePriceResponse struct { + Mins int64 + PriceExponent int8 + Price int64 + CloseTime int64 +} + +func (a *AveragePriceResponse) Encode(_m *SbeGoMarshaller, _w io.Writer, doRangeCheck bool) error { + if doRangeCheck { + if err := a.RangeCheck(a.SbeSchemaVersion(), a.SbeSchemaVersion()); err != nil { + return err + } + } + if err := _m.WriteInt64(_w, a.Mins); err != nil { + return err + } + if err := _m.WriteInt8(_w, a.PriceExponent); err != nil { + return err + } + if err := _m.WriteInt64(_w, a.Price); err != nil { + return err + } + if err := _m.WriteInt64(_w, a.CloseTime); err != nil { + return err + } + return nil +} + +func (a *AveragePriceResponse) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint16, doRangeCheck bool) error { + if !a.MinsInActingVersion(actingVersion) { + a.Mins = a.MinsNullValue() + } else { + if err := _m.ReadInt64(_r, &a.Mins); err != nil { + return err + } + } + if !a.PriceExponentInActingVersion(actingVersion) { + a.PriceExponent = a.PriceExponentNullValue() + } else { + if err := _m.ReadInt8(_r, &a.PriceExponent); err != nil { + return err + } + } + if !a.PriceInActingVersion(actingVersion) { + a.Price = a.PriceNullValue() + } else { + if err := _m.ReadInt64(_r, &a.Price); err != nil { + return err + } + } + if !a.CloseTimeInActingVersion(actingVersion) { + a.CloseTime = a.CloseTimeNullValue() + } else { + if err := _m.ReadInt64(_r, &a.CloseTime); err != nil { + return err + } + } + if actingVersion > a.SbeSchemaVersion() && blockLength > a.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-a.SbeBlockLength())) + } + if doRangeCheck { + if err := a.RangeCheck(actingVersion, a.SbeSchemaVersion()); err != nil { + return err + } + } + return nil +} + +func (a *AveragePriceResponse) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if a.MinsInActingVersion(actingVersion) { + if a.Mins < a.MinsMinValue() || a.Mins > a.MinsMaxValue() { + return fmt.Errorf("Range check failed on a.Mins (%v < %v > %v)", a.MinsMinValue(), a.Mins, a.MinsMaxValue()) + } + } + if a.PriceExponentInActingVersion(actingVersion) { + if a.PriceExponent < a.PriceExponentMinValue() || a.PriceExponent > a.PriceExponentMaxValue() { + return fmt.Errorf("Range check failed on a.PriceExponent (%v < %v > %v)", a.PriceExponentMinValue(), a.PriceExponent, a.PriceExponentMaxValue()) + } + } + if a.PriceInActingVersion(actingVersion) { + if a.Price != a.PriceNullValue() && (a.Price < a.PriceMinValue() || a.Price > a.PriceMaxValue()) { + return fmt.Errorf("Range check failed on a.Price (%v < %v > %v)", a.PriceMinValue(), a.Price, a.PriceMaxValue()) + } + } + if a.CloseTimeInActingVersion(actingVersion) { + if a.CloseTime != a.CloseTimeNullValue() && (a.CloseTime < a.CloseTimeMinValue() || a.CloseTime > a.CloseTimeMaxValue()) { + return fmt.Errorf("Range check failed on a.CloseTime (%v < %v > %v)", a.CloseTimeMinValue(), a.CloseTime, a.CloseTimeMaxValue()) + } + } + return nil +} + +func AveragePriceResponseInit(a *AveragePriceResponse) { + a.Price = math.MinInt64 + a.CloseTime = math.MinInt64 + return +} + +func (*AveragePriceResponse) SbeBlockLength() (blockLength uint16) { + return 25 +} + +func (*AveragePriceResponse) SbeTemplateId() (templateId uint16) { + return 204 +} + +func (*AveragePriceResponse) SbeSchemaId() (schemaId uint16) { + return 3 +} + +func (*AveragePriceResponse) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} + +func (*AveragePriceResponse) SbeSemanticType() (semanticType []byte) { + return []byte("") +} + +func (*AveragePriceResponse) SbeSemanticVersion() (semanticVersion string) { + return "5.2" +} + +func (*AveragePriceResponse) MinsId() uint16 { + return 1 +} + +func (*AveragePriceResponse) MinsSinceVersion() uint16 { + return 0 +} + +func (a *AveragePriceResponse) MinsInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.MinsSinceVersion() +} + +func (*AveragePriceResponse) MinsDeprecated() uint16 { + return 0 +} + +func (*AveragePriceResponse) MinsMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*AveragePriceResponse) MinsMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*AveragePriceResponse) MinsMaxValue() int64 { + return math.MaxInt64 +} + +func (*AveragePriceResponse) MinsNullValue() int64 { + return math.MinInt64 +} + +func (*AveragePriceResponse) PriceExponentId() uint16 { + return 2 +} + +func (*AveragePriceResponse) PriceExponentSinceVersion() uint16 { + return 0 +} + +func (a *AveragePriceResponse) PriceExponentInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.PriceExponentSinceVersion() +} + +func (*AveragePriceResponse) PriceExponentDeprecated() uint16 { + return 0 +} + +func (*AveragePriceResponse) PriceExponentMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*AveragePriceResponse) PriceExponentMinValue() int8 { + return math.MinInt8 + 1 +} + +func (*AveragePriceResponse) PriceExponentMaxValue() int8 { + return math.MaxInt8 +} + +func (*AveragePriceResponse) PriceExponentNullValue() int8 { + return math.MinInt8 +} + +func (*AveragePriceResponse) PriceId() uint16 { + return 3 +} + +func (*AveragePriceResponse) PriceSinceVersion() uint16 { + return 0 +} + +func (a *AveragePriceResponse) PriceInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.PriceSinceVersion() +} + +func (*AveragePriceResponse) PriceDeprecated() uint16 { + return 0 +} + +func (*AveragePriceResponse) PriceMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*AveragePriceResponse) PriceMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*AveragePriceResponse) PriceMaxValue() int64 { + return math.MaxInt64 +} + +func (*AveragePriceResponse) PriceNullValue() int64 { + return math.MinInt64 +} + +func (*AveragePriceResponse) CloseTimeId() uint16 { + return 4 +} + +func (*AveragePriceResponse) CloseTimeSinceVersion() uint16 { + return 0 +} + +func (a *AveragePriceResponse) CloseTimeInActingVersion(actingVersion uint16) bool { + return actingVersion >= a.CloseTimeSinceVersion() +} + +func (*AveragePriceResponse) CloseTimeDeprecated() uint16 { + return 0 +} + +func (*AveragePriceResponse) CloseTimeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*AveragePriceResponse) CloseTimeMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*AveragePriceResponse) CloseTimeMaxValue() int64 { + return math.MaxInt64 +} + +func (*AveragePriceResponse) CloseTimeNullValue() int64 { + return math.MinInt64 +} diff --git a/v2/sbe/spot_3_1/BalanceUpdateEvent.go b/v2/sbe/spot_3_1/BalanceUpdateEvent.go new file mode 100644 index 00000000..8d2ad05e --- /dev/null +++ b/v2/sbe/spot_3_1/BalanceUpdateEvent.go @@ -0,0 +1,418 @@ +// Generated SBE (Simple Binary Encoding) message codec + +package sbe + +import ( + "errors" + "fmt" + "io" + "io/ioutil" + "math" + "unicode/utf8" +) + +type BalanceUpdateEvent struct { + EventTime int64 + ClearTime int64 + QtyExponent int8 + FreeQtyDelta int64 + SubscriptionId uint16 + Asset []uint8 +} + +func (b *BalanceUpdateEvent) Encode(_m *SbeGoMarshaller, _w io.Writer, doRangeCheck bool) error { + if doRangeCheck { + if err := b.RangeCheck(b.SbeSchemaVersion(), b.SbeSchemaVersion()); err != nil { + return err + } + } + if err := _m.WriteInt64(_w, b.EventTime); err != nil { + return err + } + if err := _m.WriteInt64(_w, b.ClearTime); err != nil { + return err + } + if err := _m.WriteInt8(_w, b.QtyExponent); err != nil { + return err + } + if err := _m.WriteInt64(_w, b.FreeQtyDelta); err != nil { + return err + } + if err := _m.WriteUint16(_w, b.SubscriptionId); err != nil { + return err + } + if err := _m.WriteUint8(_w, uint8(len(b.Asset))); err != nil { + return err + } + if err := _m.WriteBytes(_w, b.Asset); err != nil { + return err + } + return nil +} + +func (b *BalanceUpdateEvent) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint16, doRangeCheck bool) error { + if !b.EventTimeInActingVersion(actingVersion) { + b.EventTime = b.EventTimeNullValue() + } else { + if err := _m.ReadInt64(_r, &b.EventTime); err != nil { + return err + } + } + if !b.ClearTimeInActingVersion(actingVersion) { + b.ClearTime = b.ClearTimeNullValue() + } else { + if err := _m.ReadInt64(_r, &b.ClearTime); err != nil { + return err + } + } + if !b.QtyExponentInActingVersion(actingVersion) { + b.QtyExponent = b.QtyExponentNullValue() + } else { + if err := _m.ReadInt8(_r, &b.QtyExponent); err != nil { + return err + } + } + if !b.FreeQtyDeltaInActingVersion(actingVersion) { + b.FreeQtyDelta = b.FreeQtyDeltaNullValue() + } else { + if err := _m.ReadInt64(_r, &b.FreeQtyDelta); err != nil { + return err + } + } + if !b.SubscriptionIdInActingVersion(actingVersion) { + b.SubscriptionId = b.SubscriptionIdNullValue() + } else { + if err := _m.ReadUint16(_r, &b.SubscriptionId); err != nil { + return err + } + } + if actingVersion > b.SbeSchemaVersion() && blockLength > b.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-b.SbeBlockLength())) + } + + if b.AssetInActingVersion(actingVersion) { + var AssetLength uint8 + if err := _m.ReadUint8(_r, &AssetLength); err != nil { + return err + } + if cap(b.Asset) < int(AssetLength) { + b.Asset = make([]uint8, AssetLength) + } + b.Asset = b.Asset[:AssetLength] + if err := _m.ReadBytes(_r, b.Asset); err != nil { + return err + } + } + if doRangeCheck { + if err := b.RangeCheck(actingVersion, b.SbeSchemaVersion()); err != nil { + return err + } + } + return nil +} + +func (b *BalanceUpdateEvent) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if b.EventTimeInActingVersion(actingVersion) { + if b.EventTime < b.EventTimeMinValue() || b.EventTime > b.EventTimeMaxValue() { + return fmt.Errorf("Range check failed on b.EventTime (%v < %v > %v)", b.EventTimeMinValue(), b.EventTime, b.EventTimeMaxValue()) + } + } + if b.ClearTimeInActingVersion(actingVersion) { + if b.ClearTime != b.ClearTimeNullValue() && (b.ClearTime < b.ClearTimeMinValue() || b.ClearTime > b.ClearTimeMaxValue()) { + return fmt.Errorf("Range check failed on b.ClearTime (%v < %v > %v)", b.ClearTimeMinValue(), b.ClearTime, b.ClearTimeMaxValue()) + } + } + if b.QtyExponentInActingVersion(actingVersion) { + if b.QtyExponent < b.QtyExponentMinValue() || b.QtyExponent > b.QtyExponentMaxValue() { + return fmt.Errorf("Range check failed on b.QtyExponent (%v < %v > %v)", b.QtyExponentMinValue(), b.QtyExponent, b.QtyExponentMaxValue()) + } + } + if b.FreeQtyDeltaInActingVersion(actingVersion) { + if b.FreeQtyDelta < b.FreeQtyDeltaMinValue() || b.FreeQtyDelta > b.FreeQtyDeltaMaxValue() { + return fmt.Errorf("Range check failed on b.FreeQtyDelta (%v < %v > %v)", b.FreeQtyDeltaMinValue(), b.FreeQtyDelta, b.FreeQtyDeltaMaxValue()) + } + } + if b.SubscriptionIdInActingVersion(actingVersion) { + if b.SubscriptionId != b.SubscriptionIdNullValue() && (b.SubscriptionId < b.SubscriptionIdMinValue() || b.SubscriptionId > b.SubscriptionIdMaxValue()) { + return fmt.Errorf("Range check failed on b.SubscriptionId (%v < %v > %v)", b.SubscriptionIdMinValue(), b.SubscriptionId, b.SubscriptionIdMaxValue()) + } + } + if !utf8.Valid(b.Asset[:]) { + return errors.New("b.Asset failed UTF-8 validation") + } + return nil +} + +func BalanceUpdateEventInit(b *BalanceUpdateEvent) { + b.ClearTime = math.MinInt64 + b.SubscriptionId = math.MaxUint16 + return +} + +func (*BalanceUpdateEvent) SbeBlockLength() (blockLength uint16) { + return 27 +} + +func (*BalanceUpdateEvent) SbeTemplateId() (templateId uint16) { + return 601 +} + +func (*BalanceUpdateEvent) SbeSchemaId() (schemaId uint16) { + return 3 +} + +func (*BalanceUpdateEvent) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} + +func (*BalanceUpdateEvent) SbeSemanticType() (semanticType []byte) { + return []byte("") +} + +func (*BalanceUpdateEvent) SbeSemanticVersion() (semanticVersion string) { + return "5.2" +} + +func (*BalanceUpdateEvent) EventTimeId() uint16 { + return 1 +} + +func (*BalanceUpdateEvent) EventTimeSinceVersion() uint16 { + return 0 +} + +func (b *BalanceUpdateEvent) EventTimeInActingVersion(actingVersion uint16) bool { + return actingVersion >= b.EventTimeSinceVersion() +} + +func (*BalanceUpdateEvent) EventTimeDeprecated() uint16 { + return 0 +} + +func (*BalanceUpdateEvent) EventTimeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*BalanceUpdateEvent) EventTimeMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*BalanceUpdateEvent) EventTimeMaxValue() int64 { + return math.MaxInt64 +} + +func (*BalanceUpdateEvent) EventTimeNullValue() int64 { + return math.MinInt64 +} + +func (*BalanceUpdateEvent) ClearTimeId() uint16 { + return 2 +} + +func (*BalanceUpdateEvent) ClearTimeSinceVersion() uint16 { + return 0 +} + +func (b *BalanceUpdateEvent) ClearTimeInActingVersion(actingVersion uint16) bool { + return actingVersion >= b.ClearTimeSinceVersion() +} + +func (*BalanceUpdateEvent) ClearTimeDeprecated() uint16 { + return 0 +} + +func (*BalanceUpdateEvent) ClearTimeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*BalanceUpdateEvent) ClearTimeMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*BalanceUpdateEvent) ClearTimeMaxValue() int64 { + return math.MaxInt64 +} + +func (*BalanceUpdateEvent) ClearTimeNullValue() int64 { + return math.MinInt64 +} + +func (*BalanceUpdateEvent) QtyExponentId() uint16 { + return 3 +} + +func (*BalanceUpdateEvent) QtyExponentSinceVersion() uint16 { + return 0 +} + +func (b *BalanceUpdateEvent) QtyExponentInActingVersion(actingVersion uint16) bool { + return actingVersion >= b.QtyExponentSinceVersion() +} + +func (*BalanceUpdateEvent) QtyExponentDeprecated() uint16 { + return 0 +} + +func (*BalanceUpdateEvent) QtyExponentMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*BalanceUpdateEvent) QtyExponentMinValue() int8 { + return math.MinInt8 + 1 +} + +func (*BalanceUpdateEvent) QtyExponentMaxValue() int8 { + return math.MaxInt8 +} + +func (*BalanceUpdateEvent) QtyExponentNullValue() int8 { + return math.MinInt8 +} + +func (*BalanceUpdateEvent) FreeQtyDeltaId() uint16 { + return 4 +} + +func (*BalanceUpdateEvent) FreeQtyDeltaSinceVersion() uint16 { + return 0 +} + +func (b *BalanceUpdateEvent) FreeQtyDeltaInActingVersion(actingVersion uint16) bool { + return actingVersion >= b.FreeQtyDeltaSinceVersion() +} + +func (*BalanceUpdateEvent) FreeQtyDeltaDeprecated() uint16 { + return 0 +} + +func (*BalanceUpdateEvent) FreeQtyDeltaMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*BalanceUpdateEvent) FreeQtyDeltaMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*BalanceUpdateEvent) FreeQtyDeltaMaxValue() int64 { + return math.MaxInt64 +} + +func (*BalanceUpdateEvent) FreeQtyDeltaNullValue() int64 { + return math.MinInt64 +} + +func (*BalanceUpdateEvent) SubscriptionIdId() uint16 { + return 5 +} + +func (*BalanceUpdateEvent) SubscriptionIdSinceVersion() uint16 { + return 1 +} + +func (b *BalanceUpdateEvent) SubscriptionIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= b.SubscriptionIdSinceVersion() +} + +func (*BalanceUpdateEvent) SubscriptionIdDeprecated() uint16 { + return 0 +} + +func (*BalanceUpdateEvent) SubscriptionIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*BalanceUpdateEvent) SubscriptionIdMinValue() uint16 { + return 0 +} + +func (*BalanceUpdateEvent) SubscriptionIdMaxValue() uint16 { + return math.MaxUint16 - 1 +} + +func (*BalanceUpdateEvent) SubscriptionIdNullValue() uint16 { + return math.MaxUint16 +} + +func (*BalanceUpdateEvent) AssetMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*BalanceUpdateEvent) AssetSinceVersion() uint16 { + return 0 +} + +func (b *BalanceUpdateEvent) AssetInActingVersion(actingVersion uint16) bool { + return actingVersion >= b.AssetSinceVersion() +} + +func (*BalanceUpdateEvent) AssetDeprecated() uint16 { + return 0 +} + +func (BalanceUpdateEvent) AssetCharacterEncoding() string { + return "UTF-8" +} + +func (BalanceUpdateEvent) AssetHeaderLength() uint64 { + return 1 +} diff --git a/v2/sbe/spot_3_1/BookTickerResponse.go b/v2/sbe/spot_3_1/BookTickerResponse.go new file mode 100644 index 00000000..9f7f938c --- /dev/null +++ b/v2/sbe/spot_3_1/BookTickerResponse.go @@ -0,0 +1,560 @@ +// Generated SBE (Simple Binary Encoding) message codec + +package sbe + +import ( + "errors" + "fmt" + "io" + "io/ioutil" + "math" + "unicode/utf8" +) + +type BookTickerResponse struct { + Tickers []BookTickerResponseTickers +} +type BookTickerResponseTickers struct { + PriceExponent int8 + QtyExponent int8 + BidPrice int64 + BidQty int64 + AskPrice int64 + AskQty int64 + Symbol []uint8 +} + +func (b *BookTickerResponse) Encode(_m *SbeGoMarshaller, _w io.Writer, doRangeCheck bool) error { + if doRangeCheck { + if err := b.RangeCheck(b.SbeSchemaVersion(), b.SbeSchemaVersion()); err != nil { + return err + } + } + var TickersBlockLength uint16 = 34 + if err := _m.WriteUint16(_w, TickersBlockLength); err != nil { + return err + } + var TickersNumInGroup uint32 = uint32(len(b.Tickers)) + if err := _m.WriteUint32(_w, TickersNumInGroup); err != nil { + return err + } + for i := range b.Tickers { + if err := b.Tickers[i].Encode(_m, _w); err != nil { + return err + } + } + return nil +} + +func (b *BookTickerResponse) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint16, doRangeCheck bool) error { + if actingVersion > b.SbeSchemaVersion() && blockLength > b.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-b.SbeBlockLength())) + } + + if b.TickersInActingVersion(actingVersion) { + var TickersBlockLength uint16 + if err := _m.ReadUint16(_r, &TickersBlockLength); err != nil { + return err + } + var TickersNumInGroup uint32 + if err := _m.ReadUint32(_r, &TickersNumInGroup); err != nil { + return err + } + if cap(b.Tickers) < int(TickersNumInGroup) { + b.Tickers = make([]BookTickerResponseTickers, TickersNumInGroup) + } + b.Tickers = b.Tickers[:TickersNumInGroup] + for i := range b.Tickers { + if err := b.Tickers[i].Decode(_m, _r, actingVersion, uint(TickersBlockLength)); err != nil { + return err + } + } + } + if doRangeCheck { + if err := b.RangeCheck(actingVersion, b.SbeSchemaVersion()); err != nil { + return err + } + } + return nil +} + +func (b *BookTickerResponse) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + for i := range b.Tickers { + if err := b.Tickers[i].RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + } + return nil +} + +func BookTickerResponseInit(b *BookTickerResponse) { + return +} + +func (b *BookTickerResponseTickers) Encode(_m *SbeGoMarshaller, _w io.Writer) error { + if err := _m.WriteInt8(_w, b.PriceExponent); err != nil { + return err + } + if err := _m.WriteInt8(_w, b.QtyExponent); err != nil { + return err + } + if err := _m.WriteInt64(_w, b.BidPrice); err != nil { + return err + } + if err := _m.WriteInt64(_w, b.BidQty); err != nil { + return err + } + if err := _m.WriteInt64(_w, b.AskPrice); err != nil { + return err + } + if err := _m.WriteInt64(_w, b.AskQty); err != nil { + return err + } + if err := _m.WriteUint8(_w, uint8(len(b.Symbol))); err != nil { + return err + } + if err := _m.WriteBytes(_w, b.Symbol); err != nil { + return err + } + return nil +} + +func (b *BookTickerResponseTickers) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint) error { + if !b.PriceExponentInActingVersion(actingVersion) { + b.PriceExponent = b.PriceExponentNullValue() + } else { + if err := _m.ReadInt8(_r, &b.PriceExponent); err != nil { + return err + } + } + if !b.QtyExponentInActingVersion(actingVersion) { + b.QtyExponent = b.QtyExponentNullValue() + } else { + if err := _m.ReadInt8(_r, &b.QtyExponent); err != nil { + return err + } + } + if !b.BidPriceInActingVersion(actingVersion) { + b.BidPrice = b.BidPriceNullValue() + } else { + if err := _m.ReadInt64(_r, &b.BidPrice); err != nil { + return err + } + } + if !b.BidQtyInActingVersion(actingVersion) { + b.BidQty = b.BidQtyNullValue() + } else { + if err := _m.ReadInt64(_r, &b.BidQty); err != nil { + return err + } + } + if !b.AskPriceInActingVersion(actingVersion) { + b.AskPrice = b.AskPriceNullValue() + } else { + if err := _m.ReadInt64(_r, &b.AskPrice); err != nil { + return err + } + } + if !b.AskQtyInActingVersion(actingVersion) { + b.AskQty = b.AskQtyNullValue() + } else { + if err := _m.ReadInt64(_r, &b.AskQty); err != nil { + return err + } + } + if actingVersion > b.SbeSchemaVersion() && blockLength > b.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-b.SbeBlockLength())) + } + + if b.SymbolInActingVersion(actingVersion) { + var SymbolLength uint8 + if err := _m.ReadUint8(_r, &SymbolLength); err != nil { + return err + } + if cap(b.Symbol) < int(SymbolLength) { + b.Symbol = make([]uint8, SymbolLength) + } + b.Symbol = b.Symbol[:SymbolLength] + if err := _m.ReadBytes(_r, b.Symbol); err != nil { + return err + } + } + return nil +} + +func (b *BookTickerResponseTickers) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if b.PriceExponentInActingVersion(actingVersion) { + if b.PriceExponent < b.PriceExponentMinValue() || b.PriceExponent > b.PriceExponentMaxValue() { + return fmt.Errorf("Range check failed on b.PriceExponent (%v < %v > %v)", b.PriceExponentMinValue(), b.PriceExponent, b.PriceExponentMaxValue()) + } + } + if b.QtyExponentInActingVersion(actingVersion) { + if b.QtyExponent < b.QtyExponentMinValue() || b.QtyExponent > b.QtyExponentMaxValue() { + return fmt.Errorf("Range check failed on b.QtyExponent (%v < %v > %v)", b.QtyExponentMinValue(), b.QtyExponent, b.QtyExponentMaxValue()) + } + } + if b.BidPriceInActingVersion(actingVersion) { + if b.BidPrice != b.BidPriceNullValue() && (b.BidPrice < b.BidPriceMinValue() || b.BidPrice > b.BidPriceMaxValue()) { + return fmt.Errorf("Range check failed on b.BidPrice (%v < %v > %v)", b.BidPriceMinValue(), b.BidPrice, b.BidPriceMaxValue()) + } + } + if b.BidQtyInActingVersion(actingVersion) { + if b.BidQty < b.BidQtyMinValue() || b.BidQty > b.BidQtyMaxValue() { + return fmt.Errorf("Range check failed on b.BidQty (%v < %v > %v)", b.BidQtyMinValue(), b.BidQty, b.BidQtyMaxValue()) + } + } + if b.AskPriceInActingVersion(actingVersion) { + if b.AskPrice != b.AskPriceNullValue() && (b.AskPrice < b.AskPriceMinValue() || b.AskPrice > b.AskPriceMaxValue()) { + return fmt.Errorf("Range check failed on b.AskPrice (%v < %v > %v)", b.AskPriceMinValue(), b.AskPrice, b.AskPriceMaxValue()) + } + } + if b.AskQtyInActingVersion(actingVersion) { + if b.AskQty < b.AskQtyMinValue() || b.AskQty > b.AskQtyMaxValue() { + return fmt.Errorf("Range check failed on b.AskQty (%v < %v > %v)", b.AskQtyMinValue(), b.AskQty, b.AskQtyMaxValue()) + } + } + if !utf8.Valid(b.Symbol[:]) { + return errors.New("b.Symbol failed UTF-8 validation") + } + return nil +} + +func BookTickerResponseTickersInit(b *BookTickerResponseTickers) { + b.BidPrice = math.MinInt64 + b.AskPrice = math.MinInt64 + return +} + +func (*BookTickerResponse) SbeBlockLength() (blockLength uint16) { + return 0 +} + +func (*BookTickerResponse) SbeTemplateId() (templateId uint16) { + return 212 +} + +func (*BookTickerResponse) SbeSchemaId() (schemaId uint16) { + return 3 +} + +func (*BookTickerResponse) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} + +func (*BookTickerResponse) SbeSemanticType() (semanticType []byte) { + return []byte("") +} + +func (*BookTickerResponse) SbeSemanticVersion() (semanticVersion string) { + return "5.2" +} + +func (*BookTickerResponseTickers) PriceExponentId() uint16 { + return 1 +} + +func (*BookTickerResponseTickers) PriceExponentSinceVersion() uint16 { + return 0 +} + +func (b *BookTickerResponseTickers) PriceExponentInActingVersion(actingVersion uint16) bool { + return actingVersion >= b.PriceExponentSinceVersion() +} + +func (*BookTickerResponseTickers) PriceExponentDeprecated() uint16 { + return 0 +} + +func (*BookTickerResponseTickers) PriceExponentMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*BookTickerResponseTickers) PriceExponentMinValue() int8 { + return math.MinInt8 + 1 +} + +func (*BookTickerResponseTickers) PriceExponentMaxValue() int8 { + return math.MaxInt8 +} + +func (*BookTickerResponseTickers) PriceExponentNullValue() int8 { + return math.MinInt8 +} + +func (*BookTickerResponseTickers) QtyExponentId() uint16 { + return 2 +} + +func (*BookTickerResponseTickers) QtyExponentSinceVersion() uint16 { + return 0 +} + +func (b *BookTickerResponseTickers) QtyExponentInActingVersion(actingVersion uint16) bool { + return actingVersion >= b.QtyExponentSinceVersion() +} + +func (*BookTickerResponseTickers) QtyExponentDeprecated() uint16 { + return 0 +} + +func (*BookTickerResponseTickers) QtyExponentMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*BookTickerResponseTickers) QtyExponentMinValue() int8 { + return math.MinInt8 + 1 +} + +func (*BookTickerResponseTickers) QtyExponentMaxValue() int8 { + return math.MaxInt8 +} + +func (*BookTickerResponseTickers) QtyExponentNullValue() int8 { + return math.MinInt8 +} + +func (*BookTickerResponseTickers) BidPriceId() uint16 { + return 3 +} + +func (*BookTickerResponseTickers) BidPriceSinceVersion() uint16 { + return 0 +} + +func (b *BookTickerResponseTickers) BidPriceInActingVersion(actingVersion uint16) bool { + return actingVersion >= b.BidPriceSinceVersion() +} + +func (*BookTickerResponseTickers) BidPriceDeprecated() uint16 { + return 0 +} + +func (*BookTickerResponseTickers) BidPriceMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*BookTickerResponseTickers) BidPriceMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*BookTickerResponseTickers) BidPriceMaxValue() int64 { + return math.MaxInt64 +} + +func (*BookTickerResponseTickers) BidPriceNullValue() int64 { + return math.MinInt64 +} + +func (*BookTickerResponseTickers) BidQtyId() uint16 { + return 4 +} + +func (*BookTickerResponseTickers) BidQtySinceVersion() uint16 { + return 0 +} + +func (b *BookTickerResponseTickers) BidQtyInActingVersion(actingVersion uint16) bool { + return actingVersion >= b.BidQtySinceVersion() +} + +func (*BookTickerResponseTickers) BidQtyDeprecated() uint16 { + return 0 +} + +func (*BookTickerResponseTickers) BidQtyMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*BookTickerResponseTickers) BidQtyMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*BookTickerResponseTickers) BidQtyMaxValue() int64 { + return math.MaxInt64 +} + +func (*BookTickerResponseTickers) BidQtyNullValue() int64 { + return math.MinInt64 +} + +func (*BookTickerResponseTickers) AskPriceId() uint16 { + return 5 +} + +func (*BookTickerResponseTickers) AskPriceSinceVersion() uint16 { + return 0 +} + +func (b *BookTickerResponseTickers) AskPriceInActingVersion(actingVersion uint16) bool { + return actingVersion >= b.AskPriceSinceVersion() +} + +func (*BookTickerResponseTickers) AskPriceDeprecated() uint16 { + return 0 +} + +func (*BookTickerResponseTickers) AskPriceMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*BookTickerResponseTickers) AskPriceMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*BookTickerResponseTickers) AskPriceMaxValue() int64 { + return math.MaxInt64 +} + +func (*BookTickerResponseTickers) AskPriceNullValue() int64 { + return math.MinInt64 +} + +func (*BookTickerResponseTickers) AskQtyId() uint16 { + return 6 +} + +func (*BookTickerResponseTickers) AskQtySinceVersion() uint16 { + return 0 +} + +func (b *BookTickerResponseTickers) AskQtyInActingVersion(actingVersion uint16) bool { + return actingVersion >= b.AskQtySinceVersion() +} + +func (*BookTickerResponseTickers) AskQtyDeprecated() uint16 { + return 0 +} + +func (*BookTickerResponseTickers) AskQtyMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*BookTickerResponseTickers) AskQtyMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*BookTickerResponseTickers) AskQtyMaxValue() int64 { + return math.MaxInt64 +} + +func (*BookTickerResponseTickers) AskQtyNullValue() int64 { + return math.MinInt64 +} + +func (*BookTickerResponseTickers) SymbolMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*BookTickerResponseTickers) SymbolSinceVersion() uint16 { + return 0 +} + +func (b *BookTickerResponseTickers) SymbolInActingVersion(actingVersion uint16) bool { + return actingVersion >= b.SymbolSinceVersion() +} + +func (*BookTickerResponseTickers) SymbolDeprecated() uint16 { + return 0 +} + +func (BookTickerResponseTickers) SymbolCharacterEncoding() string { + return "UTF-8" +} + +func (BookTickerResponseTickers) SymbolHeaderLength() uint64 { + return 1 +} + +func (*BookTickerResponse) TickersId() uint16 { + return 100 +} + +func (*BookTickerResponse) TickersSinceVersion() uint16 { + return 0 +} + +func (b *BookTickerResponse) TickersInActingVersion(actingVersion uint16) bool { + return actingVersion >= b.TickersSinceVersion() +} + +func (*BookTickerResponse) TickersDeprecated() uint16 { + return 0 +} + +func (*BookTickerResponseTickers) SbeBlockLength() (blockLength uint) { + return 34 +} + +func (*BookTickerResponseTickers) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} diff --git a/v2/sbe/spot_3_1/BookTickerSymbolResponse.go b/v2/sbe/spot_3_1/BookTickerSymbolResponse.go new file mode 100644 index 00000000..1925cf95 --- /dev/null +++ b/v2/sbe/spot_3_1/BookTickerSymbolResponse.go @@ -0,0 +1,476 @@ +// Generated SBE (Simple Binary Encoding) message codec + +package sbe + +import ( + "errors" + "fmt" + "io" + "io/ioutil" + "math" + "unicode/utf8" +) + +type BookTickerSymbolResponse struct { + PriceExponent int8 + QtyExponent int8 + BidPrice int64 + BidQty int64 + AskPrice int64 + AskQty int64 + Symbol []uint8 +} + +func (b *BookTickerSymbolResponse) Encode(_m *SbeGoMarshaller, _w io.Writer, doRangeCheck bool) error { + if doRangeCheck { + if err := b.RangeCheck(b.SbeSchemaVersion(), b.SbeSchemaVersion()); err != nil { + return err + } + } + if err := _m.WriteInt8(_w, b.PriceExponent); err != nil { + return err + } + if err := _m.WriteInt8(_w, b.QtyExponent); err != nil { + return err + } + if err := _m.WriteInt64(_w, b.BidPrice); err != nil { + return err + } + if err := _m.WriteInt64(_w, b.BidQty); err != nil { + return err + } + if err := _m.WriteInt64(_w, b.AskPrice); err != nil { + return err + } + if err := _m.WriteInt64(_w, b.AskQty); err != nil { + return err + } + if err := _m.WriteUint8(_w, uint8(len(b.Symbol))); err != nil { + return err + } + if err := _m.WriteBytes(_w, b.Symbol); err != nil { + return err + } + return nil +} + +func (b *BookTickerSymbolResponse) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint16, doRangeCheck bool) error { + if !b.PriceExponentInActingVersion(actingVersion) { + b.PriceExponent = b.PriceExponentNullValue() + } else { + if err := _m.ReadInt8(_r, &b.PriceExponent); err != nil { + return err + } + } + if !b.QtyExponentInActingVersion(actingVersion) { + b.QtyExponent = b.QtyExponentNullValue() + } else { + if err := _m.ReadInt8(_r, &b.QtyExponent); err != nil { + return err + } + } + if !b.BidPriceInActingVersion(actingVersion) { + b.BidPrice = b.BidPriceNullValue() + } else { + if err := _m.ReadInt64(_r, &b.BidPrice); err != nil { + return err + } + } + if !b.BidQtyInActingVersion(actingVersion) { + b.BidQty = b.BidQtyNullValue() + } else { + if err := _m.ReadInt64(_r, &b.BidQty); err != nil { + return err + } + } + if !b.AskPriceInActingVersion(actingVersion) { + b.AskPrice = b.AskPriceNullValue() + } else { + if err := _m.ReadInt64(_r, &b.AskPrice); err != nil { + return err + } + } + if !b.AskQtyInActingVersion(actingVersion) { + b.AskQty = b.AskQtyNullValue() + } else { + if err := _m.ReadInt64(_r, &b.AskQty); err != nil { + return err + } + } + if actingVersion > b.SbeSchemaVersion() && blockLength > b.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-b.SbeBlockLength())) + } + + if b.SymbolInActingVersion(actingVersion) { + var SymbolLength uint8 + if err := _m.ReadUint8(_r, &SymbolLength); err != nil { + return err + } + if cap(b.Symbol) < int(SymbolLength) { + b.Symbol = make([]uint8, SymbolLength) + } + b.Symbol = b.Symbol[:SymbolLength] + if err := _m.ReadBytes(_r, b.Symbol); err != nil { + return err + } + } + if doRangeCheck { + if err := b.RangeCheck(actingVersion, b.SbeSchemaVersion()); err != nil { + return err + } + } + return nil +} + +func (b *BookTickerSymbolResponse) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if b.PriceExponentInActingVersion(actingVersion) { + if b.PriceExponent < b.PriceExponentMinValue() || b.PriceExponent > b.PriceExponentMaxValue() { + return fmt.Errorf("Range check failed on b.PriceExponent (%v < %v > %v)", b.PriceExponentMinValue(), b.PriceExponent, b.PriceExponentMaxValue()) + } + } + if b.QtyExponentInActingVersion(actingVersion) { + if b.QtyExponent < b.QtyExponentMinValue() || b.QtyExponent > b.QtyExponentMaxValue() { + return fmt.Errorf("Range check failed on b.QtyExponent (%v < %v > %v)", b.QtyExponentMinValue(), b.QtyExponent, b.QtyExponentMaxValue()) + } + } + if b.BidPriceInActingVersion(actingVersion) { + if b.BidPrice != b.BidPriceNullValue() && (b.BidPrice < b.BidPriceMinValue() || b.BidPrice > b.BidPriceMaxValue()) { + return fmt.Errorf("Range check failed on b.BidPrice (%v < %v > %v)", b.BidPriceMinValue(), b.BidPrice, b.BidPriceMaxValue()) + } + } + if b.BidQtyInActingVersion(actingVersion) { + if b.BidQty < b.BidQtyMinValue() || b.BidQty > b.BidQtyMaxValue() { + return fmt.Errorf("Range check failed on b.BidQty (%v < %v > %v)", b.BidQtyMinValue(), b.BidQty, b.BidQtyMaxValue()) + } + } + if b.AskPriceInActingVersion(actingVersion) { + if b.AskPrice != b.AskPriceNullValue() && (b.AskPrice < b.AskPriceMinValue() || b.AskPrice > b.AskPriceMaxValue()) { + return fmt.Errorf("Range check failed on b.AskPrice (%v < %v > %v)", b.AskPriceMinValue(), b.AskPrice, b.AskPriceMaxValue()) + } + } + if b.AskQtyInActingVersion(actingVersion) { + if b.AskQty < b.AskQtyMinValue() || b.AskQty > b.AskQtyMaxValue() { + return fmt.Errorf("Range check failed on b.AskQty (%v < %v > %v)", b.AskQtyMinValue(), b.AskQty, b.AskQtyMaxValue()) + } + } + if !utf8.Valid(b.Symbol[:]) { + return errors.New("b.Symbol failed UTF-8 validation") + } + return nil +} + +func BookTickerSymbolResponseInit(b *BookTickerSymbolResponse) { + b.BidPrice = math.MinInt64 + b.AskPrice = math.MinInt64 + return +} + +func (*BookTickerSymbolResponse) SbeBlockLength() (blockLength uint16) { + return 34 +} + +func (*BookTickerSymbolResponse) SbeTemplateId() (templateId uint16) { + return 211 +} + +func (*BookTickerSymbolResponse) SbeSchemaId() (schemaId uint16) { + return 3 +} + +func (*BookTickerSymbolResponse) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} + +func (*BookTickerSymbolResponse) SbeSemanticType() (semanticType []byte) { + return []byte("") +} + +func (*BookTickerSymbolResponse) SbeSemanticVersion() (semanticVersion string) { + return "5.2" +} + +func (*BookTickerSymbolResponse) PriceExponentId() uint16 { + return 1 +} + +func (*BookTickerSymbolResponse) PriceExponentSinceVersion() uint16 { + return 0 +} + +func (b *BookTickerSymbolResponse) PriceExponentInActingVersion(actingVersion uint16) bool { + return actingVersion >= b.PriceExponentSinceVersion() +} + +func (*BookTickerSymbolResponse) PriceExponentDeprecated() uint16 { + return 0 +} + +func (*BookTickerSymbolResponse) PriceExponentMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*BookTickerSymbolResponse) PriceExponentMinValue() int8 { + return math.MinInt8 + 1 +} + +func (*BookTickerSymbolResponse) PriceExponentMaxValue() int8 { + return math.MaxInt8 +} + +func (*BookTickerSymbolResponse) PriceExponentNullValue() int8 { + return math.MinInt8 +} + +func (*BookTickerSymbolResponse) QtyExponentId() uint16 { + return 2 +} + +func (*BookTickerSymbolResponse) QtyExponentSinceVersion() uint16 { + return 0 +} + +func (b *BookTickerSymbolResponse) QtyExponentInActingVersion(actingVersion uint16) bool { + return actingVersion >= b.QtyExponentSinceVersion() +} + +func (*BookTickerSymbolResponse) QtyExponentDeprecated() uint16 { + return 0 +} + +func (*BookTickerSymbolResponse) QtyExponentMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*BookTickerSymbolResponse) QtyExponentMinValue() int8 { + return math.MinInt8 + 1 +} + +func (*BookTickerSymbolResponse) QtyExponentMaxValue() int8 { + return math.MaxInt8 +} + +func (*BookTickerSymbolResponse) QtyExponentNullValue() int8 { + return math.MinInt8 +} + +func (*BookTickerSymbolResponse) BidPriceId() uint16 { + return 3 +} + +func (*BookTickerSymbolResponse) BidPriceSinceVersion() uint16 { + return 0 +} + +func (b *BookTickerSymbolResponse) BidPriceInActingVersion(actingVersion uint16) bool { + return actingVersion >= b.BidPriceSinceVersion() +} + +func (*BookTickerSymbolResponse) BidPriceDeprecated() uint16 { + return 0 +} + +func (*BookTickerSymbolResponse) BidPriceMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*BookTickerSymbolResponse) BidPriceMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*BookTickerSymbolResponse) BidPriceMaxValue() int64 { + return math.MaxInt64 +} + +func (*BookTickerSymbolResponse) BidPriceNullValue() int64 { + return math.MinInt64 +} + +func (*BookTickerSymbolResponse) BidQtyId() uint16 { + return 4 +} + +func (*BookTickerSymbolResponse) BidQtySinceVersion() uint16 { + return 0 +} + +func (b *BookTickerSymbolResponse) BidQtyInActingVersion(actingVersion uint16) bool { + return actingVersion >= b.BidQtySinceVersion() +} + +func (*BookTickerSymbolResponse) BidQtyDeprecated() uint16 { + return 0 +} + +func (*BookTickerSymbolResponse) BidQtyMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*BookTickerSymbolResponse) BidQtyMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*BookTickerSymbolResponse) BidQtyMaxValue() int64 { + return math.MaxInt64 +} + +func (*BookTickerSymbolResponse) BidQtyNullValue() int64 { + return math.MinInt64 +} + +func (*BookTickerSymbolResponse) AskPriceId() uint16 { + return 5 +} + +func (*BookTickerSymbolResponse) AskPriceSinceVersion() uint16 { + return 0 +} + +func (b *BookTickerSymbolResponse) AskPriceInActingVersion(actingVersion uint16) bool { + return actingVersion >= b.AskPriceSinceVersion() +} + +func (*BookTickerSymbolResponse) AskPriceDeprecated() uint16 { + return 0 +} + +func (*BookTickerSymbolResponse) AskPriceMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*BookTickerSymbolResponse) AskPriceMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*BookTickerSymbolResponse) AskPriceMaxValue() int64 { + return math.MaxInt64 +} + +func (*BookTickerSymbolResponse) AskPriceNullValue() int64 { + return math.MinInt64 +} + +func (*BookTickerSymbolResponse) AskQtyId() uint16 { + return 6 +} + +func (*BookTickerSymbolResponse) AskQtySinceVersion() uint16 { + return 0 +} + +func (b *BookTickerSymbolResponse) AskQtyInActingVersion(actingVersion uint16) bool { + return actingVersion >= b.AskQtySinceVersion() +} + +func (*BookTickerSymbolResponse) AskQtyDeprecated() uint16 { + return 0 +} + +func (*BookTickerSymbolResponse) AskQtyMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*BookTickerSymbolResponse) AskQtyMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*BookTickerSymbolResponse) AskQtyMaxValue() int64 { + return math.MaxInt64 +} + +func (*BookTickerSymbolResponse) AskQtyNullValue() int64 { + return math.MinInt64 +} + +func (*BookTickerSymbolResponse) SymbolMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*BookTickerSymbolResponse) SymbolSinceVersion() uint16 { + return 0 +} + +func (b *BookTickerSymbolResponse) SymbolInActingVersion(actingVersion uint16) bool { + return actingVersion >= b.SymbolSinceVersion() +} + +func (*BookTickerSymbolResponse) SymbolDeprecated() uint16 { + return 0 +} + +func (BookTickerSymbolResponse) SymbolCharacterEncoding() string { + return "UTF-8" +} + +func (BookTickerSymbolResponse) SymbolHeaderLength() uint64 { + return 1 +} diff --git a/v2/sbe/spot_3_1/BoolEnum.go b/v2/sbe/spot_3_1/BoolEnum.go new file mode 100644 index 00000000..36777699 --- /dev/null +++ b/v2/sbe/spot_3_1/BoolEnum.go @@ -0,0 +1,73 @@ +// Generated SBE (Simple Binary Encoding) message codec + +package sbe + +import ( + "fmt" + "io" + "reflect" +) + +type BoolEnumEnum uint8 +type BoolEnumValues struct { + False BoolEnumEnum + True BoolEnumEnum + NullValue BoolEnumEnum +} + +var BoolEnum = BoolEnumValues{0, 1, 255} + +func (b BoolEnumEnum) Encode(_m *SbeGoMarshaller, _w io.Writer) error { + if err := _m.WriteUint8(_w, uint8(b)); err != nil { + return err + } + return nil +} + +func (b *BoolEnumEnum) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16) error { + if err := _m.ReadUint8(_r, (*uint8)(b)); err != nil { + return err + } + return nil +} + +func (b BoolEnumEnum) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if actingVersion > schemaVersion { + return nil + } + value := reflect.ValueOf(BoolEnum) + for idx := 0; idx < value.NumField(); idx++ { + if b == value.Field(idx).Interface() { + return nil + } + } + return fmt.Errorf("Range check failed on BoolEnum, unknown enumeration value %d", b) +} + +func (*BoolEnumEnum) EncodedLength() int64 { + return 1 +} + +func (*BoolEnumEnum) FalseSinceVersion() uint16 { + return 0 +} + +func (b *BoolEnumEnum) FalseInActingVersion(actingVersion uint16) bool { + return actingVersion >= b.FalseSinceVersion() +} + +func (*BoolEnumEnum) FalseDeprecated() uint16 { + return 0 +} + +func (*BoolEnumEnum) TrueSinceVersion() uint16 { + return 0 +} + +func (b *BoolEnumEnum) TrueInActingVersion(actingVersion uint16) bool { + return actingVersion >= b.TrueSinceVersion() +} + +func (*BoolEnumEnum) TrueDeprecated() uint16 { + return 0 +} diff --git a/v2/sbe/spot_3_1/CancelOpenOrdersResponse.go b/v2/sbe/spot_3_1/CancelOpenOrdersResponse.go new file mode 100644 index 00000000..39433a24 --- /dev/null +++ b/v2/sbe/spot_3_1/CancelOpenOrdersResponse.go @@ -0,0 +1,203 @@ +// Generated SBE (Simple Binary Encoding) message codec + +package sbe + +import ( + "io" + "io/ioutil" +) + +type CancelOpenOrdersResponse struct { + Responses []CancelOpenOrdersResponseResponses +} +type CancelOpenOrdersResponseResponses struct { + Response []uint8 +} + +func (c *CancelOpenOrdersResponse) Encode(_m *SbeGoMarshaller, _w io.Writer, doRangeCheck bool) error { + if doRangeCheck { + if err := c.RangeCheck(c.SbeSchemaVersion(), c.SbeSchemaVersion()); err != nil { + return err + } + } + var ResponsesBlockLength uint16 = 0 + if err := _m.WriteUint16(_w, ResponsesBlockLength); err != nil { + return err + } + var ResponsesNumInGroup uint32 = uint32(len(c.Responses)) + if err := _m.WriteUint32(_w, ResponsesNumInGroup); err != nil { + return err + } + for i := range c.Responses { + if err := c.Responses[i].Encode(_m, _w); err != nil { + return err + } + } + return nil +} + +func (c *CancelOpenOrdersResponse) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint16, doRangeCheck bool) error { + if actingVersion > c.SbeSchemaVersion() && blockLength > c.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-c.SbeBlockLength())) + } + + if c.ResponsesInActingVersion(actingVersion) { + var ResponsesBlockLength uint16 + if err := _m.ReadUint16(_r, &ResponsesBlockLength); err != nil { + return err + } + var ResponsesNumInGroup uint32 + if err := _m.ReadUint32(_r, &ResponsesNumInGroup); err != nil { + return err + } + if cap(c.Responses) < int(ResponsesNumInGroup) { + c.Responses = make([]CancelOpenOrdersResponseResponses, ResponsesNumInGroup) + } + c.Responses = c.Responses[:ResponsesNumInGroup] + for i := range c.Responses { + if err := c.Responses[i].Decode(_m, _r, actingVersion, uint(ResponsesBlockLength)); err != nil { + return err + } + } + } + if doRangeCheck { + if err := c.RangeCheck(actingVersion, c.SbeSchemaVersion()); err != nil { + return err + } + } + return nil +} + +func (c *CancelOpenOrdersResponse) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + for i := range c.Responses { + if err := c.Responses[i].RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + } + return nil +} + +func CancelOpenOrdersResponseInit(c *CancelOpenOrdersResponse) { + return +} + +func (c *CancelOpenOrdersResponseResponses) Encode(_m *SbeGoMarshaller, _w io.Writer) error { + if err := _m.WriteUint16(_w, uint16(len(c.Response))); err != nil { + return err + } + if err := _m.WriteBytes(_w, c.Response); err != nil { + return err + } + return nil +} + +func (c *CancelOpenOrdersResponseResponses) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint) error { + if actingVersion > c.SbeSchemaVersion() && blockLength > c.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-c.SbeBlockLength())) + } + + if c.ResponseInActingVersion(actingVersion) { + var ResponseLength uint16 + if err := _m.ReadUint16(_r, &ResponseLength); err != nil { + return err + } + if cap(c.Response) < int(ResponseLength) { + c.Response = make([]uint8, ResponseLength) + } + c.Response = c.Response[:ResponseLength] + if err := _m.ReadBytes(_r, c.Response); err != nil { + return err + } + } + return nil +} + +func (c *CancelOpenOrdersResponseResponses) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + return nil +} + +func CancelOpenOrdersResponseResponsesInit(c *CancelOpenOrdersResponseResponses) { + return +} + +func (*CancelOpenOrdersResponse) SbeBlockLength() (blockLength uint16) { + return 0 +} + +func (*CancelOpenOrdersResponse) SbeTemplateId() (templateId uint16) { + return 306 +} + +func (*CancelOpenOrdersResponse) SbeSchemaId() (schemaId uint16) { + return 3 +} + +func (*CancelOpenOrdersResponse) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} + +func (*CancelOpenOrdersResponse) SbeSemanticType() (semanticType []byte) { + return []byte("") +} + +func (*CancelOpenOrdersResponse) SbeSemanticVersion() (semanticVersion string) { + return "5.2" +} + +func (*CancelOpenOrdersResponseResponses) ResponseMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*CancelOpenOrdersResponseResponses) ResponseSinceVersion() uint16 { + return 0 +} + +func (c *CancelOpenOrdersResponseResponses) ResponseInActingVersion(actingVersion uint16) bool { + return actingVersion >= c.ResponseSinceVersion() +} + +func (*CancelOpenOrdersResponseResponses) ResponseDeprecated() uint16 { + return 0 +} + +func (CancelOpenOrdersResponseResponses) ResponseCharacterEncoding() string { + return "null" +} + +func (CancelOpenOrdersResponseResponses) ResponseHeaderLength() uint64 { + return 2 +} + +func (*CancelOpenOrdersResponse) ResponsesId() uint16 { + return 100 +} + +func (*CancelOpenOrdersResponse) ResponsesSinceVersion() uint16 { + return 0 +} + +func (c *CancelOpenOrdersResponse) ResponsesInActingVersion(actingVersion uint16) bool { + return actingVersion >= c.ResponsesSinceVersion() +} + +func (*CancelOpenOrdersResponse) ResponsesDeprecated() uint16 { + return 0 +} + +func (*CancelOpenOrdersResponseResponses) SbeBlockLength() (blockLength uint) { + return 0 +} + +func (*CancelOpenOrdersResponseResponses) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} diff --git a/v2/sbe/spot_3_1/CancelOrderListResponse.go b/v2/sbe/spot_3_1/CancelOrderListResponse.go new file mode 100644 index 00000000..403964e4 --- /dev/null +++ b/v2/sbe/spot_3_1/CancelOrderListResponse.go @@ -0,0 +1,2473 @@ +// Generated SBE (Simple Binary Encoding) message codec + +package sbe + +import ( + "errors" + "fmt" + "io" + "io/ioutil" + "math" + "unicode/utf8" +) + +type CancelOrderListResponse struct { + OrderListId int64 + ContingencyType ContingencyTypeEnum + ListStatusType ListStatusTypeEnum + ListOrderStatus ListOrderStatusEnum + TransactionTime int64 + PriceExponent int8 + QtyExponent int8 + Orders []CancelOrderListResponseOrders + OrderReports []CancelOrderListResponseOrderReports + ListClientOrderId []uint8 + Symbol []uint8 +} +type CancelOrderListResponseOrders struct { + OrderId int64 + Symbol []uint8 + ClientOrderId []uint8 +} +type CancelOrderListResponseOrderReports struct { + OrderId int64 + OrderListId int64 + TransactTime int64 + Price int64 + OrigQty int64 + ExecutedQty int64 + CummulativeQuoteQty int64 + Status OrderStatusEnum + TimeInForce TimeInForceEnum + OrderType OrderTypeEnum + Side OrderSideEnum + StopPrice int64 + TrailingDelta int64 + TrailingTime int64 + IcebergQty int64 + StrategyId int64 + StrategyType int32 + OrderCapacity OrderCapacityEnum + WorkingFloor FloorEnum + SelfTradePreventionMode SelfTradePreventionModeEnum + PreventedQuantity int64 + UsedSor BoolEnumEnum + OrigQuoteOrderQty int64 + PegPriceType PegPriceTypeEnum + PegOffsetType PegOffsetTypeEnum + PegOffsetValue uint8 + PeggedPrice int64 + Symbol []uint8 + OrigClientOrderId []uint8 + ClientOrderId []uint8 +} + +func (c *CancelOrderListResponse) Encode(_m *SbeGoMarshaller, _w io.Writer, doRangeCheck bool) error { + if doRangeCheck { + if err := c.RangeCheck(c.SbeSchemaVersion(), c.SbeSchemaVersion()); err != nil { + return err + } + } + if err := _m.WriteInt64(_w, c.OrderListId); err != nil { + return err + } + if err := c.ContingencyType.Encode(_m, _w); err != nil { + return err + } + if err := c.ListStatusType.Encode(_m, _w); err != nil { + return err + } + if err := c.ListOrderStatus.Encode(_m, _w); err != nil { + return err + } + if err := _m.WriteInt64(_w, c.TransactionTime); err != nil { + return err + } + if err := _m.WriteInt8(_w, c.PriceExponent); err != nil { + return err + } + if err := _m.WriteInt8(_w, c.QtyExponent); err != nil { + return err + } + var OrdersBlockLength uint16 = 8 + if err := _m.WriteUint16(_w, OrdersBlockLength); err != nil { + return err + } + var OrdersNumInGroup uint16 = uint16(len(c.Orders)) + if err := _m.WriteUint16(_w, OrdersNumInGroup); err != nil { + return err + } + for i := range c.Orders { + if err := c.Orders[i].Encode(_m, _w); err != nil { + return err + } + } + var OrderReportsBlockLength uint16 = 135 + if err := _m.WriteUint16(_w, OrderReportsBlockLength); err != nil { + return err + } + var OrderReportsNumInGroup uint16 = uint16(len(c.OrderReports)) + if err := _m.WriteUint16(_w, OrderReportsNumInGroup); err != nil { + return err + } + for i := range c.OrderReports { + if err := c.OrderReports[i].Encode(_m, _w); err != nil { + return err + } + } + if err := _m.WriteUint8(_w, uint8(len(c.ListClientOrderId))); err != nil { + return err + } + if err := _m.WriteBytes(_w, c.ListClientOrderId); err != nil { + return err + } + if err := _m.WriteUint8(_w, uint8(len(c.Symbol))); err != nil { + return err + } + if err := _m.WriteBytes(_w, c.Symbol); err != nil { + return err + } + return nil +} + +func (c *CancelOrderListResponse) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint16, doRangeCheck bool) error { + if !c.OrderListIdInActingVersion(actingVersion) { + c.OrderListId = c.OrderListIdNullValue() + } else { + if err := _m.ReadInt64(_r, &c.OrderListId); err != nil { + return err + } + } + if c.ContingencyTypeInActingVersion(actingVersion) { + if err := c.ContingencyType.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if c.ListStatusTypeInActingVersion(actingVersion) { + if err := c.ListStatusType.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if c.ListOrderStatusInActingVersion(actingVersion) { + if err := c.ListOrderStatus.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if !c.TransactionTimeInActingVersion(actingVersion) { + c.TransactionTime = c.TransactionTimeNullValue() + } else { + if err := _m.ReadInt64(_r, &c.TransactionTime); err != nil { + return err + } + } + if !c.PriceExponentInActingVersion(actingVersion) { + c.PriceExponent = c.PriceExponentNullValue() + } else { + if err := _m.ReadInt8(_r, &c.PriceExponent); err != nil { + return err + } + } + if !c.QtyExponentInActingVersion(actingVersion) { + c.QtyExponent = c.QtyExponentNullValue() + } else { + if err := _m.ReadInt8(_r, &c.QtyExponent); err != nil { + return err + } + } + if actingVersion > c.SbeSchemaVersion() && blockLength > c.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-c.SbeBlockLength())) + } + + if c.OrdersInActingVersion(actingVersion) { + var OrdersBlockLength uint16 + if err := _m.ReadUint16(_r, &OrdersBlockLength); err != nil { + return err + } + var OrdersNumInGroup uint16 + if err := _m.ReadUint16(_r, &OrdersNumInGroup); err != nil { + return err + } + if cap(c.Orders) < int(OrdersNumInGroup) { + c.Orders = make([]CancelOrderListResponseOrders, OrdersNumInGroup) + } + c.Orders = c.Orders[:OrdersNumInGroup] + for i := range c.Orders { + if err := c.Orders[i].Decode(_m, _r, actingVersion, uint(OrdersBlockLength)); err != nil { + return err + } + } + } + + if c.OrderReportsInActingVersion(actingVersion) { + var OrderReportsBlockLength uint16 + if err := _m.ReadUint16(_r, &OrderReportsBlockLength); err != nil { + return err + } + var OrderReportsNumInGroup uint16 + if err := _m.ReadUint16(_r, &OrderReportsNumInGroup); err != nil { + return err + } + if cap(c.OrderReports) < int(OrderReportsNumInGroup) { + c.OrderReports = make([]CancelOrderListResponseOrderReports, OrderReportsNumInGroup) + } + c.OrderReports = c.OrderReports[:OrderReportsNumInGroup] + for i := range c.OrderReports { + if err := c.OrderReports[i].Decode(_m, _r, actingVersion, uint(OrderReportsBlockLength)); err != nil { + return err + } + } + } + + if c.ListClientOrderIdInActingVersion(actingVersion) { + var ListClientOrderIdLength uint8 + if err := _m.ReadUint8(_r, &ListClientOrderIdLength); err != nil { + return err + } + if cap(c.ListClientOrderId) < int(ListClientOrderIdLength) { + c.ListClientOrderId = make([]uint8, ListClientOrderIdLength) + } + c.ListClientOrderId = c.ListClientOrderId[:ListClientOrderIdLength] + if err := _m.ReadBytes(_r, c.ListClientOrderId); err != nil { + return err + } + } + + if c.SymbolInActingVersion(actingVersion) { + var SymbolLength uint8 + if err := _m.ReadUint8(_r, &SymbolLength); err != nil { + return err + } + if cap(c.Symbol) < int(SymbolLength) { + c.Symbol = make([]uint8, SymbolLength) + } + c.Symbol = c.Symbol[:SymbolLength] + if err := _m.ReadBytes(_r, c.Symbol); err != nil { + return err + } + } + if doRangeCheck { + if err := c.RangeCheck(actingVersion, c.SbeSchemaVersion()); err != nil { + return err + } + } + return nil +} + +func (c *CancelOrderListResponse) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if c.OrderListIdInActingVersion(actingVersion) { + if c.OrderListId < c.OrderListIdMinValue() || c.OrderListId > c.OrderListIdMaxValue() { + return fmt.Errorf("Range check failed on c.OrderListId (%v < %v > %v)", c.OrderListIdMinValue(), c.OrderListId, c.OrderListIdMaxValue()) + } + } + if err := c.ContingencyType.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if err := c.ListStatusType.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if err := c.ListOrderStatus.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if c.TransactionTimeInActingVersion(actingVersion) { + if c.TransactionTime < c.TransactionTimeMinValue() || c.TransactionTime > c.TransactionTimeMaxValue() { + return fmt.Errorf("Range check failed on c.TransactionTime (%v < %v > %v)", c.TransactionTimeMinValue(), c.TransactionTime, c.TransactionTimeMaxValue()) + } + } + if c.PriceExponentInActingVersion(actingVersion) { + if c.PriceExponent < c.PriceExponentMinValue() || c.PriceExponent > c.PriceExponentMaxValue() { + return fmt.Errorf("Range check failed on c.PriceExponent (%v < %v > %v)", c.PriceExponentMinValue(), c.PriceExponent, c.PriceExponentMaxValue()) + } + } + if c.QtyExponentInActingVersion(actingVersion) { + if c.QtyExponent < c.QtyExponentMinValue() || c.QtyExponent > c.QtyExponentMaxValue() { + return fmt.Errorf("Range check failed on c.QtyExponent (%v < %v > %v)", c.QtyExponentMinValue(), c.QtyExponent, c.QtyExponentMaxValue()) + } + } + for i := range c.Orders { + if err := c.Orders[i].RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + } + for i := range c.OrderReports { + if err := c.OrderReports[i].RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + } + if !utf8.Valid(c.ListClientOrderId[:]) { + return errors.New("c.ListClientOrderId failed UTF-8 validation") + } + if !utf8.Valid(c.Symbol[:]) { + return errors.New("c.Symbol failed UTF-8 validation") + } + return nil +} + +func CancelOrderListResponseInit(c *CancelOrderListResponse) { + return +} + +func (c *CancelOrderListResponseOrders) Encode(_m *SbeGoMarshaller, _w io.Writer) error { + if err := _m.WriteInt64(_w, c.OrderId); err != nil { + return err + } + if err := _m.WriteUint8(_w, uint8(len(c.Symbol))); err != nil { + return err + } + if err := _m.WriteBytes(_w, c.Symbol); err != nil { + return err + } + if err := _m.WriteUint8(_w, uint8(len(c.ClientOrderId))); err != nil { + return err + } + if err := _m.WriteBytes(_w, c.ClientOrderId); err != nil { + return err + } + return nil +} + +func (c *CancelOrderListResponseOrders) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint) error { + if !c.OrderIdInActingVersion(actingVersion) { + c.OrderId = c.OrderIdNullValue() + } else { + if err := _m.ReadInt64(_r, &c.OrderId); err != nil { + return err + } + } + if actingVersion > c.SbeSchemaVersion() && blockLength > c.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-c.SbeBlockLength())) + } + + if c.SymbolInActingVersion(actingVersion) { + var SymbolLength uint8 + if err := _m.ReadUint8(_r, &SymbolLength); err != nil { + return err + } + if cap(c.Symbol) < int(SymbolLength) { + c.Symbol = make([]uint8, SymbolLength) + } + c.Symbol = c.Symbol[:SymbolLength] + if err := _m.ReadBytes(_r, c.Symbol); err != nil { + return err + } + } + + if c.ClientOrderIdInActingVersion(actingVersion) { + var ClientOrderIdLength uint8 + if err := _m.ReadUint8(_r, &ClientOrderIdLength); err != nil { + return err + } + if cap(c.ClientOrderId) < int(ClientOrderIdLength) { + c.ClientOrderId = make([]uint8, ClientOrderIdLength) + } + c.ClientOrderId = c.ClientOrderId[:ClientOrderIdLength] + if err := _m.ReadBytes(_r, c.ClientOrderId); err != nil { + return err + } + } + return nil +} + +func (c *CancelOrderListResponseOrders) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if c.OrderIdInActingVersion(actingVersion) { + if c.OrderId < c.OrderIdMinValue() || c.OrderId > c.OrderIdMaxValue() { + return fmt.Errorf("Range check failed on c.OrderId (%v < %v > %v)", c.OrderIdMinValue(), c.OrderId, c.OrderIdMaxValue()) + } + } + if !utf8.Valid(c.Symbol[:]) { + return errors.New("c.Symbol failed UTF-8 validation") + } + if !utf8.Valid(c.ClientOrderId[:]) { + return errors.New("c.ClientOrderId failed UTF-8 validation") + } + return nil +} + +func CancelOrderListResponseOrdersInit(c *CancelOrderListResponseOrders) { + return +} + +func (c *CancelOrderListResponseOrderReports) Encode(_m *SbeGoMarshaller, _w io.Writer) error { + if err := _m.WriteInt64(_w, c.OrderId); err != nil { + return err + } + if err := _m.WriteInt64(_w, c.OrderListId); err != nil { + return err + } + if err := _m.WriteInt64(_w, c.TransactTime); err != nil { + return err + } + if err := _m.WriteInt64(_w, c.Price); err != nil { + return err + } + if err := _m.WriteInt64(_w, c.OrigQty); err != nil { + return err + } + if err := _m.WriteInt64(_w, c.ExecutedQty); err != nil { + return err + } + if err := _m.WriteInt64(_w, c.CummulativeQuoteQty); err != nil { + return err + } + if err := c.Status.Encode(_m, _w); err != nil { + return err + } + if err := c.TimeInForce.Encode(_m, _w); err != nil { + return err + } + if err := c.OrderType.Encode(_m, _w); err != nil { + return err + } + if err := c.Side.Encode(_m, _w); err != nil { + return err + } + if err := _m.WriteInt64(_w, c.StopPrice); err != nil { + return err + } + if err := _m.WriteInt64(_w, c.TrailingDelta); err != nil { + return err + } + if err := _m.WriteInt64(_w, c.TrailingTime); err != nil { + return err + } + if err := _m.WriteInt64(_w, c.IcebergQty); err != nil { + return err + } + if err := _m.WriteInt64(_w, c.StrategyId); err != nil { + return err + } + if err := _m.WriteInt32(_w, c.StrategyType); err != nil { + return err + } + if err := c.OrderCapacity.Encode(_m, _w); err != nil { + return err + } + if err := c.WorkingFloor.Encode(_m, _w); err != nil { + return err + } + if err := c.SelfTradePreventionMode.Encode(_m, _w); err != nil { + return err + } + if err := _m.WriteInt64(_w, c.PreventedQuantity); err != nil { + return err + } + if err := c.UsedSor.Encode(_m, _w); err != nil { + return err + } + if err := _m.WriteInt64(_w, c.OrigQuoteOrderQty); err != nil { + return err + } + if err := c.PegPriceType.Encode(_m, _w); err != nil { + return err + } + if err := c.PegOffsetType.Encode(_m, _w); err != nil { + return err + } + if err := _m.WriteUint8(_w, c.PegOffsetValue); err != nil { + return err + } + if err := _m.WriteInt64(_w, c.PeggedPrice); err != nil { + return err + } + if err := _m.WriteUint8(_w, uint8(len(c.Symbol))); err != nil { + return err + } + if err := _m.WriteBytes(_w, c.Symbol); err != nil { + return err + } + if err := _m.WriteUint8(_w, uint8(len(c.OrigClientOrderId))); err != nil { + return err + } + if err := _m.WriteBytes(_w, c.OrigClientOrderId); err != nil { + return err + } + if err := _m.WriteUint8(_w, uint8(len(c.ClientOrderId))); err != nil { + return err + } + if err := _m.WriteBytes(_w, c.ClientOrderId); err != nil { + return err + } + return nil +} + +func (c *CancelOrderListResponseOrderReports) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint) error { + if !c.OrderIdInActingVersion(actingVersion) { + c.OrderId = c.OrderIdNullValue() + } else { + if err := _m.ReadInt64(_r, &c.OrderId); err != nil { + return err + } + } + if !c.OrderListIdInActingVersion(actingVersion) { + c.OrderListId = c.OrderListIdNullValue() + } else { + if err := _m.ReadInt64(_r, &c.OrderListId); err != nil { + return err + } + } + if !c.TransactTimeInActingVersion(actingVersion) { + c.TransactTime = c.TransactTimeNullValue() + } else { + if err := _m.ReadInt64(_r, &c.TransactTime); err != nil { + return err + } + } + if !c.PriceInActingVersion(actingVersion) { + c.Price = c.PriceNullValue() + } else { + if err := _m.ReadInt64(_r, &c.Price); err != nil { + return err + } + } + if !c.OrigQtyInActingVersion(actingVersion) { + c.OrigQty = c.OrigQtyNullValue() + } else { + if err := _m.ReadInt64(_r, &c.OrigQty); err != nil { + return err + } + } + if !c.ExecutedQtyInActingVersion(actingVersion) { + c.ExecutedQty = c.ExecutedQtyNullValue() + } else { + if err := _m.ReadInt64(_r, &c.ExecutedQty); err != nil { + return err + } + } + if !c.CummulativeQuoteQtyInActingVersion(actingVersion) { + c.CummulativeQuoteQty = c.CummulativeQuoteQtyNullValue() + } else { + if err := _m.ReadInt64(_r, &c.CummulativeQuoteQty); err != nil { + return err + } + } + if c.StatusInActingVersion(actingVersion) { + if err := c.Status.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if c.TimeInForceInActingVersion(actingVersion) { + if err := c.TimeInForce.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if c.OrderTypeInActingVersion(actingVersion) { + if err := c.OrderType.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if c.SideInActingVersion(actingVersion) { + if err := c.Side.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if !c.StopPriceInActingVersion(actingVersion) { + c.StopPrice = c.StopPriceNullValue() + } else { + if err := _m.ReadInt64(_r, &c.StopPrice); err != nil { + return err + } + } + if !c.TrailingDeltaInActingVersion(actingVersion) { + c.TrailingDelta = c.TrailingDeltaNullValue() + } else { + if err := _m.ReadInt64(_r, &c.TrailingDelta); err != nil { + return err + } + } + if !c.TrailingTimeInActingVersion(actingVersion) { + c.TrailingTime = c.TrailingTimeNullValue() + } else { + if err := _m.ReadInt64(_r, &c.TrailingTime); err != nil { + return err + } + } + if !c.IcebergQtyInActingVersion(actingVersion) { + c.IcebergQty = c.IcebergQtyNullValue() + } else { + if err := _m.ReadInt64(_r, &c.IcebergQty); err != nil { + return err + } + } + if !c.StrategyIdInActingVersion(actingVersion) { + c.StrategyId = c.StrategyIdNullValue() + } else { + if err := _m.ReadInt64(_r, &c.StrategyId); err != nil { + return err + } + } + if !c.StrategyTypeInActingVersion(actingVersion) { + c.StrategyType = c.StrategyTypeNullValue() + } else { + if err := _m.ReadInt32(_r, &c.StrategyType); err != nil { + return err + } + } + if c.OrderCapacityInActingVersion(actingVersion) { + if err := c.OrderCapacity.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if c.WorkingFloorInActingVersion(actingVersion) { + if err := c.WorkingFloor.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if c.SelfTradePreventionModeInActingVersion(actingVersion) { + if err := c.SelfTradePreventionMode.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if !c.PreventedQuantityInActingVersion(actingVersion) { + c.PreventedQuantity = c.PreventedQuantityNullValue() + } else { + if err := _m.ReadInt64(_r, &c.PreventedQuantity); err != nil { + return err + } + } + if c.UsedSorInActingVersion(actingVersion) { + if err := c.UsedSor.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if !c.OrigQuoteOrderQtyInActingVersion(actingVersion) { + c.OrigQuoteOrderQty = c.OrigQuoteOrderQtyNullValue() + } else { + if err := _m.ReadInt64(_r, &c.OrigQuoteOrderQty); err != nil { + return err + } + } + if c.PegPriceTypeInActingVersion(actingVersion) { + if err := c.PegPriceType.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if c.PegOffsetTypeInActingVersion(actingVersion) { + if err := c.PegOffsetType.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if !c.PegOffsetValueInActingVersion(actingVersion) { + c.PegOffsetValue = c.PegOffsetValueNullValue() + } else { + if err := _m.ReadUint8(_r, &c.PegOffsetValue); err != nil { + return err + } + } + if !c.PeggedPriceInActingVersion(actingVersion) { + c.PeggedPrice = c.PeggedPriceNullValue() + } else { + if err := _m.ReadInt64(_r, &c.PeggedPrice); err != nil { + return err + } + } + if actingVersion > c.SbeSchemaVersion() && blockLength > c.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-c.SbeBlockLength())) + } + + if c.SymbolInActingVersion(actingVersion) { + var SymbolLength uint8 + if err := _m.ReadUint8(_r, &SymbolLength); err != nil { + return err + } + if cap(c.Symbol) < int(SymbolLength) { + c.Symbol = make([]uint8, SymbolLength) + } + c.Symbol = c.Symbol[:SymbolLength] + if err := _m.ReadBytes(_r, c.Symbol); err != nil { + return err + } + } + + if c.OrigClientOrderIdInActingVersion(actingVersion) { + var OrigClientOrderIdLength uint8 + if err := _m.ReadUint8(_r, &OrigClientOrderIdLength); err != nil { + return err + } + if cap(c.OrigClientOrderId) < int(OrigClientOrderIdLength) { + c.OrigClientOrderId = make([]uint8, OrigClientOrderIdLength) + } + c.OrigClientOrderId = c.OrigClientOrderId[:OrigClientOrderIdLength] + if err := _m.ReadBytes(_r, c.OrigClientOrderId); err != nil { + return err + } + } + + if c.ClientOrderIdInActingVersion(actingVersion) { + var ClientOrderIdLength uint8 + if err := _m.ReadUint8(_r, &ClientOrderIdLength); err != nil { + return err + } + if cap(c.ClientOrderId) < int(ClientOrderIdLength) { + c.ClientOrderId = make([]uint8, ClientOrderIdLength) + } + c.ClientOrderId = c.ClientOrderId[:ClientOrderIdLength] + if err := _m.ReadBytes(_r, c.ClientOrderId); err != nil { + return err + } + } + return nil +} + +func (c *CancelOrderListResponseOrderReports) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if c.OrderIdInActingVersion(actingVersion) { + if c.OrderId < c.OrderIdMinValue() || c.OrderId > c.OrderIdMaxValue() { + return fmt.Errorf("Range check failed on c.OrderId (%v < %v > %v)", c.OrderIdMinValue(), c.OrderId, c.OrderIdMaxValue()) + } + } + if c.OrderListIdInActingVersion(actingVersion) { + if c.OrderListId != c.OrderListIdNullValue() && (c.OrderListId < c.OrderListIdMinValue() || c.OrderListId > c.OrderListIdMaxValue()) { + return fmt.Errorf("Range check failed on c.OrderListId (%v < %v > %v)", c.OrderListIdMinValue(), c.OrderListId, c.OrderListIdMaxValue()) + } + } + if c.TransactTimeInActingVersion(actingVersion) { + if c.TransactTime < c.TransactTimeMinValue() || c.TransactTime > c.TransactTimeMaxValue() { + return fmt.Errorf("Range check failed on c.TransactTime (%v < %v > %v)", c.TransactTimeMinValue(), c.TransactTime, c.TransactTimeMaxValue()) + } + } + if c.PriceInActingVersion(actingVersion) { + if c.Price < c.PriceMinValue() || c.Price > c.PriceMaxValue() { + return fmt.Errorf("Range check failed on c.Price (%v < %v > %v)", c.PriceMinValue(), c.Price, c.PriceMaxValue()) + } + } + if c.OrigQtyInActingVersion(actingVersion) { + if c.OrigQty < c.OrigQtyMinValue() || c.OrigQty > c.OrigQtyMaxValue() { + return fmt.Errorf("Range check failed on c.OrigQty (%v < %v > %v)", c.OrigQtyMinValue(), c.OrigQty, c.OrigQtyMaxValue()) + } + } + if c.ExecutedQtyInActingVersion(actingVersion) { + if c.ExecutedQty < c.ExecutedQtyMinValue() || c.ExecutedQty > c.ExecutedQtyMaxValue() { + return fmt.Errorf("Range check failed on c.ExecutedQty (%v < %v > %v)", c.ExecutedQtyMinValue(), c.ExecutedQty, c.ExecutedQtyMaxValue()) + } + } + if c.CummulativeQuoteQtyInActingVersion(actingVersion) { + if c.CummulativeQuoteQty < c.CummulativeQuoteQtyMinValue() || c.CummulativeQuoteQty > c.CummulativeQuoteQtyMaxValue() { + return fmt.Errorf("Range check failed on c.CummulativeQuoteQty (%v < %v > %v)", c.CummulativeQuoteQtyMinValue(), c.CummulativeQuoteQty, c.CummulativeQuoteQtyMaxValue()) + } + } + if err := c.Status.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if err := c.TimeInForce.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if err := c.OrderType.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if err := c.Side.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if c.StopPriceInActingVersion(actingVersion) { + if c.StopPrice != c.StopPriceNullValue() && (c.StopPrice < c.StopPriceMinValue() || c.StopPrice > c.StopPriceMaxValue()) { + return fmt.Errorf("Range check failed on c.StopPrice (%v < %v > %v)", c.StopPriceMinValue(), c.StopPrice, c.StopPriceMaxValue()) + } + } + if c.TrailingDeltaInActingVersion(actingVersion) { + if c.TrailingDelta != c.TrailingDeltaNullValue() && (c.TrailingDelta < c.TrailingDeltaMinValue() || c.TrailingDelta > c.TrailingDeltaMaxValue()) { + return fmt.Errorf("Range check failed on c.TrailingDelta (%v < %v > %v)", c.TrailingDeltaMinValue(), c.TrailingDelta, c.TrailingDeltaMaxValue()) + } + } + if c.TrailingTimeInActingVersion(actingVersion) { + if c.TrailingTime != c.TrailingTimeNullValue() && (c.TrailingTime < c.TrailingTimeMinValue() || c.TrailingTime > c.TrailingTimeMaxValue()) { + return fmt.Errorf("Range check failed on c.TrailingTime (%v < %v > %v)", c.TrailingTimeMinValue(), c.TrailingTime, c.TrailingTimeMaxValue()) + } + } + if c.IcebergQtyInActingVersion(actingVersion) { + if c.IcebergQty != c.IcebergQtyNullValue() && (c.IcebergQty < c.IcebergQtyMinValue() || c.IcebergQty > c.IcebergQtyMaxValue()) { + return fmt.Errorf("Range check failed on c.IcebergQty (%v < %v > %v)", c.IcebergQtyMinValue(), c.IcebergQty, c.IcebergQtyMaxValue()) + } + } + if c.StrategyIdInActingVersion(actingVersion) { + if c.StrategyId != c.StrategyIdNullValue() && (c.StrategyId < c.StrategyIdMinValue() || c.StrategyId > c.StrategyIdMaxValue()) { + return fmt.Errorf("Range check failed on c.StrategyId (%v < %v > %v)", c.StrategyIdMinValue(), c.StrategyId, c.StrategyIdMaxValue()) + } + } + if c.StrategyTypeInActingVersion(actingVersion) { + if c.StrategyType != c.StrategyTypeNullValue() && (c.StrategyType < c.StrategyTypeMinValue() || c.StrategyType > c.StrategyTypeMaxValue()) { + return fmt.Errorf("Range check failed on c.StrategyType (%v < %v > %v)", c.StrategyTypeMinValue(), c.StrategyType, c.StrategyTypeMaxValue()) + } + } + if err := c.OrderCapacity.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if err := c.WorkingFloor.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if err := c.SelfTradePreventionMode.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if c.PreventedQuantityInActingVersion(actingVersion) { + if c.PreventedQuantity < c.PreventedQuantityMinValue() || c.PreventedQuantity > c.PreventedQuantityMaxValue() { + return fmt.Errorf("Range check failed on c.PreventedQuantity (%v < %v > %v)", c.PreventedQuantityMinValue(), c.PreventedQuantity, c.PreventedQuantityMaxValue()) + } + } + if err := c.UsedSor.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if c.OrigQuoteOrderQtyInActingVersion(actingVersion) { + if c.OrigQuoteOrderQty < c.OrigQuoteOrderQtyMinValue() || c.OrigQuoteOrderQty > c.OrigQuoteOrderQtyMaxValue() { + return fmt.Errorf("Range check failed on c.OrigQuoteOrderQty (%v < %v > %v)", c.OrigQuoteOrderQtyMinValue(), c.OrigQuoteOrderQty, c.OrigQuoteOrderQtyMaxValue()) + } + } + if err := c.PegPriceType.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if err := c.PegOffsetType.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if c.PegOffsetValueInActingVersion(actingVersion) { + if c.PegOffsetValue != c.PegOffsetValueNullValue() && (c.PegOffsetValue < c.PegOffsetValueMinValue() || c.PegOffsetValue > c.PegOffsetValueMaxValue()) { + return fmt.Errorf("Range check failed on c.PegOffsetValue (%v < %v > %v)", c.PegOffsetValueMinValue(), c.PegOffsetValue, c.PegOffsetValueMaxValue()) + } + } + if c.PeggedPriceInActingVersion(actingVersion) { + if c.PeggedPrice != c.PeggedPriceNullValue() && (c.PeggedPrice < c.PeggedPriceMinValue() || c.PeggedPrice > c.PeggedPriceMaxValue()) { + return fmt.Errorf("Range check failed on c.PeggedPrice (%v < %v > %v)", c.PeggedPriceMinValue(), c.PeggedPrice, c.PeggedPriceMaxValue()) + } + } + if !utf8.Valid(c.Symbol[:]) { + return errors.New("c.Symbol failed UTF-8 validation") + } + if !utf8.Valid(c.OrigClientOrderId[:]) { + return errors.New("c.OrigClientOrderId failed UTF-8 validation") + } + if !utf8.Valid(c.ClientOrderId[:]) { + return errors.New("c.ClientOrderId failed UTF-8 validation") + } + return nil +} + +func CancelOrderListResponseOrderReportsInit(c *CancelOrderListResponseOrderReports) { + c.OrderListId = math.MinInt64 + c.StopPrice = math.MinInt64 + c.TrailingDelta = math.MinInt64 + c.TrailingTime = math.MinInt64 + c.IcebergQty = math.MinInt64 + c.StrategyId = math.MinInt64 + c.StrategyType = math.MinInt32 + c.PegOffsetValue = math.MaxUint8 + c.PeggedPrice = math.MinInt64 + return +} + +func (*CancelOrderListResponse) SbeBlockLength() (blockLength uint16) { + return 21 +} + +func (*CancelOrderListResponse) SbeTemplateId() (templateId uint16) { + return 312 +} + +func (*CancelOrderListResponse) SbeSchemaId() (schemaId uint16) { + return 3 +} + +func (*CancelOrderListResponse) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} + +func (*CancelOrderListResponse) SbeSemanticType() (semanticType []byte) { + return []byte("") +} + +func (*CancelOrderListResponse) SbeSemanticVersion() (semanticVersion string) { + return "5.2" +} + +func (*CancelOrderListResponse) OrderListIdId() uint16 { + return 1 +} + +func (*CancelOrderListResponse) OrderListIdSinceVersion() uint16 { + return 0 +} + +func (c *CancelOrderListResponse) OrderListIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= c.OrderListIdSinceVersion() +} + +func (*CancelOrderListResponse) OrderListIdDeprecated() uint16 { + return 0 +} + +func (*CancelOrderListResponse) OrderListIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*CancelOrderListResponse) OrderListIdMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*CancelOrderListResponse) OrderListIdMaxValue() int64 { + return math.MaxInt64 +} + +func (*CancelOrderListResponse) OrderListIdNullValue() int64 { + return math.MinInt64 +} + +func (*CancelOrderListResponse) ContingencyTypeId() uint16 { + return 2 +} + +func (*CancelOrderListResponse) ContingencyTypeSinceVersion() uint16 { + return 0 +} + +func (c *CancelOrderListResponse) ContingencyTypeInActingVersion(actingVersion uint16) bool { + return actingVersion >= c.ContingencyTypeSinceVersion() +} + +func (*CancelOrderListResponse) ContingencyTypeDeprecated() uint16 { + return 0 +} + +func (*CancelOrderListResponse) ContingencyTypeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*CancelOrderListResponse) ListStatusTypeId() uint16 { + return 3 +} + +func (*CancelOrderListResponse) ListStatusTypeSinceVersion() uint16 { + return 0 +} + +func (c *CancelOrderListResponse) ListStatusTypeInActingVersion(actingVersion uint16) bool { + return actingVersion >= c.ListStatusTypeSinceVersion() +} + +func (*CancelOrderListResponse) ListStatusTypeDeprecated() uint16 { + return 0 +} + +func (*CancelOrderListResponse) ListStatusTypeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*CancelOrderListResponse) ListOrderStatusId() uint16 { + return 4 +} + +func (*CancelOrderListResponse) ListOrderStatusSinceVersion() uint16 { + return 0 +} + +func (c *CancelOrderListResponse) ListOrderStatusInActingVersion(actingVersion uint16) bool { + return actingVersion >= c.ListOrderStatusSinceVersion() +} + +func (*CancelOrderListResponse) ListOrderStatusDeprecated() uint16 { + return 0 +} + +func (*CancelOrderListResponse) ListOrderStatusMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*CancelOrderListResponse) TransactionTimeId() uint16 { + return 5 +} + +func (*CancelOrderListResponse) TransactionTimeSinceVersion() uint16 { + return 0 +} + +func (c *CancelOrderListResponse) TransactionTimeInActingVersion(actingVersion uint16) bool { + return actingVersion >= c.TransactionTimeSinceVersion() +} + +func (*CancelOrderListResponse) TransactionTimeDeprecated() uint16 { + return 0 +} + +func (*CancelOrderListResponse) TransactionTimeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*CancelOrderListResponse) TransactionTimeMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*CancelOrderListResponse) TransactionTimeMaxValue() int64 { + return math.MaxInt64 +} + +func (*CancelOrderListResponse) TransactionTimeNullValue() int64 { + return math.MinInt64 +} + +func (*CancelOrderListResponse) PriceExponentId() uint16 { + return 6 +} + +func (*CancelOrderListResponse) PriceExponentSinceVersion() uint16 { + return 0 +} + +func (c *CancelOrderListResponse) PriceExponentInActingVersion(actingVersion uint16) bool { + return actingVersion >= c.PriceExponentSinceVersion() +} + +func (*CancelOrderListResponse) PriceExponentDeprecated() uint16 { + return 0 +} + +func (*CancelOrderListResponse) PriceExponentMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*CancelOrderListResponse) PriceExponentMinValue() int8 { + return math.MinInt8 + 1 +} + +func (*CancelOrderListResponse) PriceExponentMaxValue() int8 { + return math.MaxInt8 +} + +func (*CancelOrderListResponse) PriceExponentNullValue() int8 { + return math.MinInt8 +} + +func (*CancelOrderListResponse) QtyExponentId() uint16 { + return 7 +} + +func (*CancelOrderListResponse) QtyExponentSinceVersion() uint16 { + return 0 +} + +func (c *CancelOrderListResponse) QtyExponentInActingVersion(actingVersion uint16) bool { + return actingVersion >= c.QtyExponentSinceVersion() +} + +func (*CancelOrderListResponse) QtyExponentDeprecated() uint16 { + return 0 +} + +func (*CancelOrderListResponse) QtyExponentMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*CancelOrderListResponse) QtyExponentMinValue() int8 { + return math.MinInt8 + 1 +} + +func (*CancelOrderListResponse) QtyExponentMaxValue() int8 { + return math.MaxInt8 +} + +func (*CancelOrderListResponse) QtyExponentNullValue() int8 { + return math.MinInt8 +} + +func (*CancelOrderListResponseOrders) OrderIdId() uint16 { + return 1 +} + +func (*CancelOrderListResponseOrders) OrderIdSinceVersion() uint16 { + return 0 +} + +func (c *CancelOrderListResponseOrders) OrderIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= c.OrderIdSinceVersion() +} + +func (*CancelOrderListResponseOrders) OrderIdDeprecated() uint16 { + return 0 +} + +func (*CancelOrderListResponseOrders) OrderIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*CancelOrderListResponseOrders) OrderIdMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*CancelOrderListResponseOrders) OrderIdMaxValue() int64 { + return math.MaxInt64 +} + +func (*CancelOrderListResponseOrders) OrderIdNullValue() int64 { + return math.MinInt64 +} + +func (*CancelOrderListResponseOrders) SymbolMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*CancelOrderListResponseOrders) SymbolSinceVersion() uint16 { + return 0 +} + +func (c *CancelOrderListResponseOrders) SymbolInActingVersion(actingVersion uint16) bool { + return actingVersion >= c.SymbolSinceVersion() +} + +func (*CancelOrderListResponseOrders) SymbolDeprecated() uint16 { + return 0 +} + +func (CancelOrderListResponseOrders) SymbolCharacterEncoding() string { + return "UTF-8" +} + +func (CancelOrderListResponseOrders) SymbolHeaderLength() uint64 { + return 1 +} + +func (*CancelOrderListResponseOrders) ClientOrderIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*CancelOrderListResponseOrders) ClientOrderIdSinceVersion() uint16 { + return 0 +} + +func (c *CancelOrderListResponseOrders) ClientOrderIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= c.ClientOrderIdSinceVersion() +} + +func (*CancelOrderListResponseOrders) ClientOrderIdDeprecated() uint16 { + return 0 +} + +func (CancelOrderListResponseOrders) ClientOrderIdCharacterEncoding() string { + return "UTF-8" +} + +func (CancelOrderListResponseOrders) ClientOrderIdHeaderLength() uint64 { + return 1 +} + +func (*CancelOrderListResponseOrderReports) OrderIdId() uint16 { + return 1 +} + +func (*CancelOrderListResponseOrderReports) OrderIdSinceVersion() uint16 { + return 0 +} + +func (c *CancelOrderListResponseOrderReports) OrderIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= c.OrderIdSinceVersion() +} + +func (*CancelOrderListResponseOrderReports) OrderIdDeprecated() uint16 { + return 0 +} + +func (*CancelOrderListResponseOrderReports) OrderIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*CancelOrderListResponseOrderReports) OrderIdMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*CancelOrderListResponseOrderReports) OrderIdMaxValue() int64 { + return math.MaxInt64 +} + +func (*CancelOrderListResponseOrderReports) OrderIdNullValue() int64 { + return math.MinInt64 +} + +func (*CancelOrderListResponseOrderReports) OrderListIdId() uint16 { + return 2 +} + +func (*CancelOrderListResponseOrderReports) OrderListIdSinceVersion() uint16 { + return 0 +} + +func (c *CancelOrderListResponseOrderReports) OrderListIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= c.OrderListIdSinceVersion() +} + +func (*CancelOrderListResponseOrderReports) OrderListIdDeprecated() uint16 { + return 0 +} + +func (*CancelOrderListResponseOrderReports) OrderListIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*CancelOrderListResponseOrderReports) OrderListIdMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*CancelOrderListResponseOrderReports) OrderListIdMaxValue() int64 { + return math.MaxInt64 +} + +func (*CancelOrderListResponseOrderReports) OrderListIdNullValue() int64 { + return math.MinInt64 +} + +func (*CancelOrderListResponseOrderReports) TransactTimeId() uint16 { + return 3 +} + +func (*CancelOrderListResponseOrderReports) TransactTimeSinceVersion() uint16 { + return 0 +} + +func (c *CancelOrderListResponseOrderReports) TransactTimeInActingVersion(actingVersion uint16) bool { + return actingVersion >= c.TransactTimeSinceVersion() +} + +func (*CancelOrderListResponseOrderReports) TransactTimeDeprecated() uint16 { + return 0 +} + +func (*CancelOrderListResponseOrderReports) TransactTimeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*CancelOrderListResponseOrderReports) TransactTimeMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*CancelOrderListResponseOrderReports) TransactTimeMaxValue() int64 { + return math.MaxInt64 +} + +func (*CancelOrderListResponseOrderReports) TransactTimeNullValue() int64 { + return math.MinInt64 +} + +func (*CancelOrderListResponseOrderReports) PriceId() uint16 { + return 4 +} + +func (*CancelOrderListResponseOrderReports) PriceSinceVersion() uint16 { + return 0 +} + +func (c *CancelOrderListResponseOrderReports) PriceInActingVersion(actingVersion uint16) bool { + return actingVersion >= c.PriceSinceVersion() +} + +func (*CancelOrderListResponseOrderReports) PriceDeprecated() uint16 { + return 0 +} + +func (*CancelOrderListResponseOrderReports) PriceMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*CancelOrderListResponseOrderReports) PriceMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*CancelOrderListResponseOrderReports) PriceMaxValue() int64 { + return math.MaxInt64 +} + +func (*CancelOrderListResponseOrderReports) PriceNullValue() int64 { + return math.MinInt64 +} + +func (*CancelOrderListResponseOrderReports) OrigQtyId() uint16 { + return 5 +} + +func (*CancelOrderListResponseOrderReports) OrigQtySinceVersion() uint16 { + return 0 +} + +func (c *CancelOrderListResponseOrderReports) OrigQtyInActingVersion(actingVersion uint16) bool { + return actingVersion >= c.OrigQtySinceVersion() +} + +func (*CancelOrderListResponseOrderReports) OrigQtyDeprecated() uint16 { + return 0 +} + +func (*CancelOrderListResponseOrderReports) OrigQtyMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*CancelOrderListResponseOrderReports) OrigQtyMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*CancelOrderListResponseOrderReports) OrigQtyMaxValue() int64 { + return math.MaxInt64 +} + +func (*CancelOrderListResponseOrderReports) OrigQtyNullValue() int64 { + return math.MinInt64 +} + +func (*CancelOrderListResponseOrderReports) ExecutedQtyId() uint16 { + return 6 +} + +func (*CancelOrderListResponseOrderReports) ExecutedQtySinceVersion() uint16 { + return 0 +} + +func (c *CancelOrderListResponseOrderReports) ExecutedQtyInActingVersion(actingVersion uint16) bool { + return actingVersion >= c.ExecutedQtySinceVersion() +} + +func (*CancelOrderListResponseOrderReports) ExecutedQtyDeprecated() uint16 { + return 0 +} + +func (*CancelOrderListResponseOrderReports) ExecutedQtyMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*CancelOrderListResponseOrderReports) ExecutedQtyMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*CancelOrderListResponseOrderReports) ExecutedQtyMaxValue() int64 { + return math.MaxInt64 +} + +func (*CancelOrderListResponseOrderReports) ExecutedQtyNullValue() int64 { + return math.MinInt64 +} + +func (*CancelOrderListResponseOrderReports) CummulativeQuoteQtyId() uint16 { + return 7 +} + +func (*CancelOrderListResponseOrderReports) CummulativeQuoteQtySinceVersion() uint16 { + return 0 +} + +func (c *CancelOrderListResponseOrderReports) CummulativeQuoteQtyInActingVersion(actingVersion uint16) bool { + return actingVersion >= c.CummulativeQuoteQtySinceVersion() +} + +func (*CancelOrderListResponseOrderReports) CummulativeQuoteQtyDeprecated() uint16 { + return 0 +} + +func (*CancelOrderListResponseOrderReports) CummulativeQuoteQtyMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*CancelOrderListResponseOrderReports) CummulativeQuoteQtyMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*CancelOrderListResponseOrderReports) CummulativeQuoteQtyMaxValue() int64 { + return math.MaxInt64 +} + +func (*CancelOrderListResponseOrderReports) CummulativeQuoteQtyNullValue() int64 { + return math.MinInt64 +} + +func (*CancelOrderListResponseOrderReports) StatusId() uint16 { + return 8 +} + +func (*CancelOrderListResponseOrderReports) StatusSinceVersion() uint16 { + return 0 +} + +func (c *CancelOrderListResponseOrderReports) StatusInActingVersion(actingVersion uint16) bool { + return actingVersion >= c.StatusSinceVersion() +} + +func (*CancelOrderListResponseOrderReports) StatusDeprecated() uint16 { + return 0 +} + +func (*CancelOrderListResponseOrderReports) StatusMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*CancelOrderListResponseOrderReports) TimeInForceId() uint16 { + return 9 +} + +func (*CancelOrderListResponseOrderReports) TimeInForceSinceVersion() uint16 { + return 0 +} + +func (c *CancelOrderListResponseOrderReports) TimeInForceInActingVersion(actingVersion uint16) bool { + return actingVersion >= c.TimeInForceSinceVersion() +} + +func (*CancelOrderListResponseOrderReports) TimeInForceDeprecated() uint16 { + return 0 +} + +func (*CancelOrderListResponseOrderReports) TimeInForceMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*CancelOrderListResponseOrderReports) OrderTypeId() uint16 { + return 10 +} + +func (*CancelOrderListResponseOrderReports) OrderTypeSinceVersion() uint16 { + return 0 +} + +func (c *CancelOrderListResponseOrderReports) OrderTypeInActingVersion(actingVersion uint16) bool { + return actingVersion >= c.OrderTypeSinceVersion() +} + +func (*CancelOrderListResponseOrderReports) OrderTypeDeprecated() uint16 { + return 0 +} + +func (*CancelOrderListResponseOrderReports) OrderTypeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*CancelOrderListResponseOrderReports) SideId() uint16 { + return 11 +} + +func (*CancelOrderListResponseOrderReports) SideSinceVersion() uint16 { + return 0 +} + +func (c *CancelOrderListResponseOrderReports) SideInActingVersion(actingVersion uint16) bool { + return actingVersion >= c.SideSinceVersion() +} + +func (*CancelOrderListResponseOrderReports) SideDeprecated() uint16 { + return 0 +} + +func (*CancelOrderListResponseOrderReports) SideMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*CancelOrderListResponseOrderReports) StopPriceId() uint16 { + return 12 +} + +func (*CancelOrderListResponseOrderReports) StopPriceSinceVersion() uint16 { + return 0 +} + +func (c *CancelOrderListResponseOrderReports) StopPriceInActingVersion(actingVersion uint16) bool { + return actingVersion >= c.StopPriceSinceVersion() +} + +func (*CancelOrderListResponseOrderReports) StopPriceDeprecated() uint16 { + return 0 +} + +func (*CancelOrderListResponseOrderReports) StopPriceMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*CancelOrderListResponseOrderReports) StopPriceMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*CancelOrderListResponseOrderReports) StopPriceMaxValue() int64 { + return math.MaxInt64 +} + +func (*CancelOrderListResponseOrderReports) StopPriceNullValue() int64 { + return math.MinInt64 +} + +func (*CancelOrderListResponseOrderReports) TrailingDeltaId() uint16 { + return 13 +} + +func (*CancelOrderListResponseOrderReports) TrailingDeltaSinceVersion() uint16 { + return 0 +} + +func (c *CancelOrderListResponseOrderReports) TrailingDeltaInActingVersion(actingVersion uint16) bool { + return actingVersion >= c.TrailingDeltaSinceVersion() +} + +func (*CancelOrderListResponseOrderReports) TrailingDeltaDeprecated() uint16 { + return 0 +} + +func (*CancelOrderListResponseOrderReports) TrailingDeltaMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*CancelOrderListResponseOrderReports) TrailingDeltaMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*CancelOrderListResponseOrderReports) TrailingDeltaMaxValue() int64 { + return math.MaxInt64 +} + +func (*CancelOrderListResponseOrderReports) TrailingDeltaNullValue() int64 { + return math.MinInt64 +} + +func (*CancelOrderListResponseOrderReports) TrailingTimeId() uint16 { + return 14 +} + +func (*CancelOrderListResponseOrderReports) TrailingTimeSinceVersion() uint16 { + return 0 +} + +func (c *CancelOrderListResponseOrderReports) TrailingTimeInActingVersion(actingVersion uint16) bool { + return actingVersion >= c.TrailingTimeSinceVersion() +} + +func (*CancelOrderListResponseOrderReports) TrailingTimeDeprecated() uint16 { + return 0 +} + +func (*CancelOrderListResponseOrderReports) TrailingTimeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*CancelOrderListResponseOrderReports) TrailingTimeMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*CancelOrderListResponseOrderReports) TrailingTimeMaxValue() int64 { + return math.MaxInt64 +} + +func (*CancelOrderListResponseOrderReports) TrailingTimeNullValue() int64 { + return math.MinInt64 +} + +func (*CancelOrderListResponseOrderReports) IcebergQtyId() uint16 { + return 15 +} + +func (*CancelOrderListResponseOrderReports) IcebergQtySinceVersion() uint16 { + return 0 +} + +func (c *CancelOrderListResponseOrderReports) IcebergQtyInActingVersion(actingVersion uint16) bool { + return actingVersion >= c.IcebergQtySinceVersion() +} + +func (*CancelOrderListResponseOrderReports) IcebergQtyDeprecated() uint16 { + return 0 +} + +func (*CancelOrderListResponseOrderReports) IcebergQtyMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*CancelOrderListResponseOrderReports) IcebergQtyMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*CancelOrderListResponseOrderReports) IcebergQtyMaxValue() int64 { + return math.MaxInt64 +} + +func (*CancelOrderListResponseOrderReports) IcebergQtyNullValue() int64 { + return math.MinInt64 +} + +func (*CancelOrderListResponseOrderReports) StrategyIdId() uint16 { + return 16 +} + +func (*CancelOrderListResponseOrderReports) StrategyIdSinceVersion() uint16 { + return 0 +} + +func (c *CancelOrderListResponseOrderReports) StrategyIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= c.StrategyIdSinceVersion() +} + +func (*CancelOrderListResponseOrderReports) StrategyIdDeprecated() uint16 { + return 0 +} + +func (*CancelOrderListResponseOrderReports) StrategyIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*CancelOrderListResponseOrderReports) StrategyIdMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*CancelOrderListResponseOrderReports) StrategyIdMaxValue() int64 { + return math.MaxInt64 +} + +func (*CancelOrderListResponseOrderReports) StrategyIdNullValue() int64 { + return math.MinInt64 +} + +func (*CancelOrderListResponseOrderReports) StrategyTypeId() uint16 { + return 17 +} + +func (*CancelOrderListResponseOrderReports) StrategyTypeSinceVersion() uint16 { + return 0 +} + +func (c *CancelOrderListResponseOrderReports) StrategyTypeInActingVersion(actingVersion uint16) bool { + return actingVersion >= c.StrategyTypeSinceVersion() +} + +func (*CancelOrderListResponseOrderReports) StrategyTypeDeprecated() uint16 { + return 0 +} + +func (*CancelOrderListResponseOrderReports) StrategyTypeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*CancelOrderListResponseOrderReports) StrategyTypeMinValue() int32 { + return math.MinInt32 + 1 +} + +func (*CancelOrderListResponseOrderReports) StrategyTypeMaxValue() int32 { + return math.MaxInt32 +} + +func (*CancelOrderListResponseOrderReports) StrategyTypeNullValue() int32 { + return math.MinInt32 +} + +func (*CancelOrderListResponseOrderReports) OrderCapacityId() uint16 { + return 18 +} + +func (*CancelOrderListResponseOrderReports) OrderCapacitySinceVersion() uint16 { + return 0 +} + +func (c *CancelOrderListResponseOrderReports) OrderCapacityInActingVersion(actingVersion uint16) bool { + return actingVersion >= c.OrderCapacitySinceVersion() +} + +func (*CancelOrderListResponseOrderReports) OrderCapacityDeprecated() uint16 { + return 0 +} + +func (*CancelOrderListResponseOrderReports) OrderCapacityMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*CancelOrderListResponseOrderReports) WorkingFloorId() uint16 { + return 19 +} + +func (*CancelOrderListResponseOrderReports) WorkingFloorSinceVersion() uint16 { + return 0 +} + +func (c *CancelOrderListResponseOrderReports) WorkingFloorInActingVersion(actingVersion uint16) bool { + return actingVersion >= c.WorkingFloorSinceVersion() +} + +func (*CancelOrderListResponseOrderReports) WorkingFloorDeprecated() uint16 { + return 0 +} + +func (*CancelOrderListResponseOrderReports) WorkingFloorMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*CancelOrderListResponseOrderReports) SelfTradePreventionModeId() uint16 { + return 20 +} + +func (*CancelOrderListResponseOrderReports) SelfTradePreventionModeSinceVersion() uint16 { + return 0 +} + +func (c *CancelOrderListResponseOrderReports) SelfTradePreventionModeInActingVersion(actingVersion uint16) bool { + return actingVersion >= c.SelfTradePreventionModeSinceVersion() +} + +func (*CancelOrderListResponseOrderReports) SelfTradePreventionModeDeprecated() uint16 { + return 0 +} + +func (*CancelOrderListResponseOrderReports) SelfTradePreventionModeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*CancelOrderListResponseOrderReports) PreventedQuantityId() uint16 { + return 21 +} + +func (*CancelOrderListResponseOrderReports) PreventedQuantitySinceVersion() uint16 { + return 0 +} + +func (c *CancelOrderListResponseOrderReports) PreventedQuantityInActingVersion(actingVersion uint16) bool { + return actingVersion >= c.PreventedQuantitySinceVersion() +} + +func (*CancelOrderListResponseOrderReports) PreventedQuantityDeprecated() uint16 { + return 0 +} + +func (*CancelOrderListResponseOrderReports) PreventedQuantityMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*CancelOrderListResponseOrderReports) PreventedQuantityMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*CancelOrderListResponseOrderReports) PreventedQuantityMaxValue() int64 { + return math.MaxInt64 +} + +func (*CancelOrderListResponseOrderReports) PreventedQuantityNullValue() int64 { + return math.MinInt64 +} + +func (*CancelOrderListResponseOrderReports) UsedSorId() uint16 { + return 22 +} + +func (*CancelOrderListResponseOrderReports) UsedSorSinceVersion() uint16 { + return 0 +} + +func (c *CancelOrderListResponseOrderReports) UsedSorInActingVersion(actingVersion uint16) bool { + return actingVersion >= c.UsedSorSinceVersion() +} + +func (*CancelOrderListResponseOrderReports) UsedSorDeprecated() uint16 { + return 0 +} + +func (*CancelOrderListResponseOrderReports) UsedSorMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*CancelOrderListResponseOrderReports) OrigQuoteOrderQtyId() uint16 { + return 23 +} + +func (*CancelOrderListResponseOrderReports) OrigQuoteOrderQtySinceVersion() uint16 { + return 0 +} + +func (c *CancelOrderListResponseOrderReports) OrigQuoteOrderQtyInActingVersion(actingVersion uint16) bool { + return actingVersion >= c.OrigQuoteOrderQtySinceVersion() +} + +func (*CancelOrderListResponseOrderReports) OrigQuoteOrderQtyDeprecated() uint16 { + return 0 +} + +func (*CancelOrderListResponseOrderReports) OrigQuoteOrderQtyMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*CancelOrderListResponseOrderReports) OrigQuoteOrderQtyMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*CancelOrderListResponseOrderReports) OrigQuoteOrderQtyMaxValue() int64 { + return math.MaxInt64 +} + +func (*CancelOrderListResponseOrderReports) OrigQuoteOrderQtyNullValue() int64 { + return math.MinInt64 +} + +func (*CancelOrderListResponseOrderReports) PegPriceTypeId() uint16 { + return 24 +} + +func (*CancelOrderListResponseOrderReports) PegPriceTypeSinceVersion() uint16 { + return 1 +} + +func (c *CancelOrderListResponseOrderReports) PegPriceTypeInActingVersion(actingVersion uint16) bool { + return actingVersion >= c.PegPriceTypeSinceVersion() +} + +func (*CancelOrderListResponseOrderReports) PegPriceTypeDeprecated() uint16 { + return 0 +} + +func (*CancelOrderListResponseOrderReports) PegPriceTypeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*CancelOrderListResponseOrderReports) PegOffsetTypeId() uint16 { + return 25 +} + +func (*CancelOrderListResponseOrderReports) PegOffsetTypeSinceVersion() uint16 { + return 1 +} + +func (c *CancelOrderListResponseOrderReports) PegOffsetTypeInActingVersion(actingVersion uint16) bool { + return actingVersion >= c.PegOffsetTypeSinceVersion() +} + +func (*CancelOrderListResponseOrderReports) PegOffsetTypeDeprecated() uint16 { + return 0 +} + +func (*CancelOrderListResponseOrderReports) PegOffsetTypeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*CancelOrderListResponseOrderReports) PegOffsetValueId() uint16 { + return 26 +} + +func (*CancelOrderListResponseOrderReports) PegOffsetValueSinceVersion() uint16 { + return 1 +} + +func (c *CancelOrderListResponseOrderReports) PegOffsetValueInActingVersion(actingVersion uint16) bool { + return actingVersion >= c.PegOffsetValueSinceVersion() +} + +func (*CancelOrderListResponseOrderReports) PegOffsetValueDeprecated() uint16 { + return 0 +} + +func (*CancelOrderListResponseOrderReports) PegOffsetValueMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*CancelOrderListResponseOrderReports) PegOffsetValueMinValue() uint8 { + return 0 +} + +func (*CancelOrderListResponseOrderReports) PegOffsetValueMaxValue() uint8 { + return math.MaxUint8 - 1 +} + +func (*CancelOrderListResponseOrderReports) PegOffsetValueNullValue() uint8 { + return math.MaxUint8 +} + +func (*CancelOrderListResponseOrderReports) PeggedPriceId() uint16 { + return 27 +} + +func (*CancelOrderListResponseOrderReports) PeggedPriceSinceVersion() uint16 { + return 1 +} + +func (c *CancelOrderListResponseOrderReports) PeggedPriceInActingVersion(actingVersion uint16) bool { + return actingVersion >= c.PeggedPriceSinceVersion() +} + +func (*CancelOrderListResponseOrderReports) PeggedPriceDeprecated() uint16 { + return 0 +} + +func (*CancelOrderListResponseOrderReports) PeggedPriceMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*CancelOrderListResponseOrderReports) PeggedPriceMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*CancelOrderListResponseOrderReports) PeggedPriceMaxValue() int64 { + return math.MaxInt64 +} + +func (*CancelOrderListResponseOrderReports) PeggedPriceNullValue() int64 { + return math.MinInt64 +} + +func (*CancelOrderListResponseOrderReports) SymbolMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*CancelOrderListResponseOrderReports) SymbolSinceVersion() uint16 { + return 0 +} + +func (c *CancelOrderListResponseOrderReports) SymbolInActingVersion(actingVersion uint16) bool { + return actingVersion >= c.SymbolSinceVersion() +} + +func (*CancelOrderListResponseOrderReports) SymbolDeprecated() uint16 { + return 0 +} + +func (CancelOrderListResponseOrderReports) SymbolCharacterEncoding() string { + return "UTF-8" +} + +func (CancelOrderListResponseOrderReports) SymbolHeaderLength() uint64 { + return 1 +} + +func (*CancelOrderListResponseOrderReports) OrigClientOrderIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*CancelOrderListResponseOrderReports) OrigClientOrderIdSinceVersion() uint16 { + return 0 +} + +func (c *CancelOrderListResponseOrderReports) OrigClientOrderIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= c.OrigClientOrderIdSinceVersion() +} + +func (*CancelOrderListResponseOrderReports) OrigClientOrderIdDeprecated() uint16 { + return 0 +} + +func (CancelOrderListResponseOrderReports) OrigClientOrderIdCharacterEncoding() string { + return "UTF-8" +} + +func (CancelOrderListResponseOrderReports) OrigClientOrderIdHeaderLength() uint64 { + return 1 +} + +func (*CancelOrderListResponseOrderReports) ClientOrderIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*CancelOrderListResponseOrderReports) ClientOrderIdSinceVersion() uint16 { + return 0 +} + +func (c *CancelOrderListResponseOrderReports) ClientOrderIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= c.ClientOrderIdSinceVersion() +} + +func (*CancelOrderListResponseOrderReports) ClientOrderIdDeprecated() uint16 { + return 0 +} + +func (CancelOrderListResponseOrderReports) ClientOrderIdCharacterEncoding() string { + return "UTF-8" +} + +func (CancelOrderListResponseOrderReports) ClientOrderIdHeaderLength() uint64 { + return 1 +} + +func (*CancelOrderListResponse) OrdersId() uint16 { + return 100 +} + +func (*CancelOrderListResponse) OrdersSinceVersion() uint16 { + return 0 +} + +func (c *CancelOrderListResponse) OrdersInActingVersion(actingVersion uint16) bool { + return actingVersion >= c.OrdersSinceVersion() +} + +func (*CancelOrderListResponse) OrdersDeprecated() uint16 { + return 0 +} + +func (*CancelOrderListResponseOrders) SbeBlockLength() (blockLength uint) { + return 8 +} + +func (*CancelOrderListResponseOrders) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} + +func (*CancelOrderListResponse) OrderReportsId() uint16 { + return 101 +} + +func (*CancelOrderListResponse) OrderReportsSinceVersion() uint16 { + return 0 +} + +func (c *CancelOrderListResponse) OrderReportsInActingVersion(actingVersion uint16) bool { + return actingVersion >= c.OrderReportsSinceVersion() +} + +func (*CancelOrderListResponse) OrderReportsDeprecated() uint16 { + return 0 +} + +func (*CancelOrderListResponseOrderReports) SbeBlockLength() (blockLength uint) { + return 135 +} + +func (*CancelOrderListResponseOrderReports) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} + +func (*CancelOrderListResponse) ListClientOrderIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*CancelOrderListResponse) ListClientOrderIdSinceVersion() uint16 { + return 0 +} + +func (c *CancelOrderListResponse) ListClientOrderIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= c.ListClientOrderIdSinceVersion() +} + +func (*CancelOrderListResponse) ListClientOrderIdDeprecated() uint16 { + return 0 +} + +func (CancelOrderListResponse) ListClientOrderIdCharacterEncoding() string { + return "UTF-8" +} + +func (CancelOrderListResponse) ListClientOrderIdHeaderLength() uint64 { + return 1 +} + +func (*CancelOrderListResponse) SymbolMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*CancelOrderListResponse) SymbolSinceVersion() uint16 { + return 0 +} + +func (c *CancelOrderListResponse) SymbolInActingVersion(actingVersion uint16) bool { + return actingVersion >= c.SymbolSinceVersion() +} + +func (*CancelOrderListResponse) SymbolDeprecated() uint16 { + return 0 +} + +func (CancelOrderListResponse) SymbolCharacterEncoding() string { + return "UTF-8" +} + +func (CancelOrderListResponse) SymbolHeaderLength() uint64 { + return 1 +} diff --git a/v2/sbe/spot_3_1/CancelOrderResponse.go b/v2/sbe/spot_3_1/CancelOrderResponse.go new file mode 100644 index 00000000..ff1032ca --- /dev/null +++ b/v2/sbe/spot_3_1/CancelOrderResponse.go @@ -0,0 +1,1773 @@ +// Generated SBE (Simple Binary Encoding) message codec + +package sbe + +import ( + "errors" + "fmt" + "io" + "io/ioutil" + "math" + "unicode/utf8" +) + +type CancelOrderResponse struct { + PriceExponent int8 + QtyExponent int8 + OrderId int64 + OrderListId int64 + TransactTime int64 + Price int64 + OrigQty int64 + ExecutedQty int64 + CummulativeQuoteQty int64 + Status OrderStatusEnum + TimeInForce TimeInForceEnum + OrderType OrderTypeEnum + Side OrderSideEnum + StopPrice int64 + TrailingDelta int64 + TrailingTime int64 + IcebergQty int64 + StrategyId int64 + StrategyType int32 + OrderCapacity OrderCapacityEnum + WorkingFloor FloorEnum + SelfTradePreventionMode SelfTradePreventionModeEnum + PreventedQuantity int64 + UsedSor BoolEnumEnum + OrigQuoteOrderQty int64 + PegPriceType PegPriceTypeEnum + PegOffsetType PegOffsetTypeEnum + PegOffsetValue uint8 + PeggedPrice int64 + Symbol []uint8 + OrigClientOrderId []uint8 + ClientOrderId []uint8 +} + +func (c *CancelOrderResponse) Encode(_m *SbeGoMarshaller, _w io.Writer, doRangeCheck bool) error { + if doRangeCheck { + if err := c.RangeCheck(c.SbeSchemaVersion(), c.SbeSchemaVersion()); err != nil { + return err + } + } + if err := _m.WriteInt8(_w, c.PriceExponent); err != nil { + return err + } + if err := _m.WriteInt8(_w, c.QtyExponent); err != nil { + return err + } + if err := _m.WriteInt64(_w, c.OrderId); err != nil { + return err + } + if err := _m.WriteInt64(_w, c.OrderListId); err != nil { + return err + } + if err := _m.WriteInt64(_w, c.TransactTime); err != nil { + return err + } + if err := _m.WriteInt64(_w, c.Price); err != nil { + return err + } + if err := _m.WriteInt64(_w, c.OrigQty); err != nil { + return err + } + if err := _m.WriteInt64(_w, c.ExecutedQty); err != nil { + return err + } + if err := _m.WriteInt64(_w, c.CummulativeQuoteQty); err != nil { + return err + } + if err := c.Status.Encode(_m, _w); err != nil { + return err + } + if err := c.TimeInForce.Encode(_m, _w); err != nil { + return err + } + if err := c.OrderType.Encode(_m, _w); err != nil { + return err + } + if err := c.Side.Encode(_m, _w); err != nil { + return err + } + if err := _m.WriteInt64(_w, c.StopPrice); err != nil { + return err + } + if err := _m.WriteInt64(_w, c.TrailingDelta); err != nil { + return err + } + if err := _m.WriteInt64(_w, c.TrailingTime); err != nil { + return err + } + if err := _m.WriteInt64(_w, c.IcebergQty); err != nil { + return err + } + if err := _m.WriteInt64(_w, c.StrategyId); err != nil { + return err + } + if err := _m.WriteInt32(_w, c.StrategyType); err != nil { + return err + } + if err := c.OrderCapacity.Encode(_m, _w); err != nil { + return err + } + if err := c.WorkingFloor.Encode(_m, _w); err != nil { + return err + } + if err := c.SelfTradePreventionMode.Encode(_m, _w); err != nil { + return err + } + if err := _m.WriteInt64(_w, c.PreventedQuantity); err != nil { + return err + } + if err := c.UsedSor.Encode(_m, _w); err != nil { + return err + } + if err := _m.WriteInt64(_w, c.OrigQuoteOrderQty); err != nil { + return err + } + if err := c.PegPriceType.Encode(_m, _w); err != nil { + return err + } + if err := c.PegOffsetType.Encode(_m, _w); err != nil { + return err + } + if err := _m.WriteUint8(_w, c.PegOffsetValue); err != nil { + return err + } + if err := _m.WriteInt64(_w, c.PeggedPrice); err != nil { + return err + } + if err := _m.WriteUint8(_w, uint8(len(c.Symbol))); err != nil { + return err + } + if err := _m.WriteBytes(_w, c.Symbol); err != nil { + return err + } + if err := _m.WriteUint8(_w, uint8(len(c.OrigClientOrderId))); err != nil { + return err + } + if err := _m.WriteBytes(_w, c.OrigClientOrderId); err != nil { + return err + } + if err := _m.WriteUint8(_w, uint8(len(c.ClientOrderId))); err != nil { + return err + } + if err := _m.WriteBytes(_w, c.ClientOrderId); err != nil { + return err + } + return nil +} + +func (c *CancelOrderResponse) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint16, doRangeCheck bool) error { + if !c.PriceExponentInActingVersion(actingVersion) { + c.PriceExponent = c.PriceExponentNullValue() + } else { + if err := _m.ReadInt8(_r, &c.PriceExponent); err != nil { + return err + } + } + if !c.QtyExponentInActingVersion(actingVersion) { + c.QtyExponent = c.QtyExponentNullValue() + } else { + if err := _m.ReadInt8(_r, &c.QtyExponent); err != nil { + return err + } + } + if !c.OrderIdInActingVersion(actingVersion) { + c.OrderId = c.OrderIdNullValue() + } else { + if err := _m.ReadInt64(_r, &c.OrderId); err != nil { + return err + } + } + if !c.OrderListIdInActingVersion(actingVersion) { + c.OrderListId = c.OrderListIdNullValue() + } else { + if err := _m.ReadInt64(_r, &c.OrderListId); err != nil { + return err + } + } + if !c.TransactTimeInActingVersion(actingVersion) { + c.TransactTime = c.TransactTimeNullValue() + } else { + if err := _m.ReadInt64(_r, &c.TransactTime); err != nil { + return err + } + } + if !c.PriceInActingVersion(actingVersion) { + c.Price = c.PriceNullValue() + } else { + if err := _m.ReadInt64(_r, &c.Price); err != nil { + return err + } + } + if !c.OrigQtyInActingVersion(actingVersion) { + c.OrigQty = c.OrigQtyNullValue() + } else { + if err := _m.ReadInt64(_r, &c.OrigQty); err != nil { + return err + } + } + if !c.ExecutedQtyInActingVersion(actingVersion) { + c.ExecutedQty = c.ExecutedQtyNullValue() + } else { + if err := _m.ReadInt64(_r, &c.ExecutedQty); err != nil { + return err + } + } + if !c.CummulativeQuoteQtyInActingVersion(actingVersion) { + c.CummulativeQuoteQty = c.CummulativeQuoteQtyNullValue() + } else { + if err := _m.ReadInt64(_r, &c.CummulativeQuoteQty); err != nil { + return err + } + } + if c.StatusInActingVersion(actingVersion) { + if err := c.Status.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if c.TimeInForceInActingVersion(actingVersion) { + if err := c.TimeInForce.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if c.OrderTypeInActingVersion(actingVersion) { + if err := c.OrderType.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if c.SideInActingVersion(actingVersion) { + if err := c.Side.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if !c.StopPriceInActingVersion(actingVersion) { + c.StopPrice = c.StopPriceNullValue() + } else { + if err := _m.ReadInt64(_r, &c.StopPrice); err != nil { + return err + } + } + if !c.TrailingDeltaInActingVersion(actingVersion) { + c.TrailingDelta = c.TrailingDeltaNullValue() + } else { + if err := _m.ReadInt64(_r, &c.TrailingDelta); err != nil { + return err + } + } + if !c.TrailingTimeInActingVersion(actingVersion) { + c.TrailingTime = c.TrailingTimeNullValue() + } else { + if err := _m.ReadInt64(_r, &c.TrailingTime); err != nil { + return err + } + } + if !c.IcebergQtyInActingVersion(actingVersion) { + c.IcebergQty = c.IcebergQtyNullValue() + } else { + if err := _m.ReadInt64(_r, &c.IcebergQty); err != nil { + return err + } + } + if !c.StrategyIdInActingVersion(actingVersion) { + c.StrategyId = c.StrategyIdNullValue() + } else { + if err := _m.ReadInt64(_r, &c.StrategyId); err != nil { + return err + } + } + if !c.StrategyTypeInActingVersion(actingVersion) { + c.StrategyType = c.StrategyTypeNullValue() + } else { + if err := _m.ReadInt32(_r, &c.StrategyType); err != nil { + return err + } + } + if c.OrderCapacityInActingVersion(actingVersion) { + if err := c.OrderCapacity.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if c.WorkingFloorInActingVersion(actingVersion) { + if err := c.WorkingFloor.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if c.SelfTradePreventionModeInActingVersion(actingVersion) { + if err := c.SelfTradePreventionMode.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if !c.PreventedQuantityInActingVersion(actingVersion) { + c.PreventedQuantity = c.PreventedQuantityNullValue() + } else { + if err := _m.ReadInt64(_r, &c.PreventedQuantity); err != nil { + return err + } + } + if c.UsedSorInActingVersion(actingVersion) { + if err := c.UsedSor.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if !c.OrigQuoteOrderQtyInActingVersion(actingVersion) { + c.OrigQuoteOrderQty = c.OrigQuoteOrderQtyNullValue() + } else { + if err := _m.ReadInt64(_r, &c.OrigQuoteOrderQty); err != nil { + return err + } + } + if c.PegPriceTypeInActingVersion(actingVersion) { + if err := c.PegPriceType.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if c.PegOffsetTypeInActingVersion(actingVersion) { + if err := c.PegOffsetType.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if !c.PegOffsetValueInActingVersion(actingVersion) { + c.PegOffsetValue = c.PegOffsetValueNullValue() + } else { + if err := _m.ReadUint8(_r, &c.PegOffsetValue); err != nil { + return err + } + } + if !c.PeggedPriceInActingVersion(actingVersion) { + c.PeggedPrice = c.PeggedPriceNullValue() + } else { + if err := _m.ReadInt64(_r, &c.PeggedPrice); err != nil { + return err + } + } + if actingVersion > c.SbeSchemaVersion() && blockLength > c.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-c.SbeBlockLength())) + } + + if c.SymbolInActingVersion(actingVersion) { + var SymbolLength uint8 + if err := _m.ReadUint8(_r, &SymbolLength); err != nil { + return err + } + if cap(c.Symbol) < int(SymbolLength) { + c.Symbol = make([]uint8, SymbolLength) + } + c.Symbol = c.Symbol[:SymbolLength] + if err := _m.ReadBytes(_r, c.Symbol); err != nil { + return err + } + } + + if c.OrigClientOrderIdInActingVersion(actingVersion) { + var OrigClientOrderIdLength uint8 + if err := _m.ReadUint8(_r, &OrigClientOrderIdLength); err != nil { + return err + } + if cap(c.OrigClientOrderId) < int(OrigClientOrderIdLength) { + c.OrigClientOrderId = make([]uint8, OrigClientOrderIdLength) + } + c.OrigClientOrderId = c.OrigClientOrderId[:OrigClientOrderIdLength] + if err := _m.ReadBytes(_r, c.OrigClientOrderId); err != nil { + return err + } + } + + if c.ClientOrderIdInActingVersion(actingVersion) { + var ClientOrderIdLength uint8 + if err := _m.ReadUint8(_r, &ClientOrderIdLength); err != nil { + return err + } + if cap(c.ClientOrderId) < int(ClientOrderIdLength) { + c.ClientOrderId = make([]uint8, ClientOrderIdLength) + } + c.ClientOrderId = c.ClientOrderId[:ClientOrderIdLength] + if err := _m.ReadBytes(_r, c.ClientOrderId); err != nil { + return err + } + } + if doRangeCheck { + if err := c.RangeCheck(actingVersion, c.SbeSchemaVersion()); err != nil { + return err + } + } + return nil +} + +func (c *CancelOrderResponse) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if c.PriceExponentInActingVersion(actingVersion) { + if c.PriceExponent < c.PriceExponentMinValue() || c.PriceExponent > c.PriceExponentMaxValue() { + return fmt.Errorf("Range check failed on c.PriceExponent (%v < %v > %v)", c.PriceExponentMinValue(), c.PriceExponent, c.PriceExponentMaxValue()) + } + } + if c.QtyExponentInActingVersion(actingVersion) { + if c.QtyExponent < c.QtyExponentMinValue() || c.QtyExponent > c.QtyExponentMaxValue() { + return fmt.Errorf("Range check failed on c.QtyExponent (%v < %v > %v)", c.QtyExponentMinValue(), c.QtyExponent, c.QtyExponentMaxValue()) + } + } + if c.OrderIdInActingVersion(actingVersion) { + if c.OrderId < c.OrderIdMinValue() || c.OrderId > c.OrderIdMaxValue() { + return fmt.Errorf("Range check failed on c.OrderId (%v < %v > %v)", c.OrderIdMinValue(), c.OrderId, c.OrderIdMaxValue()) + } + } + if c.OrderListIdInActingVersion(actingVersion) { + if c.OrderListId != c.OrderListIdNullValue() && (c.OrderListId < c.OrderListIdMinValue() || c.OrderListId > c.OrderListIdMaxValue()) { + return fmt.Errorf("Range check failed on c.OrderListId (%v < %v > %v)", c.OrderListIdMinValue(), c.OrderListId, c.OrderListIdMaxValue()) + } + } + if c.TransactTimeInActingVersion(actingVersion) { + if c.TransactTime < c.TransactTimeMinValue() || c.TransactTime > c.TransactTimeMaxValue() { + return fmt.Errorf("Range check failed on c.TransactTime (%v < %v > %v)", c.TransactTimeMinValue(), c.TransactTime, c.TransactTimeMaxValue()) + } + } + if c.PriceInActingVersion(actingVersion) { + if c.Price < c.PriceMinValue() || c.Price > c.PriceMaxValue() { + return fmt.Errorf("Range check failed on c.Price (%v < %v > %v)", c.PriceMinValue(), c.Price, c.PriceMaxValue()) + } + } + if c.OrigQtyInActingVersion(actingVersion) { + if c.OrigQty < c.OrigQtyMinValue() || c.OrigQty > c.OrigQtyMaxValue() { + return fmt.Errorf("Range check failed on c.OrigQty (%v < %v > %v)", c.OrigQtyMinValue(), c.OrigQty, c.OrigQtyMaxValue()) + } + } + if c.ExecutedQtyInActingVersion(actingVersion) { + if c.ExecutedQty < c.ExecutedQtyMinValue() || c.ExecutedQty > c.ExecutedQtyMaxValue() { + return fmt.Errorf("Range check failed on c.ExecutedQty (%v < %v > %v)", c.ExecutedQtyMinValue(), c.ExecutedQty, c.ExecutedQtyMaxValue()) + } + } + if c.CummulativeQuoteQtyInActingVersion(actingVersion) { + if c.CummulativeQuoteQty < c.CummulativeQuoteQtyMinValue() || c.CummulativeQuoteQty > c.CummulativeQuoteQtyMaxValue() { + return fmt.Errorf("Range check failed on c.CummulativeQuoteQty (%v < %v > %v)", c.CummulativeQuoteQtyMinValue(), c.CummulativeQuoteQty, c.CummulativeQuoteQtyMaxValue()) + } + } + if err := c.Status.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if err := c.TimeInForce.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if err := c.OrderType.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if err := c.Side.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if c.StopPriceInActingVersion(actingVersion) { + if c.StopPrice != c.StopPriceNullValue() && (c.StopPrice < c.StopPriceMinValue() || c.StopPrice > c.StopPriceMaxValue()) { + return fmt.Errorf("Range check failed on c.StopPrice (%v < %v > %v)", c.StopPriceMinValue(), c.StopPrice, c.StopPriceMaxValue()) + } + } + if c.TrailingDeltaInActingVersion(actingVersion) { + if c.TrailingDelta != c.TrailingDeltaNullValue() && (c.TrailingDelta < c.TrailingDeltaMinValue() || c.TrailingDelta > c.TrailingDeltaMaxValue()) { + return fmt.Errorf("Range check failed on c.TrailingDelta (%v < %v > %v)", c.TrailingDeltaMinValue(), c.TrailingDelta, c.TrailingDeltaMaxValue()) + } + } + if c.TrailingTimeInActingVersion(actingVersion) { + if c.TrailingTime != c.TrailingTimeNullValue() && (c.TrailingTime < c.TrailingTimeMinValue() || c.TrailingTime > c.TrailingTimeMaxValue()) { + return fmt.Errorf("Range check failed on c.TrailingTime (%v < %v > %v)", c.TrailingTimeMinValue(), c.TrailingTime, c.TrailingTimeMaxValue()) + } + } + if c.IcebergQtyInActingVersion(actingVersion) { + if c.IcebergQty != c.IcebergQtyNullValue() && (c.IcebergQty < c.IcebergQtyMinValue() || c.IcebergQty > c.IcebergQtyMaxValue()) { + return fmt.Errorf("Range check failed on c.IcebergQty (%v < %v > %v)", c.IcebergQtyMinValue(), c.IcebergQty, c.IcebergQtyMaxValue()) + } + } + if c.StrategyIdInActingVersion(actingVersion) { + if c.StrategyId != c.StrategyIdNullValue() && (c.StrategyId < c.StrategyIdMinValue() || c.StrategyId > c.StrategyIdMaxValue()) { + return fmt.Errorf("Range check failed on c.StrategyId (%v < %v > %v)", c.StrategyIdMinValue(), c.StrategyId, c.StrategyIdMaxValue()) + } + } + if c.StrategyTypeInActingVersion(actingVersion) { + if c.StrategyType != c.StrategyTypeNullValue() && (c.StrategyType < c.StrategyTypeMinValue() || c.StrategyType > c.StrategyTypeMaxValue()) { + return fmt.Errorf("Range check failed on c.StrategyType (%v < %v > %v)", c.StrategyTypeMinValue(), c.StrategyType, c.StrategyTypeMaxValue()) + } + } + if err := c.OrderCapacity.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if err := c.WorkingFloor.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if err := c.SelfTradePreventionMode.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if c.PreventedQuantityInActingVersion(actingVersion) { + if c.PreventedQuantity < c.PreventedQuantityMinValue() || c.PreventedQuantity > c.PreventedQuantityMaxValue() { + return fmt.Errorf("Range check failed on c.PreventedQuantity (%v < %v > %v)", c.PreventedQuantityMinValue(), c.PreventedQuantity, c.PreventedQuantityMaxValue()) + } + } + if err := c.UsedSor.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if c.OrigQuoteOrderQtyInActingVersion(actingVersion) { + if c.OrigQuoteOrderQty < c.OrigQuoteOrderQtyMinValue() || c.OrigQuoteOrderQty > c.OrigQuoteOrderQtyMaxValue() { + return fmt.Errorf("Range check failed on c.OrigQuoteOrderQty (%v < %v > %v)", c.OrigQuoteOrderQtyMinValue(), c.OrigQuoteOrderQty, c.OrigQuoteOrderQtyMaxValue()) + } + } + if err := c.PegPriceType.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if err := c.PegOffsetType.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if c.PegOffsetValueInActingVersion(actingVersion) { + if c.PegOffsetValue != c.PegOffsetValueNullValue() && (c.PegOffsetValue < c.PegOffsetValueMinValue() || c.PegOffsetValue > c.PegOffsetValueMaxValue()) { + return fmt.Errorf("Range check failed on c.PegOffsetValue (%v < %v > %v)", c.PegOffsetValueMinValue(), c.PegOffsetValue, c.PegOffsetValueMaxValue()) + } + } + if c.PeggedPriceInActingVersion(actingVersion) { + if c.PeggedPrice != c.PeggedPriceNullValue() && (c.PeggedPrice < c.PeggedPriceMinValue() || c.PeggedPrice > c.PeggedPriceMaxValue()) { + return fmt.Errorf("Range check failed on c.PeggedPrice (%v < %v > %v)", c.PeggedPriceMinValue(), c.PeggedPrice, c.PeggedPriceMaxValue()) + } + } + if !utf8.Valid(c.Symbol[:]) { + return errors.New("c.Symbol failed UTF-8 validation") + } + if !utf8.Valid(c.OrigClientOrderId[:]) { + return errors.New("c.OrigClientOrderId failed UTF-8 validation") + } + if !utf8.Valid(c.ClientOrderId[:]) { + return errors.New("c.ClientOrderId failed UTF-8 validation") + } + return nil +} + +func CancelOrderResponseInit(c *CancelOrderResponse) { + c.OrderListId = math.MinInt64 + c.StopPrice = math.MinInt64 + c.TrailingDelta = math.MinInt64 + c.TrailingTime = math.MinInt64 + c.IcebergQty = math.MinInt64 + c.StrategyId = math.MinInt64 + c.StrategyType = math.MinInt32 + c.PegOffsetValue = math.MaxUint8 + c.PeggedPrice = math.MinInt64 + return +} + +func (*CancelOrderResponse) SbeBlockLength() (blockLength uint16) { + return 137 +} + +func (*CancelOrderResponse) SbeTemplateId() (templateId uint16) { + return 305 +} + +func (*CancelOrderResponse) SbeSchemaId() (schemaId uint16) { + return 3 +} + +func (*CancelOrderResponse) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} + +func (*CancelOrderResponse) SbeSemanticType() (semanticType []byte) { + return []byte("") +} + +func (*CancelOrderResponse) SbeSemanticVersion() (semanticVersion string) { + return "5.2" +} + +func (*CancelOrderResponse) PriceExponentId() uint16 { + return 1 +} + +func (*CancelOrderResponse) PriceExponentSinceVersion() uint16 { + return 0 +} + +func (c *CancelOrderResponse) PriceExponentInActingVersion(actingVersion uint16) bool { + return actingVersion >= c.PriceExponentSinceVersion() +} + +func (*CancelOrderResponse) PriceExponentDeprecated() uint16 { + return 0 +} + +func (*CancelOrderResponse) PriceExponentMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*CancelOrderResponse) PriceExponentMinValue() int8 { + return math.MinInt8 + 1 +} + +func (*CancelOrderResponse) PriceExponentMaxValue() int8 { + return math.MaxInt8 +} + +func (*CancelOrderResponse) PriceExponentNullValue() int8 { + return math.MinInt8 +} + +func (*CancelOrderResponse) QtyExponentId() uint16 { + return 2 +} + +func (*CancelOrderResponse) QtyExponentSinceVersion() uint16 { + return 0 +} + +func (c *CancelOrderResponse) QtyExponentInActingVersion(actingVersion uint16) bool { + return actingVersion >= c.QtyExponentSinceVersion() +} + +func (*CancelOrderResponse) QtyExponentDeprecated() uint16 { + return 0 +} + +func (*CancelOrderResponse) QtyExponentMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*CancelOrderResponse) QtyExponentMinValue() int8 { + return math.MinInt8 + 1 +} + +func (*CancelOrderResponse) QtyExponentMaxValue() int8 { + return math.MaxInt8 +} + +func (*CancelOrderResponse) QtyExponentNullValue() int8 { + return math.MinInt8 +} + +func (*CancelOrderResponse) OrderIdId() uint16 { + return 3 +} + +func (*CancelOrderResponse) OrderIdSinceVersion() uint16 { + return 0 +} + +func (c *CancelOrderResponse) OrderIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= c.OrderIdSinceVersion() +} + +func (*CancelOrderResponse) OrderIdDeprecated() uint16 { + return 0 +} + +func (*CancelOrderResponse) OrderIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*CancelOrderResponse) OrderIdMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*CancelOrderResponse) OrderIdMaxValue() int64 { + return math.MaxInt64 +} + +func (*CancelOrderResponse) OrderIdNullValue() int64 { + return math.MinInt64 +} + +func (*CancelOrderResponse) OrderListIdId() uint16 { + return 4 +} + +func (*CancelOrderResponse) OrderListIdSinceVersion() uint16 { + return 0 +} + +func (c *CancelOrderResponse) OrderListIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= c.OrderListIdSinceVersion() +} + +func (*CancelOrderResponse) OrderListIdDeprecated() uint16 { + return 0 +} + +func (*CancelOrderResponse) OrderListIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*CancelOrderResponse) OrderListIdMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*CancelOrderResponse) OrderListIdMaxValue() int64 { + return math.MaxInt64 +} + +func (*CancelOrderResponse) OrderListIdNullValue() int64 { + return math.MinInt64 +} + +func (*CancelOrderResponse) TransactTimeId() uint16 { + return 5 +} + +func (*CancelOrderResponse) TransactTimeSinceVersion() uint16 { + return 0 +} + +func (c *CancelOrderResponse) TransactTimeInActingVersion(actingVersion uint16) bool { + return actingVersion >= c.TransactTimeSinceVersion() +} + +func (*CancelOrderResponse) TransactTimeDeprecated() uint16 { + return 0 +} + +func (*CancelOrderResponse) TransactTimeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*CancelOrderResponse) TransactTimeMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*CancelOrderResponse) TransactTimeMaxValue() int64 { + return math.MaxInt64 +} + +func (*CancelOrderResponse) TransactTimeNullValue() int64 { + return math.MinInt64 +} + +func (*CancelOrderResponse) PriceId() uint16 { + return 6 +} + +func (*CancelOrderResponse) PriceSinceVersion() uint16 { + return 0 +} + +func (c *CancelOrderResponse) PriceInActingVersion(actingVersion uint16) bool { + return actingVersion >= c.PriceSinceVersion() +} + +func (*CancelOrderResponse) PriceDeprecated() uint16 { + return 0 +} + +func (*CancelOrderResponse) PriceMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*CancelOrderResponse) PriceMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*CancelOrderResponse) PriceMaxValue() int64 { + return math.MaxInt64 +} + +func (*CancelOrderResponse) PriceNullValue() int64 { + return math.MinInt64 +} + +func (*CancelOrderResponse) OrigQtyId() uint16 { + return 7 +} + +func (*CancelOrderResponse) OrigQtySinceVersion() uint16 { + return 0 +} + +func (c *CancelOrderResponse) OrigQtyInActingVersion(actingVersion uint16) bool { + return actingVersion >= c.OrigQtySinceVersion() +} + +func (*CancelOrderResponse) OrigQtyDeprecated() uint16 { + return 0 +} + +func (*CancelOrderResponse) OrigQtyMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*CancelOrderResponse) OrigQtyMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*CancelOrderResponse) OrigQtyMaxValue() int64 { + return math.MaxInt64 +} + +func (*CancelOrderResponse) OrigQtyNullValue() int64 { + return math.MinInt64 +} + +func (*CancelOrderResponse) ExecutedQtyId() uint16 { + return 8 +} + +func (*CancelOrderResponse) ExecutedQtySinceVersion() uint16 { + return 0 +} + +func (c *CancelOrderResponse) ExecutedQtyInActingVersion(actingVersion uint16) bool { + return actingVersion >= c.ExecutedQtySinceVersion() +} + +func (*CancelOrderResponse) ExecutedQtyDeprecated() uint16 { + return 0 +} + +func (*CancelOrderResponse) ExecutedQtyMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*CancelOrderResponse) ExecutedQtyMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*CancelOrderResponse) ExecutedQtyMaxValue() int64 { + return math.MaxInt64 +} + +func (*CancelOrderResponse) ExecutedQtyNullValue() int64 { + return math.MinInt64 +} + +func (*CancelOrderResponse) CummulativeQuoteQtyId() uint16 { + return 9 +} + +func (*CancelOrderResponse) CummulativeQuoteQtySinceVersion() uint16 { + return 0 +} + +func (c *CancelOrderResponse) CummulativeQuoteQtyInActingVersion(actingVersion uint16) bool { + return actingVersion >= c.CummulativeQuoteQtySinceVersion() +} + +func (*CancelOrderResponse) CummulativeQuoteQtyDeprecated() uint16 { + return 0 +} + +func (*CancelOrderResponse) CummulativeQuoteQtyMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*CancelOrderResponse) CummulativeQuoteQtyMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*CancelOrderResponse) CummulativeQuoteQtyMaxValue() int64 { + return math.MaxInt64 +} + +func (*CancelOrderResponse) CummulativeQuoteQtyNullValue() int64 { + return math.MinInt64 +} + +func (*CancelOrderResponse) StatusId() uint16 { + return 10 +} + +func (*CancelOrderResponse) StatusSinceVersion() uint16 { + return 0 +} + +func (c *CancelOrderResponse) StatusInActingVersion(actingVersion uint16) bool { + return actingVersion >= c.StatusSinceVersion() +} + +func (*CancelOrderResponse) StatusDeprecated() uint16 { + return 0 +} + +func (*CancelOrderResponse) StatusMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*CancelOrderResponse) TimeInForceId() uint16 { + return 11 +} + +func (*CancelOrderResponse) TimeInForceSinceVersion() uint16 { + return 0 +} + +func (c *CancelOrderResponse) TimeInForceInActingVersion(actingVersion uint16) bool { + return actingVersion >= c.TimeInForceSinceVersion() +} + +func (*CancelOrderResponse) TimeInForceDeprecated() uint16 { + return 0 +} + +func (*CancelOrderResponse) TimeInForceMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*CancelOrderResponse) OrderTypeId() uint16 { + return 12 +} + +func (*CancelOrderResponse) OrderTypeSinceVersion() uint16 { + return 0 +} + +func (c *CancelOrderResponse) OrderTypeInActingVersion(actingVersion uint16) bool { + return actingVersion >= c.OrderTypeSinceVersion() +} + +func (*CancelOrderResponse) OrderTypeDeprecated() uint16 { + return 0 +} + +func (*CancelOrderResponse) OrderTypeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*CancelOrderResponse) SideId() uint16 { + return 13 +} + +func (*CancelOrderResponse) SideSinceVersion() uint16 { + return 0 +} + +func (c *CancelOrderResponse) SideInActingVersion(actingVersion uint16) bool { + return actingVersion >= c.SideSinceVersion() +} + +func (*CancelOrderResponse) SideDeprecated() uint16 { + return 0 +} + +func (*CancelOrderResponse) SideMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*CancelOrderResponse) StopPriceId() uint16 { + return 14 +} + +func (*CancelOrderResponse) StopPriceSinceVersion() uint16 { + return 0 +} + +func (c *CancelOrderResponse) StopPriceInActingVersion(actingVersion uint16) bool { + return actingVersion >= c.StopPriceSinceVersion() +} + +func (*CancelOrderResponse) StopPriceDeprecated() uint16 { + return 0 +} + +func (*CancelOrderResponse) StopPriceMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*CancelOrderResponse) StopPriceMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*CancelOrderResponse) StopPriceMaxValue() int64 { + return math.MaxInt64 +} + +func (*CancelOrderResponse) StopPriceNullValue() int64 { + return math.MinInt64 +} + +func (*CancelOrderResponse) TrailingDeltaId() uint16 { + return 15 +} + +func (*CancelOrderResponse) TrailingDeltaSinceVersion() uint16 { + return 0 +} + +func (c *CancelOrderResponse) TrailingDeltaInActingVersion(actingVersion uint16) bool { + return actingVersion >= c.TrailingDeltaSinceVersion() +} + +func (*CancelOrderResponse) TrailingDeltaDeprecated() uint16 { + return 0 +} + +func (*CancelOrderResponse) TrailingDeltaMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*CancelOrderResponse) TrailingDeltaMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*CancelOrderResponse) TrailingDeltaMaxValue() int64 { + return math.MaxInt64 +} + +func (*CancelOrderResponse) TrailingDeltaNullValue() int64 { + return math.MinInt64 +} + +func (*CancelOrderResponse) TrailingTimeId() uint16 { + return 16 +} + +func (*CancelOrderResponse) TrailingTimeSinceVersion() uint16 { + return 0 +} + +func (c *CancelOrderResponse) TrailingTimeInActingVersion(actingVersion uint16) bool { + return actingVersion >= c.TrailingTimeSinceVersion() +} + +func (*CancelOrderResponse) TrailingTimeDeprecated() uint16 { + return 0 +} + +func (*CancelOrderResponse) TrailingTimeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*CancelOrderResponse) TrailingTimeMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*CancelOrderResponse) TrailingTimeMaxValue() int64 { + return math.MaxInt64 +} + +func (*CancelOrderResponse) TrailingTimeNullValue() int64 { + return math.MinInt64 +} + +func (*CancelOrderResponse) IcebergQtyId() uint16 { + return 17 +} + +func (*CancelOrderResponse) IcebergQtySinceVersion() uint16 { + return 0 +} + +func (c *CancelOrderResponse) IcebergQtyInActingVersion(actingVersion uint16) bool { + return actingVersion >= c.IcebergQtySinceVersion() +} + +func (*CancelOrderResponse) IcebergQtyDeprecated() uint16 { + return 0 +} + +func (*CancelOrderResponse) IcebergQtyMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*CancelOrderResponse) IcebergQtyMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*CancelOrderResponse) IcebergQtyMaxValue() int64 { + return math.MaxInt64 +} + +func (*CancelOrderResponse) IcebergQtyNullValue() int64 { + return math.MinInt64 +} + +func (*CancelOrderResponse) StrategyIdId() uint16 { + return 18 +} + +func (*CancelOrderResponse) StrategyIdSinceVersion() uint16 { + return 0 +} + +func (c *CancelOrderResponse) StrategyIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= c.StrategyIdSinceVersion() +} + +func (*CancelOrderResponse) StrategyIdDeprecated() uint16 { + return 0 +} + +func (*CancelOrderResponse) StrategyIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*CancelOrderResponse) StrategyIdMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*CancelOrderResponse) StrategyIdMaxValue() int64 { + return math.MaxInt64 +} + +func (*CancelOrderResponse) StrategyIdNullValue() int64 { + return math.MinInt64 +} + +func (*CancelOrderResponse) StrategyTypeId() uint16 { + return 19 +} + +func (*CancelOrderResponse) StrategyTypeSinceVersion() uint16 { + return 0 +} + +func (c *CancelOrderResponse) StrategyTypeInActingVersion(actingVersion uint16) bool { + return actingVersion >= c.StrategyTypeSinceVersion() +} + +func (*CancelOrderResponse) StrategyTypeDeprecated() uint16 { + return 0 +} + +func (*CancelOrderResponse) StrategyTypeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*CancelOrderResponse) StrategyTypeMinValue() int32 { + return math.MinInt32 + 1 +} + +func (*CancelOrderResponse) StrategyTypeMaxValue() int32 { + return math.MaxInt32 +} + +func (*CancelOrderResponse) StrategyTypeNullValue() int32 { + return math.MinInt32 +} + +func (*CancelOrderResponse) OrderCapacityId() uint16 { + return 20 +} + +func (*CancelOrderResponse) OrderCapacitySinceVersion() uint16 { + return 0 +} + +func (c *CancelOrderResponse) OrderCapacityInActingVersion(actingVersion uint16) bool { + return actingVersion >= c.OrderCapacitySinceVersion() +} + +func (*CancelOrderResponse) OrderCapacityDeprecated() uint16 { + return 0 +} + +func (*CancelOrderResponse) OrderCapacityMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*CancelOrderResponse) WorkingFloorId() uint16 { + return 21 +} + +func (*CancelOrderResponse) WorkingFloorSinceVersion() uint16 { + return 0 +} + +func (c *CancelOrderResponse) WorkingFloorInActingVersion(actingVersion uint16) bool { + return actingVersion >= c.WorkingFloorSinceVersion() +} + +func (*CancelOrderResponse) WorkingFloorDeprecated() uint16 { + return 0 +} + +func (*CancelOrderResponse) WorkingFloorMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*CancelOrderResponse) SelfTradePreventionModeId() uint16 { + return 22 +} + +func (*CancelOrderResponse) SelfTradePreventionModeSinceVersion() uint16 { + return 0 +} + +func (c *CancelOrderResponse) SelfTradePreventionModeInActingVersion(actingVersion uint16) bool { + return actingVersion >= c.SelfTradePreventionModeSinceVersion() +} + +func (*CancelOrderResponse) SelfTradePreventionModeDeprecated() uint16 { + return 0 +} + +func (*CancelOrderResponse) SelfTradePreventionModeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*CancelOrderResponse) PreventedQuantityId() uint16 { + return 23 +} + +func (*CancelOrderResponse) PreventedQuantitySinceVersion() uint16 { + return 0 +} + +func (c *CancelOrderResponse) PreventedQuantityInActingVersion(actingVersion uint16) bool { + return actingVersion >= c.PreventedQuantitySinceVersion() +} + +func (*CancelOrderResponse) PreventedQuantityDeprecated() uint16 { + return 0 +} + +func (*CancelOrderResponse) PreventedQuantityMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*CancelOrderResponse) PreventedQuantityMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*CancelOrderResponse) PreventedQuantityMaxValue() int64 { + return math.MaxInt64 +} + +func (*CancelOrderResponse) PreventedQuantityNullValue() int64 { + return math.MinInt64 +} + +func (*CancelOrderResponse) UsedSorId() uint16 { + return 24 +} + +func (*CancelOrderResponse) UsedSorSinceVersion() uint16 { + return 0 +} + +func (c *CancelOrderResponse) UsedSorInActingVersion(actingVersion uint16) bool { + return actingVersion >= c.UsedSorSinceVersion() +} + +func (*CancelOrderResponse) UsedSorDeprecated() uint16 { + return 0 +} + +func (*CancelOrderResponse) UsedSorMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*CancelOrderResponse) OrigQuoteOrderQtyId() uint16 { + return 25 +} + +func (*CancelOrderResponse) OrigQuoteOrderQtySinceVersion() uint16 { + return 0 +} + +func (c *CancelOrderResponse) OrigQuoteOrderQtyInActingVersion(actingVersion uint16) bool { + return actingVersion >= c.OrigQuoteOrderQtySinceVersion() +} + +func (*CancelOrderResponse) OrigQuoteOrderQtyDeprecated() uint16 { + return 0 +} + +func (*CancelOrderResponse) OrigQuoteOrderQtyMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*CancelOrderResponse) OrigQuoteOrderQtyMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*CancelOrderResponse) OrigQuoteOrderQtyMaxValue() int64 { + return math.MaxInt64 +} + +func (*CancelOrderResponse) OrigQuoteOrderQtyNullValue() int64 { + return math.MinInt64 +} + +func (*CancelOrderResponse) PegPriceTypeId() uint16 { + return 26 +} + +func (*CancelOrderResponse) PegPriceTypeSinceVersion() uint16 { + return 1 +} + +func (c *CancelOrderResponse) PegPriceTypeInActingVersion(actingVersion uint16) bool { + return actingVersion >= c.PegPriceTypeSinceVersion() +} + +func (*CancelOrderResponse) PegPriceTypeDeprecated() uint16 { + return 0 +} + +func (*CancelOrderResponse) PegPriceTypeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*CancelOrderResponse) PegOffsetTypeId() uint16 { + return 27 +} + +func (*CancelOrderResponse) PegOffsetTypeSinceVersion() uint16 { + return 1 +} + +func (c *CancelOrderResponse) PegOffsetTypeInActingVersion(actingVersion uint16) bool { + return actingVersion >= c.PegOffsetTypeSinceVersion() +} + +func (*CancelOrderResponse) PegOffsetTypeDeprecated() uint16 { + return 0 +} + +func (*CancelOrderResponse) PegOffsetTypeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*CancelOrderResponse) PegOffsetValueId() uint16 { + return 28 +} + +func (*CancelOrderResponse) PegOffsetValueSinceVersion() uint16 { + return 1 +} + +func (c *CancelOrderResponse) PegOffsetValueInActingVersion(actingVersion uint16) bool { + return actingVersion >= c.PegOffsetValueSinceVersion() +} + +func (*CancelOrderResponse) PegOffsetValueDeprecated() uint16 { + return 0 +} + +func (*CancelOrderResponse) PegOffsetValueMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*CancelOrderResponse) PegOffsetValueMinValue() uint8 { + return 0 +} + +func (*CancelOrderResponse) PegOffsetValueMaxValue() uint8 { + return math.MaxUint8 - 1 +} + +func (*CancelOrderResponse) PegOffsetValueNullValue() uint8 { + return math.MaxUint8 +} + +func (*CancelOrderResponse) PeggedPriceId() uint16 { + return 29 +} + +func (*CancelOrderResponse) PeggedPriceSinceVersion() uint16 { + return 1 +} + +func (c *CancelOrderResponse) PeggedPriceInActingVersion(actingVersion uint16) bool { + return actingVersion >= c.PeggedPriceSinceVersion() +} + +func (*CancelOrderResponse) PeggedPriceDeprecated() uint16 { + return 0 +} + +func (*CancelOrderResponse) PeggedPriceMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*CancelOrderResponse) PeggedPriceMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*CancelOrderResponse) PeggedPriceMaxValue() int64 { + return math.MaxInt64 +} + +func (*CancelOrderResponse) PeggedPriceNullValue() int64 { + return math.MinInt64 +} + +func (*CancelOrderResponse) SymbolMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*CancelOrderResponse) SymbolSinceVersion() uint16 { + return 0 +} + +func (c *CancelOrderResponse) SymbolInActingVersion(actingVersion uint16) bool { + return actingVersion >= c.SymbolSinceVersion() +} + +func (*CancelOrderResponse) SymbolDeprecated() uint16 { + return 0 +} + +func (CancelOrderResponse) SymbolCharacterEncoding() string { + return "UTF-8" +} + +func (CancelOrderResponse) SymbolHeaderLength() uint64 { + return 1 +} + +func (*CancelOrderResponse) OrigClientOrderIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*CancelOrderResponse) OrigClientOrderIdSinceVersion() uint16 { + return 0 +} + +func (c *CancelOrderResponse) OrigClientOrderIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= c.OrigClientOrderIdSinceVersion() +} + +func (*CancelOrderResponse) OrigClientOrderIdDeprecated() uint16 { + return 0 +} + +func (CancelOrderResponse) OrigClientOrderIdCharacterEncoding() string { + return "UTF-8" +} + +func (CancelOrderResponse) OrigClientOrderIdHeaderLength() uint64 { + return 1 +} + +func (*CancelOrderResponse) ClientOrderIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*CancelOrderResponse) ClientOrderIdSinceVersion() uint16 { + return 0 +} + +func (c *CancelOrderResponse) ClientOrderIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= c.ClientOrderIdSinceVersion() +} + +func (*CancelOrderResponse) ClientOrderIdDeprecated() uint16 { + return 0 +} + +func (CancelOrderResponse) ClientOrderIdCharacterEncoding() string { + return "UTF-8" +} + +func (CancelOrderResponse) ClientOrderIdHeaderLength() uint64 { + return 1 +} diff --git a/v2/sbe/spot_3_1/CancelReplaceOrderResponse.go b/v2/sbe/spot_3_1/CancelReplaceOrderResponse.go new file mode 100644 index 00000000..de3da99d --- /dev/null +++ b/v2/sbe/spot_3_1/CancelReplaceOrderResponse.go @@ -0,0 +1,258 @@ +// Generated SBE (Simple Binary Encoding) message codec + +package sbe + +import ( + "io" + "io/ioutil" +) + +type CancelReplaceOrderResponse struct { + CancelResult CancelReplaceStatusEnum + NewOrderResult CancelReplaceStatusEnum + CancelResponse []uint8 + NewOrderResponse []uint8 +} + +func (c *CancelReplaceOrderResponse) Encode(_m *SbeGoMarshaller, _w io.Writer, doRangeCheck bool) error { + if doRangeCheck { + if err := c.RangeCheck(c.SbeSchemaVersion(), c.SbeSchemaVersion()); err != nil { + return err + } + } + if err := c.CancelResult.Encode(_m, _w); err != nil { + return err + } + if err := c.NewOrderResult.Encode(_m, _w); err != nil { + return err + } + if err := _m.WriteUint16(_w, uint16(len(c.CancelResponse))); err != nil { + return err + } + if err := _m.WriteBytes(_w, c.CancelResponse); err != nil { + return err + } + if err := _m.WriteUint32(_w, uint32(len(c.NewOrderResponse))); err != nil { + return err + } + if err := _m.WriteBytes(_w, c.NewOrderResponse); err != nil { + return err + } + return nil +} + +func (c *CancelReplaceOrderResponse) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint16, doRangeCheck bool) error { + if c.CancelResultInActingVersion(actingVersion) { + if err := c.CancelResult.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if c.NewOrderResultInActingVersion(actingVersion) { + if err := c.NewOrderResult.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if actingVersion > c.SbeSchemaVersion() && blockLength > c.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-c.SbeBlockLength())) + } + + if c.CancelResponseInActingVersion(actingVersion) { + var CancelResponseLength uint16 + if err := _m.ReadUint16(_r, &CancelResponseLength); err != nil { + return err + } + if cap(c.CancelResponse) < int(CancelResponseLength) { + c.CancelResponse = make([]uint8, CancelResponseLength) + } + c.CancelResponse = c.CancelResponse[:CancelResponseLength] + if err := _m.ReadBytes(_r, c.CancelResponse); err != nil { + return err + } + } + + if c.NewOrderResponseInActingVersion(actingVersion) { + var NewOrderResponseLength uint32 + if err := _m.ReadUint32(_r, &NewOrderResponseLength); err != nil { + return err + } + if cap(c.NewOrderResponse) < int(NewOrderResponseLength) { + c.NewOrderResponse = make([]uint8, NewOrderResponseLength) + } + c.NewOrderResponse = c.NewOrderResponse[:NewOrderResponseLength] + if err := _m.ReadBytes(_r, c.NewOrderResponse); err != nil { + return err + } + } + if doRangeCheck { + if err := c.RangeCheck(actingVersion, c.SbeSchemaVersion()); err != nil { + return err + } + } + return nil +} + +func (c *CancelReplaceOrderResponse) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if err := c.CancelResult.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if err := c.NewOrderResult.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + return nil +} + +func CancelReplaceOrderResponseInit(c *CancelReplaceOrderResponse) { + return +} + +func (*CancelReplaceOrderResponse) SbeBlockLength() (blockLength uint16) { + return 2 +} + +func (*CancelReplaceOrderResponse) SbeTemplateId() (templateId uint16) { + return 307 +} + +func (*CancelReplaceOrderResponse) SbeSchemaId() (schemaId uint16) { + return 3 +} + +func (*CancelReplaceOrderResponse) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} + +func (*CancelReplaceOrderResponse) SbeSemanticType() (semanticType []byte) { + return []byte("") +} + +func (*CancelReplaceOrderResponse) SbeSemanticVersion() (semanticVersion string) { + return "5.2" +} + +func (*CancelReplaceOrderResponse) CancelResultId() uint16 { + return 1 +} + +func (*CancelReplaceOrderResponse) CancelResultSinceVersion() uint16 { + return 0 +} + +func (c *CancelReplaceOrderResponse) CancelResultInActingVersion(actingVersion uint16) bool { + return actingVersion >= c.CancelResultSinceVersion() +} + +func (*CancelReplaceOrderResponse) CancelResultDeprecated() uint16 { + return 0 +} + +func (*CancelReplaceOrderResponse) CancelResultMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*CancelReplaceOrderResponse) NewOrderResultId() uint16 { + return 2 +} + +func (*CancelReplaceOrderResponse) NewOrderResultSinceVersion() uint16 { + return 0 +} + +func (c *CancelReplaceOrderResponse) NewOrderResultInActingVersion(actingVersion uint16) bool { + return actingVersion >= c.NewOrderResultSinceVersion() +} + +func (*CancelReplaceOrderResponse) NewOrderResultDeprecated() uint16 { + return 0 +} + +func (*CancelReplaceOrderResponse) NewOrderResultMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*CancelReplaceOrderResponse) CancelResponseMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*CancelReplaceOrderResponse) CancelResponseSinceVersion() uint16 { + return 0 +} + +func (c *CancelReplaceOrderResponse) CancelResponseInActingVersion(actingVersion uint16) bool { + return actingVersion >= c.CancelResponseSinceVersion() +} + +func (*CancelReplaceOrderResponse) CancelResponseDeprecated() uint16 { + return 0 +} + +func (CancelReplaceOrderResponse) CancelResponseCharacterEncoding() string { + return "null" +} + +func (CancelReplaceOrderResponse) CancelResponseHeaderLength() uint64 { + return 2 +} + +func (*CancelReplaceOrderResponse) NewOrderResponseMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*CancelReplaceOrderResponse) NewOrderResponseSinceVersion() uint16 { + return 0 +} + +func (c *CancelReplaceOrderResponse) NewOrderResponseInActingVersion(actingVersion uint16) bool { + return actingVersion >= c.NewOrderResponseSinceVersion() +} + +func (*CancelReplaceOrderResponse) NewOrderResponseDeprecated() uint16 { + return 0 +} + +func (CancelReplaceOrderResponse) NewOrderResponseCharacterEncoding() string { + return "null" +} + +func (CancelReplaceOrderResponse) NewOrderResponseHeaderLength() uint64 { + return 4 +} diff --git a/v2/sbe/spot_3_1/CancelReplaceStatus.go b/v2/sbe/spot_3_1/CancelReplaceStatus.go new file mode 100644 index 00000000..9ce6ccae --- /dev/null +++ b/v2/sbe/spot_3_1/CancelReplaceStatus.go @@ -0,0 +1,99 @@ +// Generated SBE (Simple Binary Encoding) message codec + +package sbe + +import ( + "fmt" + "io" + "reflect" +) + +type CancelReplaceStatusEnum uint8 +type CancelReplaceStatusValues struct { + Success CancelReplaceStatusEnum + Failure CancelReplaceStatusEnum + NotAttempted CancelReplaceStatusEnum + NonRepresentable CancelReplaceStatusEnum + NullValue CancelReplaceStatusEnum +} + +var CancelReplaceStatus = CancelReplaceStatusValues{0, 1, 2, 254, 255} + +func (c CancelReplaceStatusEnum) Encode(_m *SbeGoMarshaller, _w io.Writer) error { + if err := _m.WriteUint8(_w, uint8(c)); err != nil { + return err + } + return nil +} + +func (c *CancelReplaceStatusEnum) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16) error { + if err := _m.ReadUint8(_r, (*uint8)(c)); err != nil { + return err + } + return nil +} + +func (c CancelReplaceStatusEnum) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if actingVersion > schemaVersion { + return nil + } + value := reflect.ValueOf(CancelReplaceStatus) + for idx := 0; idx < value.NumField(); idx++ { + if c == value.Field(idx).Interface() { + return nil + } + } + return fmt.Errorf("Range check failed on CancelReplaceStatus, unknown enumeration value %d", c) +} + +func (*CancelReplaceStatusEnum) EncodedLength() int64 { + return 1 +} + +func (*CancelReplaceStatusEnum) SuccessSinceVersion() uint16 { + return 0 +} + +func (c *CancelReplaceStatusEnum) SuccessInActingVersion(actingVersion uint16) bool { + return actingVersion >= c.SuccessSinceVersion() +} + +func (*CancelReplaceStatusEnum) SuccessDeprecated() uint16 { + return 0 +} + +func (*CancelReplaceStatusEnum) FailureSinceVersion() uint16 { + return 0 +} + +func (c *CancelReplaceStatusEnum) FailureInActingVersion(actingVersion uint16) bool { + return actingVersion >= c.FailureSinceVersion() +} + +func (*CancelReplaceStatusEnum) FailureDeprecated() uint16 { + return 0 +} + +func (*CancelReplaceStatusEnum) NotAttemptedSinceVersion() uint16 { + return 0 +} + +func (c *CancelReplaceStatusEnum) NotAttemptedInActingVersion(actingVersion uint16) bool { + return actingVersion >= c.NotAttemptedSinceVersion() +} + +func (*CancelReplaceStatusEnum) NotAttemptedDeprecated() uint16 { + return 0 +} + +func (*CancelReplaceStatusEnum) NonRepresentableSinceVersion() uint16 { + return 0 +} + +func (c *CancelReplaceStatusEnum) NonRepresentableInActingVersion(actingVersion uint16) bool { + return actingVersion >= c.NonRepresentableSinceVersion() +} + +func (*CancelReplaceStatusEnum) NonRepresentableDeprecated() uint16 { + return 0 +} diff --git a/v2/sbe/spot_3_1/ContingencyType.go b/v2/sbe/spot_3_1/ContingencyType.go new file mode 100644 index 00000000..263677e8 --- /dev/null +++ b/v2/sbe/spot_3_1/ContingencyType.go @@ -0,0 +1,86 @@ +// Generated SBE (Simple Binary Encoding) message codec + +package sbe + +import ( + "fmt" + "io" + "reflect" +) + +type ContingencyTypeEnum uint8 +type ContingencyTypeValues struct { + Oco ContingencyTypeEnum + Oto ContingencyTypeEnum + NonRepresentable ContingencyTypeEnum + NullValue ContingencyTypeEnum +} + +var ContingencyType = ContingencyTypeValues{1, 2, 254, 255} + +func (c ContingencyTypeEnum) Encode(_m *SbeGoMarshaller, _w io.Writer) error { + if err := _m.WriteUint8(_w, uint8(c)); err != nil { + return err + } + return nil +} + +func (c *ContingencyTypeEnum) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16) error { + if err := _m.ReadUint8(_r, (*uint8)(c)); err != nil { + return err + } + return nil +} + +func (c ContingencyTypeEnum) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if actingVersion > schemaVersion { + return nil + } + value := reflect.ValueOf(ContingencyType) + for idx := 0; idx < value.NumField(); idx++ { + if c == value.Field(idx).Interface() { + return nil + } + } + return fmt.Errorf("Range check failed on ContingencyType, unknown enumeration value %d", c) +} + +func (*ContingencyTypeEnum) EncodedLength() int64 { + return 1 +} + +func (*ContingencyTypeEnum) OcoSinceVersion() uint16 { + return 0 +} + +func (c *ContingencyTypeEnum) OcoInActingVersion(actingVersion uint16) bool { + return actingVersion >= c.OcoSinceVersion() +} + +func (*ContingencyTypeEnum) OcoDeprecated() uint16 { + return 0 +} + +func (*ContingencyTypeEnum) OtoSinceVersion() uint16 { + return 0 +} + +func (c *ContingencyTypeEnum) OtoInActingVersion(actingVersion uint16) bool { + return actingVersion >= c.OtoSinceVersion() +} + +func (*ContingencyTypeEnum) OtoDeprecated() uint16 { + return 0 +} + +func (*ContingencyTypeEnum) NonRepresentableSinceVersion() uint16 { + return 0 +} + +func (c *ContingencyTypeEnum) NonRepresentableInActingVersion(actingVersion uint16) bool { + return actingVersion >= c.NonRepresentableSinceVersion() +} + +func (*ContingencyTypeEnum) NonRepresentableDeprecated() uint16 { + return 0 +} diff --git a/v2/sbe/spot_3_1/DepthResponse.go b/v2/sbe/spot_3_1/DepthResponse.go new file mode 100644 index 00000000..c69fe484 --- /dev/null +++ b/v2/sbe/spot_3_1/DepthResponse.go @@ -0,0 +1,640 @@ +// Generated SBE (Simple Binary Encoding) message codec + +package sbe + +import ( + "fmt" + "io" + "io/ioutil" + "math" +) + +type DepthResponse struct { + LastUpdateId int64 + PriceExponent int8 + QtyExponent int8 + Bids []DepthResponseBids + Asks []DepthResponseAsks +} +type DepthResponseBids struct { + Price int64 + Qty int64 +} +type DepthResponseAsks struct { + Price int64 + Qty int64 +} + +func (d *DepthResponse) Encode(_m *SbeGoMarshaller, _w io.Writer, doRangeCheck bool) error { + if doRangeCheck { + if err := d.RangeCheck(d.SbeSchemaVersion(), d.SbeSchemaVersion()); err != nil { + return err + } + } + if err := _m.WriteInt64(_w, d.LastUpdateId); err != nil { + return err + } + if err := _m.WriteInt8(_w, d.PriceExponent); err != nil { + return err + } + if err := _m.WriteInt8(_w, d.QtyExponent); err != nil { + return err + } + var BidsBlockLength uint16 = 16 + if err := _m.WriteUint16(_w, BidsBlockLength); err != nil { + return err + } + var BidsNumInGroup uint32 = uint32(len(d.Bids)) + if err := _m.WriteUint32(_w, BidsNumInGroup); err != nil { + return err + } + for i := range d.Bids { + if err := d.Bids[i].Encode(_m, _w); err != nil { + return err + } + } + var AsksBlockLength uint16 = 16 + if err := _m.WriteUint16(_w, AsksBlockLength); err != nil { + return err + } + var AsksNumInGroup uint32 = uint32(len(d.Asks)) + if err := _m.WriteUint32(_w, AsksNumInGroup); err != nil { + return err + } + for i := range d.Asks { + if err := d.Asks[i].Encode(_m, _w); err != nil { + return err + } + } + return nil +} + +func (d *DepthResponse) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint16, doRangeCheck bool) error { + if !d.LastUpdateIdInActingVersion(actingVersion) { + d.LastUpdateId = d.LastUpdateIdNullValue() + } else { + if err := _m.ReadInt64(_r, &d.LastUpdateId); err != nil { + return err + } + } + if !d.PriceExponentInActingVersion(actingVersion) { + d.PriceExponent = d.PriceExponentNullValue() + } else { + if err := _m.ReadInt8(_r, &d.PriceExponent); err != nil { + return err + } + } + if !d.QtyExponentInActingVersion(actingVersion) { + d.QtyExponent = d.QtyExponentNullValue() + } else { + if err := _m.ReadInt8(_r, &d.QtyExponent); err != nil { + return err + } + } + if actingVersion > d.SbeSchemaVersion() && blockLength > d.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-d.SbeBlockLength())) + } + + if d.BidsInActingVersion(actingVersion) { + var BidsBlockLength uint16 + if err := _m.ReadUint16(_r, &BidsBlockLength); err != nil { + return err + } + var BidsNumInGroup uint32 + if err := _m.ReadUint32(_r, &BidsNumInGroup); err != nil { + return err + } + if cap(d.Bids) < int(BidsNumInGroup) { + d.Bids = make([]DepthResponseBids, BidsNumInGroup) + } + d.Bids = d.Bids[:BidsNumInGroup] + for i := range d.Bids { + if err := d.Bids[i].Decode(_m, _r, actingVersion, uint(BidsBlockLength)); err != nil { + return err + } + } + } + + if d.AsksInActingVersion(actingVersion) { + var AsksBlockLength uint16 + if err := _m.ReadUint16(_r, &AsksBlockLength); err != nil { + return err + } + var AsksNumInGroup uint32 + if err := _m.ReadUint32(_r, &AsksNumInGroup); err != nil { + return err + } + if cap(d.Asks) < int(AsksNumInGroup) { + d.Asks = make([]DepthResponseAsks, AsksNumInGroup) + } + d.Asks = d.Asks[:AsksNumInGroup] + for i := range d.Asks { + if err := d.Asks[i].Decode(_m, _r, actingVersion, uint(AsksBlockLength)); err != nil { + return err + } + } + } + if doRangeCheck { + if err := d.RangeCheck(actingVersion, d.SbeSchemaVersion()); err != nil { + return err + } + } + return nil +} + +func (d *DepthResponse) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if d.LastUpdateIdInActingVersion(actingVersion) { + if d.LastUpdateId < d.LastUpdateIdMinValue() || d.LastUpdateId > d.LastUpdateIdMaxValue() { + return fmt.Errorf("Range check failed on d.LastUpdateId (%v < %v > %v)", d.LastUpdateIdMinValue(), d.LastUpdateId, d.LastUpdateIdMaxValue()) + } + } + if d.PriceExponentInActingVersion(actingVersion) { + if d.PriceExponent < d.PriceExponentMinValue() || d.PriceExponent > d.PriceExponentMaxValue() { + return fmt.Errorf("Range check failed on d.PriceExponent (%v < %v > %v)", d.PriceExponentMinValue(), d.PriceExponent, d.PriceExponentMaxValue()) + } + } + if d.QtyExponentInActingVersion(actingVersion) { + if d.QtyExponent < d.QtyExponentMinValue() || d.QtyExponent > d.QtyExponentMaxValue() { + return fmt.Errorf("Range check failed on d.QtyExponent (%v < %v > %v)", d.QtyExponentMinValue(), d.QtyExponent, d.QtyExponentMaxValue()) + } + } + for i := range d.Bids { + if err := d.Bids[i].RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + } + for i := range d.Asks { + if err := d.Asks[i].RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + } + return nil +} + +func DepthResponseInit(d *DepthResponse) { + return +} + +func (d *DepthResponseBids) Encode(_m *SbeGoMarshaller, _w io.Writer) error { + if err := _m.WriteInt64(_w, d.Price); err != nil { + return err + } + if err := _m.WriteInt64(_w, d.Qty); err != nil { + return err + } + return nil +} + +func (d *DepthResponseBids) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint) error { + if !d.PriceInActingVersion(actingVersion) { + d.Price = d.PriceNullValue() + } else { + if err := _m.ReadInt64(_r, &d.Price); err != nil { + return err + } + } + if !d.QtyInActingVersion(actingVersion) { + d.Qty = d.QtyNullValue() + } else { + if err := _m.ReadInt64(_r, &d.Qty); err != nil { + return err + } + } + if actingVersion > d.SbeSchemaVersion() && blockLength > d.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-d.SbeBlockLength())) + } + return nil +} + +func (d *DepthResponseBids) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if d.PriceInActingVersion(actingVersion) { + if d.Price < d.PriceMinValue() || d.Price > d.PriceMaxValue() { + return fmt.Errorf("Range check failed on d.Price (%v < %v > %v)", d.PriceMinValue(), d.Price, d.PriceMaxValue()) + } + } + if d.QtyInActingVersion(actingVersion) { + if d.Qty < d.QtyMinValue() || d.Qty > d.QtyMaxValue() { + return fmt.Errorf("Range check failed on d.Qty (%v < %v > %v)", d.QtyMinValue(), d.Qty, d.QtyMaxValue()) + } + } + return nil +} + +func DepthResponseBidsInit(d *DepthResponseBids) { + return +} + +func (d *DepthResponseAsks) Encode(_m *SbeGoMarshaller, _w io.Writer) error { + if err := _m.WriteInt64(_w, d.Price); err != nil { + return err + } + if err := _m.WriteInt64(_w, d.Qty); err != nil { + return err + } + return nil +} + +func (d *DepthResponseAsks) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint) error { + if !d.PriceInActingVersion(actingVersion) { + d.Price = d.PriceNullValue() + } else { + if err := _m.ReadInt64(_r, &d.Price); err != nil { + return err + } + } + if !d.QtyInActingVersion(actingVersion) { + d.Qty = d.QtyNullValue() + } else { + if err := _m.ReadInt64(_r, &d.Qty); err != nil { + return err + } + } + if actingVersion > d.SbeSchemaVersion() && blockLength > d.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-d.SbeBlockLength())) + } + return nil +} + +func (d *DepthResponseAsks) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if d.PriceInActingVersion(actingVersion) { + if d.Price < d.PriceMinValue() || d.Price > d.PriceMaxValue() { + return fmt.Errorf("Range check failed on d.Price (%v < %v > %v)", d.PriceMinValue(), d.Price, d.PriceMaxValue()) + } + } + if d.QtyInActingVersion(actingVersion) { + if d.Qty < d.QtyMinValue() || d.Qty > d.QtyMaxValue() { + return fmt.Errorf("Range check failed on d.Qty (%v < %v > %v)", d.QtyMinValue(), d.Qty, d.QtyMaxValue()) + } + } + return nil +} + +func DepthResponseAsksInit(d *DepthResponseAsks) { + return +} + +func (*DepthResponse) SbeBlockLength() (blockLength uint16) { + return 10 +} + +func (*DepthResponse) SbeTemplateId() (templateId uint16) { + return 200 +} + +func (*DepthResponse) SbeSchemaId() (schemaId uint16) { + return 3 +} + +func (*DepthResponse) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} + +func (*DepthResponse) SbeSemanticType() (semanticType []byte) { + return []byte("") +} + +func (*DepthResponse) SbeSemanticVersion() (semanticVersion string) { + return "5.2" +} + +func (*DepthResponse) LastUpdateIdId() uint16 { + return 1 +} + +func (*DepthResponse) LastUpdateIdSinceVersion() uint16 { + return 0 +} + +func (d *DepthResponse) LastUpdateIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= d.LastUpdateIdSinceVersion() +} + +func (*DepthResponse) LastUpdateIdDeprecated() uint16 { + return 0 +} + +func (*DepthResponse) LastUpdateIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*DepthResponse) LastUpdateIdMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*DepthResponse) LastUpdateIdMaxValue() int64 { + return math.MaxInt64 +} + +func (*DepthResponse) LastUpdateIdNullValue() int64 { + return math.MinInt64 +} + +func (*DepthResponse) PriceExponentId() uint16 { + return 2 +} + +func (*DepthResponse) PriceExponentSinceVersion() uint16 { + return 0 +} + +func (d *DepthResponse) PriceExponentInActingVersion(actingVersion uint16) bool { + return actingVersion >= d.PriceExponentSinceVersion() +} + +func (*DepthResponse) PriceExponentDeprecated() uint16 { + return 0 +} + +func (*DepthResponse) PriceExponentMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*DepthResponse) PriceExponentMinValue() int8 { + return math.MinInt8 + 1 +} + +func (*DepthResponse) PriceExponentMaxValue() int8 { + return math.MaxInt8 +} + +func (*DepthResponse) PriceExponentNullValue() int8 { + return math.MinInt8 +} + +func (*DepthResponse) QtyExponentId() uint16 { + return 3 +} + +func (*DepthResponse) QtyExponentSinceVersion() uint16 { + return 0 +} + +func (d *DepthResponse) QtyExponentInActingVersion(actingVersion uint16) bool { + return actingVersion >= d.QtyExponentSinceVersion() +} + +func (*DepthResponse) QtyExponentDeprecated() uint16 { + return 0 +} + +func (*DepthResponse) QtyExponentMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*DepthResponse) QtyExponentMinValue() int8 { + return math.MinInt8 + 1 +} + +func (*DepthResponse) QtyExponentMaxValue() int8 { + return math.MaxInt8 +} + +func (*DepthResponse) QtyExponentNullValue() int8 { + return math.MinInt8 +} + +func (*DepthResponseBids) PriceId() uint16 { + return 1 +} + +func (*DepthResponseBids) PriceSinceVersion() uint16 { + return 0 +} + +func (d *DepthResponseBids) PriceInActingVersion(actingVersion uint16) bool { + return actingVersion >= d.PriceSinceVersion() +} + +func (*DepthResponseBids) PriceDeprecated() uint16 { + return 0 +} + +func (*DepthResponseBids) PriceMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*DepthResponseBids) PriceMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*DepthResponseBids) PriceMaxValue() int64 { + return math.MaxInt64 +} + +func (*DepthResponseBids) PriceNullValue() int64 { + return math.MinInt64 +} + +func (*DepthResponseBids) QtyId() uint16 { + return 2 +} + +func (*DepthResponseBids) QtySinceVersion() uint16 { + return 0 +} + +func (d *DepthResponseBids) QtyInActingVersion(actingVersion uint16) bool { + return actingVersion >= d.QtySinceVersion() +} + +func (*DepthResponseBids) QtyDeprecated() uint16 { + return 0 +} + +func (*DepthResponseBids) QtyMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*DepthResponseBids) QtyMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*DepthResponseBids) QtyMaxValue() int64 { + return math.MaxInt64 +} + +func (*DepthResponseBids) QtyNullValue() int64 { + return math.MinInt64 +} + +func (*DepthResponseAsks) PriceId() uint16 { + return 1 +} + +func (*DepthResponseAsks) PriceSinceVersion() uint16 { + return 0 +} + +func (d *DepthResponseAsks) PriceInActingVersion(actingVersion uint16) bool { + return actingVersion >= d.PriceSinceVersion() +} + +func (*DepthResponseAsks) PriceDeprecated() uint16 { + return 0 +} + +func (*DepthResponseAsks) PriceMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*DepthResponseAsks) PriceMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*DepthResponseAsks) PriceMaxValue() int64 { + return math.MaxInt64 +} + +func (*DepthResponseAsks) PriceNullValue() int64 { + return math.MinInt64 +} + +func (*DepthResponseAsks) QtyId() uint16 { + return 2 +} + +func (*DepthResponseAsks) QtySinceVersion() uint16 { + return 0 +} + +func (d *DepthResponseAsks) QtyInActingVersion(actingVersion uint16) bool { + return actingVersion >= d.QtySinceVersion() +} + +func (*DepthResponseAsks) QtyDeprecated() uint16 { + return 0 +} + +func (*DepthResponseAsks) QtyMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*DepthResponseAsks) QtyMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*DepthResponseAsks) QtyMaxValue() int64 { + return math.MaxInt64 +} + +func (*DepthResponseAsks) QtyNullValue() int64 { + return math.MinInt64 +} + +func (*DepthResponse) BidsId() uint16 { + return 100 +} + +func (*DepthResponse) BidsSinceVersion() uint16 { + return 0 +} + +func (d *DepthResponse) BidsInActingVersion(actingVersion uint16) bool { + return actingVersion >= d.BidsSinceVersion() +} + +func (*DepthResponse) BidsDeprecated() uint16 { + return 0 +} + +func (*DepthResponseBids) SbeBlockLength() (blockLength uint) { + return 16 +} + +func (*DepthResponseBids) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} + +func (*DepthResponse) AsksId() uint16 { + return 101 +} + +func (*DepthResponse) AsksSinceVersion() uint16 { + return 0 +} + +func (d *DepthResponse) AsksInActingVersion(actingVersion uint16) bool { + return actingVersion >= d.AsksSinceVersion() +} + +func (*DepthResponse) AsksDeprecated() uint16 { + return 0 +} + +func (*DepthResponseAsks) SbeBlockLength() (blockLength uint) { + return 16 +} + +func (*DepthResponseAsks) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} diff --git a/v2/sbe/spot_3_1/ErrorResponse.go b/v2/sbe/spot_3_1/ErrorResponse.go new file mode 100644 index 00000000..ffe59774 --- /dev/null +++ b/v2/sbe/spot_3_1/ErrorResponse.go @@ -0,0 +1,357 @@ +// Generated SBE (Simple Binary Encoding) message codec + +package sbe + +import ( + "errors" + "fmt" + "io" + "io/ioutil" + "math" + "unicode/utf8" +) + +type ErrorResponse struct { + Code int16 + ServerTime int64 + RetryAfter int64 + Msg []uint8 + Data []uint8 +} + +func (e *ErrorResponse) Encode(_m *SbeGoMarshaller, _w io.Writer, doRangeCheck bool) error { + if doRangeCheck { + if err := e.RangeCheck(e.SbeSchemaVersion(), e.SbeSchemaVersion()); err != nil { + return err + } + } + if err := _m.WriteInt16(_w, e.Code); err != nil { + return err + } + if err := _m.WriteInt64(_w, e.ServerTime); err != nil { + return err + } + if err := _m.WriteInt64(_w, e.RetryAfter); err != nil { + return err + } + if err := _m.WriteUint16(_w, uint16(len(e.Msg))); err != nil { + return err + } + if err := _m.WriteBytes(_w, e.Msg); err != nil { + return err + } + if err := _m.WriteUint32(_w, uint32(len(e.Data))); err != nil { + return err + } + if err := _m.WriteBytes(_w, e.Data); err != nil { + return err + } + return nil +} + +func (e *ErrorResponse) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint16, doRangeCheck bool) error { + if !e.CodeInActingVersion(actingVersion) { + e.Code = e.CodeNullValue() + } else { + if err := _m.ReadInt16(_r, &e.Code); err != nil { + return err + } + } + if !e.ServerTimeInActingVersion(actingVersion) { + e.ServerTime = e.ServerTimeNullValue() + } else { + if err := _m.ReadInt64(_r, &e.ServerTime); err != nil { + return err + } + } + if !e.RetryAfterInActingVersion(actingVersion) { + e.RetryAfter = e.RetryAfterNullValue() + } else { + if err := _m.ReadInt64(_r, &e.RetryAfter); err != nil { + return err + } + } + if actingVersion > e.SbeSchemaVersion() && blockLength > e.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-e.SbeBlockLength())) + } + + if e.MsgInActingVersion(actingVersion) { + var MsgLength uint16 + if err := _m.ReadUint16(_r, &MsgLength); err != nil { + return err + } + if cap(e.Msg) < int(MsgLength) { + e.Msg = make([]uint8, MsgLength) + } + e.Msg = e.Msg[:MsgLength] + if err := _m.ReadBytes(_r, e.Msg); err != nil { + return err + } + } + + if e.DataInActingVersion(actingVersion) { + var DataLength uint32 + if err := _m.ReadUint32(_r, &DataLength); err != nil { + return err + } + if cap(e.Data) < int(DataLength) { + e.Data = make([]uint8, DataLength) + } + e.Data = e.Data[:DataLength] + if err := _m.ReadBytes(_r, e.Data); err != nil { + return err + } + } + if doRangeCheck { + if err := e.RangeCheck(actingVersion, e.SbeSchemaVersion()); err != nil { + return err + } + } + return nil +} + +func (e *ErrorResponse) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if e.CodeInActingVersion(actingVersion) { + if e.Code < e.CodeMinValue() || e.Code > e.CodeMaxValue() { + return fmt.Errorf("Range check failed on e.Code (%v < %v > %v)", e.CodeMinValue(), e.Code, e.CodeMaxValue()) + } + } + if e.ServerTimeInActingVersion(actingVersion) { + if e.ServerTime != e.ServerTimeNullValue() && (e.ServerTime < e.ServerTimeMinValue() || e.ServerTime > e.ServerTimeMaxValue()) { + return fmt.Errorf("Range check failed on e.ServerTime (%v < %v > %v)", e.ServerTimeMinValue(), e.ServerTime, e.ServerTimeMaxValue()) + } + } + if e.RetryAfterInActingVersion(actingVersion) { + if e.RetryAfter != e.RetryAfterNullValue() && (e.RetryAfter < e.RetryAfterMinValue() || e.RetryAfter > e.RetryAfterMaxValue()) { + return fmt.Errorf("Range check failed on e.RetryAfter (%v < %v > %v)", e.RetryAfterMinValue(), e.RetryAfter, e.RetryAfterMaxValue()) + } + } + if !utf8.Valid(e.Msg[:]) { + return errors.New("e.Msg failed UTF-8 validation") + } + return nil +} + +func ErrorResponseInit(e *ErrorResponse) { + e.ServerTime = math.MinInt64 + e.RetryAfter = math.MinInt64 + return +} + +func (*ErrorResponse) SbeBlockLength() (blockLength uint16) { + return 18 +} + +func (*ErrorResponse) SbeTemplateId() (templateId uint16) { + return 100 +} + +func (*ErrorResponse) SbeSchemaId() (schemaId uint16) { + return 3 +} + +func (*ErrorResponse) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} + +func (*ErrorResponse) SbeSemanticType() (semanticType []byte) { + return []byte("") +} + +func (*ErrorResponse) SbeSemanticVersion() (semanticVersion string) { + return "5.2" +} + +func (*ErrorResponse) CodeId() uint16 { + return 1 +} + +func (*ErrorResponse) CodeSinceVersion() uint16 { + return 0 +} + +func (e *ErrorResponse) CodeInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.CodeSinceVersion() +} + +func (*ErrorResponse) CodeDeprecated() uint16 { + return 0 +} + +func (*ErrorResponse) CodeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*ErrorResponse) CodeMinValue() int16 { + return math.MinInt16 + 1 +} + +func (*ErrorResponse) CodeMaxValue() int16 { + return math.MaxInt16 +} + +func (*ErrorResponse) CodeNullValue() int16 { + return math.MinInt16 +} + +func (*ErrorResponse) ServerTimeId() uint16 { + return 2 +} + +func (*ErrorResponse) ServerTimeSinceVersion() uint16 { + return 0 +} + +func (e *ErrorResponse) ServerTimeInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.ServerTimeSinceVersion() +} + +func (*ErrorResponse) ServerTimeDeprecated() uint16 { + return 0 +} + +func (*ErrorResponse) ServerTimeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*ErrorResponse) ServerTimeMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*ErrorResponse) ServerTimeMaxValue() int64 { + return math.MaxInt64 +} + +func (*ErrorResponse) ServerTimeNullValue() int64 { + return math.MinInt64 +} + +func (*ErrorResponse) RetryAfterId() uint16 { + return 3 +} + +func (*ErrorResponse) RetryAfterSinceVersion() uint16 { + return 0 +} + +func (e *ErrorResponse) RetryAfterInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.RetryAfterSinceVersion() +} + +func (*ErrorResponse) RetryAfterDeprecated() uint16 { + return 0 +} + +func (*ErrorResponse) RetryAfterMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*ErrorResponse) RetryAfterMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*ErrorResponse) RetryAfterMaxValue() int64 { + return math.MaxInt64 +} + +func (*ErrorResponse) RetryAfterNullValue() int64 { + return math.MinInt64 +} + +func (*ErrorResponse) MsgMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*ErrorResponse) MsgSinceVersion() uint16 { + return 0 +} + +func (e *ErrorResponse) MsgInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.MsgSinceVersion() +} + +func (*ErrorResponse) MsgDeprecated() uint16 { + return 0 +} + +func (ErrorResponse) MsgCharacterEncoding() string { + return "UTF-8" +} + +func (ErrorResponse) MsgHeaderLength() uint64 { + return 2 +} + +func (*ErrorResponse) DataMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*ErrorResponse) DataSinceVersion() uint16 { + return 0 +} + +func (e *ErrorResponse) DataInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.DataSinceVersion() +} + +func (*ErrorResponse) DataDeprecated() uint16 { + return 0 +} + +func (ErrorResponse) DataCharacterEncoding() string { + return "null" +} + +func (ErrorResponse) DataHeaderLength() uint64 { + return 4 +} diff --git a/v2/sbe/spot_3_1/EventStreamTerminatedEvent.go b/v2/sbe/spot_3_1/EventStreamTerminatedEvent.go new file mode 100644 index 00000000..edf74de5 --- /dev/null +++ b/v2/sbe/spot_3_1/EventStreamTerminatedEvent.go @@ -0,0 +1,183 @@ +// Generated SBE (Simple Binary Encoding) message codec + +package sbe + +import ( + "fmt" + "io" + "io/ioutil" + "math" +) + +type EventStreamTerminatedEvent struct { + EventTime int64 + SubscriptionId uint16 +} + +func (e *EventStreamTerminatedEvent) Encode(_m *SbeGoMarshaller, _w io.Writer, doRangeCheck bool) error { + if doRangeCheck { + if err := e.RangeCheck(e.SbeSchemaVersion(), e.SbeSchemaVersion()); err != nil { + return err + } + } + if err := _m.WriteInt64(_w, e.EventTime); err != nil { + return err + } + if err := _m.WriteUint16(_w, e.SubscriptionId); err != nil { + return err + } + return nil +} + +func (e *EventStreamTerminatedEvent) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint16, doRangeCheck bool) error { + if !e.EventTimeInActingVersion(actingVersion) { + e.EventTime = e.EventTimeNullValue() + } else { + if err := _m.ReadInt64(_r, &e.EventTime); err != nil { + return err + } + } + if !e.SubscriptionIdInActingVersion(actingVersion) { + e.SubscriptionId = e.SubscriptionIdNullValue() + } else { + if err := _m.ReadUint16(_r, &e.SubscriptionId); err != nil { + return err + } + } + if actingVersion > e.SbeSchemaVersion() && blockLength > e.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-e.SbeBlockLength())) + } + if doRangeCheck { + if err := e.RangeCheck(actingVersion, e.SbeSchemaVersion()); err != nil { + return err + } + } + return nil +} + +func (e *EventStreamTerminatedEvent) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if e.EventTimeInActingVersion(actingVersion) { + if e.EventTime < e.EventTimeMinValue() || e.EventTime > e.EventTimeMaxValue() { + return fmt.Errorf("Range check failed on e.EventTime (%v < %v > %v)", e.EventTimeMinValue(), e.EventTime, e.EventTimeMaxValue()) + } + } + if e.SubscriptionIdInActingVersion(actingVersion) { + if e.SubscriptionId != e.SubscriptionIdNullValue() && (e.SubscriptionId < e.SubscriptionIdMinValue() || e.SubscriptionId > e.SubscriptionIdMaxValue()) { + return fmt.Errorf("Range check failed on e.SubscriptionId (%v < %v > %v)", e.SubscriptionIdMinValue(), e.SubscriptionId, e.SubscriptionIdMaxValue()) + } + } + return nil +} + +func EventStreamTerminatedEventInit(e *EventStreamTerminatedEvent) { + e.SubscriptionId = math.MaxUint16 + return +} + +func (*EventStreamTerminatedEvent) SbeBlockLength() (blockLength uint16) { + return 10 +} + +func (*EventStreamTerminatedEvent) SbeTemplateId() (templateId uint16) { + return 602 +} + +func (*EventStreamTerminatedEvent) SbeSchemaId() (schemaId uint16) { + return 3 +} + +func (*EventStreamTerminatedEvent) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} + +func (*EventStreamTerminatedEvent) SbeSemanticType() (semanticType []byte) { + return []byte("") +} + +func (*EventStreamTerminatedEvent) SbeSemanticVersion() (semanticVersion string) { + return "5.2" +} + +func (*EventStreamTerminatedEvent) EventTimeId() uint16 { + return 1 +} + +func (*EventStreamTerminatedEvent) EventTimeSinceVersion() uint16 { + return 0 +} + +func (e *EventStreamTerminatedEvent) EventTimeInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.EventTimeSinceVersion() +} + +func (*EventStreamTerminatedEvent) EventTimeDeprecated() uint16 { + return 0 +} + +func (*EventStreamTerminatedEvent) EventTimeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*EventStreamTerminatedEvent) EventTimeMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*EventStreamTerminatedEvent) EventTimeMaxValue() int64 { + return math.MaxInt64 +} + +func (*EventStreamTerminatedEvent) EventTimeNullValue() int64 { + return math.MinInt64 +} + +func (*EventStreamTerminatedEvent) SubscriptionIdId() uint16 { + return 2 +} + +func (*EventStreamTerminatedEvent) SubscriptionIdSinceVersion() uint16 { + return 1 +} + +func (e *EventStreamTerminatedEvent) SubscriptionIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.SubscriptionIdSinceVersion() +} + +func (*EventStreamTerminatedEvent) SubscriptionIdDeprecated() uint16 { + return 0 +} + +func (*EventStreamTerminatedEvent) SubscriptionIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*EventStreamTerminatedEvent) SubscriptionIdMinValue() uint16 { + return 0 +} + +func (*EventStreamTerminatedEvent) SubscriptionIdMaxValue() uint16 { + return math.MaxUint16 - 1 +} + +func (*EventStreamTerminatedEvent) SubscriptionIdNullValue() uint16 { + return math.MaxUint16 +} diff --git a/v2/sbe/spot_3_1/ExchangeInfoResponse.go b/v2/sbe/spot_3_1/ExchangeInfoResponse.go new file mode 100644 index 00000000..6bf9fd2b --- /dev/null +++ b/v2/sbe/spot_3_1/ExchangeInfoResponse.go @@ -0,0 +1,2212 @@ +// Generated SBE (Simple Binary Encoding) message codec + +package sbe + +import ( + "errors" + "fmt" + "io" + "io/ioutil" + "math" + "unicode/utf8" +) + +type ExchangeInfoResponse struct { + RateLimits []ExchangeInfoResponseRateLimits + ExchangeFilters []ExchangeInfoResponseExchangeFilters + Symbols []ExchangeInfoResponseSymbols + Sors []ExchangeInfoResponseSors +} +type ExchangeInfoResponseRateLimits struct { + RateLimitType RateLimitTypeEnum + Interval RateLimitIntervalEnum + IntervalNum uint8 + RateLimit int64 +} +type ExchangeInfoResponseExchangeFilters struct { + Filter []uint8 +} +type ExchangeInfoResponseSymbols struct { + Status SymbolStatusEnum + BaseAssetPrecision uint8 + QuoteAssetPrecision uint8 + BaseCommissionPrecision uint8 + QuoteCommissionPrecision uint8 + OrderTypes OrderTypes + IcebergAllowed BoolEnumEnum + OcoAllowed BoolEnumEnum + OtoAllowed BoolEnumEnum + QuoteOrderQtyMarketAllowed BoolEnumEnum + AllowTrailingStop BoolEnumEnum + CancelReplaceAllowed BoolEnumEnum + AmendAllowed BoolEnumEnum + IsSpotTradingAllowed BoolEnumEnum + IsMarginTradingAllowed BoolEnumEnum + DefaultSelfTradePreventionMode SelfTradePreventionModeEnum + AllowedSelfTradePreventionModes AllowedSelfTradePreventionModes + PegInstructionsAllowed BoolEnumEnum + Filters []ExchangeInfoResponseSymbolsFilters + PermissionSets []ExchangeInfoResponseSymbolsPermissionSets + Symbol []uint8 + BaseAsset []uint8 + QuoteAsset []uint8 +} +type ExchangeInfoResponseSymbolsFilters struct { + Filter []uint8 +} +type ExchangeInfoResponseSymbolsPermissionSets struct { + Permissions []ExchangeInfoResponseSymbolsPermissionSetsPermissions +} +type ExchangeInfoResponseSymbolsPermissionSetsPermissions struct { + Permission []uint8 +} +type ExchangeInfoResponseSors struct { + SorSymbols []ExchangeInfoResponseSorsSorSymbols + BaseAsset []uint8 +} +type ExchangeInfoResponseSorsSorSymbols struct { + Symbol []uint8 +} + +func (e *ExchangeInfoResponse) Encode(_m *SbeGoMarshaller, _w io.Writer, doRangeCheck bool) error { + if doRangeCheck { + if err := e.RangeCheck(e.SbeSchemaVersion(), e.SbeSchemaVersion()); err != nil { + return err + } + } + var RateLimitsBlockLength uint16 = 11 + if err := _m.WriteUint16(_w, RateLimitsBlockLength); err != nil { + return err + } + var RateLimitsNumInGroup uint32 = uint32(len(e.RateLimits)) + if err := _m.WriteUint32(_w, RateLimitsNumInGroup); err != nil { + return err + } + for i := range e.RateLimits { + if err := e.RateLimits[i].Encode(_m, _w); err != nil { + return err + } + } + var ExchangeFiltersBlockLength uint16 = 0 + if err := _m.WriteUint16(_w, ExchangeFiltersBlockLength); err != nil { + return err + } + var ExchangeFiltersNumInGroup uint32 = uint32(len(e.ExchangeFilters)) + if err := _m.WriteUint32(_w, ExchangeFiltersNumInGroup); err != nil { + return err + } + for i := range e.ExchangeFilters { + if err := e.ExchangeFilters[i].Encode(_m, _w); err != nil { + return err + } + } + var SymbolsBlockLength uint16 = 19 + if err := _m.WriteUint16(_w, SymbolsBlockLength); err != nil { + return err + } + var SymbolsNumInGroup uint32 = uint32(len(e.Symbols)) + if err := _m.WriteUint32(_w, SymbolsNumInGroup); err != nil { + return err + } + for i := range e.Symbols { + if err := e.Symbols[i].Encode(_m, _w); err != nil { + return err + } + } + var SorsBlockLength uint16 = 0 + if err := _m.WriteUint16(_w, SorsBlockLength); err != nil { + return err + } + var SorsNumInGroup uint32 = uint32(len(e.Sors)) + if err := _m.WriteUint32(_w, SorsNumInGroup); err != nil { + return err + } + for i := range e.Sors { + if err := e.Sors[i].Encode(_m, _w); err != nil { + return err + } + } + return nil +} + +func (e *ExchangeInfoResponse) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint16, doRangeCheck bool) error { + if actingVersion > e.SbeSchemaVersion() && blockLength > e.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-e.SbeBlockLength())) + } + + if e.RateLimitsInActingVersion(actingVersion) { + var RateLimitsBlockLength uint16 + if err := _m.ReadUint16(_r, &RateLimitsBlockLength); err != nil { + return err + } + var RateLimitsNumInGroup uint32 + if err := _m.ReadUint32(_r, &RateLimitsNumInGroup); err != nil { + return err + } + if cap(e.RateLimits) < int(RateLimitsNumInGroup) { + e.RateLimits = make([]ExchangeInfoResponseRateLimits, RateLimitsNumInGroup) + } + e.RateLimits = e.RateLimits[:RateLimitsNumInGroup] + for i := range e.RateLimits { + if err := e.RateLimits[i].Decode(_m, _r, actingVersion, uint(RateLimitsBlockLength)); err != nil { + return err + } + } + } + + if e.ExchangeFiltersInActingVersion(actingVersion) { + var ExchangeFiltersBlockLength uint16 + if err := _m.ReadUint16(_r, &ExchangeFiltersBlockLength); err != nil { + return err + } + var ExchangeFiltersNumInGroup uint32 + if err := _m.ReadUint32(_r, &ExchangeFiltersNumInGroup); err != nil { + return err + } + if cap(e.ExchangeFilters) < int(ExchangeFiltersNumInGroup) { + e.ExchangeFilters = make([]ExchangeInfoResponseExchangeFilters, ExchangeFiltersNumInGroup) + } + e.ExchangeFilters = e.ExchangeFilters[:ExchangeFiltersNumInGroup] + for i := range e.ExchangeFilters { + if err := e.ExchangeFilters[i].Decode(_m, _r, actingVersion, uint(ExchangeFiltersBlockLength)); err != nil { + return err + } + } + } + + if e.SymbolsInActingVersion(actingVersion) { + var SymbolsBlockLength uint16 + if err := _m.ReadUint16(_r, &SymbolsBlockLength); err != nil { + return err + } + var SymbolsNumInGroup uint32 + if err := _m.ReadUint32(_r, &SymbolsNumInGroup); err != nil { + return err + } + if cap(e.Symbols) < int(SymbolsNumInGroup) { + e.Symbols = make([]ExchangeInfoResponseSymbols, SymbolsNumInGroup) + } + e.Symbols = e.Symbols[:SymbolsNumInGroup] + for i := range e.Symbols { + if err := e.Symbols[i].Decode(_m, _r, actingVersion, uint(SymbolsBlockLength)); err != nil { + return err + } + } + } + + if e.SorsInActingVersion(actingVersion) { + var SorsBlockLength uint16 + if err := _m.ReadUint16(_r, &SorsBlockLength); err != nil { + return err + } + var SorsNumInGroup uint32 + if err := _m.ReadUint32(_r, &SorsNumInGroup); err != nil { + return err + } + if cap(e.Sors) < int(SorsNumInGroup) { + e.Sors = make([]ExchangeInfoResponseSors, SorsNumInGroup) + } + e.Sors = e.Sors[:SorsNumInGroup] + for i := range e.Sors { + if err := e.Sors[i].Decode(_m, _r, actingVersion, uint(SorsBlockLength)); err != nil { + return err + } + } + } + if doRangeCheck { + if err := e.RangeCheck(actingVersion, e.SbeSchemaVersion()); err != nil { + return err + } + } + return nil +} + +func (e *ExchangeInfoResponse) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + for i := range e.RateLimits { + if err := e.RateLimits[i].RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + } + for i := range e.ExchangeFilters { + if err := e.ExchangeFilters[i].RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + } + for i := range e.Symbols { + if err := e.Symbols[i].RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + } + for i := range e.Sors { + if err := e.Sors[i].RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + } + return nil +} + +func ExchangeInfoResponseInit(e *ExchangeInfoResponse) { + return +} + +func (e *ExchangeInfoResponseRateLimits) Encode(_m *SbeGoMarshaller, _w io.Writer) error { + if err := e.RateLimitType.Encode(_m, _w); err != nil { + return err + } + if err := e.Interval.Encode(_m, _w); err != nil { + return err + } + if err := _m.WriteUint8(_w, e.IntervalNum); err != nil { + return err + } + if err := _m.WriteInt64(_w, e.RateLimit); err != nil { + return err + } + return nil +} + +func (e *ExchangeInfoResponseRateLimits) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint) error { + if e.RateLimitTypeInActingVersion(actingVersion) { + if err := e.RateLimitType.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if e.IntervalInActingVersion(actingVersion) { + if err := e.Interval.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if !e.IntervalNumInActingVersion(actingVersion) { + e.IntervalNum = e.IntervalNumNullValue() + } else { + if err := _m.ReadUint8(_r, &e.IntervalNum); err != nil { + return err + } + } + if !e.RateLimitInActingVersion(actingVersion) { + e.RateLimit = e.RateLimitNullValue() + } else { + if err := _m.ReadInt64(_r, &e.RateLimit); err != nil { + return err + } + } + if actingVersion > e.SbeSchemaVersion() && blockLength > e.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-e.SbeBlockLength())) + } + return nil +} + +func (e *ExchangeInfoResponseRateLimits) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if err := e.RateLimitType.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if err := e.Interval.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if e.IntervalNumInActingVersion(actingVersion) { + if e.IntervalNum < e.IntervalNumMinValue() || e.IntervalNum > e.IntervalNumMaxValue() { + return fmt.Errorf("Range check failed on e.IntervalNum (%v < %v > %v)", e.IntervalNumMinValue(), e.IntervalNum, e.IntervalNumMaxValue()) + } + } + if e.RateLimitInActingVersion(actingVersion) { + if e.RateLimit < e.RateLimitMinValue() || e.RateLimit > e.RateLimitMaxValue() { + return fmt.Errorf("Range check failed on e.RateLimit (%v < %v > %v)", e.RateLimitMinValue(), e.RateLimit, e.RateLimitMaxValue()) + } + } + return nil +} + +func ExchangeInfoResponseRateLimitsInit(e *ExchangeInfoResponseRateLimits) { + return +} + +func (e *ExchangeInfoResponseExchangeFilters) Encode(_m *SbeGoMarshaller, _w io.Writer) error { + if err := _m.WriteUint8(_w, uint8(len(e.Filter))); err != nil { + return err + } + if err := _m.WriteBytes(_w, e.Filter); err != nil { + return err + } + return nil +} + +func (e *ExchangeInfoResponseExchangeFilters) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint) error { + if actingVersion > e.SbeSchemaVersion() && blockLength > e.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-e.SbeBlockLength())) + } + + if e.FilterInActingVersion(actingVersion) { + var FilterLength uint8 + if err := _m.ReadUint8(_r, &FilterLength); err != nil { + return err + } + if cap(e.Filter) < int(FilterLength) { + e.Filter = make([]uint8, FilterLength) + } + e.Filter = e.Filter[:FilterLength] + if err := _m.ReadBytes(_r, e.Filter); err != nil { + return err + } + } + return nil +} + +func (e *ExchangeInfoResponseExchangeFilters) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + return nil +} + +func ExchangeInfoResponseExchangeFiltersInit(e *ExchangeInfoResponseExchangeFilters) { + return +} + +func (e *ExchangeInfoResponseSymbols) Encode(_m *SbeGoMarshaller, _w io.Writer) error { + if err := e.Status.Encode(_m, _w); err != nil { + return err + } + if err := _m.WriteUint8(_w, e.BaseAssetPrecision); err != nil { + return err + } + if err := _m.WriteUint8(_w, e.QuoteAssetPrecision); err != nil { + return err + } + if err := _m.WriteUint8(_w, e.BaseCommissionPrecision); err != nil { + return err + } + if err := _m.WriteUint8(_w, e.QuoteCommissionPrecision); err != nil { + return err + } + if err := e.OrderTypes.Encode(_m, _w); err != nil { + return err + } + if err := e.IcebergAllowed.Encode(_m, _w); err != nil { + return err + } + if err := e.OcoAllowed.Encode(_m, _w); err != nil { + return err + } + if err := e.OtoAllowed.Encode(_m, _w); err != nil { + return err + } + if err := e.QuoteOrderQtyMarketAllowed.Encode(_m, _w); err != nil { + return err + } + if err := e.AllowTrailingStop.Encode(_m, _w); err != nil { + return err + } + if err := e.CancelReplaceAllowed.Encode(_m, _w); err != nil { + return err + } + if err := e.AmendAllowed.Encode(_m, _w); err != nil { + return err + } + if err := e.IsSpotTradingAllowed.Encode(_m, _w); err != nil { + return err + } + if err := e.IsMarginTradingAllowed.Encode(_m, _w); err != nil { + return err + } + if err := e.DefaultSelfTradePreventionMode.Encode(_m, _w); err != nil { + return err + } + if err := e.AllowedSelfTradePreventionModes.Encode(_m, _w); err != nil { + return err + } + if err := e.PegInstructionsAllowed.Encode(_m, _w); err != nil { + return err + } + var FiltersBlockLength uint16 = 0 + if err := _m.WriteUint16(_w, FiltersBlockLength); err != nil { + return err + } + var FiltersNumInGroup uint32 = uint32(len(e.Filters)) + if err := _m.WriteUint32(_w, FiltersNumInGroup); err != nil { + return err + } + for i := range e.Filters { + if err := e.Filters[i].Encode(_m, _w); err != nil { + return err + } + } + var PermissionSetsBlockLength uint16 = 0 + if err := _m.WriteUint16(_w, PermissionSetsBlockLength); err != nil { + return err + } + var PermissionSetsNumInGroup uint32 = uint32(len(e.PermissionSets)) + if err := _m.WriteUint32(_w, PermissionSetsNumInGroup); err != nil { + return err + } + for i := range e.PermissionSets { + if err := e.PermissionSets[i].Encode(_m, _w); err != nil { + return err + } + } + if err := _m.WriteUint8(_w, uint8(len(e.Symbol))); err != nil { + return err + } + if err := _m.WriteBytes(_w, e.Symbol); err != nil { + return err + } + if err := _m.WriteUint8(_w, uint8(len(e.BaseAsset))); err != nil { + return err + } + if err := _m.WriteBytes(_w, e.BaseAsset); err != nil { + return err + } + if err := _m.WriteUint8(_w, uint8(len(e.QuoteAsset))); err != nil { + return err + } + if err := _m.WriteBytes(_w, e.QuoteAsset); err != nil { + return err + } + return nil +} + +func (e *ExchangeInfoResponseSymbols) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint) error { + if e.StatusInActingVersion(actingVersion) { + if err := e.Status.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if !e.BaseAssetPrecisionInActingVersion(actingVersion) { + e.BaseAssetPrecision = e.BaseAssetPrecisionNullValue() + } else { + if err := _m.ReadUint8(_r, &e.BaseAssetPrecision); err != nil { + return err + } + } + if !e.QuoteAssetPrecisionInActingVersion(actingVersion) { + e.QuoteAssetPrecision = e.QuoteAssetPrecisionNullValue() + } else { + if err := _m.ReadUint8(_r, &e.QuoteAssetPrecision); err != nil { + return err + } + } + if !e.BaseCommissionPrecisionInActingVersion(actingVersion) { + e.BaseCommissionPrecision = e.BaseCommissionPrecisionNullValue() + } else { + if err := _m.ReadUint8(_r, &e.BaseCommissionPrecision); err != nil { + return err + } + } + if !e.QuoteCommissionPrecisionInActingVersion(actingVersion) { + e.QuoteCommissionPrecision = e.QuoteCommissionPrecisionNullValue() + } else { + if err := _m.ReadUint8(_r, &e.QuoteCommissionPrecision); err != nil { + return err + } + } + if e.OrderTypesInActingVersion(actingVersion) { + if err := e.OrderTypes.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if e.IcebergAllowedInActingVersion(actingVersion) { + if err := e.IcebergAllowed.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if e.OcoAllowedInActingVersion(actingVersion) { + if err := e.OcoAllowed.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if e.OtoAllowedInActingVersion(actingVersion) { + if err := e.OtoAllowed.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if e.QuoteOrderQtyMarketAllowedInActingVersion(actingVersion) { + if err := e.QuoteOrderQtyMarketAllowed.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if e.AllowTrailingStopInActingVersion(actingVersion) { + if err := e.AllowTrailingStop.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if e.CancelReplaceAllowedInActingVersion(actingVersion) { + if err := e.CancelReplaceAllowed.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if e.AmendAllowedInActingVersion(actingVersion) { + if err := e.AmendAllowed.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if e.IsSpotTradingAllowedInActingVersion(actingVersion) { + if err := e.IsSpotTradingAllowed.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if e.IsMarginTradingAllowedInActingVersion(actingVersion) { + if err := e.IsMarginTradingAllowed.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if e.DefaultSelfTradePreventionModeInActingVersion(actingVersion) { + if err := e.DefaultSelfTradePreventionMode.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if e.AllowedSelfTradePreventionModesInActingVersion(actingVersion) { + if err := e.AllowedSelfTradePreventionModes.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if e.PegInstructionsAllowedInActingVersion(actingVersion) { + if err := e.PegInstructionsAllowed.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if actingVersion > e.SbeSchemaVersion() && blockLength > e.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-e.SbeBlockLength())) + } + + if e.FiltersInActingVersion(actingVersion) { + var FiltersBlockLength uint16 + if err := _m.ReadUint16(_r, &FiltersBlockLength); err != nil { + return err + } + var FiltersNumInGroup uint32 + if err := _m.ReadUint32(_r, &FiltersNumInGroup); err != nil { + return err + } + if cap(e.Filters) < int(FiltersNumInGroup) { + e.Filters = make([]ExchangeInfoResponseSymbolsFilters, FiltersNumInGroup) + } + e.Filters = e.Filters[:FiltersNumInGroup] + for i := range e.Filters { + if err := e.Filters[i].Decode(_m, _r, actingVersion, uint(FiltersBlockLength)); err != nil { + return err + } + } + } + + if e.PermissionSetsInActingVersion(actingVersion) { + var PermissionSetsBlockLength uint16 + if err := _m.ReadUint16(_r, &PermissionSetsBlockLength); err != nil { + return err + } + var PermissionSetsNumInGroup uint32 + if err := _m.ReadUint32(_r, &PermissionSetsNumInGroup); err != nil { + return err + } + if cap(e.PermissionSets) < int(PermissionSetsNumInGroup) { + e.PermissionSets = make([]ExchangeInfoResponseSymbolsPermissionSets, PermissionSetsNumInGroup) + } + e.PermissionSets = e.PermissionSets[:PermissionSetsNumInGroup] + for i := range e.PermissionSets { + if err := e.PermissionSets[i].Decode(_m, _r, actingVersion, uint(PermissionSetsBlockLength)); err != nil { + return err + } + } + } + + if e.SymbolInActingVersion(actingVersion) { + var SymbolLength uint8 + if err := _m.ReadUint8(_r, &SymbolLength); err != nil { + return err + } + if cap(e.Symbol) < int(SymbolLength) { + e.Symbol = make([]uint8, SymbolLength) + } + e.Symbol = e.Symbol[:SymbolLength] + if err := _m.ReadBytes(_r, e.Symbol); err != nil { + return err + } + } + + if e.BaseAssetInActingVersion(actingVersion) { + var BaseAssetLength uint8 + if err := _m.ReadUint8(_r, &BaseAssetLength); err != nil { + return err + } + if cap(e.BaseAsset) < int(BaseAssetLength) { + e.BaseAsset = make([]uint8, BaseAssetLength) + } + e.BaseAsset = e.BaseAsset[:BaseAssetLength] + if err := _m.ReadBytes(_r, e.BaseAsset); err != nil { + return err + } + } + + if e.QuoteAssetInActingVersion(actingVersion) { + var QuoteAssetLength uint8 + if err := _m.ReadUint8(_r, &QuoteAssetLength); err != nil { + return err + } + if cap(e.QuoteAsset) < int(QuoteAssetLength) { + e.QuoteAsset = make([]uint8, QuoteAssetLength) + } + e.QuoteAsset = e.QuoteAsset[:QuoteAssetLength] + if err := _m.ReadBytes(_r, e.QuoteAsset); err != nil { + return err + } + } + return nil +} + +func (e *ExchangeInfoResponseSymbols) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if err := e.Status.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if e.BaseAssetPrecisionInActingVersion(actingVersion) { + if e.BaseAssetPrecision < e.BaseAssetPrecisionMinValue() || e.BaseAssetPrecision > e.BaseAssetPrecisionMaxValue() { + return fmt.Errorf("Range check failed on e.BaseAssetPrecision (%v < %v > %v)", e.BaseAssetPrecisionMinValue(), e.BaseAssetPrecision, e.BaseAssetPrecisionMaxValue()) + } + } + if e.QuoteAssetPrecisionInActingVersion(actingVersion) { + if e.QuoteAssetPrecision < e.QuoteAssetPrecisionMinValue() || e.QuoteAssetPrecision > e.QuoteAssetPrecisionMaxValue() { + return fmt.Errorf("Range check failed on e.QuoteAssetPrecision (%v < %v > %v)", e.QuoteAssetPrecisionMinValue(), e.QuoteAssetPrecision, e.QuoteAssetPrecisionMaxValue()) + } + } + if e.BaseCommissionPrecisionInActingVersion(actingVersion) { + if e.BaseCommissionPrecision < e.BaseCommissionPrecisionMinValue() || e.BaseCommissionPrecision > e.BaseCommissionPrecisionMaxValue() { + return fmt.Errorf("Range check failed on e.BaseCommissionPrecision (%v < %v > %v)", e.BaseCommissionPrecisionMinValue(), e.BaseCommissionPrecision, e.BaseCommissionPrecisionMaxValue()) + } + } + if e.QuoteCommissionPrecisionInActingVersion(actingVersion) { + if e.QuoteCommissionPrecision < e.QuoteCommissionPrecisionMinValue() || e.QuoteCommissionPrecision > e.QuoteCommissionPrecisionMaxValue() { + return fmt.Errorf("Range check failed on e.QuoteCommissionPrecision (%v < %v > %v)", e.QuoteCommissionPrecisionMinValue(), e.QuoteCommissionPrecision, e.QuoteCommissionPrecisionMaxValue()) + } + } + if err := e.IcebergAllowed.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if err := e.OcoAllowed.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if err := e.OtoAllowed.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if err := e.QuoteOrderQtyMarketAllowed.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if err := e.AllowTrailingStop.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if err := e.CancelReplaceAllowed.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if err := e.AmendAllowed.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if err := e.IsSpotTradingAllowed.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if err := e.IsMarginTradingAllowed.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if err := e.DefaultSelfTradePreventionMode.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if err := e.PegInstructionsAllowed.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + for i := range e.Filters { + if err := e.Filters[i].RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + } + for i := range e.PermissionSets { + if err := e.PermissionSets[i].RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + } + if !utf8.Valid(e.Symbol[:]) { + return errors.New("e.Symbol failed UTF-8 validation") + } + if !utf8.Valid(e.BaseAsset[:]) { + return errors.New("e.BaseAsset failed UTF-8 validation") + } + if !utf8.Valid(e.QuoteAsset[:]) { + return errors.New("e.QuoteAsset failed UTF-8 validation") + } + return nil +} + +func ExchangeInfoResponseSymbolsInit(e *ExchangeInfoResponseSymbols) { + return +} + +func (e *ExchangeInfoResponseSymbolsFilters) Encode(_m *SbeGoMarshaller, _w io.Writer) error { + if err := _m.WriteUint8(_w, uint8(len(e.Filter))); err != nil { + return err + } + if err := _m.WriteBytes(_w, e.Filter); err != nil { + return err + } + return nil +} + +func (e *ExchangeInfoResponseSymbolsFilters) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint) error { + if actingVersion > e.SbeSchemaVersion() && blockLength > e.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-e.SbeBlockLength())) + } + + if e.FilterInActingVersion(actingVersion) { + var FilterLength uint8 + if err := _m.ReadUint8(_r, &FilterLength); err != nil { + return err + } + if cap(e.Filter) < int(FilterLength) { + e.Filter = make([]uint8, FilterLength) + } + e.Filter = e.Filter[:FilterLength] + if err := _m.ReadBytes(_r, e.Filter); err != nil { + return err + } + } + return nil +} + +func (e *ExchangeInfoResponseSymbolsFilters) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + return nil +} + +func ExchangeInfoResponseSymbolsFiltersInit(e *ExchangeInfoResponseSymbolsFilters) { + return +} + +func (e *ExchangeInfoResponseSymbolsPermissionSets) Encode(_m *SbeGoMarshaller, _w io.Writer) error { + var PermissionsBlockLength uint16 = 0 + if err := _m.WriteUint16(_w, PermissionsBlockLength); err != nil { + return err + } + var PermissionsNumInGroup uint32 = uint32(len(e.Permissions)) + if err := _m.WriteUint32(_w, PermissionsNumInGroup); err != nil { + return err + } + for i := range e.Permissions { + if err := e.Permissions[i].Encode(_m, _w); err != nil { + return err + } + } + return nil +} + +func (e *ExchangeInfoResponseSymbolsPermissionSets) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint) error { + if actingVersion > e.SbeSchemaVersion() && blockLength > e.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-e.SbeBlockLength())) + } + + if e.PermissionsInActingVersion(actingVersion) { + var PermissionsBlockLength uint16 + if err := _m.ReadUint16(_r, &PermissionsBlockLength); err != nil { + return err + } + var PermissionsNumInGroup uint32 + if err := _m.ReadUint32(_r, &PermissionsNumInGroup); err != nil { + return err + } + if cap(e.Permissions) < int(PermissionsNumInGroup) { + e.Permissions = make([]ExchangeInfoResponseSymbolsPermissionSetsPermissions, PermissionsNumInGroup) + } + e.Permissions = e.Permissions[:PermissionsNumInGroup] + for i := range e.Permissions { + if err := e.Permissions[i].Decode(_m, _r, actingVersion, uint(PermissionsBlockLength)); err != nil { + return err + } + } + } + return nil +} + +func (e *ExchangeInfoResponseSymbolsPermissionSets) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + for i := range e.Permissions { + if err := e.Permissions[i].RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + } + return nil +} + +func ExchangeInfoResponseSymbolsPermissionSetsInit(e *ExchangeInfoResponseSymbolsPermissionSets) { + return +} + +func (e *ExchangeInfoResponseSymbolsPermissionSetsPermissions) Encode(_m *SbeGoMarshaller, _w io.Writer) error { + if err := _m.WriteUint8(_w, uint8(len(e.Permission))); err != nil { + return err + } + if err := _m.WriteBytes(_w, e.Permission); err != nil { + return err + } + return nil +} + +func (e *ExchangeInfoResponseSymbolsPermissionSetsPermissions) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint) error { + if actingVersion > e.SbeSchemaVersion() && blockLength > e.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-e.SbeBlockLength())) + } + + if e.PermissionInActingVersion(actingVersion) { + var PermissionLength uint8 + if err := _m.ReadUint8(_r, &PermissionLength); err != nil { + return err + } + if cap(e.Permission) < int(PermissionLength) { + e.Permission = make([]uint8, PermissionLength) + } + e.Permission = e.Permission[:PermissionLength] + if err := _m.ReadBytes(_r, e.Permission); err != nil { + return err + } + } + return nil +} + +func (e *ExchangeInfoResponseSymbolsPermissionSetsPermissions) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if !utf8.Valid(e.Permission[:]) { + return errors.New("e.Permission failed UTF-8 validation") + } + return nil +} + +func ExchangeInfoResponseSymbolsPermissionSetsPermissionsInit(e *ExchangeInfoResponseSymbolsPermissionSetsPermissions) { + return +} + +func (e *ExchangeInfoResponseSors) Encode(_m *SbeGoMarshaller, _w io.Writer) error { + var SorSymbolsBlockLength uint16 = 0 + if err := _m.WriteUint16(_w, SorSymbolsBlockLength); err != nil { + return err + } + var SorSymbolsNumInGroup uint32 = uint32(len(e.SorSymbols)) + if err := _m.WriteUint32(_w, SorSymbolsNumInGroup); err != nil { + return err + } + for i := range e.SorSymbols { + if err := e.SorSymbols[i].Encode(_m, _w); err != nil { + return err + } + } + if err := _m.WriteUint8(_w, uint8(len(e.BaseAsset))); err != nil { + return err + } + if err := _m.WriteBytes(_w, e.BaseAsset); err != nil { + return err + } + return nil +} + +func (e *ExchangeInfoResponseSors) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint) error { + if actingVersion > e.SbeSchemaVersion() && blockLength > e.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-e.SbeBlockLength())) + } + + if e.SorSymbolsInActingVersion(actingVersion) { + var SorSymbolsBlockLength uint16 + if err := _m.ReadUint16(_r, &SorSymbolsBlockLength); err != nil { + return err + } + var SorSymbolsNumInGroup uint32 + if err := _m.ReadUint32(_r, &SorSymbolsNumInGroup); err != nil { + return err + } + if cap(e.SorSymbols) < int(SorSymbolsNumInGroup) { + e.SorSymbols = make([]ExchangeInfoResponseSorsSorSymbols, SorSymbolsNumInGroup) + } + e.SorSymbols = e.SorSymbols[:SorSymbolsNumInGroup] + for i := range e.SorSymbols { + if err := e.SorSymbols[i].Decode(_m, _r, actingVersion, uint(SorSymbolsBlockLength)); err != nil { + return err + } + } + } + + if e.BaseAssetInActingVersion(actingVersion) { + var BaseAssetLength uint8 + if err := _m.ReadUint8(_r, &BaseAssetLength); err != nil { + return err + } + if cap(e.BaseAsset) < int(BaseAssetLength) { + e.BaseAsset = make([]uint8, BaseAssetLength) + } + e.BaseAsset = e.BaseAsset[:BaseAssetLength] + if err := _m.ReadBytes(_r, e.BaseAsset); err != nil { + return err + } + } + return nil +} + +func (e *ExchangeInfoResponseSors) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + for i := range e.SorSymbols { + if err := e.SorSymbols[i].RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + } + if !utf8.Valid(e.BaseAsset[:]) { + return errors.New("e.BaseAsset failed UTF-8 validation") + } + return nil +} + +func ExchangeInfoResponseSorsInit(e *ExchangeInfoResponseSors) { + return +} + +func (e *ExchangeInfoResponseSorsSorSymbols) Encode(_m *SbeGoMarshaller, _w io.Writer) error { + if err := _m.WriteUint8(_w, uint8(len(e.Symbol))); err != nil { + return err + } + if err := _m.WriteBytes(_w, e.Symbol); err != nil { + return err + } + return nil +} + +func (e *ExchangeInfoResponseSorsSorSymbols) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint) error { + if actingVersion > e.SbeSchemaVersion() && blockLength > e.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-e.SbeBlockLength())) + } + + if e.SymbolInActingVersion(actingVersion) { + var SymbolLength uint8 + if err := _m.ReadUint8(_r, &SymbolLength); err != nil { + return err + } + if cap(e.Symbol) < int(SymbolLength) { + e.Symbol = make([]uint8, SymbolLength) + } + e.Symbol = e.Symbol[:SymbolLength] + if err := _m.ReadBytes(_r, e.Symbol); err != nil { + return err + } + } + return nil +} + +func (e *ExchangeInfoResponseSorsSorSymbols) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if !utf8.Valid(e.Symbol[:]) { + return errors.New("e.Symbol failed UTF-8 validation") + } + return nil +} + +func ExchangeInfoResponseSorsSorSymbolsInit(e *ExchangeInfoResponseSorsSorSymbols) { + return +} + +func (*ExchangeInfoResponse) SbeBlockLength() (blockLength uint16) { + return 0 +} + +func (*ExchangeInfoResponse) SbeTemplateId() (templateId uint16) { + return 103 +} + +func (*ExchangeInfoResponse) SbeSchemaId() (schemaId uint16) { + return 3 +} + +func (*ExchangeInfoResponse) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} + +func (*ExchangeInfoResponse) SbeSemanticType() (semanticType []byte) { + return []byte("") +} + +func (*ExchangeInfoResponse) SbeSemanticVersion() (semanticVersion string) { + return "5.2" +} + +func (*ExchangeInfoResponseRateLimits) RateLimitTypeId() uint16 { + return 1 +} + +func (*ExchangeInfoResponseRateLimits) RateLimitTypeSinceVersion() uint16 { + return 0 +} + +func (e *ExchangeInfoResponseRateLimits) RateLimitTypeInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.RateLimitTypeSinceVersion() +} + +func (*ExchangeInfoResponseRateLimits) RateLimitTypeDeprecated() uint16 { + return 0 +} + +func (*ExchangeInfoResponseRateLimits) RateLimitTypeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*ExchangeInfoResponseRateLimits) IntervalId() uint16 { + return 2 +} + +func (*ExchangeInfoResponseRateLimits) IntervalSinceVersion() uint16 { + return 0 +} + +func (e *ExchangeInfoResponseRateLimits) IntervalInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.IntervalSinceVersion() +} + +func (*ExchangeInfoResponseRateLimits) IntervalDeprecated() uint16 { + return 0 +} + +func (*ExchangeInfoResponseRateLimits) IntervalMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*ExchangeInfoResponseRateLimits) IntervalNumId() uint16 { + return 3 +} + +func (*ExchangeInfoResponseRateLimits) IntervalNumSinceVersion() uint16 { + return 0 +} + +func (e *ExchangeInfoResponseRateLimits) IntervalNumInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.IntervalNumSinceVersion() +} + +func (*ExchangeInfoResponseRateLimits) IntervalNumDeprecated() uint16 { + return 0 +} + +func (*ExchangeInfoResponseRateLimits) IntervalNumMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*ExchangeInfoResponseRateLimits) IntervalNumMinValue() uint8 { + return 0 +} + +func (*ExchangeInfoResponseRateLimits) IntervalNumMaxValue() uint8 { + return math.MaxUint8 - 1 +} + +func (*ExchangeInfoResponseRateLimits) IntervalNumNullValue() uint8 { + return math.MaxUint8 +} + +func (*ExchangeInfoResponseRateLimits) RateLimitId() uint16 { + return 4 +} + +func (*ExchangeInfoResponseRateLimits) RateLimitSinceVersion() uint16 { + return 0 +} + +func (e *ExchangeInfoResponseRateLimits) RateLimitInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.RateLimitSinceVersion() +} + +func (*ExchangeInfoResponseRateLimits) RateLimitDeprecated() uint16 { + return 0 +} + +func (*ExchangeInfoResponseRateLimits) RateLimitMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*ExchangeInfoResponseRateLimits) RateLimitMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*ExchangeInfoResponseRateLimits) RateLimitMaxValue() int64 { + return math.MaxInt64 +} + +func (*ExchangeInfoResponseRateLimits) RateLimitNullValue() int64 { + return math.MinInt64 +} + +func (*ExchangeInfoResponseExchangeFilters) FilterMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*ExchangeInfoResponseExchangeFilters) FilterSinceVersion() uint16 { + return 0 +} + +func (e *ExchangeInfoResponseExchangeFilters) FilterInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.FilterSinceVersion() +} + +func (*ExchangeInfoResponseExchangeFilters) FilterDeprecated() uint16 { + return 0 +} + +func (ExchangeInfoResponseExchangeFilters) FilterCharacterEncoding() string { + return "null" +} + +func (ExchangeInfoResponseExchangeFilters) FilterHeaderLength() uint64 { + return 1 +} + +func (*ExchangeInfoResponseSymbols) StatusId() uint16 { + return 1 +} + +func (*ExchangeInfoResponseSymbols) StatusSinceVersion() uint16 { + return 0 +} + +func (e *ExchangeInfoResponseSymbols) StatusInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.StatusSinceVersion() +} + +func (*ExchangeInfoResponseSymbols) StatusDeprecated() uint16 { + return 0 +} + +func (*ExchangeInfoResponseSymbols) StatusMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*ExchangeInfoResponseSymbols) BaseAssetPrecisionId() uint16 { + return 2 +} + +func (*ExchangeInfoResponseSymbols) BaseAssetPrecisionSinceVersion() uint16 { + return 0 +} + +func (e *ExchangeInfoResponseSymbols) BaseAssetPrecisionInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.BaseAssetPrecisionSinceVersion() +} + +func (*ExchangeInfoResponseSymbols) BaseAssetPrecisionDeprecated() uint16 { + return 0 +} + +func (*ExchangeInfoResponseSymbols) BaseAssetPrecisionMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*ExchangeInfoResponseSymbols) BaseAssetPrecisionMinValue() uint8 { + return 0 +} + +func (*ExchangeInfoResponseSymbols) BaseAssetPrecisionMaxValue() uint8 { + return math.MaxUint8 - 1 +} + +func (*ExchangeInfoResponseSymbols) BaseAssetPrecisionNullValue() uint8 { + return math.MaxUint8 +} + +func (*ExchangeInfoResponseSymbols) QuoteAssetPrecisionId() uint16 { + return 3 +} + +func (*ExchangeInfoResponseSymbols) QuoteAssetPrecisionSinceVersion() uint16 { + return 0 +} + +func (e *ExchangeInfoResponseSymbols) QuoteAssetPrecisionInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.QuoteAssetPrecisionSinceVersion() +} + +func (*ExchangeInfoResponseSymbols) QuoteAssetPrecisionDeprecated() uint16 { + return 0 +} + +func (*ExchangeInfoResponseSymbols) QuoteAssetPrecisionMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*ExchangeInfoResponseSymbols) QuoteAssetPrecisionMinValue() uint8 { + return 0 +} + +func (*ExchangeInfoResponseSymbols) QuoteAssetPrecisionMaxValue() uint8 { + return math.MaxUint8 - 1 +} + +func (*ExchangeInfoResponseSymbols) QuoteAssetPrecisionNullValue() uint8 { + return math.MaxUint8 +} + +func (*ExchangeInfoResponseSymbols) BaseCommissionPrecisionId() uint16 { + return 4 +} + +func (*ExchangeInfoResponseSymbols) BaseCommissionPrecisionSinceVersion() uint16 { + return 0 +} + +func (e *ExchangeInfoResponseSymbols) BaseCommissionPrecisionInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.BaseCommissionPrecisionSinceVersion() +} + +func (*ExchangeInfoResponseSymbols) BaseCommissionPrecisionDeprecated() uint16 { + return 0 +} + +func (*ExchangeInfoResponseSymbols) BaseCommissionPrecisionMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*ExchangeInfoResponseSymbols) BaseCommissionPrecisionMinValue() uint8 { + return 0 +} + +func (*ExchangeInfoResponseSymbols) BaseCommissionPrecisionMaxValue() uint8 { + return math.MaxUint8 - 1 +} + +func (*ExchangeInfoResponseSymbols) BaseCommissionPrecisionNullValue() uint8 { + return math.MaxUint8 +} + +func (*ExchangeInfoResponseSymbols) QuoteCommissionPrecisionId() uint16 { + return 5 +} + +func (*ExchangeInfoResponseSymbols) QuoteCommissionPrecisionSinceVersion() uint16 { + return 0 +} + +func (e *ExchangeInfoResponseSymbols) QuoteCommissionPrecisionInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.QuoteCommissionPrecisionSinceVersion() +} + +func (*ExchangeInfoResponseSymbols) QuoteCommissionPrecisionDeprecated() uint16 { + return 0 +} + +func (*ExchangeInfoResponseSymbols) QuoteCommissionPrecisionMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*ExchangeInfoResponseSymbols) QuoteCommissionPrecisionMinValue() uint8 { + return 0 +} + +func (*ExchangeInfoResponseSymbols) QuoteCommissionPrecisionMaxValue() uint8 { + return math.MaxUint8 - 1 +} + +func (*ExchangeInfoResponseSymbols) QuoteCommissionPrecisionNullValue() uint8 { + return math.MaxUint8 +} + +func (*ExchangeInfoResponseSymbols) OrderTypesId() uint16 { + return 6 +} + +func (*ExchangeInfoResponseSymbols) OrderTypesSinceVersion() uint16 { + return 0 +} + +func (e *ExchangeInfoResponseSymbols) OrderTypesInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.OrderTypesSinceVersion() +} + +func (*ExchangeInfoResponseSymbols) OrderTypesDeprecated() uint16 { + return 0 +} + +func (*ExchangeInfoResponseSymbols) OrderTypesMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*ExchangeInfoResponseSymbols) IcebergAllowedId() uint16 { + return 7 +} + +func (*ExchangeInfoResponseSymbols) IcebergAllowedSinceVersion() uint16 { + return 0 +} + +func (e *ExchangeInfoResponseSymbols) IcebergAllowedInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.IcebergAllowedSinceVersion() +} + +func (*ExchangeInfoResponseSymbols) IcebergAllowedDeprecated() uint16 { + return 0 +} + +func (*ExchangeInfoResponseSymbols) IcebergAllowedMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*ExchangeInfoResponseSymbols) OcoAllowedId() uint16 { + return 8 +} + +func (*ExchangeInfoResponseSymbols) OcoAllowedSinceVersion() uint16 { + return 0 +} + +func (e *ExchangeInfoResponseSymbols) OcoAllowedInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.OcoAllowedSinceVersion() +} + +func (*ExchangeInfoResponseSymbols) OcoAllowedDeprecated() uint16 { + return 0 +} + +func (*ExchangeInfoResponseSymbols) OcoAllowedMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*ExchangeInfoResponseSymbols) OtoAllowedId() uint16 { + return 9 +} + +func (*ExchangeInfoResponseSymbols) OtoAllowedSinceVersion() uint16 { + return 0 +} + +func (e *ExchangeInfoResponseSymbols) OtoAllowedInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.OtoAllowedSinceVersion() +} + +func (*ExchangeInfoResponseSymbols) OtoAllowedDeprecated() uint16 { + return 0 +} + +func (*ExchangeInfoResponseSymbols) OtoAllowedMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*ExchangeInfoResponseSymbols) QuoteOrderQtyMarketAllowedId() uint16 { + return 10 +} + +func (*ExchangeInfoResponseSymbols) QuoteOrderQtyMarketAllowedSinceVersion() uint16 { + return 0 +} + +func (e *ExchangeInfoResponseSymbols) QuoteOrderQtyMarketAllowedInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.QuoteOrderQtyMarketAllowedSinceVersion() +} + +func (*ExchangeInfoResponseSymbols) QuoteOrderQtyMarketAllowedDeprecated() uint16 { + return 0 +} + +func (*ExchangeInfoResponseSymbols) QuoteOrderQtyMarketAllowedMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*ExchangeInfoResponseSymbols) AllowTrailingStopId() uint16 { + return 11 +} + +func (*ExchangeInfoResponseSymbols) AllowTrailingStopSinceVersion() uint16 { + return 0 +} + +func (e *ExchangeInfoResponseSymbols) AllowTrailingStopInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.AllowTrailingStopSinceVersion() +} + +func (*ExchangeInfoResponseSymbols) AllowTrailingStopDeprecated() uint16 { + return 0 +} + +func (*ExchangeInfoResponseSymbols) AllowTrailingStopMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*ExchangeInfoResponseSymbols) CancelReplaceAllowedId() uint16 { + return 12 +} + +func (*ExchangeInfoResponseSymbols) CancelReplaceAllowedSinceVersion() uint16 { + return 0 +} + +func (e *ExchangeInfoResponseSymbols) CancelReplaceAllowedInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.CancelReplaceAllowedSinceVersion() +} + +func (*ExchangeInfoResponseSymbols) CancelReplaceAllowedDeprecated() uint16 { + return 0 +} + +func (*ExchangeInfoResponseSymbols) CancelReplaceAllowedMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*ExchangeInfoResponseSymbols) AmendAllowedId() uint16 { + return 13 +} + +func (*ExchangeInfoResponseSymbols) AmendAllowedSinceVersion() uint16 { + return 0 +} + +func (e *ExchangeInfoResponseSymbols) AmendAllowedInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.AmendAllowedSinceVersion() +} + +func (*ExchangeInfoResponseSymbols) AmendAllowedDeprecated() uint16 { + return 0 +} + +func (*ExchangeInfoResponseSymbols) AmendAllowedMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*ExchangeInfoResponseSymbols) IsSpotTradingAllowedId() uint16 { + return 14 +} + +func (*ExchangeInfoResponseSymbols) IsSpotTradingAllowedSinceVersion() uint16 { + return 0 +} + +func (e *ExchangeInfoResponseSymbols) IsSpotTradingAllowedInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.IsSpotTradingAllowedSinceVersion() +} + +func (*ExchangeInfoResponseSymbols) IsSpotTradingAllowedDeprecated() uint16 { + return 0 +} + +func (*ExchangeInfoResponseSymbols) IsSpotTradingAllowedMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*ExchangeInfoResponseSymbols) IsMarginTradingAllowedId() uint16 { + return 15 +} + +func (*ExchangeInfoResponseSymbols) IsMarginTradingAllowedSinceVersion() uint16 { + return 0 +} + +func (e *ExchangeInfoResponseSymbols) IsMarginTradingAllowedInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.IsMarginTradingAllowedSinceVersion() +} + +func (*ExchangeInfoResponseSymbols) IsMarginTradingAllowedDeprecated() uint16 { + return 0 +} + +func (*ExchangeInfoResponseSymbols) IsMarginTradingAllowedMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*ExchangeInfoResponseSymbols) DefaultSelfTradePreventionModeId() uint16 { + return 16 +} + +func (*ExchangeInfoResponseSymbols) DefaultSelfTradePreventionModeSinceVersion() uint16 { + return 0 +} + +func (e *ExchangeInfoResponseSymbols) DefaultSelfTradePreventionModeInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.DefaultSelfTradePreventionModeSinceVersion() +} + +func (*ExchangeInfoResponseSymbols) DefaultSelfTradePreventionModeDeprecated() uint16 { + return 0 +} + +func (*ExchangeInfoResponseSymbols) DefaultSelfTradePreventionModeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*ExchangeInfoResponseSymbols) AllowedSelfTradePreventionModesId() uint16 { + return 17 +} + +func (*ExchangeInfoResponseSymbols) AllowedSelfTradePreventionModesSinceVersion() uint16 { + return 0 +} + +func (e *ExchangeInfoResponseSymbols) AllowedSelfTradePreventionModesInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.AllowedSelfTradePreventionModesSinceVersion() +} + +func (*ExchangeInfoResponseSymbols) AllowedSelfTradePreventionModesDeprecated() uint16 { + return 0 +} + +func (*ExchangeInfoResponseSymbols) AllowedSelfTradePreventionModesMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*ExchangeInfoResponseSymbols) PegInstructionsAllowedId() uint16 { + return 18 +} + +func (*ExchangeInfoResponseSymbols) PegInstructionsAllowedSinceVersion() uint16 { + return 1 +} + +func (e *ExchangeInfoResponseSymbols) PegInstructionsAllowedInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.PegInstructionsAllowedSinceVersion() +} + +func (*ExchangeInfoResponseSymbols) PegInstructionsAllowedDeprecated() uint16 { + return 0 +} + +func (*ExchangeInfoResponseSymbols) PegInstructionsAllowedMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*ExchangeInfoResponseSymbolsFilters) FilterMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*ExchangeInfoResponseSymbolsFilters) FilterSinceVersion() uint16 { + return 0 +} + +func (e *ExchangeInfoResponseSymbolsFilters) FilterInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.FilterSinceVersion() +} + +func (*ExchangeInfoResponseSymbolsFilters) FilterDeprecated() uint16 { + return 0 +} + +func (ExchangeInfoResponseSymbolsFilters) FilterCharacterEncoding() string { + return "null" +} + +func (ExchangeInfoResponseSymbolsFilters) FilterHeaderLength() uint64 { + return 1 +} + +func (*ExchangeInfoResponseSymbolsPermissionSetsPermissions) PermissionMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*ExchangeInfoResponseSymbolsPermissionSetsPermissions) PermissionSinceVersion() uint16 { + return 0 +} + +func (e *ExchangeInfoResponseSymbolsPermissionSetsPermissions) PermissionInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.PermissionSinceVersion() +} + +func (*ExchangeInfoResponseSymbolsPermissionSetsPermissions) PermissionDeprecated() uint16 { + return 0 +} + +func (ExchangeInfoResponseSymbolsPermissionSetsPermissions) PermissionCharacterEncoding() string { + return "UTF-8" +} + +func (ExchangeInfoResponseSymbolsPermissionSetsPermissions) PermissionHeaderLength() uint64 { + return 1 +} + +func (*ExchangeInfoResponseSymbols) SymbolMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*ExchangeInfoResponseSymbols) SymbolSinceVersion() uint16 { + return 0 +} + +func (e *ExchangeInfoResponseSymbols) SymbolInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.SymbolSinceVersion() +} + +func (*ExchangeInfoResponseSymbols) SymbolDeprecated() uint16 { + return 0 +} + +func (ExchangeInfoResponseSymbols) SymbolCharacterEncoding() string { + return "UTF-8" +} + +func (ExchangeInfoResponseSymbols) SymbolHeaderLength() uint64 { + return 1 +} + +func (*ExchangeInfoResponseSymbols) BaseAssetMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*ExchangeInfoResponseSymbols) BaseAssetSinceVersion() uint16 { + return 0 +} + +func (e *ExchangeInfoResponseSymbols) BaseAssetInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.BaseAssetSinceVersion() +} + +func (*ExchangeInfoResponseSymbols) BaseAssetDeprecated() uint16 { + return 0 +} + +func (ExchangeInfoResponseSymbols) BaseAssetCharacterEncoding() string { + return "UTF-8" +} + +func (ExchangeInfoResponseSymbols) BaseAssetHeaderLength() uint64 { + return 1 +} + +func (*ExchangeInfoResponseSymbols) QuoteAssetMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*ExchangeInfoResponseSymbols) QuoteAssetSinceVersion() uint16 { + return 0 +} + +func (e *ExchangeInfoResponseSymbols) QuoteAssetInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.QuoteAssetSinceVersion() +} + +func (*ExchangeInfoResponseSymbols) QuoteAssetDeprecated() uint16 { + return 0 +} + +func (ExchangeInfoResponseSymbols) QuoteAssetCharacterEncoding() string { + return "UTF-8" +} + +func (ExchangeInfoResponseSymbols) QuoteAssetHeaderLength() uint64 { + return 1 +} + +func (*ExchangeInfoResponseSorsSorSymbols) SymbolMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*ExchangeInfoResponseSorsSorSymbols) SymbolSinceVersion() uint16 { + return 0 +} + +func (e *ExchangeInfoResponseSorsSorSymbols) SymbolInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.SymbolSinceVersion() +} + +func (*ExchangeInfoResponseSorsSorSymbols) SymbolDeprecated() uint16 { + return 0 +} + +func (ExchangeInfoResponseSorsSorSymbols) SymbolCharacterEncoding() string { + return "UTF-8" +} + +func (ExchangeInfoResponseSorsSorSymbols) SymbolHeaderLength() uint64 { + return 1 +} + +func (*ExchangeInfoResponseSors) BaseAssetMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*ExchangeInfoResponseSors) BaseAssetSinceVersion() uint16 { + return 0 +} + +func (e *ExchangeInfoResponseSors) BaseAssetInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.BaseAssetSinceVersion() +} + +func (*ExchangeInfoResponseSors) BaseAssetDeprecated() uint16 { + return 0 +} + +func (ExchangeInfoResponseSors) BaseAssetCharacterEncoding() string { + return "UTF-8" +} + +func (ExchangeInfoResponseSors) BaseAssetHeaderLength() uint64 { + return 1 +} + +func (*ExchangeInfoResponse) RateLimitsId() uint16 { + return 100 +} + +func (*ExchangeInfoResponse) RateLimitsSinceVersion() uint16 { + return 0 +} + +func (e *ExchangeInfoResponse) RateLimitsInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.RateLimitsSinceVersion() +} + +func (*ExchangeInfoResponse) RateLimitsDeprecated() uint16 { + return 0 +} + +func (*ExchangeInfoResponseRateLimits) SbeBlockLength() (blockLength uint) { + return 11 +} + +func (*ExchangeInfoResponseRateLimits) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} + +func (*ExchangeInfoResponse) ExchangeFiltersId() uint16 { + return 101 +} + +func (*ExchangeInfoResponse) ExchangeFiltersSinceVersion() uint16 { + return 0 +} + +func (e *ExchangeInfoResponse) ExchangeFiltersInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.ExchangeFiltersSinceVersion() +} + +func (*ExchangeInfoResponse) ExchangeFiltersDeprecated() uint16 { + return 0 +} + +func (*ExchangeInfoResponseExchangeFilters) SbeBlockLength() (blockLength uint) { + return 0 +} + +func (*ExchangeInfoResponseExchangeFilters) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} + +func (*ExchangeInfoResponse) SymbolsId() uint16 { + return 102 +} + +func (*ExchangeInfoResponse) SymbolsSinceVersion() uint16 { + return 0 +} + +func (e *ExchangeInfoResponse) SymbolsInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.SymbolsSinceVersion() +} + +func (*ExchangeInfoResponse) SymbolsDeprecated() uint16 { + return 0 +} + +func (*ExchangeInfoResponseSymbols) SbeBlockLength() (blockLength uint) { + return 19 +} + +func (*ExchangeInfoResponseSymbols) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} + +func (*ExchangeInfoResponseSymbols) FiltersId() uint16 { + return 100 +} + +func (*ExchangeInfoResponseSymbols) FiltersSinceVersion() uint16 { + return 0 +} + +func (e *ExchangeInfoResponseSymbols) FiltersInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.FiltersSinceVersion() +} + +func (*ExchangeInfoResponseSymbols) FiltersDeprecated() uint16 { + return 0 +} + +func (*ExchangeInfoResponseSymbolsFilters) SbeBlockLength() (blockLength uint) { + return 0 +} + +func (*ExchangeInfoResponseSymbolsFilters) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} + +func (*ExchangeInfoResponseSymbols) PermissionSetsId() uint16 { + return 101 +} + +func (*ExchangeInfoResponseSymbols) PermissionSetsSinceVersion() uint16 { + return 0 +} + +func (e *ExchangeInfoResponseSymbols) PermissionSetsInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.PermissionSetsSinceVersion() +} + +func (*ExchangeInfoResponseSymbols) PermissionSetsDeprecated() uint16 { + return 0 +} + +func (*ExchangeInfoResponseSymbolsPermissionSets) SbeBlockLength() (blockLength uint) { + return 0 +} + +func (*ExchangeInfoResponseSymbolsPermissionSets) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} + +func (*ExchangeInfoResponseSymbolsPermissionSets) PermissionsId() uint16 { + return 100 +} + +func (*ExchangeInfoResponseSymbolsPermissionSets) PermissionsSinceVersion() uint16 { + return 0 +} + +func (e *ExchangeInfoResponseSymbolsPermissionSets) PermissionsInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.PermissionsSinceVersion() +} + +func (*ExchangeInfoResponseSymbolsPermissionSets) PermissionsDeprecated() uint16 { + return 0 +} + +func (*ExchangeInfoResponseSymbolsPermissionSetsPermissions) SbeBlockLength() (blockLength uint) { + return 0 +} + +func (*ExchangeInfoResponseSymbolsPermissionSetsPermissions) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} + +func (*ExchangeInfoResponse) SorsId() uint16 { + return 103 +} + +func (*ExchangeInfoResponse) SorsSinceVersion() uint16 { + return 0 +} + +func (e *ExchangeInfoResponse) SorsInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.SorsSinceVersion() +} + +func (*ExchangeInfoResponse) SorsDeprecated() uint16 { + return 0 +} + +func (*ExchangeInfoResponseSors) SbeBlockLength() (blockLength uint) { + return 0 +} + +func (*ExchangeInfoResponseSors) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} + +func (*ExchangeInfoResponseSors) SorSymbolsId() uint16 { + return 1 +} + +func (*ExchangeInfoResponseSors) SorSymbolsSinceVersion() uint16 { + return 0 +} + +func (e *ExchangeInfoResponseSors) SorSymbolsInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.SorSymbolsSinceVersion() +} + +func (*ExchangeInfoResponseSors) SorSymbolsDeprecated() uint16 { + return 0 +} + +func (*ExchangeInfoResponseSorsSorSymbols) SbeBlockLength() (blockLength uint) { + return 0 +} + +func (*ExchangeInfoResponseSorsSorSymbols) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} diff --git a/v2/sbe/spot_3_1/ExchangeMaxNumAlgoOrdersFilter.go b/v2/sbe/spot_3_1/ExchangeMaxNumAlgoOrdersFilter.go new file mode 100644 index 00000000..f5b65c5a --- /dev/null +++ b/v2/sbe/spot_3_1/ExchangeMaxNumAlgoOrdersFilter.go @@ -0,0 +1,160 @@ +// Generated SBE (Simple Binary Encoding) message codec + +package sbe + +import ( + "fmt" + "io" + "io/ioutil" + "math" +) + +type ExchangeMaxNumAlgoOrdersFilter struct { + FilterType FilterTypeEnum + MaxNumAlgoOrders int64 +} + +func (e *ExchangeMaxNumAlgoOrdersFilter) Encode(_m *SbeGoMarshaller, _w io.Writer, doRangeCheck bool) error { + if doRangeCheck { + if err := e.RangeCheck(e.SbeSchemaVersion(), e.SbeSchemaVersion()); err != nil { + return err + } + } + if err := _m.WriteInt64(_w, e.MaxNumAlgoOrders); err != nil { + return err + } + return nil +} + +func (e *ExchangeMaxNumAlgoOrdersFilter) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint16, doRangeCheck bool) error { + e.FilterType = FilterType.ExchangeMaxNumAlgoOrders + if !e.MaxNumAlgoOrdersInActingVersion(actingVersion) { + e.MaxNumAlgoOrders = e.MaxNumAlgoOrdersNullValue() + } else { + if err := _m.ReadInt64(_r, &e.MaxNumAlgoOrders); err != nil { + return err + } + } + if actingVersion > e.SbeSchemaVersion() && blockLength > e.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-e.SbeBlockLength())) + } + if doRangeCheck { + if err := e.RangeCheck(actingVersion, e.SbeSchemaVersion()); err != nil { + return err + } + } + return nil +} + +func (e *ExchangeMaxNumAlgoOrdersFilter) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if err := e.FilterType.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if e.MaxNumAlgoOrdersInActingVersion(actingVersion) { + if e.MaxNumAlgoOrders < e.MaxNumAlgoOrdersMinValue() || e.MaxNumAlgoOrders > e.MaxNumAlgoOrdersMaxValue() { + return fmt.Errorf("Range check failed on e.MaxNumAlgoOrders (%v < %v > %v)", e.MaxNumAlgoOrdersMinValue(), e.MaxNumAlgoOrders, e.MaxNumAlgoOrdersMaxValue()) + } + } + return nil +} + +func ExchangeMaxNumAlgoOrdersFilterInit(e *ExchangeMaxNumAlgoOrdersFilter) { + e.FilterType = FilterType.ExchangeMaxNumAlgoOrders + return +} + +func (*ExchangeMaxNumAlgoOrdersFilter) SbeBlockLength() (blockLength uint16) { + return 8 +} + +func (*ExchangeMaxNumAlgoOrdersFilter) SbeTemplateId() (templateId uint16) { + return 16 +} + +func (*ExchangeMaxNumAlgoOrdersFilter) SbeSchemaId() (schemaId uint16) { + return 3 +} + +func (*ExchangeMaxNumAlgoOrdersFilter) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} + +func (*ExchangeMaxNumAlgoOrdersFilter) SbeSemanticType() (semanticType []byte) { + return []byte("") +} + +func (*ExchangeMaxNumAlgoOrdersFilter) SbeSemanticVersion() (semanticVersion string) { + return "5.2" +} + +func (*ExchangeMaxNumAlgoOrdersFilter) FilterTypeId() uint16 { + return 1 +} + +func (*ExchangeMaxNumAlgoOrdersFilter) FilterTypeSinceVersion() uint16 { + return 0 +} + +func (e *ExchangeMaxNumAlgoOrdersFilter) FilterTypeInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.FilterTypeSinceVersion() +} + +func (*ExchangeMaxNumAlgoOrdersFilter) FilterTypeDeprecated() uint16 { + return 0 +} + +func (*ExchangeMaxNumAlgoOrdersFilter) FilterTypeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "constant" + } + return "" +} + +func (*ExchangeMaxNumAlgoOrdersFilter) MaxNumAlgoOrdersId() uint16 { + return 2 +} + +func (*ExchangeMaxNumAlgoOrdersFilter) MaxNumAlgoOrdersSinceVersion() uint16 { + return 0 +} + +func (e *ExchangeMaxNumAlgoOrdersFilter) MaxNumAlgoOrdersInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.MaxNumAlgoOrdersSinceVersion() +} + +func (*ExchangeMaxNumAlgoOrdersFilter) MaxNumAlgoOrdersDeprecated() uint16 { + return 0 +} + +func (*ExchangeMaxNumAlgoOrdersFilter) MaxNumAlgoOrdersMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*ExchangeMaxNumAlgoOrdersFilter) MaxNumAlgoOrdersMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*ExchangeMaxNumAlgoOrdersFilter) MaxNumAlgoOrdersMaxValue() int64 { + return math.MaxInt64 +} + +func (*ExchangeMaxNumAlgoOrdersFilter) MaxNumAlgoOrdersNullValue() int64 { + return math.MinInt64 +} diff --git a/v2/sbe/spot_3_1/ExchangeMaxNumIcebergOrdersFilter.go b/v2/sbe/spot_3_1/ExchangeMaxNumIcebergOrdersFilter.go new file mode 100644 index 00000000..d2f8ac4e --- /dev/null +++ b/v2/sbe/spot_3_1/ExchangeMaxNumIcebergOrdersFilter.go @@ -0,0 +1,160 @@ +// Generated SBE (Simple Binary Encoding) message codec + +package sbe + +import ( + "fmt" + "io" + "io/ioutil" + "math" +) + +type ExchangeMaxNumIcebergOrdersFilter struct { + FilterType FilterTypeEnum + MaxNumIcebergOrders int64 +} + +func (e *ExchangeMaxNumIcebergOrdersFilter) Encode(_m *SbeGoMarshaller, _w io.Writer, doRangeCheck bool) error { + if doRangeCheck { + if err := e.RangeCheck(e.SbeSchemaVersion(), e.SbeSchemaVersion()); err != nil { + return err + } + } + if err := _m.WriteInt64(_w, e.MaxNumIcebergOrders); err != nil { + return err + } + return nil +} + +func (e *ExchangeMaxNumIcebergOrdersFilter) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint16, doRangeCheck bool) error { + e.FilterType = FilterType.ExchangeMaxNumIcebergOrders + if !e.MaxNumIcebergOrdersInActingVersion(actingVersion) { + e.MaxNumIcebergOrders = e.MaxNumIcebergOrdersNullValue() + } else { + if err := _m.ReadInt64(_r, &e.MaxNumIcebergOrders); err != nil { + return err + } + } + if actingVersion > e.SbeSchemaVersion() && blockLength > e.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-e.SbeBlockLength())) + } + if doRangeCheck { + if err := e.RangeCheck(actingVersion, e.SbeSchemaVersion()); err != nil { + return err + } + } + return nil +} + +func (e *ExchangeMaxNumIcebergOrdersFilter) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if err := e.FilterType.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if e.MaxNumIcebergOrdersInActingVersion(actingVersion) { + if e.MaxNumIcebergOrders < e.MaxNumIcebergOrdersMinValue() || e.MaxNumIcebergOrders > e.MaxNumIcebergOrdersMaxValue() { + return fmt.Errorf("Range check failed on e.MaxNumIcebergOrders (%v < %v > %v)", e.MaxNumIcebergOrdersMinValue(), e.MaxNumIcebergOrders, e.MaxNumIcebergOrdersMaxValue()) + } + } + return nil +} + +func ExchangeMaxNumIcebergOrdersFilterInit(e *ExchangeMaxNumIcebergOrdersFilter) { + e.FilterType = FilterType.ExchangeMaxNumIcebergOrders + return +} + +func (*ExchangeMaxNumIcebergOrdersFilter) SbeBlockLength() (blockLength uint16) { + return 8 +} + +func (*ExchangeMaxNumIcebergOrdersFilter) SbeTemplateId() (templateId uint16) { + return 17 +} + +func (*ExchangeMaxNumIcebergOrdersFilter) SbeSchemaId() (schemaId uint16) { + return 3 +} + +func (*ExchangeMaxNumIcebergOrdersFilter) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} + +func (*ExchangeMaxNumIcebergOrdersFilter) SbeSemanticType() (semanticType []byte) { + return []byte("") +} + +func (*ExchangeMaxNumIcebergOrdersFilter) SbeSemanticVersion() (semanticVersion string) { + return "5.2" +} + +func (*ExchangeMaxNumIcebergOrdersFilter) FilterTypeId() uint16 { + return 1 +} + +func (*ExchangeMaxNumIcebergOrdersFilter) FilterTypeSinceVersion() uint16 { + return 0 +} + +func (e *ExchangeMaxNumIcebergOrdersFilter) FilterTypeInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.FilterTypeSinceVersion() +} + +func (*ExchangeMaxNumIcebergOrdersFilter) FilterTypeDeprecated() uint16 { + return 0 +} + +func (*ExchangeMaxNumIcebergOrdersFilter) FilterTypeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "constant" + } + return "" +} + +func (*ExchangeMaxNumIcebergOrdersFilter) MaxNumIcebergOrdersId() uint16 { + return 2 +} + +func (*ExchangeMaxNumIcebergOrdersFilter) MaxNumIcebergOrdersSinceVersion() uint16 { + return 0 +} + +func (e *ExchangeMaxNumIcebergOrdersFilter) MaxNumIcebergOrdersInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.MaxNumIcebergOrdersSinceVersion() +} + +func (*ExchangeMaxNumIcebergOrdersFilter) MaxNumIcebergOrdersDeprecated() uint16 { + return 0 +} + +func (*ExchangeMaxNumIcebergOrdersFilter) MaxNumIcebergOrdersMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*ExchangeMaxNumIcebergOrdersFilter) MaxNumIcebergOrdersMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*ExchangeMaxNumIcebergOrdersFilter) MaxNumIcebergOrdersMaxValue() int64 { + return math.MaxInt64 +} + +func (*ExchangeMaxNumIcebergOrdersFilter) MaxNumIcebergOrdersNullValue() int64 { + return math.MinInt64 +} diff --git a/v2/sbe/spot_3_1/ExchangeMaxNumOrderListsFilter.go b/v2/sbe/spot_3_1/ExchangeMaxNumOrderListsFilter.go new file mode 100644 index 00000000..9a8209ae --- /dev/null +++ b/v2/sbe/spot_3_1/ExchangeMaxNumOrderListsFilter.go @@ -0,0 +1,160 @@ +// Generated SBE (Simple Binary Encoding) message codec + +package sbe + +import ( + "fmt" + "io" + "io/ioutil" + "math" +) + +type ExchangeMaxNumOrderListsFilter struct { + FilterType FilterTypeEnum + MaxNumOrderLists int64 +} + +func (e *ExchangeMaxNumOrderListsFilter) Encode(_m *SbeGoMarshaller, _w io.Writer, doRangeCheck bool) error { + if doRangeCheck { + if err := e.RangeCheck(e.SbeSchemaVersion(), e.SbeSchemaVersion()); err != nil { + return err + } + } + if err := _m.WriteInt64(_w, e.MaxNumOrderLists); err != nil { + return err + } + return nil +} + +func (e *ExchangeMaxNumOrderListsFilter) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint16, doRangeCheck bool) error { + e.FilterType = FilterType.ExchangeMaxNumOrderLists + if !e.MaxNumOrderListsInActingVersion(actingVersion) { + e.MaxNumOrderLists = e.MaxNumOrderListsNullValue() + } else { + if err := _m.ReadInt64(_r, &e.MaxNumOrderLists); err != nil { + return err + } + } + if actingVersion > e.SbeSchemaVersion() && blockLength > e.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-e.SbeBlockLength())) + } + if doRangeCheck { + if err := e.RangeCheck(actingVersion, e.SbeSchemaVersion()); err != nil { + return err + } + } + return nil +} + +func (e *ExchangeMaxNumOrderListsFilter) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if err := e.FilterType.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if e.MaxNumOrderListsInActingVersion(actingVersion) { + if e.MaxNumOrderLists < e.MaxNumOrderListsMinValue() || e.MaxNumOrderLists > e.MaxNumOrderListsMaxValue() { + return fmt.Errorf("Range check failed on e.MaxNumOrderLists (%v < %v > %v)", e.MaxNumOrderListsMinValue(), e.MaxNumOrderLists, e.MaxNumOrderListsMaxValue()) + } + } + return nil +} + +func ExchangeMaxNumOrderListsFilterInit(e *ExchangeMaxNumOrderListsFilter) { + e.FilterType = FilterType.ExchangeMaxNumOrderLists + return +} + +func (*ExchangeMaxNumOrderListsFilter) SbeBlockLength() (blockLength uint16) { + return 8 +} + +func (*ExchangeMaxNumOrderListsFilter) SbeTemplateId() (templateId uint16) { + return 19 +} + +func (*ExchangeMaxNumOrderListsFilter) SbeSchemaId() (schemaId uint16) { + return 3 +} + +func (*ExchangeMaxNumOrderListsFilter) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} + +func (*ExchangeMaxNumOrderListsFilter) SbeSemanticType() (semanticType []byte) { + return []byte("") +} + +func (*ExchangeMaxNumOrderListsFilter) SbeSemanticVersion() (semanticVersion string) { + return "5.2" +} + +func (*ExchangeMaxNumOrderListsFilter) FilterTypeId() uint16 { + return 1 +} + +func (*ExchangeMaxNumOrderListsFilter) FilterTypeSinceVersion() uint16 { + return 0 +} + +func (e *ExchangeMaxNumOrderListsFilter) FilterTypeInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.FilterTypeSinceVersion() +} + +func (*ExchangeMaxNumOrderListsFilter) FilterTypeDeprecated() uint16 { + return 0 +} + +func (*ExchangeMaxNumOrderListsFilter) FilterTypeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "constant" + } + return "" +} + +func (*ExchangeMaxNumOrderListsFilter) MaxNumOrderListsId() uint16 { + return 2 +} + +func (*ExchangeMaxNumOrderListsFilter) MaxNumOrderListsSinceVersion() uint16 { + return 0 +} + +func (e *ExchangeMaxNumOrderListsFilter) MaxNumOrderListsInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.MaxNumOrderListsSinceVersion() +} + +func (*ExchangeMaxNumOrderListsFilter) MaxNumOrderListsDeprecated() uint16 { + return 0 +} + +func (*ExchangeMaxNumOrderListsFilter) MaxNumOrderListsMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*ExchangeMaxNumOrderListsFilter) MaxNumOrderListsMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*ExchangeMaxNumOrderListsFilter) MaxNumOrderListsMaxValue() int64 { + return math.MaxInt64 +} + +func (*ExchangeMaxNumOrderListsFilter) MaxNumOrderListsNullValue() int64 { + return math.MinInt64 +} diff --git a/v2/sbe/spot_3_1/ExchangeMaxNumOrdersFilter.go b/v2/sbe/spot_3_1/ExchangeMaxNumOrdersFilter.go new file mode 100644 index 00000000..b71b6fa4 --- /dev/null +++ b/v2/sbe/spot_3_1/ExchangeMaxNumOrdersFilter.go @@ -0,0 +1,160 @@ +// Generated SBE (Simple Binary Encoding) message codec + +package sbe + +import ( + "fmt" + "io" + "io/ioutil" + "math" +) + +type ExchangeMaxNumOrdersFilter struct { + FilterType FilterTypeEnum + MaxNumOrders int64 +} + +func (e *ExchangeMaxNumOrdersFilter) Encode(_m *SbeGoMarshaller, _w io.Writer, doRangeCheck bool) error { + if doRangeCheck { + if err := e.RangeCheck(e.SbeSchemaVersion(), e.SbeSchemaVersion()); err != nil { + return err + } + } + if err := _m.WriteInt64(_w, e.MaxNumOrders); err != nil { + return err + } + return nil +} + +func (e *ExchangeMaxNumOrdersFilter) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint16, doRangeCheck bool) error { + e.FilterType = FilterType.ExchangeMaxNumOrders + if !e.MaxNumOrdersInActingVersion(actingVersion) { + e.MaxNumOrders = e.MaxNumOrdersNullValue() + } else { + if err := _m.ReadInt64(_r, &e.MaxNumOrders); err != nil { + return err + } + } + if actingVersion > e.SbeSchemaVersion() && blockLength > e.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-e.SbeBlockLength())) + } + if doRangeCheck { + if err := e.RangeCheck(actingVersion, e.SbeSchemaVersion()); err != nil { + return err + } + } + return nil +} + +func (e *ExchangeMaxNumOrdersFilter) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if err := e.FilterType.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if e.MaxNumOrdersInActingVersion(actingVersion) { + if e.MaxNumOrders < e.MaxNumOrdersMinValue() || e.MaxNumOrders > e.MaxNumOrdersMaxValue() { + return fmt.Errorf("Range check failed on e.MaxNumOrders (%v < %v > %v)", e.MaxNumOrdersMinValue(), e.MaxNumOrders, e.MaxNumOrdersMaxValue()) + } + } + return nil +} + +func ExchangeMaxNumOrdersFilterInit(e *ExchangeMaxNumOrdersFilter) { + e.FilterType = FilterType.ExchangeMaxNumOrders + return +} + +func (*ExchangeMaxNumOrdersFilter) SbeBlockLength() (blockLength uint16) { + return 8 +} + +func (*ExchangeMaxNumOrdersFilter) SbeTemplateId() (templateId uint16) { + return 15 +} + +func (*ExchangeMaxNumOrdersFilter) SbeSchemaId() (schemaId uint16) { + return 3 +} + +func (*ExchangeMaxNumOrdersFilter) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} + +func (*ExchangeMaxNumOrdersFilter) SbeSemanticType() (semanticType []byte) { + return []byte("") +} + +func (*ExchangeMaxNumOrdersFilter) SbeSemanticVersion() (semanticVersion string) { + return "5.2" +} + +func (*ExchangeMaxNumOrdersFilter) FilterTypeId() uint16 { + return 1 +} + +func (*ExchangeMaxNumOrdersFilter) FilterTypeSinceVersion() uint16 { + return 0 +} + +func (e *ExchangeMaxNumOrdersFilter) FilterTypeInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.FilterTypeSinceVersion() +} + +func (*ExchangeMaxNumOrdersFilter) FilterTypeDeprecated() uint16 { + return 0 +} + +func (*ExchangeMaxNumOrdersFilter) FilterTypeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "constant" + } + return "" +} + +func (*ExchangeMaxNumOrdersFilter) MaxNumOrdersId() uint16 { + return 2 +} + +func (*ExchangeMaxNumOrdersFilter) MaxNumOrdersSinceVersion() uint16 { + return 0 +} + +func (e *ExchangeMaxNumOrdersFilter) MaxNumOrdersInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.MaxNumOrdersSinceVersion() +} + +func (*ExchangeMaxNumOrdersFilter) MaxNumOrdersDeprecated() uint16 { + return 0 +} + +func (*ExchangeMaxNumOrdersFilter) MaxNumOrdersMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*ExchangeMaxNumOrdersFilter) MaxNumOrdersMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*ExchangeMaxNumOrdersFilter) MaxNumOrdersMaxValue() int64 { + return math.MaxInt64 +} + +func (*ExchangeMaxNumOrdersFilter) MaxNumOrdersNullValue() int64 { + return math.MinInt64 +} diff --git a/v2/sbe/spot_3_1/ExecutionReportEvent.go b/v2/sbe/spot_3_1/ExecutionReportEvent.go new file mode 100644 index 00000000..a95698a7 --- /dev/null +++ b/v2/sbe/spot_3_1/ExecutionReportEvent.go @@ -0,0 +1,3269 @@ +// Generated SBE (Simple Binary Encoding) message codec + +package sbe + +import ( + "errors" + "fmt" + "io" + "io/ioutil" + "math" + "unicode/utf8" +) + +type ExecutionReportEvent struct { + EventTime int64 + TransactTime int64 + PriceExponent int8 + QtyExponent int8 + CommissionExponent int8 + OrderCreationTime int64 + WorkingTime int64 + OrderId int64 + OrderListId int64 + OrigQty int64 + Price int64 + OrigQuoteOrderQty int64 + IcebergQty int64 + StopPrice int64 + OrderType OrderTypeEnum + Side OrderSideEnum + TimeInForce TimeInForceEnum + ExecutionType ExecutionTypeEnum + OrderStatus OrderStatusEnum + TradeId int64 + ExecutionId int64 + ExecutedQty int64 + CummulativeQuoteQty int64 + LastQty int64 + LastPrice int64 + QuoteQty int64 + Commission int64 + IsWorking BoolEnumEnum + IsMaker BoolEnumEnum + IsBestMatch BoolEnumEnum + MatchType MatchTypeEnum + SelfTradePreventionMode SelfTradePreventionModeEnum + OrderCapacity OrderCapacityEnum + WorkingFloor FloorEnum + UsedSor BoolEnumEnum + AllocId int64 + TrailingDelta uint64 + TrailingTime int64 + TradeGroupId int64 + PreventedQty int64 + LastPreventedQty int64 + PreventedMatchId int64 + PreventedExecutionQty int64 + PreventedExecutionPrice int64 + PreventedExecutionQuoteQty int64 + StrategyType int32 + StrategyId int64 + CounterOrderId int64 + SubscriptionId uint16 + PegPriceType PegPriceTypeEnum + PegOffsetType PegOffsetTypeEnum + PegOffsetValue uint8 + PeggedPrice int64 + Symbol []uint8 + ClientOrderId []uint8 + OrigClientOrderId []uint8 + CommissionAsset []uint8 + RejectReason []uint8 + CounterSymbol []uint8 +} + +func (e *ExecutionReportEvent) Encode(_m *SbeGoMarshaller, _w io.Writer, doRangeCheck bool) error { + if doRangeCheck { + if err := e.RangeCheck(e.SbeSchemaVersion(), e.SbeSchemaVersion()); err != nil { + return err + } + } + if err := _m.WriteInt64(_w, e.EventTime); err != nil { + return err + } + if err := _m.WriteInt64(_w, e.TransactTime); err != nil { + return err + } + if err := _m.WriteInt8(_w, e.PriceExponent); err != nil { + return err + } + if err := _m.WriteInt8(_w, e.QtyExponent); err != nil { + return err + } + if err := _m.WriteInt8(_w, e.CommissionExponent); err != nil { + return err + } + if err := _m.WriteInt64(_w, e.OrderCreationTime); err != nil { + return err + } + if err := _m.WriteInt64(_w, e.WorkingTime); err != nil { + return err + } + if err := _m.WriteInt64(_w, e.OrderId); err != nil { + return err + } + if err := _m.WriteInt64(_w, e.OrderListId); err != nil { + return err + } + if err := _m.WriteInt64(_w, e.OrigQty); err != nil { + return err + } + if err := _m.WriteInt64(_w, e.Price); err != nil { + return err + } + if err := _m.WriteInt64(_w, e.OrigQuoteOrderQty); err != nil { + return err + } + if err := _m.WriteInt64(_w, e.IcebergQty); err != nil { + return err + } + if err := _m.WriteInt64(_w, e.StopPrice); err != nil { + return err + } + if err := e.OrderType.Encode(_m, _w); err != nil { + return err + } + if err := e.Side.Encode(_m, _w); err != nil { + return err + } + if err := e.TimeInForce.Encode(_m, _w); err != nil { + return err + } + if err := e.ExecutionType.Encode(_m, _w); err != nil { + return err + } + if err := e.OrderStatus.Encode(_m, _w); err != nil { + return err + } + if err := _m.WriteInt64(_w, e.TradeId); err != nil { + return err + } + if err := _m.WriteInt64(_w, e.ExecutionId); err != nil { + return err + } + if err := _m.WriteInt64(_w, e.ExecutedQty); err != nil { + return err + } + if err := _m.WriteInt64(_w, e.CummulativeQuoteQty); err != nil { + return err + } + if err := _m.WriteInt64(_w, e.LastQty); err != nil { + return err + } + if err := _m.WriteInt64(_w, e.LastPrice); err != nil { + return err + } + if err := _m.WriteInt64(_w, e.QuoteQty); err != nil { + return err + } + if err := _m.WriteInt64(_w, e.Commission); err != nil { + return err + } + if err := e.IsWorking.Encode(_m, _w); err != nil { + return err + } + if err := e.IsMaker.Encode(_m, _w); err != nil { + return err + } + if err := e.IsBestMatch.Encode(_m, _w); err != nil { + return err + } + if err := e.MatchType.Encode(_m, _w); err != nil { + return err + } + if err := e.SelfTradePreventionMode.Encode(_m, _w); err != nil { + return err + } + if err := e.OrderCapacity.Encode(_m, _w); err != nil { + return err + } + if err := e.WorkingFloor.Encode(_m, _w); err != nil { + return err + } + if err := e.UsedSor.Encode(_m, _w); err != nil { + return err + } + if err := _m.WriteInt64(_w, e.AllocId); err != nil { + return err + } + if err := _m.WriteUint64(_w, e.TrailingDelta); err != nil { + return err + } + if err := _m.WriteInt64(_w, e.TrailingTime); err != nil { + return err + } + if err := _m.WriteInt64(_w, e.TradeGroupId); err != nil { + return err + } + if err := _m.WriteInt64(_w, e.PreventedQty); err != nil { + return err + } + if err := _m.WriteInt64(_w, e.LastPreventedQty); err != nil { + return err + } + if err := _m.WriteInt64(_w, e.PreventedMatchId); err != nil { + return err + } + if err := _m.WriteInt64(_w, e.PreventedExecutionQty); err != nil { + return err + } + if err := _m.WriteInt64(_w, e.PreventedExecutionPrice); err != nil { + return err + } + if err := _m.WriteInt64(_w, e.PreventedExecutionQuoteQty); err != nil { + return err + } + if err := _m.WriteInt32(_w, e.StrategyType); err != nil { + return err + } + if err := _m.WriteInt64(_w, e.StrategyId); err != nil { + return err + } + if err := _m.WriteInt64(_w, e.CounterOrderId); err != nil { + return err + } + if err := _m.WriteUint16(_w, e.SubscriptionId); err != nil { + return err + } + if err := e.PegPriceType.Encode(_m, _w); err != nil { + return err + } + if err := e.PegOffsetType.Encode(_m, _w); err != nil { + return err + } + if err := _m.WriteUint8(_w, e.PegOffsetValue); err != nil { + return err + } + if err := _m.WriteInt64(_w, e.PeggedPrice); err != nil { + return err + } + if err := _m.WriteUint8(_w, uint8(len(e.Symbol))); err != nil { + return err + } + if err := _m.WriteBytes(_w, e.Symbol); err != nil { + return err + } + if err := _m.WriteUint8(_w, uint8(len(e.ClientOrderId))); err != nil { + return err + } + if err := _m.WriteBytes(_w, e.ClientOrderId); err != nil { + return err + } + if err := _m.WriteUint8(_w, uint8(len(e.OrigClientOrderId))); err != nil { + return err + } + if err := _m.WriteBytes(_w, e.OrigClientOrderId); err != nil { + return err + } + if err := _m.WriteUint8(_w, uint8(len(e.CommissionAsset))); err != nil { + return err + } + if err := _m.WriteBytes(_w, e.CommissionAsset); err != nil { + return err + } + if err := _m.WriteUint8(_w, uint8(len(e.RejectReason))); err != nil { + return err + } + if err := _m.WriteBytes(_w, e.RejectReason); err != nil { + return err + } + if err := _m.WriteUint8(_w, uint8(len(e.CounterSymbol))); err != nil { + return err + } + if err := _m.WriteBytes(_w, e.CounterSymbol); err != nil { + return err + } + return nil +} + +func (e *ExecutionReportEvent) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint16, doRangeCheck bool) error { + if !e.EventTimeInActingVersion(actingVersion) { + e.EventTime = e.EventTimeNullValue() + } else { + if err := _m.ReadInt64(_r, &e.EventTime); err != nil { + return err + } + } + if !e.TransactTimeInActingVersion(actingVersion) { + e.TransactTime = e.TransactTimeNullValue() + } else { + if err := _m.ReadInt64(_r, &e.TransactTime); err != nil { + return err + } + } + if !e.PriceExponentInActingVersion(actingVersion) { + e.PriceExponent = e.PriceExponentNullValue() + } else { + if err := _m.ReadInt8(_r, &e.PriceExponent); err != nil { + return err + } + } + if !e.QtyExponentInActingVersion(actingVersion) { + e.QtyExponent = e.QtyExponentNullValue() + } else { + if err := _m.ReadInt8(_r, &e.QtyExponent); err != nil { + return err + } + } + if !e.CommissionExponentInActingVersion(actingVersion) { + e.CommissionExponent = e.CommissionExponentNullValue() + } else { + if err := _m.ReadInt8(_r, &e.CommissionExponent); err != nil { + return err + } + } + if !e.OrderCreationTimeInActingVersion(actingVersion) { + e.OrderCreationTime = e.OrderCreationTimeNullValue() + } else { + if err := _m.ReadInt64(_r, &e.OrderCreationTime); err != nil { + return err + } + } + if !e.WorkingTimeInActingVersion(actingVersion) { + e.WorkingTime = e.WorkingTimeNullValue() + } else { + if err := _m.ReadInt64(_r, &e.WorkingTime); err != nil { + return err + } + } + if !e.OrderIdInActingVersion(actingVersion) { + e.OrderId = e.OrderIdNullValue() + } else { + if err := _m.ReadInt64(_r, &e.OrderId); err != nil { + return err + } + } + if !e.OrderListIdInActingVersion(actingVersion) { + e.OrderListId = e.OrderListIdNullValue() + } else { + if err := _m.ReadInt64(_r, &e.OrderListId); err != nil { + return err + } + } + if !e.OrigQtyInActingVersion(actingVersion) { + e.OrigQty = e.OrigQtyNullValue() + } else { + if err := _m.ReadInt64(_r, &e.OrigQty); err != nil { + return err + } + } + if !e.PriceInActingVersion(actingVersion) { + e.Price = e.PriceNullValue() + } else { + if err := _m.ReadInt64(_r, &e.Price); err != nil { + return err + } + } + if !e.OrigQuoteOrderQtyInActingVersion(actingVersion) { + e.OrigQuoteOrderQty = e.OrigQuoteOrderQtyNullValue() + } else { + if err := _m.ReadInt64(_r, &e.OrigQuoteOrderQty); err != nil { + return err + } + } + if !e.IcebergQtyInActingVersion(actingVersion) { + e.IcebergQty = e.IcebergQtyNullValue() + } else { + if err := _m.ReadInt64(_r, &e.IcebergQty); err != nil { + return err + } + } + if !e.StopPriceInActingVersion(actingVersion) { + e.StopPrice = e.StopPriceNullValue() + } else { + if err := _m.ReadInt64(_r, &e.StopPrice); err != nil { + return err + } + } + if e.OrderTypeInActingVersion(actingVersion) { + if err := e.OrderType.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if e.SideInActingVersion(actingVersion) { + if err := e.Side.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if e.TimeInForceInActingVersion(actingVersion) { + if err := e.TimeInForce.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if e.ExecutionTypeInActingVersion(actingVersion) { + if err := e.ExecutionType.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if e.OrderStatusInActingVersion(actingVersion) { + if err := e.OrderStatus.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if !e.TradeIdInActingVersion(actingVersion) { + e.TradeId = e.TradeIdNullValue() + } else { + if err := _m.ReadInt64(_r, &e.TradeId); err != nil { + return err + } + } + if !e.ExecutionIdInActingVersion(actingVersion) { + e.ExecutionId = e.ExecutionIdNullValue() + } else { + if err := _m.ReadInt64(_r, &e.ExecutionId); err != nil { + return err + } + } + if !e.ExecutedQtyInActingVersion(actingVersion) { + e.ExecutedQty = e.ExecutedQtyNullValue() + } else { + if err := _m.ReadInt64(_r, &e.ExecutedQty); err != nil { + return err + } + } + if !e.CummulativeQuoteQtyInActingVersion(actingVersion) { + e.CummulativeQuoteQty = e.CummulativeQuoteQtyNullValue() + } else { + if err := _m.ReadInt64(_r, &e.CummulativeQuoteQty); err != nil { + return err + } + } + if !e.LastQtyInActingVersion(actingVersion) { + e.LastQty = e.LastQtyNullValue() + } else { + if err := _m.ReadInt64(_r, &e.LastQty); err != nil { + return err + } + } + if !e.LastPriceInActingVersion(actingVersion) { + e.LastPrice = e.LastPriceNullValue() + } else { + if err := _m.ReadInt64(_r, &e.LastPrice); err != nil { + return err + } + } + if !e.QuoteQtyInActingVersion(actingVersion) { + e.QuoteQty = e.QuoteQtyNullValue() + } else { + if err := _m.ReadInt64(_r, &e.QuoteQty); err != nil { + return err + } + } + if !e.CommissionInActingVersion(actingVersion) { + e.Commission = e.CommissionNullValue() + } else { + if err := _m.ReadInt64(_r, &e.Commission); err != nil { + return err + } + } + if e.IsWorkingInActingVersion(actingVersion) { + if err := e.IsWorking.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if e.IsMakerInActingVersion(actingVersion) { + if err := e.IsMaker.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if e.IsBestMatchInActingVersion(actingVersion) { + if err := e.IsBestMatch.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if e.MatchTypeInActingVersion(actingVersion) { + if err := e.MatchType.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if e.SelfTradePreventionModeInActingVersion(actingVersion) { + if err := e.SelfTradePreventionMode.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if e.OrderCapacityInActingVersion(actingVersion) { + if err := e.OrderCapacity.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if e.WorkingFloorInActingVersion(actingVersion) { + if err := e.WorkingFloor.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if e.UsedSorInActingVersion(actingVersion) { + if err := e.UsedSor.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if !e.AllocIdInActingVersion(actingVersion) { + e.AllocId = e.AllocIdNullValue() + } else { + if err := _m.ReadInt64(_r, &e.AllocId); err != nil { + return err + } + } + if !e.TrailingDeltaInActingVersion(actingVersion) { + e.TrailingDelta = e.TrailingDeltaNullValue() + } else { + if err := _m.ReadUint64(_r, &e.TrailingDelta); err != nil { + return err + } + } + if !e.TrailingTimeInActingVersion(actingVersion) { + e.TrailingTime = e.TrailingTimeNullValue() + } else { + if err := _m.ReadInt64(_r, &e.TrailingTime); err != nil { + return err + } + } + if !e.TradeGroupIdInActingVersion(actingVersion) { + e.TradeGroupId = e.TradeGroupIdNullValue() + } else { + if err := _m.ReadInt64(_r, &e.TradeGroupId); err != nil { + return err + } + } + if !e.PreventedQtyInActingVersion(actingVersion) { + e.PreventedQty = e.PreventedQtyNullValue() + } else { + if err := _m.ReadInt64(_r, &e.PreventedQty); err != nil { + return err + } + } + if !e.LastPreventedQtyInActingVersion(actingVersion) { + e.LastPreventedQty = e.LastPreventedQtyNullValue() + } else { + if err := _m.ReadInt64(_r, &e.LastPreventedQty); err != nil { + return err + } + } + if !e.PreventedMatchIdInActingVersion(actingVersion) { + e.PreventedMatchId = e.PreventedMatchIdNullValue() + } else { + if err := _m.ReadInt64(_r, &e.PreventedMatchId); err != nil { + return err + } + } + if !e.PreventedExecutionQtyInActingVersion(actingVersion) { + e.PreventedExecutionQty = e.PreventedExecutionQtyNullValue() + } else { + if err := _m.ReadInt64(_r, &e.PreventedExecutionQty); err != nil { + return err + } + } + if !e.PreventedExecutionPriceInActingVersion(actingVersion) { + e.PreventedExecutionPrice = e.PreventedExecutionPriceNullValue() + } else { + if err := _m.ReadInt64(_r, &e.PreventedExecutionPrice); err != nil { + return err + } + } + if !e.PreventedExecutionQuoteQtyInActingVersion(actingVersion) { + e.PreventedExecutionQuoteQty = e.PreventedExecutionQuoteQtyNullValue() + } else { + if err := _m.ReadInt64(_r, &e.PreventedExecutionQuoteQty); err != nil { + return err + } + } + if !e.StrategyTypeInActingVersion(actingVersion) { + e.StrategyType = e.StrategyTypeNullValue() + } else { + if err := _m.ReadInt32(_r, &e.StrategyType); err != nil { + return err + } + } + if !e.StrategyIdInActingVersion(actingVersion) { + e.StrategyId = e.StrategyIdNullValue() + } else { + if err := _m.ReadInt64(_r, &e.StrategyId); err != nil { + return err + } + } + if !e.CounterOrderIdInActingVersion(actingVersion) { + e.CounterOrderId = e.CounterOrderIdNullValue() + } else { + if err := _m.ReadInt64(_r, &e.CounterOrderId); err != nil { + return err + } + } + if !e.SubscriptionIdInActingVersion(actingVersion) { + e.SubscriptionId = e.SubscriptionIdNullValue() + } else { + if err := _m.ReadUint16(_r, &e.SubscriptionId); err != nil { + return err + } + } + if e.PegPriceTypeInActingVersion(actingVersion) { + if err := e.PegPriceType.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if e.PegOffsetTypeInActingVersion(actingVersion) { + if err := e.PegOffsetType.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if !e.PegOffsetValueInActingVersion(actingVersion) { + e.PegOffsetValue = e.PegOffsetValueNullValue() + } else { + if err := _m.ReadUint8(_r, &e.PegOffsetValue); err != nil { + return err + } + } + if !e.PeggedPriceInActingVersion(actingVersion) { + e.PeggedPrice = e.PeggedPriceNullValue() + } else { + if err := _m.ReadInt64(_r, &e.PeggedPrice); err != nil { + return err + } + } + if actingVersion > e.SbeSchemaVersion() && blockLength > e.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-e.SbeBlockLength())) + } + + if e.SymbolInActingVersion(actingVersion) { + var SymbolLength uint8 + if err := _m.ReadUint8(_r, &SymbolLength); err != nil { + return err + } + if cap(e.Symbol) < int(SymbolLength) { + e.Symbol = make([]uint8, SymbolLength) + } + e.Symbol = e.Symbol[:SymbolLength] + if err := _m.ReadBytes(_r, e.Symbol); err != nil { + return err + } + } + + if e.ClientOrderIdInActingVersion(actingVersion) { + var ClientOrderIdLength uint8 + if err := _m.ReadUint8(_r, &ClientOrderIdLength); err != nil { + return err + } + if cap(e.ClientOrderId) < int(ClientOrderIdLength) { + e.ClientOrderId = make([]uint8, ClientOrderIdLength) + } + e.ClientOrderId = e.ClientOrderId[:ClientOrderIdLength] + if err := _m.ReadBytes(_r, e.ClientOrderId); err != nil { + return err + } + } + + if e.OrigClientOrderIdInActingVersion(actingVersion) { + var OrigClientOrderIdLength uint8 + if err := _m.ReadUint8(_r, &OrigClientOrderIdLength); err != nil { + return err + } + if cap(e.OrigClientOrderId) < int(OrigClientOrderIdLength) { + e.OrigClientOrderId = make([]uint8, OrigClientOrderIdLength) + } + e.OrigClientOrderId = e.OrigClientOrderId[:OrigClientOrderIdLength] + if err := _m.ReadBytes(_r, e.OrigClientOrderId); err != nil { + return err + } + } + + if e.CommissionAssetInActingVersion(actingVersion) { + var CommissionAssetLength uint8 + if err := _m.ReadUint8(_r, &CommissionAssetLength); err != nil { + return err + } + if cap(e.CommissionAsset) < int(CommissionAssetLength) { + e.CommissionAsset = make([]uint8, CommissionAssetLength) + } + e.CommissionAsset = e.CommissionAsset[:CommissionAssetLength] + if err := _m.ReadBytes(_r, e.CommissionAsset); err != nil { + return err + } + } + + if e.RejectReasonInActingVersion(actingVersion) { + var RejectReasonLength uint8 + if err := _m.ReadUint8(_r, &RejectReasonLength); err != nil { + return err + } + if cap(e.RejectReason) < int(RejectReasonLength) { + e.RejectReason = make([]uint8, RejectReasonLength) + } + e.RejectReason = e.RejectReason[:RejectReasonLength] + if err := _m.ReadBytes(_r, e.RejectReason); err != nil { + return err + } + } + + if e.CounterSymbolInActingVersion(actingVersion) { + var CounterSymbolLength uint8 + if err := _m.ReadUint8(_r, &CounterSymbolLength); err != nil { + return err + } + if cap(e.CounterSymbol) < int(CounterSymbolLength) { + e.CounterSymbol = make([]uint8, CounterSymbolLength) + } + e.CounterSymbol = e.CounterSymbol[:CounterSymbolLength] + if err := _m.ReadBytes(_r, e.CounterSymbol); err != nil { + return err + } + } + if doRangeCheck { + if err := e.RangeCheck(actingVersion, e.SbeSchemaVersion()); err != nil { + return err + } + } + return nil +} + +func (e *ExecutionReportEvent) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if e.EventTimeInActingVersion(actingVersion) { + if e.EventTime < e.EventTimeMinValue() || e.EventTime > e.EventTimeMaxValue() { + return fmt.Errorf("Range check failed on e.EventTime (%v < %v > %v)", e.EventTimeMinValue(), e.EventTime, e.EventTimeMaxValue()) + } + } + if e.TransactTimeInActingVersion(actingVersion) { + if e.TransactTime < e.TransactTimeMinValue() || e.TransactTime > e.TransactTimeMaxValue() { + return fmt.Errorf("Range check failed on e.TransactTime (%v < %v > %v)", e.TransactTimeMinValue(), e.TransactTime, e.TransactTimeMaxValue()) + } + } + if e.PriceExponentInActingVersion(actingVersion) { + if e.PriceExponent < e.PriceExponentMinValue() || e.PriceExponent > e.PriceExponentMaxValue() { + return fmt.Errorf("Range check failed on e.PriceExponent (%v < %v > %v)", e.PriceExponentMinValue(), e.PriceExponent, e.PriceExponentMaxValue()) + } + } + if e.QtyExponentInActingVersion(actingVersion) { + if e.QtyExponent < e.QtyExponentMinValue() || e.QtyExponent > e.QtyExponentMaxValue() { + return fmt.Errorf("Range check failed on e.QtyExponent (%v < %v > %v)", e.QtyExponentMinValue(), e.QtyExponent, e.QtyExponentMaxValue()) + } + } + if e.CommissionExponentInActingVersion(actingVersion) { + if e.CommissionExponent < e.CommissionExponentMinValue() || e.CommissionExponent > e.CommissionExponentMaxValue() { + return fmt.Errorf("Range check failed on e.CommissionExponent (%v < %v > %v)", e.CommissionExponentMinValue(), e.CommissionExponent, e.CommissionExponentMaxValue()) + } + } + if e.OrderCreationTimeInActingVersion(actingVersion) { + if e.OrderCreationTime != e.OrderCreationTimeNullValue() && (e.OrderCreationTime < e.OrderCreationTimeMinValue() || e.OrderCreationTime > e.OrderCreationTimeMaxValue()) { + return fmt.Errorf("Range check failed on e.OrderCreationTime (%v < %v > %v)", e.OrderCreationTimeMinValue(), e.OrderCreationTime, e.OrderCreationTimeMaxValue()) + } + } + if e.WorkingTimeInActingVersion(actingVersion) { + if e.WorkingTime != e.WorkingTimeNullValue() && (e.WorkingTime < e.WorkingTimeMinValue() || e.WorkingTime > e.WorkingTimeMaxValue()) { + return fmt.Errorf("Range check failed on e.WorkingTime (%v < %v > %v)", e.WorkingTimeMinValue(), e.WorkingTime, e.WorkingTimeMaxValue()) + } + } + if e.OrderIdInActingVersion(actingVersion) { + if e.OrderId < e.OrderIdMinValue() || e.OrderId > e.OrderIdMaxValue() { + return fmt.Errorf("Range check failed on e.OrderId (%v < %v > %v)", e.OrderIdMinValue(), e.OrderId, e.OrderIdMaxValue()) + } + } + if e.OrderListIdInActingVersion(actingVersion) { + if e.OrderListId != e.OrderListIdNullValue() && (e.OrderListId < e.OrderListIdMinValue() || e.OrderListId > e.OrderListIdMaxValue()) { + return fmt.Errorf("Range check failed on e.OrderListId (%v < %v > %v)", e.OrderListIdMinValue(), e.OrderListId, e.OrderListIdMaxValue()) + } + } + if e.OrigQtyInActingVersion(actingVersion) { + if e.OrigQty < e.OrigQtyMinValue() || e.OrigQty > e.OrigQtyMaxValue() { + return fmt.Errorf("Range check failed on e.OrigQty (%v < %v > %v)", e.OrigQtyMinValue(), e.OrigQty, e.OrigQtyMaxValue()) + } + } + if e.PriceInActingVersion(actingVersion) { + if e.Price < e.PriceMinValue() || e.Price > e.PriceMaxValue() { + return fmt.Errorf("Range check failed on e.Price (%v < %v > %v)", e.PriceMinValue(), e.Price, e.PriceMaxValue()) + } + } + if e.OrigQuoteOrderQtyInActingVersion(actingVersion) { + if e.OrigQuoteOrderQty < e.OrigQuoteOrderQtyMinValue() || e.OrigQuoteOrderQty > e.OrigQuoteOrderQtyMaxValue() { + return fmt.Errorf("Range check failed on e.OrigQuoteOrderQty (%v < %v > %v)", e.OrigQuoteOrderQtyMinValue(), e.OrigQuoteOrderQty, e.OrigQuoteOrderQtyMaxValue()) + } + } + if e.IcebergQtyInActingVersion(actingVersion) { + if e.IcebergQty < e.IcebergQtyMinValue() || e.IcebergQty > e.IcebergQtyMaxValue() { + return fmt.Errorf("Range check failed on e.IcebergQty (%v < %v > %v)", e.IcebergQtyMinValue(), e.IcebergQty, e.IcebergQtyMaxValue()) + } + } + if e.StopPriceInActingVersion(actingVersion) { + if e.StopPrice < e.StopPriceMinValue() || e.StopPrice > e.StopPriceMaxValue() { + return fmt.Errorf("Range check failed on e.StopPrice (%v < %v > %v)", e.StopPriceMinValue(), e.StopPrice, e.StopPriceMaxValue()) + } + } + if err := e.OrderType.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if err := e.Side.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if err := e.TimeInForce.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if err := e.ExecutionType.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if err := e.OrderStatus.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if e.TradeIdInActingVersion(actingVersion) { + if e.TradeId != e.TradeIdNullValue() && (e.TradeId < e.TradeIdMinValue() || e.TradeId > e.TradeIdMaxValue()) { + return fmt.Errorf("Range check failed on e.TradeId (%v < %v > %v)", e.TradeIdMinValue(), e.TradeId, e.TradeIdMaxValue()) + } + } + if e.ExecutionIdInActingVersion(actingVersion) { + if e.ExecutionId < e.ExecutionIdMinValue() || e.ExecutionId > e.ExecutionIdMaxValue() { + return fmt.Errorf("Range check failed on e.ExecutionId (%v < %v > %v)", e.ExecutionIdMinValue(), e.ExecutionId, e.ExecutionIdMaxValue()) + } + } + if e.ExecutedQtyInActingVersion(actingVersion) { + if e.ExecutedQty < e.ExecutedQtyMinValue() || e.ExecutedQty > e.ExecutedQtyMaxValue() { + return fmt.Errorf("Range check failed on e.ExecutedQty (%v < %v > %v)", e.ExecutedQtyMinValue(), e.ExecutedQty, e.ExecutedQtyMaxValue()) + } + } + if e.CummulativeQuoteQtyInActingVersion(actingVersion) { + if e.CummulativeQuoteQty < e.CummulativeQuoteQtyMinValue() || e.CummulativeQuoteQty > e.CummulativeQuoteQtyMaxValue() { + return fmt.Errorf("Range check failed on e.CummulativeQuoteQty (%v < %v > %v)", e.CummulativeQuoteQtyMinValue(), e.CummulativeQuoteQty, e.CummulativeQuoteQtyMaxValue()) + } + } + if e.LastQtyInActingVersion(actingVersion) { + if e.LastQty < e.LastQtyMinValue() || e.LastQty > e.LastQtyMaxValue() { + return fmt.Errorf("Range check failed on e.LastQty (%v < %v > %v)", e.LastQtyMinValue(), e.LastQty, e.LastQtyMaxValue()) + } + } + if e.LastPriceInActingVersion(actingVersion) { + if e.LastPrice < e.LastPriceMinValue() || e.LastPrice > e.LastPriceMaxValue() { + return fmt.Errorf("Range check failed on e.LastPrice (%v < %v > %v)", e.LastPriceMinValue(), e.LastPrice, e.LastPriceMaxValue()) + } + } + if e.QuoteQtyInActingVersion(actingVersion) { + if e.QuoteQty < e.QuoteQtyMinValue() || e.QuoteQty > e.QuoteQtyMaxValue() { + return fmt.Errorf("Range check failed on e.QuoteQty (%v < %v > %v)", e.QuoteQtyMinValue(), e.QuoteQty, e.QuoteQtyMaxValue()) + } + } + if e.CommissionInActingVersion(actingVersion) { + if e.Commission < e.CommissionMinValue() || e.Commission > e.CommissionMaxValue() { + return fmt.Errorf("Range check failed on e.Commission (%v < %v > %v)", e.CommissionMinValue(), e.Commission, e.CommissionMaxValue()) + } + } + if err := e.IsWorking.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if err := e.IsMaker.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if err := e.IsBestMatch.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if err := e.MatchType.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if err := e.SelfTradePreventionMode.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if err := e.OrderCapacity.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if err := e.WorkingFloor.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if err := e.UsedSor.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if e.AllocIdInActingVersion(actingVersion) { + if e.AllocId != e.AllocIdNullValue() && (e.AllocId < e.AllocIdMinValue() || e.AllocId > e.AllocIdMaxValue()) { + return fmt.Errorf("Range check failed on e.AllocId (%v < %v > %v)", e.AllocIdMinValue(), e.AllocId, e.AllocIdMaxValue()) + } + } + if e.TrailingDeltaInActingVersion(actingVersion) { + if e.TrailingDelta != e.TrailingDeltaNullValue() && (e.TrailingDelta < e.TrailingDeltaMinValue() || e.TrailingDelta > e.TrailingDeltaMaxValue()) { + return fmt.Errorf("Range check failed on e.TrailingDelta (%v < %v > %v)", e.TrailingDeltaMinValue(), e.TrailingDelta, e.TrailingDeltaMaxValue()) + } + } + if e.TrailingTimeInActingVersion(actingVersion) { + if e.TrailingTime != e.TrailingTimeNullValue() && (e.TrailingTime < e.TrailingTimeMinValue() || e.TrailingTime > e.TrailingTimeMaxValue()) { + return fmt.Errorf("Range check failed on e.TrailingTime (%v < %v > %v)", e.TrailingTimeMinValue(), e.TrailingTime, e.TrailingTimeMaxValue()) + } + } + if e.TradeGroupIdInActingVersion(actingVersion) { + if e.TradeGroupId != e.TradeGroupIdNullValue() && (e.TradeGroupId < e.TradeGroupIdMinValue() || e.TradeGroupId > e.TradeGroupIdMaxValue()) { + return fmt.Errorf("Range check failed on e.TradeGroupId (%v < %v > %v)", e.TradeGroupIdMinValue(), e.TradeGroupId, e.TradeGroupIdMaxValue()) + } + } + if e.PreventedQtyInActingVersion(actingVersion) { + if e.PreventedQty < e.PreventedQtyMinValue() || e.PreventedQty > e.PreventedQtyMaxValue() { + return fmt.Errorf("Range check failed on e.PreventedQty (%v < %v > %v)", e.PreventedQtyMinValue(), e.PreventedQty, e.PreventedQtyMaxValue()) + } + } + if e.LastPreventedQtyInActingVersion(actingVersion) { + if e.LastPreventedQty != e.LastPreventedQtyNullValue() && (e.LastPreventedQty < e.LastPreventedQtyMinValue() || e.LastPreventedQty > e.LastPreventedQtyMaxValue()) { + return fmt.Errorf("Range check failed on e.LastPreventedQty (%v < %v > %v)", e.LastPreventedQtyMinValue(), e.LastPreventedQty, e.LastPreventedQtyMaxValue()) + } + } + if e.PreventedMatchIdInActingVersion(actingVersion) { + if e.PreventedMatchId != e.PreventedMatchIdNullValue() && (e.PreventedMatchId < e.PreventedMatchIdMinValue() || e.PreventedMatchId > e.PreventedMatchIdMaxValue()) { + return fmt.Errorf("Range check failed on e.PreventedMatchId (%v < %v > %v)", e.PreventedMatchIdMinValue(), e.PreventedMatchId, e.PreventedMatchIdMaxValue()) + } + } + if e.PreventedExecutionQtyInActingVersion(actingVersion) { + if e.PreventedExecutionQty != e.PreventedExecutionQtyNullValue() && (e.PreventedExecutionQty < e.PreventedExecutionQtyMinValue() || e.PreventedExecutionQty > e.PreventedExecutionQtyMaxValue()) { + return fmt.Errorf("Range check failed on e.PreventedExecutionQty (%v < %v > %v)", e.PreventedExecutionQtyMinValue(), e.PreventedExecutionQty, e.PreventedExecutionQtyMaxValue()) + } + } + if e.PreventedExecutionPriceInActingVersion(actingVersion) { + if e.PreventedExecutionPrice != e.PreventedExecutionPriceNullValue() && (e.PreventedExecutionPrice < e.PreventedExecutionPriceMinValue() || e.PreventedExecutionPrice > e.PreventedExecutionPriceMaxValue()) { + return fmt.Errorf("Range check failed on e.PreventedExecutionPrice (%v < %v > %v)", e.PreventedExecutionPriceMinValue(), e.PreventedExecutionPrice, e.PreventedExecutionPriceMaxValue()) + } + } + if e.PreventedExecutionQuoteQtyInActingVersion(actingVersion) { + if e.PreventedExecutionQuoteQty != e.PreventedExecutionQuoteQtyNullValue() && (e.PreventedExecutionQuoteQty < e.PreventedExecutionQuoteQtyMinValue() || e.PreventedExecutionQuoteQty > e.PreventedExecutionQuoteQtyMaxValue()) { + return fmt.Errorf("Range check failed on e.PreventedExecutionQuoteQty (%v < %v > %v)", e.PreventedExecutionQuoteQtyMinValue(), e.PreventedExecutionQuoteQty, e.PreventedExecutionQuoteQtyMaxValue()) + } + } + if e.StrategyTypeInActingVersion(actingVersion) { + if e.StrategyType != e.StrategyTypeNullValue() && (e.StrategyType < e.StrategyTypeMinValue() || e.StrategyType > e.StrategyTypeMaxValue()) { + return fmt.Errorf("Range check failed on e.StrategyType (%v < %v > %v)", e.StrategyTypeMinValue(), e.StrategyType, e.StrategyTypeMaxValue()) + } + } + if e.StrategyIdInActingVersion(actingVersion) { + if e.StrategyId != e.StrategyIdNullValue() && (e.StrategyId < e.StrategyIdMinValue() || e.StrategyId > e.StrategyIdMaxValue()) { + return fmt.Errorf("Range check failed on e.StrategyId (%v < %v > %v)", e.StrategyIdMinValue(), e.StrategyId, e.StrategyIdMaxValue()) + } + } + if e.CounterOrderIdInActingVersion(actingVersion) { + if e.CounterOrderId != e.CounterOrderIdNullValue() && (e.CounterOrderId < e.CounterOrderIdMinValue() || e.CounterOrderId > e.CounterOrderIdMaxValue()) { + return fmt.Errorf("Range check failed on e.CounterOrderId (%v < %v > %v)", e.CounterOrderIdMinValue(), e.CounterOrderId, e.CounterOrderIdMaxValue()) + } + } + if e.SubscriptionIdInActingVersion(actingVersion) { + if e.SubscriptionId != e.SubscriptionIdNullValue() && (e.SubscriptionId < e.SubscriptionIdMinValue() || e.SubscriptionId > e.SubscriptionIdMaxValue()) { + return fmt.Errorf("Range check failed on e.SubscriptionId (%v < %v > %v)", e.SubscriptionIdMinValue(), e.SubscriptionId, e.SubscriptionIdMaxValue()) + } + } + if err := e.PegPriceType.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if err := e.PegOffsetType.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if e.PegOffsetValueInActingVersion(actingVersion) { + if e.PegOffsetValue != e.PegOffsetValueNullValue() && (e.PegOffsetValue < e.PegOffsetValueMinValue() || e.PegOffsetValue > e.PegOffsetValueMaxValue()) { + return fmt.Errorf("Range check failed on e.PegOffsetValue (%v < %v > %v)", e.PegOffsetValueMinValue(), e.PegOffsetValue, e.PegOffsetValueMaxValue()) + } + } + if e.PeggedPriceInActingVersion(actingVersion) { + if e.PeggedPrice != e.PeggedPriceNullValue() && (e.PeggedPrice < e.PeggedPriceMinValue() || e.PeggedPrice > e.PeggedPriceMaxValue()) { + return fmt.Errorf("Range check failed on e.PeggedPrice (%v < %v > %v)", e.PeggedPriceMinValue(), e.PeggedPrice, e.PeggedPriceMaxValue()) + } + } + if !utf8.Valid(e.Symbol[:]) { + return errors.New("e.Symbol failed UTF-8 validation") + } + if !utf8.Valid(e.ClientOrderId[:]) { + return errors.New("e.ClientOrderId failed UTF-8 validation") + } + if !utf8.Valid(e.OrigClientOrderId[:]) { + return errors.New("e.OrigClientOrderId failed UTF-8 validation") + } + if !utf8.Valid(e.CommissionAsset[:]) { + return errors.New("e.CommissionAsset failed UTF-8 validation") + } + if !utf8.Valid(e.RejectReason[:]) { + return errors.New("e.RejectReason failed UTF-8 validation") + } + if !utf8.Valid(e.CounterSymbol[:]) { + return errors.New("e.CounterSymbol failed UTF-8 validation") + } + return nil +} + +func ExecutionReportEventInit(e *ExecutionReportEvent) { + e.OrderCreationTime = math.MinInt64 + e.WorkingTime = math.MinInt64 + e.OrderListId = math.MinInt64 + e.TradeId = math.MinInt64 + e.AllocId = math.MinInt64 + e.TrailingDelta = math.MaxUint64 + e.TrailingTime = math.MinInt64 + e.TradeGroupId = math.MinInt64 + e.LastPreventedQty = math.MinInt64 + e.PreventedMatchId = math.MinInt64 + e.PreventedExecutionQty = math.MinInt64 + e.PreventedExecutionPrice = math.MinInt64 + e.PreventedExecutionQuoteQty = math.MinInt64 + e.StrategyType = math.MinInt32 + e.StrategyId = math.MinInt64 + e.CounterOrderId = math.MinInt64 + e.SubscriptionId = math.MaxUint16 + e.PegOffsetValue = math.MaxUint8 + e.PeggedPrice = math.MinInt64 + return +} + +func (*ExecutionReportEvent) SbeBlockLength() (blockLength uint16) { + return 281 +} + +func (*ExecutionReportEvent) SbeTemplateId() (templateId uint16) { + return 603 +} + +func (*ExecutionReportEvent) SbeSchemaId() (schemaId uint16) { + return 3 +} + +func (*ExecutionReportEvent) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} + +func (*ExecutionReportEvent) SbeSemanticType() (semanticType []byte) { + return []byte("") +} + +func (*ExecutionReportEvent) SbeSemanticVersion() (semanticVersion string) { + return "5.2" +} + +func (*ExecutionReportEvent) EventTimeId() uint16 { + return 1 +} + +func (*ExecutionReportEvent) EventTimeSinceVersion() uint16 { + return 0 +} + +func (e *ExecutionReportEvent) EventTimeInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.EventTimeSinceVersion() +} + +func (*ExecutionReportEvent) EventTimeDeprecated() uint16 { + return 0 +} + +func (*ExecutionReportEvent) EventTimeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*ExecutionReportEvent) EventTimeMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*ExecutionReportEvent) EventTimeMaxValue() int64 { + return math.MaxInt64 +} + +func (*ExecutionReportEvent) EventTimeNullValue() int64 { + return math.MinInt64 +} + +func (*ExecutionReportEvent) TransactTimeId() uint16 { + return 2 +} + +func (*ExecutionReportEvent) TransactTimeSinceVersion() uint16 { + return 0 +} + +func (e *ExecutionReportEvent) TransactTimeInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.TransactTimeSinceVersion() +} + +func (*ExecutionReportEvent) TransactTimeDeprecated() uint16 { + return 0 +} + +func (*ExecutionReportEvent) TransactTimeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*ExecutionReportEvent) TransactTimeMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*ExecutionReportEvent) TransactTimeMaxValue() int64 { + return math.MaxInt64 +} + +func (*ExecutionReportEvent) TransactTimeNullValue() int64 { + return math.MinInt64 +} + +func (*ExecutionReportEvent) PriceExponentId() uint16 { + return 3 +} + +func (*ExecutionReportEvent) PriceExponentSinceVersion() uint16 { + return 0 +} + +func (e *ExecutionReportEvent) PriceExponentInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.PriceExponentSinceVersion() +} + +func (*ExecutionReportEvent) PriceExponentDeprecated() uint16 { + return 0 +} + +func (*ExecutionReportEvent) PriceExponentMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*ExecutionReportEvent) PriceExponentMinValue() int8 { + return math.MinInt8 + 1 +} + +func (*ExecutionReportEvent) PriceExponentMaxValue() int8 { + return math.MaxInt8 +} + +func (*ExecutionReportEvent) PriceExponentNullValue() int8 { + return math.MinInt8 +} + +func (*ExecutionReportEvent) QtyExponentId() uint16 { + return 4 +} + +func (*ExecutionReportEvent) QtyExponentSinceVersion() uint16 { + return 0 +} + +func (e *ExecutionReportEvent) QtyExponentInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.QtyExponentSinceVersion() +} + +func (*ExecutionReportEvent) QtyExponentDeprecated() uint16 { + return 0 +} + +func (*ExecutionReportEvent) QtyExponentMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*ExecutionReportEvent) QtyExponentMinValue() int8 { + return math.MinInt8 + 1 +} + +func (*ExecutionReportEvent) QtyExponentMaxValue() int8 { + return math.MaxInt8 +} + +func (*ExecutionReportEvent) QtyExponentNullValue() int8 { + return math.MinInt8 +} + +func (*ExecutionReportEvent) CommissionExponentId() uint16 { + return 5 +} + +func (*ExecutionReportEvent) CommissionExponentSinceVersion() uint16 { + return 0 +} + +func (e *ExecutionReportEvent) CommissionExponentInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.CommissionExponentSinceVersion() +} + +func (*ExecutionReportEvent) CommissionExponentDeprecated() uint16 { + return 0 +} + +func (*ExecutionReportEvent) CommissionExponentMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*ExecutionReportEvent) CommissionExponentMinValue() int8 { + return math.MinInt8 + 1 +} + +func (*ExecutionReportEvent) CommissionExponentMaxValue() int8 { + return math.MaxInt8 +} + +func (*ExecutionReportEvent) CommissionExponentNullValue() int8 { + return math.MinInt8 +} + +func (*ExecutionReportEvent) OrderCreationTimeId() uint16 { + return 6 +} + +func (*ExecutionReportEvent) OrderCreationTimeSinceVersion() uint16 { + return 0 +} + +func (e *ExecutionReportEvent) OrderCreationTimeInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.OrderCreationTimeSinceVersion() +} + +func (*ExecutionReportEvent) OrderCreationTimeDeprecated() uint16 { + return 0 +} + +func (*ExecutionReportEvent) OrderCreationTimeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*ExecutionReportEvent) OrderCreationTimeMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*ExecutionReportEvent) OrderCreationTimeMaxValue() int64 { + return math.MaxInt64 +} + +func (*ExecutionReportEvent) OrderCreationTimeNullValue() int64 { + return math.MinInt64 +} + +func (*ExecutionReportEvent) WorkingTimeId() uint16 { + return 7 +} + +func (*ExecutionReportEvent) WorkingTimeSinceVersion() uint16 { + return 0 +} + +func (e *ExecutionReportEvent) WorkingTimeInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.WorkingTimeSinceVersion() +} + +func (*ExecutionReportEvent) WorkingTimeDeprecated() uint16 { + return 0 +} + +func (*ExecutionReportEvent) WorkingTimeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*ExecutionReportEvent) WorkingTimeMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*ExecutionReportEvent) WorkingTimeMaxValue() int64 { + return math.MaxInt64 +} + +func (*ExecutionReportEvent) WorkingTimeNullValue() int64 { + return math.MinInt64 +} + +func (*ExecutionReportEvent) OrderIdId() uint16 { + return 8 +} + +func (*ExecutionReportEvent) OrderIdSinceVersion() uint16 { + return 0 +} + +func (e *ExecutionReportEvent) OrderIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.OrderIdSinceVersion() +} + +func (*ExecutionReportEvent) OrderIdDeprecated() uint16 { + return 0 +} + +func (*ExecutionReportEvent) OrderIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*ExecutionReportEvent) OrderIdMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*ExecutionReportEvent) OrderIdMaxValue() int64 { + return math.MaxInt64 +} + +func (*ExecutionReportEvent) OrderIdNullValue() int64 { + return math.MinInt64 +} + +func (*ExecutionReportEvent) OrderListIdId() uint16 { + return 9 +} + +func (*ExecutionReportEvent) OrderListIdSinceVersion() uint16 { + return 0 +} + +func (e *ExecutionReportEvent) OrderListIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.OrderListIdSinceVersion() +} + +func (*ExecutionReportEvent) OrderListIdDeprecated() uint16 { + return 0 +} + +func (*ExecutionReportEvent) OrderListIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*ExecutionReportEvent) OrderListIdMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*ExecutionReportEvent) OrderListIdMaxValue() int64 { + return math.MaxInt64 +} + +func (*ExecutionReportEvent) OrderListIdNullValue() int64 { + return math.MinInt64 +} + +func (*ExecutionReportEvent) OrigQtyId() uint16 { + return 10 +} + +func (*ExecutionReportEvent) OrigQtySinceVersion() uint16 { + return 0 +} + +func (e *ExecutionReportEvent) OrigQtyInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.OrigQtySinceVersion() +} + +func (*ExecutionReportEvent) OrigQtyDeprecated() uint16 { + return 0 +} + +func (*ExecutionReportEvent) OrigQtyMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*ExecutionReportEvent) OrigQtyMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*ExecutionReportEvent) OrigQtyMaxValue() int64 { + return math.MaxInt64 +} + +func (*ExecutionReportEvent) OrigQtyNullValue() int64 { + return math.MinInt64 +} + +func (*ExecutionReportEvent) PriceId() uint16 { + return 11 +} + +func (*ExecutionReportEvent) PriceSinceVersion() uint16 { + return 0 +} + +func (e *ExecutionReportEvent) PriceInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.PriceSinceVersion() +} + +func (*ExecutionReportEvent) PriceDeprecated() uint16 { + return 0 +} + +func (*ExecutionReportEvent) PriceMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*ExecutionReportEvent) PriceMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*ExecutionReportEvent) PriceMaxValue() int64 { + return math.MaxInt64 +} + +func (*ExecutionReportEvent) PriceNullValue() int64 { + return math.MinInt64 +} + +func (*ExecutionReportEvent) OrigQuoteOrderQtyId() uint16 { + return 12 +} + +func (*ExecutionReportEvent) OrigQuoteOrderQtySinceVersion() uint16 { + return 0 +} + +func (e *ExecutionReportEvent) OrigQuoteOrderQtyInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.OrigQuoteOrderQtySinceVersion() +} + +func (*ExecutionReportEvent) OrigQuoteOrderQtyDeprecated() uint16 { + return 0 +} + +func (*ExecutionReportEvent) OrigQuoteOrderQtyMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*ExecutionReportEvent) OrigQuoteOrderQtyMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*ExecutionReportEvent) OrigQuoteOrderQtyMaxValue() int64 { + return math.MaxInt64 +} + +func (*ExecutionReportEvent) OrigQuoteOrderQtyNullValue() int64 { + return math.MinInt64 +} + +func (*ExecutionReportEvent) IcebergQtyId() uint16 { + return 13 +} + +func (*ExecutionReportEvent) IcebergQtySinceVersion() uint16 { + return 0 +} + +func (e *ExecutionReportEvent) IcebergQtyInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.IcebergQtySinceVersion() +} + +func (*ExecutionReportEvent) IcebergQtyDeprecated() uint16 { + return 0 +} + +func (*ExecutionReportEvent) IcebergQtyMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*ExecutionReportEvent) IcebergQtyMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*ExecutionReportEvent) IcebergQtyMaxValue() int64 { + return math.MaxInt64 +} + +func (*ExecutionReportEvent) IcebergQtyNullValue() int64 { + return math.MinInt64 +} + +func (*ExecutionReportEvent) StopPriceId() uint16 { + return 14 +} + +func (*ExecutionReportEvent) StopPriceSinceVersion() uint16 { + return 0 +} + +func (e *ExecutionReportEvent) StopPriceInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.StopPriceSinceVersion() +} + +func (*ExecutionReportEvent) StopPriceDeprecated() uint16 { + return 0 +} + +func (*ExecutionReportEvent) StopPriceMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*ExecutionReportEvent) StopPriceMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*ExecutionReportEvent) StopPriceMaxValue() int64 { + return math.MaxInt64 +} + +func (*ExecutionReportEvent) StopPriceNullValue() int64 { + return math.MinInt64 +} + +func (*ExecutionReportEvent) OrderTypeId() uint16 { + return 15 +} + +func (*ExecutionReportEvent) OrderTypeSinceVersion() uint16 { + return 0 +} + +func (e *ExecutionReportEvent) OrderTypeInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.OrderTypeSinceVersion() +} + +func (*ExecutionReportEvent) OrderTypeDeprecated() uint16 { + return 0 +} + +func (*ExecutionReportEvent) OrderTypeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*ExecutionReportEvent) SideId() uint16 { + return 16 +} + +func (*ExecutionReportEvent) SideSinceVersion() uint16 { + return 0 +} + +func (e *ExecutionReportEvent) SideInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.SideSinceVersion() +} + +func (*ExecutionReportEvent) SideDeprecated() uint16 { + return 0 +} + +func (*ExecutionReportEvent) SideMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*ExecutionReportEvent) TimeInForceId() uint16 { + return 17 +} + +func (*ExecutionReportEvent) TimeInForceSinceVersion() uint16 { + return 0 +} + +func (e *ExecutionReportEvent) TimeInForceInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.TimeInForceSinceVersion() +} + +func (*ExecutionReportEvent) TimeInForceDeprecated() uint16 { + return 0 +} + +func (*ExecutionReportEvent) TimeInForceMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*ExecutionReportEvent) ExecutionTypeId() uint16 { + return 18 +} + +func (*ExecutionReportEvent) ExecutionTypeSinceVersion() uint16 { + return 0 +} + +func (e *ExecutionReportEvent) ExecutionTypeInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.ExecutionTypeSinceVersion() +} + +func (*ExecutionReportEvent) ExecutionTypeDeprecated() uint16 { + return 0 +} + +func (*ExecutionReportEvent) ExecutionTypeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*ExecutionReportEvent) OrderStatusId() uint16 { + return 19 +} + +func (*ExecutionReportEvent) OrderStatusSinceVersion() uint16 { + return 0 +} + +func (e *ExecutionReportEvent) OrderStatusInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.OrderStatusSinceVersion() +} + +func (*ExecutionReportEvent) OrderStatusDeprecated() uint16 { + return 0 +} + +func (*ExecutionReportEvent) OrderStatusMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*ExecutionReportEvent) TradeIdId() uint16 { + return 20 +} + +func (*ExecutionReportEvent) TradeIdSinceVersion() uint16 { + return 0 +} + +func (e *ExecutionReportEvent) TradeIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.TradeIdSinceVersion() +} + +func (*ExecutionReportEvent) TradeIdDeprecated() uint16 { + return 0 +} + +func (*ExecutionReportEvent) TradeIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*ExecutionReportEvent) TradeIdMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*ExecutionReportEvent) TradeIdMaxValue() int64 { + return math.MaxInt64 +} + +func (*ExecutionReportEvent) TradeIdNullValue() int64 { + return math.MinInt64 +} + +func (*ExecutionReportEvent) ExecutionIdId() uint16 { + return 21 +} + +func (*ExecutionReportEvent) ExecutionIdSinceVersion() uint16 { + return 0 +} + +func (e *ExecutionReportEvent) ExecutionIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.ExecutionIdSinceVersion() +} + +func (*ExecutionReportEvent) ExecutionIdDeprecated() uint16 { + return 0 +} + +func (*ExecutionReportEvent) ExecutionIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*ExecutionReportEvent) ExecutionIdMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*ExecutionReportEvent) ExecutionIdMaxValue() int64 { + return math.MaxInt64 +} + +func (*ExecutionReportEvent) ExecutionIdNullValue() int64 { + return math.MinInt64 +} + +func (*ExecutionReportEvent) ExecutedQtyId() uint16 { + return 22 +} + +func (*ExecutionReportEvent) ExecutedQtySinceVersion() uint16 { + return 0 +} + +func (e *ExecutionReportEvent) ExecutedQtyInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.ExecutedQtySinceVersion() +} + +func (*ExecutionReportEvent) ExecutedQtyDeprecated() uint16 { + return 0 +} + +func (*ExecutionReportEvent) ExecutedQtyMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*ExecutionReportEvent) ExecutedQtyMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*ExecutionReportEvent) ExecutedQtyMaxValue() int64 { + return math.MaxInt64 +} + +func (*ExecutionReportEvent) ExecutedQtyNullValue() int64 { + return math.MinInt64 +} + +func (*ExecutionReportEvent) CummulativeQuoteQtyId() uint16 { + return 23 +} + +func (*ExecutionReportEvent) CummulativeQuoteQtySinceVersion() uint16 { + return 0 +} + +func (e *ExecutionReportEvent) CummulativeQuoteQtyInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.CummulativeQuoteQtySinceVersion() +} + +func (*ExecutionReportEvent) CummulativeQuoteQtyDeprecated() uint16 { + return 0 +} + +func (*ExecutionReportEvent) CummulativeQuoteQtyMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*ExecutionReportEvent) CummulativeQuoteQtyMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*ExecutionReportEvent) CummulativeQuoteQtyMaxValue() int64 { + return math.MaxInt64 +} + +func (*ExecutionReportEvent) CummulativeQuoteQtyNullValue() int64 { + return math.MinInt64 +} + +func (*ExecutionReportEvent) LastQtyId() uint16 { + return 24 +} + +func (*ExecutionReportEvent) LastQtySinceVersion() uint16 { + return 0 +} + +func (e *ExecutionReportEvent) LastQtyInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.LastQtySinceVersion() +} + +func (*ExecutionReportEvent) LastQtyDeprecated() uint16 { + return 0 +} + +func (*ExecutionReportEvent) LastQtyMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*ExecutionReportEvent) LastQtyMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*ExecutionReportEvent) LastQtyMaxValue() int64 { + return math.MaxInt64 +} + +func (*ExecutionReportEvent) LastQtyNullValue() int64 { + return math.MinInt64 +} + +func (*ExecutionReportEvent) LastPriceId() uint16 { + return 25 +} + +func (*ExecutionReportEvent) LastPriceSinceVersion() uint16 { + return 0 +} + +func (e *ExecutionReportEvent) LastPriceInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.LastPriceSinceVersion() +} + +func (*ExecutionReportEvent) LastPriceDeprecated() uint16 { + return 0 +} + +func (*ExecutionReportEvent) LastPriceMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*ExecutionReportEvent) LastPriceMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*ExecutionReportEvent) LastPriceMaxValue() int64 { + return math.MaxInt64 +} + +func (*ExecutionReportEvent) LastPriceNullValue() int64 { + return math.MinInt64 +} + +func (*ExecutionReportEvent) QuoteQtyId() uint16 { + return 26 +} + +func (*ExecutionReportEvent) QuoteQtySinceVersion() uint16 { + return 0 +} + +func (e *ExecutionReportEvent) QuoteQtyInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.QuoteQtySinceVersion() +} + +func (*ExecutionReportEvent) QuoteQtyDeprecated() uint16 { + return 0 +} + +func (*ExecutionReportEvent) QuoteQtyMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*ExecutionReportEvent) QuoteQtyMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*ExecutionReportEvent) QuoteQtyMaxValue() int64 { + return math.MaxInt64 +} + +func (*ExecutionReportEvent) QuoteQtyNullValue() int64 { + return math.MinInt64 +} + +func (*ExecutionReportEvent) CommissionId() uint16 { + return 27 +} + +func (*ExecutionReportEvent) CommissionSinceVersion() uint16 { + return 0 +} + +func (e *ExecutionReportEvent) CommissionInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.CommissionSinceVersion() +} + +func (*ExecutionReportEvent) CommissionDeprecated() uint16 { + return 0 +} + +func (*ExecutionReportEvent) CommissionMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*ExecutionReportEvent) CommissionMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*ExecutionReportEvent) CommissionMaxValue() int64 { + return math.MaxInt64 +} + +func (*ExecutionReportEvent) CommissionNullValue() int64 { + return math.MinInt64 +} + +func (*ExecutionReportEvent) IsWorkingId() uint16 { + return 28 +} + +func (*ExecutionReportEvent) IsWorkingSinceVersion() uint16 { + return 0 +} + +func (e *ExecutionReportEvent) IsWorkingInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.IsWorkingSinceVersion() +} + +func (*ExecutionReportEvent) IsWorkingDeprecated() uint16 { + return 0 +} + +func (*ExecutionReportEvent) IsWorkingMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*ExecutionReportEvent) IsMakerId() uint16 { + return 29 +} + +func (*ExecutionReportEvent) IsMakerSinceVersion() uint16 { + return 0 +} + +func (e *ExecutionReportEvent) IsMakerInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.IsMakerSinceVersion() +} + +func (*ExecutionReportEvent) IsMakerDeprecated() uint16 { + return 0 +} + +func (*ExecutionReportEvent) IsMakerMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*ExecutionReportEvent) IsBestMatchId() uint16 { + return 30 +} + +func (*ExecutionReportEvent) IsBestMatchSinceVersion() uint16 { + return 0 +} + +func (e *ExecutionReportEvent) IsBestMatchInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.IsBestMatchSinceVersion() +} + +func (*ExecutionReportEvent) IsBestMatchDeprecated() uint16 { + return 0 +} + +func (*ExecutionReportEvent) IsBestMatchMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*ExecutionReportEvent) MatchTypeId() uint16 { + return 31 +} + +func (*ExecutionReportEvent) MatchTypeSinceVersion() uint16 { + return 0 +} + +func (e *ExecutionReportEvent) MatchTypeInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.MatchTypeSinceVersion() +} + +func (*ExecutionReportEvent) MatchTypeDeprecated() uint16 { + return 0 +} + +func (*ExecutionReportEvent) MatchTypeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*ExecutionReportEvent) SelfTradePreventionModeId() uint16 { + return 32 +} + +func (*ExecutionReportEvent) SelfTradePreventionModeSinceVersion() uint16 { + return 0 +} + +func (e *ExecutionReportEvent) SelfTradePreventionModeInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.SelfTradePreventionModeSinceVersion() +} + +func (*ExecutionReportEvent) SelfTradePreventionModeDeprecated() uint16 { + return 0 +} + +func (*ExecutionReportEvent) SelfTradePreventionModeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*ExecutionReportEvent) OrderCapacityId() uint16 { + return 33 +} + +func (*ExecutionReportEvent) OrderCapacitySinceVersion() uint16 { + return 0 +} + +func (e *ExecutionReportEvent) OrderCapacityInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.OrderCapacitySinceVersion() +} + +func (*ExecutionReportEvent) OrderCapacityDeprecated() uint16 { + return 0 +} + +func (*ExecutionReportEvent) OrderCapacityMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*ExecutionReportEvent) WorkingFloorId() uint16 { + return 34 +} + +func (*ExecutionReportEvent) WorkingFloorSinceVersion() uint16 { + return 0 +} + +func (e *ExecutionReportEvent) WorkingFloorInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.WorkingFloorSinceVersion() +} + +func (*ExecutionReportEvent) WorkingFloorDeprecated() uint16 { + return 0 +} + +func (*ExecutionReportEvent) WorkingFloorMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*ExecutionReportEvent) UsedSorId() uint16 { + return 35 +} + +func (*ExecutionReportEvent) UsedSorSinceVersion() uint16 { + return 0 +} + +func (e *ExecutionReportEvent) UsedSorInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.UsedSorSinceVersion() +} + +func (*ExecutionReportEvent) UsedSorDeprecated() uint16 { + return 0 +} + +func (*ExecutionReportEvent) UsedSorMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*ExecutionReportEvent) AllocIdId() uint16 { + return 36 +} + +func (*ExecutionReportEvent) AllocIdSinceVersion() uint16 { + return 0 +} + +func (e *ExecutionReportEvent) AllocIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.AllocIdSinceVersion() +} + +func (*ExecutionReportEvent) AllocIdDeprecated() uint16 { + return 0 +} + +func (*ExecutionReportEvent) AllocIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*ExecutionReportEvent) AllocIdMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*ExecutionReportEvent) AllocIdMaxValue() int64 { + return math.MaxInt64 +} + +func (*ExecutionReportEvent) AllocIdNullValue() int64 { + return math.MinInt64 +} + +func (*ExecutionReportEvent) TrailingDeltaId() uint16 { + return 37 +} + +func (*ExecutionReportEvent) TrailingDeltaSinceVersion() uint16 { + return 0 +} + +func (e *ExecutionReportEvent) TrailingDeltaInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.TrailingDeltaSinceVersion() +} + +func (*ExecutionReportEvent) TrailingDeltaDeprecated() uint16 { + return 0 +} + +func (*ExecutionReportEvent) TrailingDeltaMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*ExecutionReportEvent) TrailingDeltaMinValue() uint64 { + return 0 +} + +func (*ExecutionReportEvent) TrailingDeltaMaxValue() uint64 { + return math.MaxUint64 - 1 +} + +func (*ExecutionReportEvent) TrailingDeltaNullValue() uint64 { + return math.MaxUint64 +} + +func (*ExecutionReportEvent) TrailingTimeId() uint16 { + return 38 +} + +func (*ExecutionReportEvent) TrailingTimeSinceVersion() uint16 { + return 0 +} + +func (e *ExecutionReportEvent) TrailingTimeInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.TrailingTimeSinceVersion() +} + +func (*ExecutionReportEvent) TrailingTimeDeprecated() uint16 { + return 0 +} + +func (*ExecutionReportEvent) TrailingTimeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*ExecutionReportEvent) TrailingTimeMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*ExecutionReportEvent) TrailingTimeMaxValue() int64 { + return math.MaxInt64 +} + +func (*ExecutionReportEvent) TrailingTimeNullValue() int64 { + return math.MinInt64 +} + +func (*ExecutionReportEvent) TradeGroupIdId() uint16 { + return 39 +} + +func (*ExecutionReportEvent) TradeGroupIdSinceVersion() uint16 { + return 0 +} + +func (e *ExecutionReportEvent) TradeGroupIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.TradeGroupIdSinceVersion() +} + +func (*ExecutionReportEvent) TradeGroupIdDeprecated() uint16 { + return 0 +} + +func (*ExecutionReportEvent) TradeGroupIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*ExecutionReportEvent) TradeGroupIdMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*ExecutionReportEvent) TradeGroupIdMaxValue() int64 { + return math.MaxInt64 +} + +func (*ExecutionReportEvent) TradeGroupIdNullValue() int64 { + return math.MinInt64 +} + +func (*ExecutionReportEvent) PreventedQtyId() uint16 { + return 40 +} + +func (*ExecutionReportEvent) PreventedQtySinceVersion() uint16 { + return 0 +} + +func (e *ExecutionReportEvent) PreventedQtyInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.PreventedQtySinceVersion() +} + +func (*ExecutionReportEvent) PreventedQtyDeprecated() uint16 { + return 0 +} + +func (*ExecutionReportEvent) PreventedQtyMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*ExecutionReportEvent) PreventedQtyMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*ExecutionReportEvent) PreventedQtyMaxValue() int64 { + return math.MaxInt64 +} + +func (*ExecutionReportEvent) PreventedQtyNullValue() int64 { + return math.MinInt64 +} + +func (*ExecutionReportEvent) LastPreventedQtyId() uint16 { + return 41 +} + +func (*ExecutionReportEvent) LastPreventedQtySinceVersion() uint16 { + return 0 +} + +func (e *ExecutionReportEvent) LastPreventedQtyInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.LastPreventedQtySinceVersion() +} + +func (*ExecutionReportEvent) LastPreventedQtyDeprecated() uint16 { + return 0 +} + +func (*ExecutionReportEvent) LastPreventedQtyMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*ExecutionReportEvent) LastPreventedQtyMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*ExecutionReportEvent) LastPreventedQtyMaxValue() int64 { + return math.MaxInt64 +} + +func (*ExecutionReportEvent) LastPreventedQtyNullValue() int64 { + return math.MinInt64 +} + +func (*ExecutionReportEvent) PreventedMatchIdId() uint16 { + return 42 +} + +func (*ExecutionReportEvent) PreventedMatchIdSinceVersion() uint16 { + return 0 +} + +func (e *ExecutionReportEvent) PreventedMatchIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.PreventedMatchIdSinceVersion() +} + +func (*ExecutionReportEvent) PreventedMatchIdDeprecated() uint16 { + return 0 +} + +func (*ExecutionReportEvent) PreventedMatchIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*ExecutionReportEvent) PreventedMatchIdMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*ExecutionReportEvent) PreventedMatchIdMaxValue() int64 { + return math.MaxInt64 +} + +func (*ExecutionReportEvent) PreventedMatchIdNullValue() int64 { + return math.MinInt64 +} + +func (*ExecutionReportEvent) PreventedExecutionQtyId() uint16 { + return 43 +} + +func (*ExecutionReportEvent) PreventedExecutionQtySinceVersion() uint16 { + return 0 +} + +func (e *ExecutionReportEvent) PreventedExecutionQtyInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.PreventedExecutionQtySinceVersion() +} + +func (*ExecutionReportEvent) PreventedExecutionQtyDeprecated() uint16 { + return 0 +} + +func (*ExecutionReportEvent) PreventedExecutionQtyMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*ExecutionReportEvent) PreventedExecutionQtyMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*ExecutionReportEvent) PreventedExecutionQtyMaxValue() int64 { + return math.MaxInt64 +} + +func (*ExecutionReportEvent) PreventedExecutionQtyNullValue() int64 { + return math.MinInt64 +} + +func (*ExecutionReportEvent) PreventedExecutionPriceId() uint16 { + return 44 +} + +func (*ExecutionReportEvent) PreventedExecutionPriceSinceVersion() uint16 { + return 0 +} + +func (e *ExecutionReportEvent) PreventedExecutionPriceInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.PreventedExecutionPriceSinceVersion() +} + +func (*ExecutionReportEvent) PreventedExecutionPriceDeprecated() uint16 { + return 0 +} + +func (*ExecutionReportEvent) PreventedExecutionPriceMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*ExecutionReportEvent) PreventedExecutionPriceMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*ExecutionReportEvent) PreventedExecutionPriceMaxValue() int64 { + return math.MaxInt64 +} + +func (*ExecutionReportEvent) PreventedExecutionPriceNullValue() int64 { + return math.MinInt64 +} + +func (*ExecutionReportEvent) PreventedExecutionQuoteQtyId() uint16 { + return 45 +} + +func (*ExecutionReportEvent) PreventedExecutionQuoteQtySinceVersion() uint16 { + return 0 +} + +func (e *ExecutionReportEvent) PreventedExecutionQuoteQtyInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.PreventedExecutionQuoteQtySinceVersion() +} + +func (*ExecutionReportEvent) PreventedExecutionQuoteQtyDeprecated() uint16 { + return 0 +} + +func (*ExecutionReportEvent) PreventedExecutionQuoteQtyMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*ExecutionReportEvent) PreventedExecutionQuoteQtyMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*ExecutionReportEvent) PreventedExecutionQuoteQtyMaxValue() int64 { + return math.MaxInt64 +} + +func (*ExecutionReportEvent) PreventedExecutionQuoteQtyNullValue() int64 { + return math.MinInt64 +} + +func (*ExecutionReportEvent) StrategyTypeId() uint16 { + return 46 +} + +func (*ExecutionReportEvent) StrategyTypeSinceVersion() uint16 { + return 0 +} + +func (e *ExecutionReportEvent) StrategyTypeInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.StrategyTypeSinceVersion() +} + +func (*ExecutionReportEvent) StrategyTypeDeprecated() uint16 { + return 0 +} + +func (*ExecutionReportEvent) StrategyTypeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*ExecutionReportEvent) StrategyTypeMinValue() int32 { + return math.MinInt32 + 1 +} + +func (*ExecutionReportEvent) StrategyTypeMaxValue() int32 { + return math.MaxInt32 +} + +func (*ExecutionReportEvent) StrategyTypeNullValue() int32 { + return math.MinInt32 +} + +func (*ExecutionReportEvent) StrategyIdId() uint16 { + return 47 +} + +func (*ExecutionReportEvent) StrategyIdSinceVersion() uint16 { + return 0 +} + +func (e *ExecutionReportEvent) StrategyIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.StrategyIdSinceVersion() +} + +func (*ExecutionReportEvent) StrategyIdDeprecated() uint16 { + return 0 +} + +func (*ExecutionReportEvent) StrategyIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*ExecutionReportEvent) StrategyIdMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*ExecutionReportEvent) StrategyIdMaxValue() int64 { + return math.MaxInt64 +} + +func (*ExecutionReportEvent) StrategyIdNullValue() int64 { + return math.MinInt64 +} + +func (*ExecutionReportEvent) CounterOrderIdId() uint16 { + return 48 +} + +func (*ExecutionReportEvent) CounterOrderIdSinceVersion() uint16 { + return 0 +} + +func (e *ExecutionReportEvent) CounterOrderIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.CounterOrderIdSinceVersion() +} + +func (*ExecutionReportEvent) CounterOrderIdDeprecated() uint16 { + return 0 +} + +func (*ExecutionReportEvent) CounterOrderIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*ExecutionReportEvent) CounterOrderIdMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*ExecutionReportEvent) CounterOrderIdMaxValue() int64 { + return math.MaxInt64 +} + +func (*ExecutionReportEvent) CounterOrderIdNullValue() int64 { + return math.MinInt64 +} + +func (*ExecutionReportEvent) SubscriptionIdId() uint16 { + return 49 +} + +func (*ExecutionReportEvent) SubscriptionIdSinceVersion() uint16 { + return 1 +} + +func (e *ExecutionReportEvent) SubscriptionIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.SubscriptionIdSinceVersion() +} + +func (*ExecutionReportEvent) SubscriptionIdDeprecated() uint16 { + return 0 +} + +func (*ExecutionReportEvent) SubscriptionIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*ExecutionReportEvent) SubscriptionIdMinValue() uint16 { + return 0 +} + +func (*ExecutionReportEvent) SubscriptionIdMaxValue() uint16 { + return math.MaxUint16 - 1 +} + +func (*ExecutionReportEvent) SubscriptionIdNullValue() uint16 { + return math.MaxUint16 +} + +func (*ExecutionReportEvent) PegPriceTypeId() uint16 { + return 50 +} + +func (*ExecutionReportEvent) PegPriceTypeSinceVersion() uint16 { + return 1 +} + +func (e *ExecutionReportEvent) PegPriceTypeInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.PegPriceTypeSinceVersion() +} + +func (*ExecutionReportEvent) PegPriceTypeDeprecated() uint16 { + return 0 +} + +func (*ExecutionReportEvent) PegPriceTypeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*ExecutionReportEvent) PegOffsetTypeId() uint16 { + return 51 +} + +func (*ExecutionReportEvent) PegOffsetTypeSinceVersion() uint16 { + return 1 +} + +func (e *ExecutionReportEvent) PegOffsetTypeInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.PegOffsetTypeSinceVersion() +} + +func (*ExecutionReportEvent) PegOffsetTypeDeprecated() uint16 { + return 0 +} + +func (*ExecutionReportEvent) PegOffsetTypeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*ExecutionReportEvent) PegOffsetValueId() uint16 { + return 52 +} + +func (*ExecutionReportEvent) PegOffsetValueSinceVersion() uint16 { + return 1 +} + +func (e *ExecutionReportEvent) PegOffsetValueInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.PegOffsetValueSinceVersion() +} + +func (*ExecutionReportEvent) PegOffsetValueDeprecated() uint16 { + return 0 +} + +func (*ExecutionReportEvent) PegOffsetValueMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*ExecutionReportEvent) PegOffsetValueMinValue() uint8 { + return 0 +} + +func (*ExecutionReportEvent) PegOffsetValueMaxValue() uint8 { + return math.MaxUint8 - 1 +} + +func (*ExecutionReportEvent) PegOffsetValueNullValue() uint8 { + return math.MaxUint8 +} + +func (*ExecutionReportEvent) PeggedPriceId() uint16 { + return 53 +} + +func (*ExecutionReportEvent) PeggedPriceSinceVersion() uint16 { + return 1 +} + +func (e *ExecutionReportEvent) PeggedPriceInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.PeggedPriceSinceVersion() +} + +func (*ExecutionReportEvent) PeggedPriceDeprecated() uint16 { + return 0 +} + +func (*ExecutionReportEvent) PeggedPriceMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*ExecutionReportEvent) PeggedPriceMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*ExecutionReportEvent) PeggedPriceMaxValue() int64 { + return math.MaxInt64 +} + +func (*ExecutionReportEvent) PeggedPriceNullValue() int64 { + return math.MinInt64 +} + +func (*ExecutionReportEvent) SymbolMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*ExecutionReportEvent) SymbolSinceVersion() uint16 { + return 0 +} + +func (e *ExecutionReportEvent) SymbolInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.SymbolSinceVersion() +} + +func (*ExecutionReportEvent) SymbolDeprecated() uint16 { + return 0 +} + +func (ExecutionReportEvent) SymbolCharacterEncoding() string { + return "UTF-8" +} + +func (ExecutionReportEvent) SymbolHeaderLength() uint64 { + return 1 +} + +func (*ExecutionReportEvent) ClientOrderIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*ExecutionReportEvent) ClientOrderIdSinceVersion() uint16 { + return 0 +} + +func (e *ExecutionReportEvent) ClientOrderIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.ClientOrderIdSinceVersion() +} + +func (*ExecutionReportEvent) ClientOrderIdDeprecated() uint16 { + return 0 +} + +func (ExecutionReportEvent) ClientOrderIdCharacterEncoding() string { + return "UTF-8" +} + +func (ExecutionReportEvent) ClientOrderIdHeaderLength() uint64 { + return 1 +} + +func (*ExecutionReportEvent) OrigClientOrderIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*ExecutionReportEvent) OrigClientOrderIdSinceVersion() uint16 { + return 0 +} + +func (e *ExecutionReportEvent) OrigClientOrderIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.OrigClientOrderIdSinceVersion() +} + +func (*ExecutionReportEvent) OrigClientOrderIdDeprecated() uint16 { + return 0 +} + +func (ExecutionReportEvent) OrigClientOrderIdCharacterEncoding() string { + return "UTF-8" +} + +func (ExecutionReportEvent) OrigClientOrderIdHeaderLength() uint64 { + return 1 +} + +func (*ExecutionReportEvent) CommissionAssetMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*ExecutionReportEvent) CommissionAssetSinceVersion() uint16 { + return 0 +} + +func (e *ExecutionReportEvent) CommissionAssetInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.CommissionAssetSinceVersion() +} + +func (*ExecutionReportEvent) CommissionAssetDeprecated() uint16 { + return 0 +} + +func (ExecutionReportEvent) CommissionAssetCharacterEncoding() string { + return "UTF-8" +} + +func (ExecutionReportEvent) CommissionAssetHeaderLength() uint64 { + return 1 +} + +func (*ExecutionReportEvent) RejectReasonMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*ExecutionReportEvent) RejectReasonSinceVersion() uint16 { + return 0 +} + +func (e *ExecutionReportEvent) RejectReasonInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.RejectReasonSinceVersion() +} + +func (*ExecutionReportEvent) RejectReasonDeprecated() uint16 { + return 0 +} + +func (ExecutionReportEvent) RejectReasonCharacterEncoding() string { + return "UTF-8" +} + +func (ExecutionReportEvent) RejectReasonHeaderLength() uint64 { + return 1 +} + +func (*ExecutionReportEvent) CounterSymbolMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*ExecutionReportEvent) CounterSymbolSinceVersion() uint16 { + return 0 +} + +func (e *ExecutionReportEvent) CounterSymbolInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.CounterSymbolSinceVersion() +} + +func (*ExecutionReportEvent) CounterSymbolDeprecated() uint16 { + return 0 +} + +func (ExecutionReportEvent) CounterSymbolCharacterEncoding() string { + return "UTF-8" +} + +func (ExecutionReportEvent) CounterSymbolHeaderLength() uint64 { + return 1 +} diff --git a/v2/sbe/spot_3_1/ExecutionType.go b/v2/sbe/spot_3_1/ExecutionType.go new file mode 100644 index 00000000..4e4bc72d --- /dev/null +++ b/v2/sbe/spot_3_1/ExecutionType.go @@ -0,0 +1,164 @@ +// Generated SBE (Simple Binary Encoding) message codec + +package sbe + +import ( + "fmt" + "io" + "reflect" +) + +type ExecutionTypeEnum uint8 +type ExecutionTypeValues struct { + New ExecutionTypeEnum + Canceled ExecutionTypeEnum + Replaced ExecutionTypeEnum + Rejected ExecutionTypeEnum + Trade ExecutionTypeEnum + Expired ExecutionTypeEnum + TradePrevention ExecutionTypeEnum + Unknown ExecutionTypeEnum + NonRepresentable ExecutionTypeEnum + NullValue ExecutionTypeEnum +} + +var ExecutionType = ExecutionTypeValues{0, 1, 2, 3, 4, 5, 8, 253, 254, 255} + +func (e ExecutionTypeEnum) Encode(_m *SbeGoMarshaller, _w io.Writer) error { + if err := _m.WriteUint8(_w, uint8(e)); err != nil { + return err + } + return nil +} + +func (e *ExecutionTypeEnum) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16) error { + if err := _m.ReadUint8(_r, (*uint8)(e)); err != nil { + return err + } + return nil +} + +func (e ExecutionTypeEnum) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if actingVersion > schemaVersion { + return nil + } + value := reflect.ValueOf(ExecutionType) + for idx := 0; idx < value.NumField(); idx++ { + if e == value.Field(idx).Interface() { + return nil + } + } + return fmt.Errorf("Range check failed on ExecutionType, unknown enumeration value %d", e) +} + +func (*ExecutionTypeEnum) EncodedLength() int64 { + return 1 +} + +func (*ExecutionTypeEnum) NewSinceVersion() uint16 { + return 0 +} + +func (e *ExecutionTypeEnum) NewInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.NewSinceVersion() +} + +func (*ExecutionTypeEnum) NewDeprecated() uint16 { + return 0 +} + +func (*ExecutionTypeEnum) CanceledSinceVersion() uint16 { + return 0 +} + +func (e *ExecutionTypeEnum) CanceledInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.CanceledSinceVersion() +} + +func (*ExecutionTypeEnum) CanceledDeprecated() uint16 { + return 0 +} + +func (*ExecutionTypeEnum) ReplacedSinceVersion() uint16 { + return 0 +} + +func (e *ExecutionTypeEnum) ReplacedInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.ReplacedSinceVersion() +} + +func (*ExecutionTypeEnum) ReplacedDeprecated() uint16 { + return 0 +} + +func (*ExecutionTypeEnum) RejectedSinceVersion() uint16 { + return 0 +} + +func (e *ExecutionTypeEnum) RejectedInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.RejectedSinceVersion() +} + +func (*ExecutionTypeEnum) RejectedDeprecated() uint16 { + return 0 +} + +func (*ExecutionTypeEnum) TradeSinceVersion() uint16 { + return 0 +} + +func (e *ExecutionTypeEnum) TradeInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.TradeSinceVersion() +} + +func (*ExecutionTypeEnum) TradeDeprecated() uint16 { + return 0 +} + +func (*ExecutionTypeEnum) ExpiredSinceVersion() uint16 { + return 0 +} + +func (e *ExecutionTypeEnum) ExpiredInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.ExpiredSinceVersion() +} + +func (*ExecutionTypeEnum) ExpiredDeprecated() uint16 { + return 0 +} + +func (*ExecutionTypeEnum) TradePreventionSinceVersion() uint16 { + return 0 +} + +func (e *ExecutionTypeEnum) TradePreventionInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.TradePreventionSinceVersion() +} + +func (*ExecutionTypeEnum) TradePreventionDeprecated() uint16 { + return 0 +} + +func (*ExecutionTypeEnum) UnknownSinceVersion() uint16 { + return 0 +} + +func (e *ExecutionTypeEnum) UnknownInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.UnknownSinceVersion() +} + +func (*ExecutionTypeEnum) UnknownDeprecated() uint16 { + return 0 +} + +func (*ExecutionTypeEnum) NonRepresentableSinceVersion() uint16 { + return 0 +} + +func (e *ExecutionTypeEnum) NonRepresentableInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.NonRepresentableSinceVersion() +} + +func (*ExecutionTypeEnum) NonRepresentableDeprecated() uint16 { + return 0 +} diff --git a/v2/sbe/spot_3_1/ExternalLockUpdateEvent.go b/v2/sbe/spot_3_1/ExternalLockUpdateEvent.go new file mode 100644 index 00000000..8767a0b3 --- /dev/null +++ b/v2/sbe/spot_3_1/ExternalLockUpdateEvent.go @@ -0,0 +1,417 @@ +// Generated SBE (Simple Binary Encoding) message codec + +package sbe + +import ( + "errors" + "fmt" + "io" + "io/ioutil" + "math" + "unicode/utf8" +) + +type ExternalLockUpdateEvent struct { + EventTime int64 + ClearTime int64 + QtyExponent int8 + LockedQtyDelta int64 + SubscriptionId uint16 + Asset []uint8 +} + +func (e *ExternalLockUpdateEvent) Encode(_m *SbeGoMarshaller, _w io.Writer, doRangeCheck bool) error { + if doRangeCheck { + if err := e.RangeCheck(e.SbeSchemaVersion(), e.SbeSchemaVersion()); err != nil { + return err + } + } + if err := _m.WriteInt64(_w, e.EventTime); err != nil { + return err + } + if err := _m.WriteInt64(_w, e.ClearTime); err != nil { + return err + } + if err := _m.WriteInt8(_w, e.QtyExponent); err != nil { + return err + } + if err := _m.WriteInt64(_w, e.LockedQtyDelta); err != nil { + return err + } + if err := _m.WriteUint16(_w, e.SubscriptionId); err != nil { + return err + } + if err := _m.WriteUint8(_w, uint8(len(e.Asset))); err != nil { + return err + } + if err := _m.WriteBytes(_w, e.Asset); err != nil { + return err + } + return nil +} + +func (e *ExternalLockUpdateEvent) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint16, doRangeCheck bool) error { + if !e.EventTimeInActingVersion(actingVersion) { + e.EventTime = e.EventTimeNullValue() + } else { + if err := _m.ReadInt64(_r, &e.EventTime); err != nil { + return err + } + } + if !e.ClearTimeInActingVersion(actingVersion) { + e.ClearTime = e.ClearTimeNullValue() + } else { + if err := _m.ReadInt64(_r, &e.ClearTime); err != nil { + return err + } + } + if !e.QtyExponentInActingVersion(actingVersion) { + e.QtyExponent = e.QtyExponentNullValue() + } else { + if err := _m.ReadInt8(_r, &e.QtyExponent); err != nil { + return err + } + } + if !e.LockedQtyDeltaInActingVersion(actingVersion) { + e.LockedQtyDelta = e.LockedQtyDeltaNullValue() + } else { + if err := _m.ReadInt64(_r, &e.LockedQtyDelta); err != nil { + return err + } + } + if !e.SubscriptionIdInActingVersion(actingVersion) { + e.SubscriptionId = e.SubscriptionIdNullValue() + } else { + if err := _m.ReadUint16(_r, &e.SubscriptionId); err != nil { + return err + } + } + if actingVersion > e.SbeSchemaVersion() && blockLength > e.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-e.SbeBlockLength())) + } + + if e.AssetInActingVersion(actingVersion) { + var AssetLength uint8 + if err := _m.ReadUint8(_r, &AssetLength); err != nil { + return err + } + if cap(e.Asset) < int(AssetLength) { + e.Asset = make([]uint8, AssetLength) + } + e.Asset = e.Asset[:AssetLength] + if err := _m.ReadBytes(_r, e.Asset); err != nil { + return err + } + } + if doRangeCheck { + if err := e.RangeCheck(actingVersion, e.SbeSchemaVersion()); err != nil { + return err + } + } + return nil +} + +func (e *ExternalLockUpdateEvent) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if e.EventTimeInActingVersion(actingVersion) { + if e.EventTime < e.EventTimeMinValue() || e.EventTime > e.EventTimeMaxValue() { + return fmt.Errorf("Range check failed on e.EventTime (%v < %v > %v)", e.EventTimeMinValue(), e.EventTime, e.EventTimeMaxValue()) + } + } + if e.ClearTimeInActingVersion(actingVersion) { + if e.ClearTime < e.ClearTimeMinValue() || e.ClearTime > e.ClearTimeMaxValue() { + return fmt.Errorf("Range check failed on e.ClearTime (%v < %v > %v)", e.ClearTimeMinValue(), e.ClearTime, e.ClearTimeMaxValue()) + } + } + if e.QtyExponentInActingVersion(actingVersion) { + if e.QtyExponent < e.QtyExponentMinValue() || e.QtyExponent > e.QtyExponentMaxValue() { + return fmt.Errorf("Range check failed on e.QtyExponent (%v < %v > %v)", e.QtyExponentMinValue(), e.QtyExponent, e.QtyExponentMaxValue()) + } + } + if e.LockedQtyDeltaInActingVersion(actingVersion) { + if e.LockedQtyDelta < e.LockedQtyDeltaMinValue() || e.LockedQtyDelta > e.LockedQtyDeltaMaxValue() { + return fmt.Errorf("Range check failed on e.LockedQtyDelta (%v < %v > %v)", e.LockedQtyDeltaMinValue(), e.LockedQtyDelta, e.LockedQtyDeltaMaxValue()) + } + } + if e.SubscriptionIdInActingVersion(actingVersion) { + if e.SubscriptionId != e.SubscriptionIdNullValue() && (e.SubscriptionId < e.SubscriptionIdMinValue() || e.SubscriptionId > e.SubscriptionIdMaxValue()) { + return fmt.Errorf("Range check failed on e.SubscriptionId (%v < %v > %v)", e.SubscriptionIdMinValue(), e.SubscriptionId, e.SubscriptionIdMaxValue()) + } + } + if !utf8.Valid(e.Asset[:]) { + return errors.New("e.Asset failed UTF-8 validation") + } + return nil +} + +func ExternalLockUpdateEventInit(e *ExternalLockUpdateEvent) { + e.SubscriptionId = math.MaxUint16 + return +} + +func (*ExternalLockUpdateEvent) SbeBlockLength() (blockLength uint16) { + return 27 +} + +func (*ExternalLockUpdateEvent) SbeTemplateId() (templateId uint16) { + return 604 +} + +func (*ExternalLockUpdateEvent) SbeSchemaId() (schemaId uint16) { + return 3 +} + +func (*ExternalLockUpdateEvent) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} + +func (*ExternalLockUpdateEvent) SbeSemanticType() (semanticType []byte) { + return []byte("") +} + +func (*ExternalLockUpdateEvent) SbeSemanticVersion() (semanticVersion string) { + return "5.2" +} + +func (*ExternalLockUpdateEvent) EventTimeId() uint16 { + return 1 +} + +func (*ExternalLockUpdateEvent) EventTimeSinceVersion() uint16 { + return 0 +} + +func (e *ExternalLockUpdateEvent) EventTimeInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.EventTimeSinceVersion() +} + +func (*ExternalLockUpdateEvent) EventTimeDeprecated() uint16 { + return 0 +} + +func (*ExternalLockUpdateEvent) EventTimeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*ExternalLockUpdateEvent) EventTimeMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*ExternalLockUpdateEvent) EventTimeMaxValue() int64 { + return math.MaxInt64 +} + +func (*ExternalLockUpdateEvent) EventTimeNullValue() int64 { + return math.MinInt64 +} + +func (*ExternalLockUpdateEvent) ClearTimeId() uint16 { + return 2 +} + +func (*ExternalLockUpdateEvent) ClearTimeSinceVersion() uint16 { + return 0 +} + +func (e *ExternalLockUpdateEvent) ClearTimeInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.ClearTimeSinceVersion() +} + +func (*ExternalLockUpdateEvent) ClearTimeDeprecated() uint16 { + return 0 +} + +func (*ExternalLockUpdateEvent) ClearTimeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*ExternalLockUpdateEvent) ClearTimeMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*ExternalLockUpdateEvent) ClearTimeMaxValue() int64 { + return math.MaxInt64 +} + +func (*ExternalLockUpdateEvent) ClearTimeNullValue() int64 { + return math.MinInt64 +} + +func (*ExternalLockUpdateEvent) QtyExponentId() uint16 { + return 3 +} + +func (*ExternalLockUpdateEvent) QtyExponentSinceVersion() uint16 { + return 0 +} + +func (e *ExternalLockUpdateEvent) QtyExponentInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.QtyExponentSinceVersion() +} + +func (*ExternalLockUpdateEvent) QtyExponentDeprecated() uint16 { + return 0 +} + +func (*ExternalLockUpdateEvent) QtyExponentMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*ExternalLockUpdateEvent) QtyExponentMinValue() int8 { + return math.MinInt8 + 1 +} + +func (*ExternalLockUpdateEvent) QtyExponentMaxValue() int8 { + return math.MaxInt8 +} + +func (*ExternalLockUpdateEvent) QtyExponentNullValue() int8 { + return math.MinInt8 +} + +func (*ExternalLockUpdateEvent) LockedQtyDeltaId() uint16 { + return 4 +} + +func (*ExternalLockUpdateEvent) LockedQtyDeltaSinceVersion() uint16 { + return 0 +} + +func (e *ExternalLockUpdateEvent) LockedQtyDeltaInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.LockedQtyDeltaSinceVersion() +} + +func (*ExternalLockUpdateEvent) LockedQtyDeltaDeprecated() uint16 { + return 0 +} + +func (*ExternalLockUpdateEvent) LockedQtyDeltaMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*ExternalLockUpdateEvent) LockedQtyDeltaMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*ExternalLockUpdateEvent) LockedQtyDeltaMaxValue() int64 { + return math.MaxInt64 +} + +func (*ExternalLockUpdateEvent) LockedQtyDeltaNullValue() int64 { + return math.MinInt64 +} + +func (*ExternalLockUpdateEvent) SubscriptionIdId() uint16 { + return 5 +} + +func (*ExternalLockUpdateEvent) SubscriptionIdSinceVersion() uint16 { + return 1 +} + +func (e *ExternalLockUpdateEvent) SubscriptionIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.SubscriptionIdSinceVersion() +} + +func (*ExternalLockUpdateEvent) SubscriptionIdDeprecated() uint16 { + return 0 +} + +func (*ExternalLockUpdateEvent) SubscriptionIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*ExternalLockUpdateEvent) SubscriptionIdMinValue() uint16 { + return 0 +} + +func (*ExternalLockUpdateEvent) SubscriptionIdMaxValue() uint16 { + return math.MaxUint16 - 1 +} + +func (*ExternalLockUpdateEvent) SubscriptionIdNullValue() uint16 { + return math.MaxUint16 +} + +func (*ExternalLockUpdateEvent) AssetMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*ExternalLockUpdateEvent) AssetSinceVersion() uint16 { + return 0 +} + +func (e *ExternalLockUpdateEvent) AssetInActingVersion(actingVersion uint16) bool { + return actingVersion >= e.AssetSinceVersion() +} + +func (*ExternalLockUpdateEvent) AssetDeprecated() uint16 { + return 0 +} + +func (ExternalLockUpdateEvent) AssetCharacterEncoding() string { + return "UTF-8" +} + +func (ExternalLockUpdateEvent) AssetHeaderLength() uint64 { + return 1 +} diff --git a/v2/sbe/spot_3_1/FilterType.go b/v2/sbe/spot_3_1/FilterType.go new file mode 100644 index 00000000..05fb9327 --- /dev/null +++ b/v2/sbe/spot_3_1/FilterType.go @@ -0,0 +1,333 @@ +// Generated SBE (Simple Binary Encoding) message codec + +package sbe + +import ( + "fmt" + "io" + "reflect" +) + +type FilterTypeEnum uint8 +type FilterTypeValues struct { + MaxPosition FilterTypeEnum + PriceFilter FilterTypeEnum + TPlusSell FilterTypeEnum + LotSize FilterTypeEnum + MaxNumOrders FilterTypeEnum + MinNotional FilterTypeEnum + MaxNumAlgoOrders FilterTypeEnum + ExchangeMaxNumOrders FilterTypeEnum + ExchangeMaxNumAlgoOrders FilterTypeEnum + IcebergParts FilterTypeEnum + MarketLotSize FilterTypeEnum + PercentPrice FilterTypeEnum + MaxNumIcebergOrders FilterTypeEnum + ExchangeMaxNumIcebergOrders FilterTypeEnum + TrailingDelta FilterTypeEnum + PercentPriceBySide FilterTypeEnum + Notional FilterTypeEnum + MaxNumOrderLists FilterTypeEnum + ExchangeMaxNumOrderLists FilterTypeEnum + MaxNumOrderAmends FilterTypeEnum + MaxAsset FilterTypeEnum + NonRepresentable FilterTypeEnum + NullValue FilterTypeEnum +} + +var FilterType = FilterTypeValues{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 254, 255} + +func (f FilterTypeEnum) Encode(_m *SbeGoMarshaller, _w io.Writer) error { + if err := _m.WriteUint8(_w, uint8(f)); err != nil { + return err + } + return nil +} + +func (f *FilterTypeEnum) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16) error { + if err := _m.ReadUint8(_r, (*uint8)(f)); err != nil { + return err + } + return nil +} + +func (f FilterTypeEnum) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if actingVersion > schemaVersion { + return nil + } + value := reflect.ValueOf(FilterType) + for idx := 0; idx < value.NumField(); idx++ { + if f == value.Field(idx).Interface() { + return nil + } + } + return fmt.Errorf("Range check failed on FilterType, unknown enumeration value %d", f) +} + +func (*FilterTypeEnum) EncodedLength() int64 { + return 1 +} + +func (*FilterTypeEnum) MaxPositionSinceVersion() uint16 { + return 0 +} + +func (f *FilterTypeEnum) MaxPositionInActingVersion(actingVersion uint16) bool { + return actingVersion >= f.MaxPositionSinceVersion() +} + +func (*FilterTypeEnum) MaxPositionDeprecated() uint16 { + return 0 +} + +func (*FilterTypeEnum) PriceFilterSinceVersion() uint16 { + return 0 +} + +func (f *FilterTypeEnum) PriceFilterInActingVersion(actingVersion uint16) bool { + return actingVersion >= f.PriceFilterSinceVersion() +} + +func (*FilterTypeEnum) PriceFilterDeprecated() uint16 { + return 0 +} + +func (*FilterTypeEnum) TPlusSellSinceVersion() uint16 { + return 0 +} + +func (f *FilterTypeEnum) TPlusSellInActingVersion(actingVersion uint16) bool { + return actingVersion >= f.TPlusSellSinceVersion() +} + +func (*FilterTypeEnum) TPlusSellDeprecated() uint16 { + return 0 +} + +func (*FilterTypeEnum) LotSizeSinceVersion() uint16 { + return 0 +} + +func (f *FilterTypeEnum) LotSizeInActingVersion(actingVersion uint16) bool { + return actingVersion >= f.LotSizeSinceVersion() +} + +func (*FilterTypeEnum) LotSizeDeprecated() uint16 { + return 0 +} + +func (*FilterTypeEnum) MaxNumOrdersSinceVersion() uint16 { + return 0 +} + +func (f *FilterTypeEnum) MaxNumOrdersInActingVersion(actingVersion uint16) bool { + return actingVersion >= f.MaxNumOrdersSinceVersion() +} + +func (*FilterTypeEnum) MaxNumOrdersDeprecated() uint16 { + return 0 +} + +func (*FilterTypeEnum) MinNotionalSinceVersion() uint16 { + return 0 +} + +func (f *FilterTypeEnum) MinNotionalInActingVersion(actingVersion uint16) bool { + return actingVersion >= f.MinNotionalSinceVersion() +} + +func (*FilterTypeEnum) MinNotionalDeprecated() uint16 { + return 0 +} + +func (*FilterTypeEnum) MaxNumAlgoOrdersSinceVersion() uint16 { + return 0 +} + +func (f *FilterTypeEnum) MaxNumAlgoOrdersInActingVersion(actingVersion uint16) bool { + return actingVersion >= f.MaxNumAlgoOrdersSinceVersion() +} + +func (*FilterTypeEnum) MaxNumAlgoOrdersDeprecated() uint16 { + return 0 +} + +func (*FilterTypeEnum) ExchangeMaxNumOrdersSinceVersion() uint16 { + return 0 +} + +func (f *FilterTypeEnum) ExchangeMaxNumOrdersInActingVersion(actingVersion uint16) bool { + return actingVersion >= f.ExchangeMaxNumOrdersSinceVersion() +} + +func (*FilterTypeEnum) ExchangeMaxNumOrdersDeprecated() uint16 { + return 0 +} + +func (*FilterTypeEnum) ExchangeMaxNumAlgoOrdersSinceVersion() uint16 { + return 0 +} + +func (f *FilterTypeEnum) ExchangeMaxNumAlgoOrdersInActingVersion(actingVersion uint16) bool { + return actingVersion >= f.ExchangeMaxNumAlgoOrdersSinceVersion() +} + +func (*FilterTypeEnum) ExchangeMaxNumAlgoOrdersDeprecated() uint16 { + return 0 +} + +func (*FilterTypeEnum) IcebergPartsSinceVersion() uint16 { + return 0 +} + +func (f *FilterTypeEnum) IcebergPartsInActingVersion(actingVersion uint16) bool { + return actingVersion >= f.IcebergPartsSinceVersion() +} + +func (*FilterTypeEnum) IcebergPartsDeprecated() uint16 { + return 0 +} + +func (*FilterTypeEnum) MarketLotSizeSinceVersion() uint16 { + return 0 +} + +func (f *FilterTypeEnum) MarketLotSizeInActingVersion(actingVersion uint16) bool { + return actingVersion >= f.MarketLotSizeSinceVersion() +} + +func (*FilterTypeEnum) MarketLotSizeDeprecated() uint16 { + return 0 +} + +func (*FilterTypeEnum) PercentPriceSinceVersion() uint16 { + return 0 +} + +func (f *FilterTypeEnum) PercentPriceInActingVersion(actingVersion uint16) bool { + return actingVersion >= f.PercentPriceSinceVersion() +} + +func (*FilterTypeEnum) PercentPriceDeprecated() uint16 { + return 0 +} + +func (*FilterTypeEnum) MaxNumIcebergOrdersSinceVersion() uint16 { + return 0 +} + +func (f *FilterTypeEnum) MaxNumIcebergOrdersInActingVersion(actingVersion uint16) bool { + return actingVersion >= f.MaxNumIcebergOrdersSinceVersion() +} + +func (*FilterTypeEnum) MaxNumIcebergOrdersDeprecated() uint16 { + return 0 +} + +func (*FilterTypeEnum) ExchangeMaxNumIcebergOrdersSinceVersion() uint16 { + return 0 +} + +func (f *FilterTypeEnum) ExchangeMaxNumIcebergOrdersInActingVersion(actingVersion uint16) bool { + return actingVersion >= f.ExchangeMaxNumIcebergOrdersSinceVersion() +} + +func (*FilterTypeEnum) ExchangeMaxNumIcebergOrdersDeprecated() uint16 { + return 0 +} + +func (*FilterTypeEnum) TrailingDeltaSinceVersion() uint16 { + return 0 +} + +func (f *FilterTypeEnum) TrailingDeltaInActingVersion(actingVersion uint16) bool { + return actingVersion >= f.TrailingDeltaSinceVersion() +} + +func (*FilterTypeEnum) TrailingDeltaDeprecated() uint16 { + return 0 +} + +func (*FilterTypeEnum) PercentPriceBySideSinceVersion() uint16 { + return 0 +} + +func (f *FilterTypeEnum) PercentPriceBySideInActingVersion(actingVersion uint16) bool { + return actingVersion >= f.PercentPriceBySideSinceVersion() +} + +func (*FilterTypeEnum) PercentPriceBySideDeprecated() uint16 { + return 0 +} + +func (*FilterTypeEnum) NotionalSinceVersion() uint16 { + return 0 +} + +func (f *FilterTypeEnum) NotionalInActingVersion(actingVersion uint16) bool { + return actingVersion >= f.NotionalSinceVersion() +} + +func (*FilterTypeEnum) NotionalDeprecated() uint16 { + return 0 +} + +func (*FilterTypeEnum) MaxNumOrderListsSinceVersion() uint16 { + return 0 +} + +func (f *FilterTypeEnum) MaxNumOrderListsInActingVersion(actingVersion uint16) bool { + return actingVersion >= f.MaxNumOrderListsSinceVersion() +} + +func (*FilterTypeEnum) MaxNumOrderListsDeprecated() uint16 { + return 0 +} + +func (*FilterTypeEnum) ExchangeMaxNumOrderListsSinceVersion() uint16 { + return 0 +} + +func (f *FilterTypeEnum) ExchangeMaxNumOrderListsInActingVersion(actingVersion uint16) bool { + return actingVersion >= f.ExchangeMaxNumOrderListsSinceVersion() +} + +func (*FilterTypeEnum) ExchangeMaxNumOrderListsDeprecated() uint16 { + return 0 +} + +func (*FilterTypeEnum) MaxNumOrderAmendsSinceVersion() uint16 { + return 0 +} + +func (f *FilterTypeEnum) MaxNumOrderAmendsInActingVersion(actingVersion uint16) bool { + return actingVersion >= f.MaxNumOrderAmendsSinceVersion() +} + +func (*FilterTypeEnum) MaxNumOrderAmendsDeprecated() uint16 { + return 0 +} + +func (*FilterTypeEnum) MaxAssetSinceVersion() uint16 { + return 0 +} + +func (f *FilterTypeEnum) MaxAssetInActingVersion(actingVersion uint16) bool { + return actingVersion >= f.MaxAssetSinceVersion() +} + +func (*FilterTypeEnum) MaxAssetDeprecated() uint16 { + return 0 +} + +func (*FilterTypeEnum) NonRepresentableSinceVersion() uint16 { + return 0 +} + +func (f *FilterTypeEnum) NonRepresentableInActingVersion(actingVersion uint16) bool { + return actingVersion >= f.NonRepresentableSinceVersion() +} + +func (*FilterTypeEnum) NonRepresentableDeprecated() uint16 { + return 0 +} diff --git a/v2/sbe/spot_3_1/Floor.go b/v2/sbe/spot_3_1/Floor.go new file mode 100644 index 00000000..67d2938b --- /dev/null +++ b/v2/sbe/spot_3_1/Floor.go @@ -0,0 +1,99 @@ +// Generated SBE (Simple Binary Encoding) message codec + +package sbe + +import ( + "fmt" + "io" + "reflect" +) + +type FloorEnum uint8 +type FloorValues struct { + Exchange FloorEnum + Broker FloorEnum + Sor FloorEnum + NonRepresentable FloorEnum + NullValue FloorEnum +} + +var Floor = FloorValues{1, 2, 3, 254, 255} + +func (f FloorEnum) Encode(_m *SbeGoMarshaller, _w io.Writer) error { + if err := _m.WriteUint8(_w, uint8(f)); err != nil { + return err + } + return nil +} + +func (f *FloorEnum) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16) error { + if err := _m.ReadUint8(_r, (*uint8)(f)); err != nil { + return err + } + return nil +} + +func (f FloorEnum) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if actingVersion > schemaVersion { + return nil + } + value := reflect.ValueOf(Floor) + for idx := 0; idx < value.NumField(); idx++ { + if f == value.Field(idx).Interface() { + return nil + } + } + return fmt.Errorf("Range check failed on Floor, unknown enumeration value %d", f) +} + +func (*FloorEnum) EncodedLength() int64 { + return 1 +} + +func (*FloorEnum) ExchangeSinceVersion() uint16 { + return 0 +} + +func (f *FloorEnum) ExchangeInActingVersion(actingVersion uint16) bool { + return actingVersion >= f.ExchangeSinceVersion() +} + +func (*FloorEnum) ExchangeDeprecated() uint16 { + return 0 +} + +func (*FloorEnum) BrokerSinceVersion() uint16 { + return 0 +} + +func (f *FloorEnum) BrokerInActingVersion(actingVersion uint16) bool { + return actingVersion >= f.BrokerSinceVersion() +} + +func (*FloorEnum) BrokerDeprecated() uint16 { + return 0 +} + +func (*FloorEnum) SorSinceVersion() uint16 { + return 0 +} + +func (f *FloorEnum) SorInActingVersion(actingVersion uint16) bool { + return actingVersion >= f.SorSinceVersion() +} + +func (*FloorEnum) SorDeprecated() uint16 { + return 0 +} + +func (*FloorEnum) NonRepresentableSinceVersion() uint16 { + return 0 +} + +func (f *FloorEnum) NonRepresentableInActingVersion(actingVersion uint16) bool { + return actingVersion >= f.NonRepresentableSinceVersion() +} + +func (*FloorEnum) NonRepresentableDeprecated() uint16 { + return 0 +} diff --git a/v2/sbe/spot_3_1/GroupSize16Encoding.go b/v2/sbe/spot_3_1/GroupSize16Encoding.go new file mode 100644 index 00000000..be7f6b00 --- /dev/null +++ b/v2/sbe/spot_3_1/GroupSize16Encoding.go @@ -0,0 +1,112 @@ +// Generated SBE (Simple Binary Encoding) message codec + +package sbe + +import ( + "fmt" + "io" + "math" +) + +type GroupSize16Encoding struct { + BlockLength uint16 + NumInGroup uint16 +} + +func (g *GroupSize16Encoding) Encode(_m *SbeGoMarshaller, _w io.Writer) error { + if err := _m.WriteUint16(_w, g.BlockLength); err != nil { + return err + } + if err := _m.WriteUint16(_w, g.NumInGroup); err != nil { + return err + } + return nil +} + +func (g *GroupSize16Encoding) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16) error { + if !g.BlockLengthInActingVersion(actingVersion) { + g.BlockLength = g.BlockLengthNullValue() + } else { + if err := _m.ReadUint16(_r, &g.BlockLength); err != nil { + return err + } + } + if !g.NumInGroupInActingVersion(actingVersion) { + g.NumInGroup = g.NumInGroupNullValue() + } else { + if err := _m.ReadUint16(_r, &g.NumInGroup); err != nil { + return err + } + } + return nil +} + +func (g *GroupSize16Encoding) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if g.BlockLengthInActingVersion(actingVersion) { + if g.BlockLength < g.BlockLengthMinValue() || g.BlockLength > g.BlockLengthMaxValue() { + return fmt.Errorf("Range check failed on g.BlockLength (%v < %v > %v)", g.BlockLengthMinValue(), g.BlockLength, g.BlockLengthMaxValue()) + } + } + if g.NumInGroupInActingVersion(actingVersion) { + if g.NumInGroup < g.NumInGroupMinValue() || g.NumInGroup > g.NumInGroupMaxValue() { + return fmt.Errorf("Range check failed on g.NumInGroup (%v < %v > %v)", g.NumInGroupMinValue(), g.NumInGroup, g.NumInGroupMaxValue()) + } + } + return nil +} + +func GroupSize16EncodingInit(g *GroupSize16Encoding) { + return +} + +func (*GroupSize16Encoding) EncodedLength() int64 { + return 4 +} + +func (*GroupSize16Encoding) BlockLengthMinValue() uint16 { + return 0 +} + +func (*GroupSize16Encoding) BlockLengthMaxValue() uint16 { + return math.MaxUint16 - 1 +} + +func (*GroupSize16Encoding) BlockLengthNullValue() uint16 { + return math.MaxUint16 +} + +func (*GroupSize16Encoding) BlockLengthSinceVersion() uint16 { + return 0 +} + +func (g *GroupSize16Encoding) BlockLengthInActingVersion(actingVersion uint16) bool { + return actingVersion >= g.BlockLengthSinceVersion() +} + +func (*GroupSize16Encoding) BlockLengthDeprecated() uint16 { + return 0 +} + +func (*GroupSize16Encoding) NumInGroupMinValue() uint16 { + return 0 +} + +func (*GroupSize16Encoding) NumInGroupMaxValue() uint16 { + return math.MaxUint16 - 1 +} + +func (*GroupSize16Encoding) NumInGroupNullValue() uint16 { + return math.MaxUint16 +} + +func (*GroupSize16Encoding) NumInGroupSinceVersion() uint16 { + return 0 +} + +func (g *GroupSize16Encoding) NumInGroupInActingVersion(actingVersion uint16) bool { + return actingVersion >= g.NumInGroupSinceVersion() +} + +func (*GroupSize16Encoding) NumInGroupDeprecated() uint16 { + return 0 +} diff --git a/v2/sbe/spot_3_1/GroupSizeEncoding.go b/v2/sbe/spot_3_1/GroupSizeEncoding.go new file mode 100644 index 00000000..3f6cbf7b --- /dev/null +++ b/v2/sbe/spot_3_1/GroupSizeEncoding.go @@ -0,0 +1,112 @@ +// Generated SBE (Simple Binary Encoding) message codec + +package sbe + +import ( + "fmt" + "io" + "math" +) + +type GroupSizeEncoding struct { + BlockLength uint16 + NumInGroup uint32 +} + +func (g *GroupSizeEncoding) Encode(_m *SbeGoMarshaller, _w io.Writer) error { + if err := _m.WriteUint16(_w, g.BlockLength); err != nil { + return err + } + if err := _m.WriteUint32(_w, g.NumInGroup); err != nil { + return err + } + return nil +} + +func (g *GroupSizeEncoding) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16) error { + if !g.BlockLengthInActingVersion(actingVersion) { + g.BlockLength = g.BlockLengthNullValue() + } else { + if err := _m.ReadUint16(_r, &g.BlockLength); err != nil { + return err + } + } + if !g.NumInGroupInActingVersion(actingVersion) { + g.NumInGroup = g.NumInGroupNullValue() + } else { + if err := _m.ReadUint32(_r, &g.NumInGroup); err != nil { + return err + } + } + return nil +} + +func (g *GroupSizeEncoding) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if g.BlockLengthInActingVersion(actingVersion) { + if g.BlockLength < g.BlockLengthMinValue() || g.BlockLength > g.BlockLengthMaxValue() { + return fmt.Errorf("Range check failed on g.BlockLength (%v < %v > %v)", g.BlockLengthMinValue(), g.BlockLength, g.BlockLengthMaxValue()) + } + } + if g.NumInGroupInActingVersion(actingVersion) { + if g.NumInGroup < g.NumInGroupMinValue() || g.NumInGroup > g.NumInGroupMaxValue() { + return fmt.Errorf("Range check failed on g.NumInGroup (%v < %v > %v)", g.NumInGroupMinValue(), g.NumInGroup, g.NumInGroupMaxValue()) + } + } + return nil +} + +func GroupSizeEncodingInit(g *GroupSizeEncoding) { + return +} + +func (*GroupSizeEncoding) EncodedLength() int64 { + return 6 +} + +func (*GroupSizeEncoding) BlockLengthMinValue() uint16 { + return 0 +} + +func (*GroupSizeEncoding) BlockLengthMaxValue() uint16 { + return math.MaxUint16 - 1 +} + +func (*GroupSizeEncoding) BlockLengthNullValue() uint16 { + return math.MaxUint16 +} + +func (*GroupSizeEncoding) BlockLengthSinceVersion() uint16 { + return 0 +} + +func (g *GroupSizeEncoding) BlockLengthInActingVersion(actingVersion uint16) bool { + return actingVersion >= g.BlockLengthSinceVersion() +} + +func (*GroupSizeEncoding) BlockLengthDeprecated() uint16 { + return 0 +} + +func (*GroupSizeEncoding) NumInGroupMinValue() uint32 { + return 0 +} + +func (*GroupSizeEncoding) NumInGroupMaxValue() uint32 { + return 2147483647 +} + +func (*GroupSizeEncoding) NumInGroupNullValue() uint32 { + return math.MaxUint32 +} + +func (*GroupSizeEncoding) NumInGroupSinceVersion() uint16 { + return 0 +} + +func (g *GroupSizeEncoding) NumInGroupInActingVersion(actingVersion uint16) bool { + return actingVersion >= g.NumInGroupSinceVersion() +} + +func (*GroupSizeEncoding) NumInGroupDeprecated() uint16 { + return 0 +} diff --git a/v2/sbe/spot_3_1/IcebergPartsFilter.go b/v2/sbe/spot_3_1/IcebergPartsFilter.go new file mode 100644 index 00000000..fd407beb --- /dev/null +++ b/v2/sbe/spot_3_1/IcebergPartsFilter.go @@ -0,0 +1,160 @@ +// Generated SBE (Simple Binary Encoding) message codec + +package sbe + +import ( + "fmt" + "io" + "io/ioutil" + "math" +) + +type IcebergPartsFilter struct { + FilterType FilterTypeEnum + FilterLimit int64 +} + +func (i *IcebergPartsFilter) Encode(_m *SbeGoMarshaller, _w io.Writer, doRangeCheck bool) error { + if doRangeCheck { + if err := i.RangeCheck(i.SbeSchemaVersion(), i.SbeSchemaVersion()); err != nil { + return err + } + } + if err := _m.WriteInt64(_w, i.FilterLimit); err != nil { + return err + } + return nil +} + +func (i *IcebergPartsFilter) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint16, doRangeCheck bool) error { + i.FilterType = FilterType.IcebergParts + if !i.FilterLimitInActingVersion(actingVersion) { + i.FilterLimit = i.FilterLimitNullValue() + } else { + if err := _m.ReadInt64(_r, &i.FilterLimit); err != nil { + return err + } + } + if actingVersion > i.SbeSchemaVersion() && blockLength > i.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-i.SbeBlockLength())) + } + if doRangeCheck { + if err := i.RangeCheck(actingVersion, i.SbeSchemaVersion()); err != nil { + return err + } + } + return nil +} + +func (i *IcebergPartsFilter) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if err := i.FilterType.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if i.FilterLimitInActingVersion(actingVersion) { + if i.FilterLimit < i.FilterLimitMinValue() || i.FilterLimit > i.FilterLimitMaxValue() { + return fmt.Errorf("Range check failed on i.FilterLimit (%v < %v > %v)", i.FilterLimitMinValue(), i.FilterLimit, i.FilterLimitMaxValue()) + } + } + return nil +} + +func IcebergPartsFilterInit(i *IcebergPartsFilter) { + i.FilterType = FilterType.IcebergParts + return +} + +func (*IcebergPartsFilter) SbeBlockLength() (blockLength uint16) { + return 8 +} + +func (*IcebergPartsFilter) SbeTemplateId() (templateId uint16) { + return 7 +} + +func (*IcebergPartsFilter) SbeSchemaId() (schemaId uint16) { + return 3 +} + +func (*IcebergPartsFilter) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} + +func (*IcebergPartsFilter) SbeSemanticType() (semanticType []byte) { + return []byte("") +} + +func (*IcebergPartsFilter) SbeSemanticVersion() (semanticVersion string) { + return "5.2" +} + +func (*IcebergPartsFilter) FilterTypeId() uint16 { + return 1 +} + +func (*IcebergPartsFilter) FilterTypeSinceVersion() uint16 { + return 0 +} + +func (i *IcebergPartsFilter) FilterTypeInActingVersion(actingVersion uint16) bool { + return actingVersion >= i.FilterTypeSinceVersion() +} + +func (*IcebergPartsFilter) FilterTypeDeprecated() uint16 { + return 0 +} + +func (*IcebergPartsFilter) FilterTypeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "constant" + } + return "" +} + +func (*IcebergPartsFilter) FilterLimitId() uint16 { + return 2 +} + +func (*IcebergPartsFilter) FilterLimitSinceVersion() uint16 { + return 0 +} + +func (i *IcebergPartsFilter) FilterLimitInActingVersion(actingVersion uint16) bool { + return actingVersion >= i.FilterLimitSinceVersion() +} + +func (*IcebergPartsFilter) FilterLimitDeprecated() uint16 { + return 0 +} + +func (*IcebergPartsFilter) FilterLimitMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*IcebergPartsFilter) FilterLimitMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*IcebergPartsFilter) FilterLimitMaxValue() int64 { + return math.MaxInt64 +} + +func (*IcebergPartsFilter) FilterLimitNullValue() int64 { + return math.MinInt64 +} diff --git a/v2/sbe/spot_3_1/KlinesResponse.go b/v2/sbe/spot_3_1/KlinesResponse.go new file mode 100644 index 00000000..7df32f6b --- /dev/null +++ b/v2/sbe/spot_3_1/KlinesResponse.go @@ -0,0 +1,920 @@ +// Generated SBE (Simple Binary Encoding) message codec + +package sbe + +import ( + "fmt" + "io" + "io/ioutil" + "math" +) + +type KlinesResponse struct { + PriceExponent int8 + QtyExponent int8 + Klines []KlinesResponseKlines +} +type KlinesResponseKlines struct { + OpenTime int64 + OpenPrice int64 + HighPrice int64 + LowPrice int64 + ClosePrice int64 + Volume [16]uint8 + CloseTime int64 + QuoteVolume [16]uint8 + NumTrades int64 + TakerBuyBaseVolume [16]uint8 + TakerBuyQuoteVolume [16]uint8 +} + +func (k *KlinesResponse) Encode(_m *SbeGoMarshaller, _w io.Writer, doRangeCheck bool) error { + if doRangeCheck { + if err := k.RangeCheck(k.SbeSchemaVersion(), k.SbeSchemaVersion()); err != nil { + return err + } + } + if err := _m.WriteInt8(_w, k.PriceExponent); err != nil { + return err + } + if err := _m.WriteInt8(_w, k.QtyExponent); err != nil { + return err + } + var KlinesBlockLength uint16 = 120 + if err := _m.WriteUint16(_w, KlinesBlockLength); err != nil { + return err + } + var KlinesNumInGroup uint32 = uint32(len(k.Klines)) + if err := _m.WriteUint32(_w, KlinesNumInGroup); err != nil { + return err + } + for i := range k.Klines { + if err := k.Klines[i].Encode(_m, _w); err != nil { + return err + } + } + return nil +} + +func (k *KlinesResponse) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint16, doRangeCheck bool) error { + if !k.PriceExponentInActingVersion(actingVersion) { + k.PriceExponent = k.PriceExponentNullValue() + } else { + if err := _m.ReadInt8(_r, &k.PriceExponent); err != nil { + return err + } + } + if !k.QtyExponentInActingVersion(actingVersion) { + k.QtyExponent = k.QtyExponentNullValue() + } else { + if err := _m.ReadInt8(_r, &k.QtyExponent); err != nil { + return err + } + } + if actingVersion > k.SbeSchemaVersion() && blockLength > k.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-k.SbeBlockLength())) + } + + if k.KlinesInActingVersion(actingVersion) { + var KlinesBlockLength uint16 + if err := _m.ReadUint16(_r, &KlinesBlockLength); err != nil { + return err + } + var KlinesNumInGroup uint32 + if err := _m.ReadUint32(_r, &KlinesNumInGroup); err != nil { + return err + } + if cap(k.Klines) < int(KlinesNumInGroup) { + k.Klines = make([]KlinesResponseKlines, KlinesNumInGroup) + } + k.Klines = k.Klines[:KlinesNumInGroup] + for i := range k.Klines { + if err := k.Klines[i].Decode(_m, _r, actingVersion, uint(KlinesBlockLength)); err != nil { + return err + } + } + } + if doRangeCheck { + if err := k.RangeCheck(actingVersion, k.SbeSchemaVersion()); err != nil { + return err + } + } + return nil +} + +func (k *KlinesResponse) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if k.PriceExponentInActingVersion(actingVersion) { + if k.PriceExponent < k.PriceExponentMinValue() || k.PriceExponent > k.PriceExponentMaxValue() { + return fmt.Errorf("Range check failed on k.PriceExponent (%v < %v > %v)", k.PriceExponentMinValue(), k.PriceExponent, k.PriceExponentMaxValue()) + } + } + if k.QtyExponentInActingVersion(actingVersion) { + if k.QtyExponent < k.QtyExponentMinValue() || k.QtyExponent > k.QtyExponentMaxValue() { + return fmt.Errorf("Range check failed on k.QtyExponent (%v < %v > %v)", k.QtyExponentMinValue(), k.QtyExponent, k.QtyExponentMaxValue()) + } + } + for i := range k.Klines { + if err := k.Klines[i].RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + } + return nil +} + +func KlinesResponseInit(k *KlinesResponse) { + return +} + +func (k *KlinesResponseKlines) Encode(_m *SbeGoMarshaller, _w io.Writer) error { + if err := _m.WriteInt64(_w, k.OpenTime); err != nil { + return err + } + if err := _m.WriteInt64(_w, k.OpenPrice); err != nil { + return err + } + if err := _m.WriteInt64(_w, k.HighPrice); err != nil { + return err + } + if err := _m.WriteInt64(_w, k.LowPrice); err != nil { + return err + } + if err := _m.WriteInt64(_w, k.ClosePrice); err != nil { + return err + } + if err := _m.WriteBytes(_w, k.Volume[:]); err != nil { + return err + } + if err := _m.WriteInt64(_w, k.CloseTime); err != nil { + return err + } + if err := _m.WriteBytes(_w, k.QuoteVolume[:]); err != nil { + return err + } + if err := _m.WriteInt64(_w, k.NumTrades); err != nil { + return err + } + if err := _m.WriteBytes(_w, k.TakerBuyBaseVolume[:]); err != nil { + return err + } + if err := _m.WriteBytes(_w, k.TakerBuyQuoteVolume[:]); err != nil { + return err + } + return nil +} + +func (k *KlinesResponseKlines) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint) error { + if !k.OpenTimeInActingVersion(actingVersion) { + k.OpenTime = k.OpenTimeNullValue() + } else { + if err := _m.ReadInt64(_r, &k.OpenTime); err != nil { + return err + } + } + if !k.OpenPriceInActingVersion(actingVersion) { + k.OpenPrice = k.OpenPriceNullValue() + } else { + if err := _m.ReadInt64(_r, &k.OpenPrice); err != nil { + return err + } + } + if !k.HighPriceInActingVersion(actingVersion) { + k.HighPrice = k.HighPriceNullValue() + } else { + if err := _m.ReadInt64(_r, &k.HighPrice); err != nil { + return err + } + } + if !k.LowPriceInActingVersion(actingVersion) { + k.LowPrice = k.LowPriceNullValue() + } else { + if err := _m.ReadInt64(_r, &k.LowPrice); err != nil { + return err + } + } + if !k.ClosePriceInActingVersion(actingVersion) { + k.ClosePrice = k.ClosePriceNullValue() + } else { + if err := _m.ReadInt64(_r, &k.ClosePrice); err != nil { + return err + } + } + if !k.VolumeInActingVersion(actingVersion) { + for idx := 0; idx < 16; idx++ { + k.Volume[idx] = k.VolumeNullValue() + } + } else { + if err := _m.ReadBytes(_r, k.Volume[:]); err != nil { + return err + } + } + if !k.CloseTimeInActingVersion(actingVersion) { + k.CloseTime = k.CloseTimeNullValue() + } else { + if err := _m.ReadInt64(_r, &k.CloseTime); err != nil { + return err + } + } + if !k.QuoteVolumeInActingVersion(actingVersion) { + for idx := 0; idx < 16; idx++ { + k.QuoteVolume[idx] = k.QuoteVolumeNullValue() + } + } else { + if err := _m.ReadBytes(_r, k.QuoteVolume[:]); err != nil { + return err + } + } + if !k.NumTradesInActingVersion(actingVersion) { + k.NumTrades = k.NumTradesNullValue() + } else { + if err := _m.ReadInt64(_r, &k.NumTrades); err != nil { + return err + } + } + if !k.TakerBuyBaseVolumeInActingVersion(actingVersion) { + for idx := 0; idx < 16; idx++ { + k.TakerBuyBaseVolume[idx] = k.TakerBuyBaseVolumeNullValue() + } + } else { + if err := _m.ReadBytes(_r, k.TakerBuyBaseVolume[:]); err != nil { + return err + } + } + if !k.TakerBuyQuoteVolumeInActingVersion(actingVersion) { + for idx := 0; idx < 16; idx++ { + k.TakerBuyQuoteVolume[idx] = k.TakerBuyQuoteVolumeNullValue() + } + } else { + if err := _m.ReadBytes(_r, k.TakerBuyQuoteVolume[:]); err != nil { + return err + } + } + if actingVersion > k.SbeSchemaVersion() && blockLength > k.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-k.SbeBlockLength())) + } + return nil +} + +func (k *KlinesResponseKlines) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if k.OpenTimeInActingVersion(actingVersion) { + if k.OpenTime < k.OpenTimeMinValue() || k.OpenTime > k.OpenTimeMaxValue() { + return fmt.Errorf("Range check failed on k.OpenTime (%v < %v > %v)", k.OpenTimeMinValue(), k.OpenTime, k.OpenTimeMaxValue()) + } + } + if k.OpenPriceInActingVersion(actingVersion) { + if k.OpenPrice < k.OpenPriceMinValue() || k.OpenPrice > k.OpenPriceMaxValue() { + return fmt.Errorf("Range check failed on k.OpenPrice (%v < %v > %v)", k.OpenPriceMinValue(), k.OpenPrice, k.OpenPriceMaxValue()) + } + } + if k.HighPriceInActingVersion(actingVersion) { + if k.HighPrice < k.HighPriceMinValue() || k.HighPrice > k.HighPriceMaxValue() { + return fmt.Errorf("Range check failed on k.HighPrice (%v < %v > %v)", k.HighPriceMinValue(), k.HighPrice, k.HighPriceMaxValue()) + } + } + if k.LowPriceInActingVersion(actingVersion) { + if k.LowPrice < k.LowPriceMinValue() || k.LowPrice > k.LowPriceMaxValue() { + return fmt.Errorf("Range check failed on k.LowPrice (%v < %v > %v)", k.LowPriceMinValue(), k.LowPrice, k.LowPriceMaxValue()) + } + } + if k.ClosePriceInActingVersion(actingVersion) { + if k.ClosePrice < k.ClosePriceMinValue() || k.ClosePrice > k.ClosePriceMaxValue() { + return fmt.Errorf("Range check failed on k.ClosePrice (%v < %v > %v)", k.ClosePriceMinValue(), k.ClosePrice, k.ClosePriceMaxValue()) + } + } + if k.VolumeInActingVersion(actingVersion) { + for idx := 0; idx < 16; idx++ { + if k.Volume[idx] < k.VolumeMinValue() || k.Volume[idx] > k.VolumeMaxValue() { + return fmt.Errorf("Range check failed on k.Volume[%d] (%v < %v > %v)", idx, k.VolumeMinValue(), k.Volume[idx], k.VolumeMaxValue()) + } + } + } + if k.CloseTimeInActingVersion(actingVersion) { + if k.CloseTime < k.CloseTimeMinValue() || k.CloseTime > k.CloseTimeMaxValue() { + return fmt.Errorf("Range check failed on k.CloseTime (%v < %v > %v)", k.CloseTimeMinValue(), k.CloseTime, k.CloseTimeMaxValue()) + } + } + if k.QuoteVolumeInActingVersion(actingVersion) { + for idx := 0; idx < 16; idx++ { + if k.QuoteVolume[idx] < k.QuoteVolumeMinValue() || k.QuoteVolume[idx] > k.QuoteVolumeMaxValue() { + return fmt.Errorf("Range check failed on k.QuoteVolume[%d] (%v < %v > %v)", idx, k.QuoteVolumeMinValue(), k.QuoteVolume[idx], k.QuoteVolumeMaxValue()) + } + } + } + if k.NumTradesInActingVersion(actingVersion) { + if k.NumTrades < k.NumTradesMinValue() || k.NumTrades > k.NumTradesMaxValue() { + return fmt.Errorf("Range check failed on k.NumTrades (%v < %v > %v)", k.NumTradesMinValue(), k.NumTrades, k.NumTradesMaxValue()) + } + } + if k.TakerBuyBaseVolumeInActingVersion(actingVersion) { + for idx := 0; idx < 16; idx++ { + if k.TakerBuyBaseVolume[idx] < k.TakerBuyBaseVolumeMinValue() || k.TakerBuyBaseVolume[idx] > k.TakerBuyBaseVolumeMaxValue() { + return fmt.Errorf("Range check failed on k.TakerBuyBaseVolume[%d] (%v < %v > %v)", idx, k.TakerBuyBaseVolumeMinValue(), k.TakerBuyBaseVolume[idx], k.TakerBuyBaseVolumeMaxValue()) + } + } + } + if k.TakerBuyQuoteVolumeInActingVersion(actingVersion) { + for idx := 0; idx < 16; idx++ { + if k.TakerBuyQuoteVolume[idx] < k.TakerBuyQuoteVolumeMinValue() || k.TakerBuyQuoteVolume[idx] > k.TakerBuyQuoteVolumeMaxValue() { + return fmt.Errorf("Range check failed on k.TakerBuyQuoteVolume[%d] (%v < %v > %v)", idx, k.TakerBuyQuoteVolumeMinValue(), k.TakerBuyQuoteVolume[idx], k.TakerBuyQuoteVolumeMaxValue()) + } + } + } + return nil +} + +func KlinesResponseKlinesInit(k *KlinesResponseKlines) { + return +} + +func (*KlinesResponse) SbeBlockLength() (blockLength uint16) { + return 2 +} + +func (*KlinesResponse) SbeTemplateId() (templateId uint16) { + return 203 +} + +func (*KlinesResponse) SbeSchemaId() (schemaId uint16) { + return 3 +} + +func (*KlinesResponse) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} + +func (*KlinesResponse) SbeSemanticType() (semanticType []byte) { + return []byte("") +} + +func (*KlinesResponse) SbeSemanticVersion() (semanticVersion string) { + return "5.2" +} + +func (*KlinesResponse) PriceExponentId() uint16 { + return 1 +} + +func (*KlinesResponse) PriceExponentSinceVersion() uint16 { + return 0 +} + +func (k *KlinesResponse) PriceExponentInActingVersion(actingVersion uint16) bool { + return actingVersion >= k.PriceExponentSinceVersion() +} + +func (*KlinesResponse) PriceExponentDeprecated() uint16 { + return 0 +} + +func (*KlinesResponse) PriceExponentMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*KlinesResponse) PriceExponentMinValue() int8 { + return math.MinInt8 + 1 +} + +func (*KlinesResponse) PriceExponentMaxValue() int8 { + return math.MaxInt8 +} + +func (*KlinesResponse) PriceExponentNullValue() int8 { + return math.MinInt8 +} + +func (*KlinesResponse) QtyExponentId() uint16 { + return 2 +} + +func (*KlinesResponse) QtyExponentSinceVersion() uint16 { + return 0 +} + +func (k *KlinesResponse) QtyExponentInActingVersion(actingVersion uint16) bool { + return actingVersion >= k.QtyExponentSinceVersion() +} + +func (*KlinesResponse) QtyExponentDeprecated() uint16 { + return 0 +} + +func (*KlinesResponse) QtyExponentMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*KlinesResponse) QtyExponentMinValue() int8 { + return math.MinInt8 + 1 +} + +func (*KlinesResponse) QtyExponentMaxValue() int8 { + return math.MaxInt8 +} + +func (*KlinesResponse) QtyExponentNullValue() int8 { + return math.MinInt8 +} + +func (*KlinesResponseKlines) OpenTimeId() uint16 { + return 1 +} + +func (*KlinesResponseKlines) OpenTimeSinceVersion() uint16 { + return 0 +} + +func (k *KlinesResponseKlines) OpenTimeInActingVersion(actingVersion uint16) bool { + return actingVersion >= k.OpenTimeSinceVersion() +} + +func (*KlinesResponseKlines) OpenTimeDeprecated() uint16 { + return 0 +} + +func (*KlinesResponseKlines) OpenTimeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*KlinesResponseKlines) OpenTimeMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*KlinesResponseKlines) OpenTimeMaxValue() int64 { + return math.MaxInt64 +} + +func (*KlinesResponseKlines) OpenTimeNullValue() int64 { + return math.MinInt64 +} + +func (*KlinesResponseKlines) OpenPriceId() uint16 { + return 2 +} + +func (*KlinesResponseKlines) OpenPriceSinceVersion() uint16 { + return 0 +} + +func (k *KlinesResponseKlines) OpenPriceInActingVersion(actingVersion uint16) bool { + return actingVersion >= k.OpenPriceSinceVersion() +} + +func (*KlinesResponseKlines) OpenPriceDeprecated() uint16 { + return 0 +} + +func (*KlinesResponseKlines) OpenPriceMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*KlinesResponseKlines) OpenPriceMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*KlinesResponseKlines) OpenPriceMaxValue() int64 { + return math.MaxInt64 +} + +func (*KlinesResponseKlines) OpenPriceNullValue() int64 { + return math.MinInt64 +} + +func (*KlinesResponseKlines) HighPriceId() uint16 { + return 3 +} + +func (*KlinesResponseKlines) HighPriceSinceVersion() uint16 { + return 0 +} + +func (k *KlinesResponseKlines) HighPriceInActingVersion(actingVersion uint16) bool { + return actingVersion >= k.HighPriceSinceVersion() +} + +func (*KlinesResponseKlines) HighPriceDeprecated() uint16 { + return 0 +} + +func (*KlinesResponseKlines) HighPriceMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*KlinesResponseKlines) HighPriceMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*KlinesResponseKlines) HighPriceMaxValue() int64 { + return math.MaxInt64 +} + +func (*KlinesResponseKlines) HighPriceNullValue() int64 { + return math.MinInt64 +} + +func (*KlinesResponseKlines) LowPriceId() uint16 { + return 4 +} + +func (*KlinesResponseKlines) LowPriceSinceVersion() uint16 { + return 0 +} + +func (k *KlinesResponseKlines) LowPriceInActingVersion(actingVersion uint16) bool { + return actingVersion >= k.LowPriceSinceVersion() +} + +func (*KlinesResponseKlines) LowPriceDeprecated() uint16 { + return 0 +} + +func (*KlinesResponseKlines) LowPriceMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*KlinesResponseKlines) LowPriceMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*KlinesResponseKlines) LowPriceMaxValue() int64 { + return math.MaxInt64 +} + +func (*KlinesResponseKlines) LowPriceNullValue() int64 { + return math.MinInt64 +} + +func (*KlinesResponseKlines) ClosePriceId() uint16 { + return 5 +} + +func (*KlinesResponseKlines) ClosePriceSinceVersion() uint16 { + return 0 +} + +func (k *KlinesResponseKlines) ClosePriceInActingVersion(actingVersion uint16) bool { + return actingVersion >= k.ClosePriceSinceVersion() +} + +func (*KlinesResponseKlines) ClosePriceDeprecated() uint16 { + return 0 +} + +func (*KlinesResponseKlines) ClosePriceMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*KlinesResponseKlines) ClosePriceMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*KlinesResponseKlines) ClosePriceMaxValue() int64 { + return math.MaxInt64 +} + +func (*KlinesResponseKlines) ClosePriceNullValue() int64 { + return math.MinInt64 +} + +func (*KlinesResponseKlines) VolumeId() uint16 { + return 6 +} + +func (*KlinesResponseKlines) VolumeSinceVersion() uint16 { + return 0 +} + +func (k *KlinesResponseKlines) VolumeInActingVersion(actingVersion uint16) bool { + return actingVersion >= k.VolumeSinceVersion() +} + +func (*KlinesResponseKlines) VolumeDeprecated() uint16 { + return 0 +} + +func (*KlinesResponseKlines) VolumeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*KlinesResponseKlines) VolumeMinValue() uint8 { + return 0 +} + +func (*KlinesResponseKlines) VolumeMaxValue() uint8 { + return math.MaxUint8 - 1 +} + +func (*KlinesResponseKlines) VolumeNullValue() uint8 { + return math.MaxUint8 +} + +func (*KlinesResponseKlines) CloseTimeId() uint16 { + return 7 +} + +func (*KlinesResponseKlines) CloseTimeSinceVersion() uint16 { + return 0 +} + +func (k *KlinesResponseKlines) CloseTimeInActingVersion(actingVersion uint16) bool { + return actingVersion >= k.CloseTimeSinceVersion() +} + +func (*KlinesResponseKlines) CloseTimeDeprecated() uint16 { + return 0 +} + +func (*KlinesResponseKlines) CloseTimeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*KlinesResponseKlines) CloseTimeMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*KlinesResponseKlines) CloseTimeMaxValue() int64 { + return math.MaxInt64 +} + +func (*KlinesResponseKlines) CloseTimeNullValue() int64 { + return math.MinInt64 +} + +func (*KlinesResponseKlines) QuoteVolumeId() uint16 { + return 8 +} + +func (*KlinesResponseKlines) QuoteVolumeSinceVersion() uint16 { + return 0 +} + +func (k *KlinesResponseKlines) QuoteVolumeInActingVersion(actingVersion uint16) bool { + return actingVersion >= k.QuoteVolumeSinceVersion() +} + +func (*KlinesResponseKlines) QuoteVolumeDeprecated() uint16 { + return 0 +} + +func (*KlinesResponseKlines) QuoteVolumeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*KlinesResponseKlines) QuoteVolumeMinValue() uint8 { + return 0 +} + +func (*KlinesResponseKlines) QuoteVolumeMaxValue() uint8 { + return math.MaxUint8 - 1 +} + +func (*KlinesResponseKlines) QuoteVolumeNullValue() uint8 { + return math.MaxUint8 +} + +func (*KlinesResponseKlines) NumTradesId() uint16 { + return 9 +} + +func (*KlinesResponseKlines) NumTradesSinceVersion() uint16 { + return 0 +} + +func (k *KlinesResponseKlines) NumTradesInActingVersion(actingVersion uint16) bool { + return actingVersion >= k.NumTradesSinceVersion() +} + +func (*KlinesResponseKlines) NumTradesDeprecated() uint16 { + return 0 +} + +func (*KlinesResponseKlines) NumTradesMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*KlinesResponseKlines) NumTradesMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*KlinesResponseKlines) NumTradesMaxValue() int64 { + return math.MaxInt64 +} + +func (*KlinesResponseKlines) NumTradesNullValue() int64 { + return math.MinInt64 +} + +func (*KlinesResponseKlines) TakerBuyBaseVolumeId() uint16 { + return 10 +} + +func (*KlinesResponseKlines) TakerBuyBaseVolumeSinceVersion() uint16 { + return 0 +} + +func (k *KlinesResponseKlines) TakerBuyBaseVolumeInActingVersion(actingVersion uint16) bool { + return actingVersion >= k.TakerBuyBaseVolumeSinceVersion() +} + +func (*KlinesResponseKlines) TakerBuyBaseVolumeDeprecated() uint16 { + return 0 +} + +func (*KlinesResponseKlines) TakerBuyBaseVolumeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*KlinesResponseKlines) TakerBuyBaseVolumeMinValue() uint8 { + return 0 +} + +func (*KlinesResponseKlines) TakerBuyBaseVolumeMaxValue() uint8 { + return math.MaxUint8 - 1 +} + +func (*KlinesResponseKlines) TakerBuyBaseVolumeNullValue() uint8 { + return math.MaxUint8 +} + +func (*KlinesResponseKlines) TakerBuyQuoteVolumeId() uint16 { + return 11 +} + +func (*KlinesResponseKlines) TakerBuyQuoteVolumeSinceVersion() uint16 { + return 0 +} + +func (k *KlinesResponseKlines) TakerBuyQuoteVolumeInActingVersion(actingVersion uint16) bool { + return actingVersion >= k.TakerBuyQuoteVolumeSinceVersion() +} + +func (*KlinesResponseKlines) TakerBuyQuoteVolumeDeprecated() uint16 { + return 0 +} + +func (*KlinesResponseKlines) TakerBuyQuoteVolumeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*KlinesResponseKlines) TakerBuyQuoteVolumeMinValue() uint8 { + return 0 +} + +func (*KlinesResponseKlines) TakerBuyQuoteVolumeMaxValue() uint8 { + return math.MaxUint8 - 1 +} + +func (*KlinesResponseKlines) TakerBuyQuoteVolumeNullValue() uint8 { + return math.MaxUint8 +} + +func (*KlinesResponse) KlinesId() uint16 { + return 100 +} + +func (*KlinesResponse) KlinesSinceVersion() uint16 { + return 0 +} + +func (k *KlinesResponse) KlinesInActingVersion(actingVersion uint16) bool { + return actingVersion >= k.KlinesSinceVersion() +} + +func (*KlinesResponse) KlinesDeprecated() uint16 { + return 0 +} + +func (*KlinesResponseKlines) SbeBlockLength() (blockLength uint) { + return 120 +} + +func (*KlinesResponseKlines) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} diff --git a/v2/sbe/spot_3_1/ListOrderStatus.go b/v2/sbe/spot_3_1/ListOrderStatus.go new file mode 100644 index 00000000..c6d37963 --- /dev/null +++ b/v2/sbe/spot_3_1/ListOrderStatus.go @@ -0,0 +1,112 @@ +// Generated SBE (Simple Binary Encoding) message codec + +package sbe + +import ( + "fmt" + "io" + "reflect" +) + +type ListOrderStatusEnum uint8 +type ListOrderStatusValues struct { + Canceling ListOrderStatusEnum + Executing ListOrderStatusEnum + AllDone ListOrderStatusEnum + Reject ListOrderStatusEnum + NonRepresentable ListOrderStatusEnum + NullValue ListOrderStatusEnum +} + +var ListOrderStatus = ListOrderStatusValues{0, 1, 2, 3, 254, 255} + +func (l ListOrderStatusEnum) Encode(_m *SbeGoMarshaller, _w io.Writer) error { + if err := _m.WriteUint8(_w, uint8(l)); err != nil { + return err + } + return nil +} + +func (l *ListOrderStatusEnum) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16) error { + if err := _m.ReadUint8(_r, (*uint8)(l)); err != nil { + return err + } + return nil +} + +func (l ListOrderStatusEnum) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if actingVersion > schemaVersion { + return nil + } + value := reflect.ValueOf(ListOrderStatus) + for idx := 0; idx < value.NumField(); idx++ { + if l == value.Field(idx).Interface() { + return nil + } + } + return fmt.Errorf("Range check failed on ListOrderStatus, unknown enumeration value %d", l) +} + +func (*ListOrderStatusEnum) EncodedLength() int64 { + return 1 +} + +func (*ListOrderStatusEnum) CancelingSinceVersion() uint16 { + return 0 +} + +func (l *ListOrderStatusEnum) CancelingInActingVersion(actingVersion uint16) bool { + return actingVersion >= l.CancelingSinceVersion() +} + +func (*ListOrderStatusEnum) CancelingDeprecated() uint16 { + return 0 +} + +func (*ListOrderStatusEnum) ExecutingSinceVersion() uint16 { + return 0 +} + +func (l *ListOrderStatusEnum) ExecutingInActingVersion(actingVersion uint16) bool { + return actingVersion >= l.ExecutingSinceVersion() +} + +func (*ListOrderStatusEnum) ExecutingDeprecated() uint16 { + return 0 +} + +func (*ListOrderStatusEnum) AllDoneSinceVersion() uint16 { + return 0 +} + +func (l *ListOrderStatusEnum) AllDoneInActingVersion(actingVersion uint16) bool { + return actingVersion >= l.AllDoneSinceVersion() +} + +func (*ListOrderStatusEnum) AllDoneDeprecated() uint16 { + return 0 +} + +func (*ListOrderStatusEnum) RejectSinceVersion() uint16 { + return 0 +} + +func (l *ListOrderStatusEnum) RejectInActingVersion(actingVersion uint16) bool { + return actingVersion >= l.RejectSinceVersion() +} + +func (*ListOrderStatusEnum) RejectDeprecated() uint16 { + return 0 +} + +func (*ListOrderStatusEnum) NonRepresentableSinceVersion() uint16 { + return 0 +} + +func (l *ListOrderStatusEnum) NonRepresentableInActingVersion(actingVersion uint16) bool { + return actingVersion >= l.NonRepresentableSinceVersion() +} + +func (*ListOrderStatusEnum) NonRepresentableDeprecated() uint16 { + return 0 +} diff --git a/v2/sbe/spot_3_1/ListStatusEvent.go b/v2/sbe/spot_3_1/ListStatusEvent.go new file mode 100644 index 00000000..638968b8 --- /dev/null +++ b/v2/sbe/spot_3_1/ListStatusEvent.go @@ -0,0 +1,859 @@ +// Generated SBE (Simple Binary Encoding) message codec + +package sbe + +import ( + "errors" + "fmt" + "io" + "io/ioutil" + "math" + "unicode/utf8" +) + +type ListStatusEvent struct { + EventTime int64 + TransactTime int64 + OrderListId int64 + ContingencyType ContingencyTypeEnum + ListStatusType ListStatusTypeEnum + ListOrderStatus ListOrderStatusEnum + SubscriptionId uint16 + Orders []ListStatusEventOrders + Symbol []uint8 + ListClientOrderId []uint8 + RejectReason []uint8 +} +type ListStatusEventOrders struct { + OrderId int64 + Symbol []uint8 + ClientOrderId []uint8 +} + +func (l *ListStatusEvent) Encode(_m *SbeGoMarshaller, _w io.Writer, doRangeCheck bool) error { + if doRangeCheck { + if err := l.RangeCheck(l.SbeSchemaVersion(), l.SbeSchemaVersion()); err != nil { + return err + } + } + if err := _m.WriteInt64(_w, l.EventTime); err != nil { + return err + } + if err := _m.WriteInt64(_w, l.TransactTime); err != nil { + return err + } + if err := _m.WriteInt64(_w, l.OrderListId); err != nil { + return err + } + if err := l.ContingencyType.Encode(_m, _w); err != nil { + return err + } + if err := l.ListStatusType.Encode(_m, _w); err != nil { + return err + } + if err := l.ListOrderStatus.Encode(_m, _w); err != nil { + return err + } + if err := _m.WriteUint16(_w, l.SubscriptionId); err != nil { + return err + } + var OrdersBlockLength uint16 = 8 + if err := _m.WriteUint16(_w, OrdersBlockLength); err != nil { + return err + } + var OrdersNumInGroup uint16 = uint16(len(l.Orders)) + if err := _m.WriteUint16(_w, OrdersNumInGroup); err != nil { + return err + } + for i := range l.Orders { + if err := l.Orders[i].Encode(_m, _w); err != nil { + return err + } + } + if err := _m.WriteUint8(_w, uint8(len(l.Symbol))); err != nil { + return err + } + if err := _m.WriteBytes(_w, l.Symbol); err != nil { + return err + } + if err := _m.WriteUint8(_w, uint8(len(l.ListClientOrderId))); err != nil { + return err + } + if err := _m.WriteBytes(_w, l.ListClientOrderId); err != nil { + return err + } + if err := _m.WriteUint8(_w, uint8(len(l.RejectReason))); err != nil { + return err + } + if err := _m.WriteBytes(_w, l.RejectReason); err != nil { + return err + } + return nil +} + +func (l *ListStatusEvent) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint16, doRangeCheck bool) error { + if !l.EventTimeInActingVersion(actingVersion) { + l.EventTime = l.EventTimeNullValue() + } else { + if err := _m.ReadInt64(_r, &l.EventTime); err != nil { + return err + } + } + if !l.TransactTimeInActingVersion(actingVersion) { + l.TransactTime = l.TransactTimeNullValue() + } else { + if err := _m.ReadInt64(_r, &l.TransactTime); err != nil { + return err + } + } + if !l.OrderListIdInActingVersion(actingVersion) { + l.OrderListId = l.OrderListIdNullValue() + } else { + if err := _m.ReadInt64(_r, &l.OrderListId); err != nil { + return err + } + } + if l.ContingencyTypeInActingVersion(actingVersion) { + if err := l.ContingencyType.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if l.ListStatusTypeInActingVersion(actingVersion) { + if err := l.ListStatusType.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if l.ListOrderStatusInActingVersion(actingVersion) { + if err := l.ListOrderStatus.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if !l.SubscriptionIdInActingVersion(actingVersion) { + l.SubscriptionId = l.SubscriptionIdNullValue() + } else { + if err := _m.ReadUint16(_r, &l.SubscriptionId); err != nil { + return err + } + } + if actingVersion > l.SbeSchemaVersion() && blockLength > l.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-l.SbeBlockLength())) + } + + if l.OrdersInActingVersion(actingVersion) { + var OrdersBlockLength uint16 + if err := _m.ReadUint16(_r, &OrdersBlockLength); err != nil { + return err + } + var OrdersNumInGroup uint16 + if err := _m.ReadUint16(_r, &OrdersNumInGroup); err != nil { + return err + } + if cap(l.Orders) < int(OrdersNumInGroup) { + l.Orders = make([]ListStatusEventOrders, OrdersNumInGroup) + } + l.Orders = l.Orders[:OrdersNumInGroup] + for i := range l.Orders { + if err := l.Orders[i].Decode(_m, _r, actingVersion, uint(OrdersBlockLength)); err != nil { + return err + } + } + } + + if l.SymbolInActingVersion(actingVersion) { + var SymbolLength uint8 + if err := _m.ReadUint8(_r, &SymbolLength); err != nil { + return err + } + if cap(l.Symbol) < int(SymbolLength) { + l.Symbol = make([]uint8, SymbolLength) + } + l.Symbol = l.Symbol[:SymbolLength] + if err := _m.ReadBytes(_r, l.Symbol); err != nil { + return err + } + } + + if l.ListClientOrderIdInActingVersion(actingVersion) { + var ListClientOrderIdLength uint8 + if err := _m.ReadUint8(_r, &ListClientOrderIdLength); err != nil { + return err + } + if cap(l.ListClientOrderId) < int(ListClientOrderIdLength) { + l.ListClientOrderId = make([]uint8, ListClientOrderIdLength) + } + l.ListClientOrderId = l.ListClientOrderId[:ListClientOrderIdLength] + if err := _m.ReadBytes(_r, l.ListClientOrderId); err != nil { + return err + } + } + + if l.RejectReasonInActingVersion(actingVersion) { + var RejectReasonLength uint8 + if err := _m.ReadUint8(_r, &RejectReasonLength); err != nil { + return err + } + if cap(l.RejectReason) < int(RejectReasonLength) { + l.RejectReason = make([]uint8, RejectReasonLength) + } + l.RejectReason = l.RejectReason[:RejectReasonLength] + if err := _m.ReadBytes(_r, l.RejectReason); err != nil { + return err + } + } + if doRangeCheck { + if err := l.RangeCheck(actingVersion, l.SbeSchemaVersion()); err != nil { + return err + } + } + return nil +} + +func (l *ListStatusEvent) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if l.EventTimeInActingVersion(actingVersion) { + if l.EventTime < l.EventTimeMinValue() || l.EventTime > l.EventTimeMaxValue() { + return fmt.Errorf("Range check failed on l.EventTime (%v < %v > %v)", l.EventTimeMinValue(), l.EventTime, l.EventTimeMaxValue()) + } + } + if l.TransactTimeInActingVersion(actingVersion) { + if l.TransactTime < l.TransactTimeMinValue() || l.TransactTime > l.TransactTimeMaxValue() { + return fmt.Errorf("Range check failed on l.TransactTime (%v < %v > %v)", l.TransactTimeMinValue(), l.TransactTime, l.TransactTimeMaxValue()) + } + } + if l.OrderListIdInActingVersion(actingVersion) { + if l.OrderListId < l.OrderListIdMinValue() || l.OrderListId > l.OrderListIdMaxValue() { + return fmt.Errorf("Range check failed on l.OrderListId (%v < %v > %v)", l.OrderListIdMinValue(), l.OrderListId, l.OrderListIdMaxValue()) + } + } + if err := l.ContingencyType.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if err := l.ListStatusType.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if err := l.ListOrderStatus.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if l.SubscriptionIdInActingVersion(actingVersion) { + if l.SubscriptionId != l.SubscriptionIdNullValue() && (l.SubscriptionId < l.SubscriptionIdMinValue() || l.SubscriptionId > l.SubscriptionIdMaxValue()) { + return fmt.Errorf("Range check failed on l.SubscriptionId (%v < %v > %v)", l.SubscriptionIdMinValue(), l.SubscriptionId, l.SubscriptionIdMaxValue()) + } + } + for i := range l.Orders { + if err := l.Orders[i].RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + } + if !utf8.Valid(l.Symbol[:]) { + return errors.New("l.Symbol failed UTF-8 validation") + } + if !utf8.Valid(l.ListClientOrderId[:]) { + return errors.New("l.ListClientOrderId failed UTF-8 validation") + } + if !utf8.Valid(l.RejectReason[:]) { + return errors.New("l.RejectReason failed UTF-8 validation") + } + return nil +} + +func ListStatusEventInit(l *ListStatusEvent) { + l.SubscriptionId = math.MaxUint16 + return +} + +func (l *ListStatusEventOrders) Encode(_m *SbeGoMarshaller, _w io.Writer) error { + if err := _m.WriteInt64(_w, l.OrderId); err != nil { + return err + } + if err := _m.WriteUint8(_w, uint8(len(l.Symbol))); err != nil { + return err + } + if err := _m.WriteBytes(_w, l.Symbol); err != nil { + return err + } + if err := _m.WriteUint8(_w, uint8(len(l.ClientOrderId))); err != nil { + return err + } + if err := _m.WriteBytes(_w, l.ClientOrderId); err != nil { + return err + } + return nil +} + +func (l *ListStatusEventOrders) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint) error { + if !l.OrderIdInActingVersion(actingVersion) { + l.OrderId = l.OrderIdNullValue() + } else { + if err := _m.ReadInt64(_r, &l.OrderId); err != nil { + return err + } + } + if actingVersion > l.SbeSchemaVersion() && blockLength > l.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-l.SbeBlockLength())) + } + + if l.SymbolInActingVersion(actingVersion) { + var SymbolLength uint8 + if err := _m.ReadUint8(_r, &SymbolLength); err != nil { + return err + } + if cap(l.Symbol) < int(SymbolLength) { + l.Symbol = make([]uint8, SymbolLength) + } + l.Symbol = l.Symbol[:SymbolLength] + if err := _m.ReadBytes(_r, l.Symbol); err != nil { + return err + } + } + + if l.ClientOrderIdInActingVersion(actingVersion) { + var ClientOrderIdLength uint8 + if err := _m.ReadUint8(_r, &ClientOrderIdLength); err != nil { + return err + } + if cap(l.ClientOrderId) < int(ClientOrderIdLength) { + l.ClientOrderId = make([]uint8, ClientOrderIdLength) + } + l.ClientOrderId = l.ClientOrderId[:ClientOrderIdLength] + if err := _m.ReadBytes(_r, l.ClientOrderId); err != nil { + return err + } + } + return nil +} + +func (l *ListStatusEventOrders) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if l.OrderIdInActingVersion(actingVersion) { + if l.OrderId < l.OrderIdMinValue() || l.OrderId > l.OrderIdMaxValue() { + return fmt.Errorf("Range check failed on l.OrderId (%v < %v > %v)", l.OrderIdMinValue(), l.OrderId, l.OrderIdMaxValue()) + } + } + if !utf8.Valid(l.Symbol[:]) { + return errors.New("l.Symbol failed UTF-8 validation") + } + if !utf8.Valid(l.ClientOrderId[:]) { + return errors.New("l.ClientOrderId failed UTF-8 validation") + } + return nil +} + +func ListStatusEventOrdersInit(l *ListStatusEventOrders) { + return +} + +func (*ListStatusEvent) SbeBlockLength() (blockLength uint16) { + return 29 +} + +func (*ListStatusEvent) SbeTemplateId() (templateId uint16) { + return 606 +} + +func (*ListStatusEvent) SbeSchemaId() (schemaId uint16) { + return 3 +} + +func (*ListStatusEvent) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} + +func (*ListStatusEvent) SbeSemanticType() (semanticType []byte) { + return []byte("") +} + +func (*ListStatusEvent) SbeSemanticVersion() (semanticVersion string) { + return "5.2" +} + +func (*ListStatusEvent) EventTimeId() uint16 { + return 1 +} + +func (*ListStatusEvent) EventTimeSinceVersion() uint16 { + return 0 +} + +func (l *ListStatusEvent) EventTimeInActingVersion(actingVersion uint16) bool { + return actingVersion >= l.EventTimeSinceVersion() +} + +func (*ListStatusEvent) EventTimeDeprecated() uint16 { + return 0 +} + +func (*ListStatusEvent) EventTimeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*ListStatusEvent) EventTimeMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*ListStatusEvent) EventTimeMaxValue() int64 { + return math.MaxInt64 +} + +func (*ListStatusEvent) EventTimeNullValue() int64 { + return math.MinInt64 +} + +func (*ListStatusEvent) TransactTimeId() uint16 { + return 2 +} + +func (*ListStatusEvent) TransactTimeSinceVersion() uint16 { + return 0 +} + +func (l *ListStatusEvent) TransactTimeInActingVersion(actingVersion uint16) bool { + return actingVersion >= l.TransactTimeSinceVersion() +} + +func (*ListStatusEvent) TransactTimeDeprecated() uint16 { + return 0 +} + +func (*ListStatusEvent) TransactTimeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*ListStatusEvent) TransactTimeMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*ListStatusEvent) TransactTimeMaxValue() int64 { + return math.MaxInt64 +} + +func (*ListStatusEvent) TransactTimeNullValue() int64 { + return math.MinInt64 +} + +func (*ListStatusEvent) OrderListIdId() uint16 { + return 3 +} + +func (*ListStatusEvent) OrderListIdSinceVersion() uint16 { + return 0 +} + +func (l *ListStatusEvent) OrderListIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= l.OrderListIdSinceVersion() +} + +func (*ListStatusEvent) OrderListIdDeprecated() uint16 { + return 0 +} + +func (*ListStatusEvent) OrderListIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*ListStatusEvent) OrderListIdMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*ListStatusEvent) OrderListIdMaxValue() int64 { + return math.MaxInt64 +} + +func (*ListStatusEvent) OrderListIdNullValue() int64 { + return math.MinInt64 +} + +func (*ListStatusEvent) ContingencyTypeId() uint16 { + return 4 +} + +func (*ListStatusEvent) ContingencyTypeSinceVersion() uint16 { + return 0 +} + +func (l *ListStatusEvent) ContingencyTypeInActingVersion(actingVersion uint16) bool { + return actingVersion >= l.ContingencyTypeSinceVersion() +} + +func (*ListStatusEvent) ContingencyTypeDeprecated() uint16 { + return 0 +} + +func (*ListStatusEvent) ContingencyTypeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*ListStatusEvent) ListStatusTypeId() uint16 { + return 5 +} + +func (*ListStatusEvent) ListStatusTypeSinceVersion() uint16 { + return 0 +} + +func (l *ListStatusEvent) ListStatusTypeInActingVersion(actingVersion uint16) bool { + return actingVersion >= l.ListStatusTypeSinceVersion() +} + +func (*ListStatusEvent) ListStatusTypeDeprecated() uint16 { + return 0 +} + +func (*ListStatusEvent) ListStatusTypeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*ListStatusEvent) ListOrderStatusId() uint16 { + return 6 +} + +func (*ListStatusEvent) ListOrderStatusSinceVersion() uint16 { + return 0 +} + +func (l *ListStatusEvent) ListOrderStatusInActingVersion(actingVersion uint16) bool { + return actingVersion >= l.ListOrderStatusSinceVersion() +} + +func (*ListStatusEvent) ListOrderStatusDeprecated() uint16 { + return 0 +} + +func (*ListStatusEvent) ListOrderStatusMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*ListStatusEvent) SubscriptionIdId() uint16 { + return 7 +} + +func (*ListStatusEvent) SubscriptionIdSinceVersion() uint16 { + return 1 +} + +func (l *ListStatusEvent) SubscriptionIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= l.SubscriptionIdSinceVersion() +} + +func (*ListStatusEvent) SubscriptionIdDeprecated() uint16 { + return 0 +} + +func (*ListStatusEvent) SubscriptionIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*ListStatusEvent) SubscriptionIdMinValue() uint16 { + return 0 +} + +func (*ListStatusEvent) SubscriptionIdMaxValue() uint16 { + return math.MaxUint16 - 1 +} + +func (*ListStatusEvent) SubscriptionIdNullValue() uint16 { + return math.MaxUint16 +} + +func (*ListStatusEventOrders) OrderIdId() uint16 { + return 1 +} + +func (*ListStatusEventOrders) OrderIdSinceVersion() uint16 { + return 0 +} + +func (l *ListStatusEventOrders) OrderIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= l.OrderIdSinceVersion() +} + +func (*ListStatusEventOrders) OrderIdDeprecated() uint16 { + return 0 +} + +func (*ListStatusEventOrders) OrderIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*ListStatusEventOrders) OrderIdMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*ListStatusEventOrders) OrderIdMaxValue() int64 { + return math.MaxInt64 +} + +func (*ListStatusEventOrders) OrderIdNullValue() int64 { + return math.MinInt64 +} + +func (*ListStatusEventOrders) SymbolMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*ListStatusEventOrders) SymbolSinceVersion() uint16 { + return 0 +} + +func (l *ListStatusEventOrders) SymbolInActingVersion(actingVersion uint16) bool { + return actingVersion >= l.SymbolSinceVersion() +} + +func (*ListStatusEventOrders) SymbolDeprecated() uint16 { + return 0 +} + +func (ListStatusEventOrders) SymbolCharacterEncoding() string { + return "UTF-8" +} + +func (ListStatusEventOrders) SymbolHeaderLength() uint64 { + return 1 +} + +func (*ListStatusEventOrders) ClientOrderIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*ListStatusEventOrders) ClientOrderIdSinceVersion() uint16 { + return 0 +} + +func (l *ListStatusEventOrders) ClientOrderIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= l.ClientOrderIdSinceVersion() +} + +func (*ListStatusEventOrders) ClientOrderIdDeprecated() uint16 { + return 0 +} + +func (ListStatusEventOrders) ClientOrderIdCharacterEncoding() string { + return "UTF-8" +} + +func (ListStatusEventOrders) ClientOrderIdHeaderLength() uint64 { + return 1 +} + +func (*ListStatusEvent) OrdersId() uint16 { + return 100 +} + +func (*ListStatusEvent) OrdersSinceVersion() uint16 { + return 0 +} + +func (l *ListStatusEvent) OrdersInActingVersion(actingVersion uint16) bool { + return actingVersion >= l.OrdersSinceVersion() +} + +func (*ListStatusEvent) OrdersDeprecated() uint16 { + return 0 +} + +func (*ListStatusEventOrders) SbeBlockLength() (blockLength uint) { + return 8 +} + +func (*ListStatusEventOrders) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} + +func (*ListStatusEvent) SymbolMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*ListStatusEvent) SymbolSinceVersion() uint16 { + return 0 +} + +func (l *ListStatusEvent) SymbolInActingVersion(actingVersion uint16) bool { + return actingVersion >= l.SymbolSinceVersion() +} + +func (*ListStatusEvent) SymbolDeprecated() uint16 { + return 0 +} + +func (ListStatusEvent) SymbolCharacterEncoding() string { + return "UTF-8" +} + +func (ListStatusEvent) SymbolHeaderLength() uint64 { + return 1 +} + +func (*ListStatusEvent) ListClientOrderIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*ListStatusEvent) ListClientOrderIdSinceVersion() uint16 { + return 0 +} + +func (l *ListStatusEvent) ListClientOrderIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= l.ListClientOrderIdSinceVersion() +} + +func (*ListStatusEvent) ListClientOrderIdDeprecated() uint16 { + return 0 +} + +func (ListStatusEvent) ListClientOrderIdCharacterEncoding() string { + return "UTF-8" +} + +func (ListStatusEvent) ListClientOrderIdHeaderLength() uint64 { + return 1 +} + +func (*ListStatusEvent) RejectReasonMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*ListStatusEvent) RejectReasonSinceVersion() uint16 { + return 0 +} + +func (l *ListStatusEvent) RejectReasonInActingVersion(actingVersion uint16) bool { + return actingVersion >= l.RejectReasonSinceVersion() +} + +func (*ListStatusEvent) RejectReasonDeprecated() uint16 { + return 0 +} + +func (ListStatusEvent) RejectReasonCharacterEncoding() string { + return "UTF-8" +} + +func (ListStatusEvent) RejectReasonHeaderLength() uint64 { + return 1 +} diff --git a/v2/sbe/spot_3_1/ListStatusType.go b/v2/sbe/spot_3_1/ListStatusType.go new file mode 100644 index 00000000..789e96fc --- /dev/null +++ b/v2/sbe/spot_3_1/ListStatusType.go @@ -0,0 +1,112 @@ +// Generated SBE (Simple Binary Encoding) message codec + +package sbe + +import ( + "fmt" + "io" + "reflect" +) + +type ListStatusTypeEnum uint8 +type ListStatusTypeValues struct { + Response ListStatusTypeEnum + ExecStarted ListStatusTypeEnum + AllDone ListStatusTypeEnum + Updated ListStatusTypeEnum + NonRepresentable ListStatusTypeEnum + NullValue ListStatusTypeEnum +} + +var ListStatusType = ListStatusTypeValues{0, 1, 2, 3, 254, 255} + +func (l ListStatusTypeEnum) Encode(_m *SbeGoMarshaller, _w io.Writer) error { + if err := _m.WriteUint8(_w, uint8(l)); err != nil { + return err + } + return nil +} + +func (l *ListStatusTypeEnum) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16) error { + if err := _m.ReadUint8(_r, (*uint8)(l)); err != nil { + return err + } + return nil +} + +func (l ListStatusTypeEnum) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if actingVersion > schemaVersion { + return nil + } + value := reflect.ValueOf(ListStatusType) + for idx := 0; idx < value.NumField(); idx++ { + if l == value.Field(idx).Interface() { + return nil + } + } + return fmt.Errorf("Range check failed on ListStatusType, unknown enumeration value %d", l) +} + +func (*ListStatusTypeEnum) EncodedLength() int64 { + return 1 +} + +func (*ListStatusTypeEnum) ResponseSinceVersion() uint16 { + return 0 +} + +func (l *ListStatusTypeEnum) ResponseInActingVersion(actingVersion uint16) bool { + return actingVersion >= l.ResponseSinceVersion() +} + +func (*ListStatusTypeEnum) ResponseDeprecated() uint16 { + return 0 +} + +func (*ListStatusTypeEnum) ExecStartedSinceVersion() uint16 { + return 0 +} + +func (l *ListStatusTypeEnum) ExecStartedInActingVersion(actingVersion uint16) bool { + return actingVersion >= l.ExecStartedSinceVersion() +} + +func (*ListStatusTypeEnum) ExecStartedDeprecated() uint16 { + return 0 +} + +func (*ListStatusTypeEnum) AllDoneSinceVersion() uint16 { + return 0 +} + +func (l *ListStatusTypeEnum) AllDoneInActingVersion(actingVersion uint16) bool { + return actingVersion >= l.AllDoneSinceVersion() +} + +func (*ListStatusTypeEnum) AllDoneDeprecated() uint16 { + return 0 +} + +func (*ListStatusTypeEnum) UpdatedSinceVersion() uint16 { + return 0 +} + +func (l *ListStatusTypeEnum) UpdatedInActingVersion(actingVersion uint16) bool { + return actingVersion >= l.UpdatedSinceVersion() +} + +func (*ListStatusTypeEnum) UpdatedDeprecated() uint16 { + return 0 +} + +func (*ListStatusTypeEnum) NonRepresentableSinceVersion() uint16 { + return 0 +} + +func (l *ListStatusTypeEnum) NonRepresentableInActingVersion(actingVersion uint16) bool { + return actingVersion >= l.NonRepresentableSinceVersion() +} + +func (*ListStatusTypeEnum) NonRepresentableDeprecated() uint16 { + return 0 +} diff --git a/v2/sbe/spot_3_1/LotSizeFilter.go b/v2/sbe/spot_3_1/LotSizeFilter.go new file mode 100644 index 00000000..3fbd3800 --- /dev/null +++ b/v2/sbe/spot_3_1/LotSizeFilter.go @@ -0,0 +1,334 @@ +// Generated SBE (Simple Binary Encoding) message codec + +package sbe + +import ( + "fmt" + "io" + "io/ioutil" + "math" +) + +type LotSizeFilter struct { + FilterType FilterTypeEnum + QtyExponent int8 + MinQty int64 + MaxQty int64 + StepSize int64 +} + +func (l *LotSizeFilter) Encode(_m *SbeGoMarshaller, _w io.Writer, doRangeCheck bool) error { + if doRangeCheck { + if err := l.RangeCheck(l.SbeSchemaVersion(), l.SbeSchemaVersion()); err != nil { + return err + } + } + if err := _m.WriteInt8(_w, l.QtyExponent); err != nil { + return err + } + if err := _m.WriteInt64(_w, l.MinQty); err != nil { + return err + } + if err := _m.WriteInt64(_w, l.MaxQty); err != nil { + return err + } + if err := _m.WriteInt64(_w, l.StepSize); err != nil { + return err + } + return nil +} + +func (l *LotSizeFilter) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint16, doRangeCheck bool) error { + l.FilterType = FilterType.LotSize + if !l.QtyExponentInActingVersion(actingVersion) { + l.QtyExponent = l.QtyExponentNullValue() + } else { + if err := _m.ReadInt8(_r, &l.QtyExponent); err != nil { + return err + } + } + if !l.MinQtyInActingVersion(actingVersion) { + l.MinQty = l.MinQtyNullValue() + } else { + if err := _m.ReadInt64(_r, &l.MinQty); err != nil { + return err + } + } + if !l.MaxQtyInActingVersion(actingVersion) { + l.MaxQty = l.MaxQtyNullValue() + } else { + if err := _m.ReadInt64(_r, &l.MaxQty); err != nil { + return err + } + } + if !l.StepSizeInActingVersion(actingVersion) { + l.StepSize = l.StepSizeNullValue() + } else { + if err := _m.ReadInt64(_r, &l.StepSize); err != nil { + return err + } + } + if actingVersion > l.SbeSchemaVersion() && blockLength > l.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-l.SbeBlockLength())) + } + if doRangeCheck { + if err := l.RangeCheck(actingVersion, l.SbeSchemaVersion()); err != nil { + return err + } + } + return nil +} + +func (l *LotSizeFilter) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if err := l.FilterType.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if l.QtyExponentInActingVersion(actingVersion) { + if l.QtyExponent < l.QtyExponentMinValue() || l.QtyExponent > l.QtyExponentMaxValue() { + return fmt.Errorf("Range check failed on l.QtyExponent (%v < %v > %v)", l.QtyExponentMinValue(), l.QtyExponent, l.QtyExponentMaxValue()) + } + } + if l.MinQtyInActingVersion(actingVersion) { + if l.MinQty < l.MinQtyMinValue() || l.MinQty > l.MinQtyMaxValue() { + return fmt.Errorf("Range check failed on l.MinQty (%v < %v > %v)", l.MinQtyMinValue(), l.MinQty, l.MinQtyMaxValue()) + } + } + if l.MaxQtyInActingVersion(actingVersion) { + if l.MaxQty < l.MaxQtyMinValue() || l.MaxQty > l.MaxQtyMaxValue() { + return fmt.Errorf("Range check failed on l.MaxQty (%v < %v > %v)", l.MaxQtyMinValue(), l.MaxQty, l.MaxQtyMaxValue()) + } + } + if l.StepSizeInActingVersion(actingVersion) { + if l.StepSize < l.StepSizeMinValue() || l.StepSize > l.StepSizeMaxValue() { + return fmt.Errorf("Range check failed on l.StepSize (%v < %v > %v)", l.StepSizeMinValue(), l.StepSize, l.StepSizeMaxValue()) + } + } + return nil +} + +func LotSizeFilterInit(l *LotSizeFilter) { + l.FilterType = FilterType.LotSize + return +} + +func (*LotSizeFilter) SbeBlockLength() (blockLength uint16) { + return 25 +} + +func (*LotSizeFilter) SbeTemplateId() (templateId uint16) { + return 4 +} + +func (*LotSizeFilter) SbeSchemaId() (schemaId uint16) { + return 3 +} + +func (*LotSizeFilter) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} + +func (*LotSizeFilter) SbeSemanticType() (semanticType []byte) { + return []byte("") +} + +func (*LotSizeFilter) SbeSemanticVersion() (semanticVersion string) { + return "5.2" +} + +func (*LotSizeFilter) FilterTypeId() uint16 { + return 1 +} + +func (*LotSizeFilter) FilterTypeSinceVersion() uint16 { + return 0 +} + +func (l *LotSizeFilter) FilterTypeInActingVersion(actingVersion uint16) bool { + return actingVersion >= l.FilterTypeSinceVersion() +} + +func (*LotSizeFilter) FilterTypeDeprecated() uint16 { + return 0 +} + +func (*LotSizeFilter) FilterTypeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "constant" + } + return "" +} + +func (*LotSizeFilter) QtyExponentId() uint16 { + return 2 +} + +func (*LotSizeFilter) QtyExponentSinceVersion() uint16 { + return 0 +} + +func (l *LotSizeFilter) QtyExponentInActingVersion(actingVersion uint16) bool { + return actingVersion >= l.QtyExponentSinceVersion() +} + +func (*LotSizeFilter) QtyExponentDeprecated() uint16 { + return 0 +} + +func (*LotSizeFilter) QtyExponentMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*LotSizeFilter) QtyExponentMinValue() int8 { + return math.MinInt8 + 1 +} + +func (*LotSizeFilter) QtyExponentMaxValue() int8 { + return math.MaxInt8 +} + +func (*LotSizeFilter) QtyExponentNullValue() int8 { + return math.MinInt8 +} + +func (*LotSizeFilter) MinQtyId() uint16 { + return 3 +} + +func (*LotSizeFilter) MinQtySinceVersion() uint16 { + return 0 +} + +func (l *LotSizeFilter) MinQtyInActingVersion(actingVersion uint16) bool { + return actingVersion >= l.MinQtySinceVersion() +} + +func (*LotSizeFilter) MinQtyDeprecated() uint16 { + return 0 +} + +func (*LotSizeFilter) MinQtyMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*LotSizeFilter) MinQtyMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*LotSizeFilter) MinQtyMaxValue() int64 { + return math.MaxInt64 +} + +func (*LotSizeFilter) MinQtyNullValue() int64 { + return math.MinInt64 +} + +func (*LotSizeFilter) MaxQtyId() uint16 { + return 4 +} + +func (*LotSizeFilter) MaxQtySinceVersion() uint16 { + return 0 +} + +func (l *LotSizeFilter) MaxQtyInActingVersion(actingVersion uint16) bool { + return actingVersion >= l.MaxQtySinceVersion() +} + +func (*LotSizeFilter) MaxQtyDeprecated() uint16 { + return 0 +} + +func (*LotSizeFilter) MaxQtyMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*LotSizeFilter) MaxQtyMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*LotSizeFilter) MaxQtyMaxValue() int64 { + return math.MaxInt64 +} + +func (*LotSizeFilter) MaxQtyNullValue() int64 { + return math.MinInt64 +} + +func (*LotSizeFilter) StepSizeId() uint16 { + return 5 +} + +func (*LotSizeFilter) StepSizeSinceVersion() uint16 { + return 0 +} + +func (l *LotSizeFilter) StepSizeInActingVersion(actingVersion uint16) bool { + return actingVersion >= l.StepSizeSinceVersion() +} + +func (*LotSizeFilter) StepSizeDeprecated() uint16 { + return 0 +} + +func (*LotSizeFilter) StepSizeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*LotSizeFilter) StepSizeMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*LotSizeFilter) StepSizeMaxValue() int64 { + return math.MaxInt64 +} + +func (*LotSizeFilter) StepSizeNullValue() int64 { + return math.MinInt64 +} diff --git a/v2/sbe/spot_3_1/MarketLotSizeFilter.go b/v2/sbe/spot_3_1/MarketLotSizeFilter.go new file mode 100644 index 00000000..8a002eeb --- /dev/null +++ b/v2/sbe/spot_3_1/MarketLotSizeFilter.go @@ -0,0 +1,334 @@ +// Generated SBE (Simple Binary Encoding) message codec + +package sbe + +import ( + "fmt" + "io" + "io/ioutil" + "math" +) + +type MarketLotSizeFilter struct { + FilterType FilterTypeEnum + QtyExponent int8 + MinQty int64 + MaxQty int64 + StepSize int64 +} + +func (m *MarketLotSizeFilter) Encode(_m *SbeGoMarshaller, _w io.Writer, doRangeCheck bool) error { + if doRangeCheck { + if err := m.RangeCheck(m.SbeSchemaVersion(), m.SbeSchemaVersion()); err != nil { + return err + } + } + if err := _m.WriteInt8(_w, m.QtyExponent); err != nil { + return err + } + if err := _m.WriteInt64(_w, m.MinQty); err != nil { + return err + } + if err := _m.WriteInt64(_w, m.MaxQty); err != nil { + return err + } + if err := _m.WriteInt64(_w, m.StepSize); err != nil { + return err + } + return nil +} + +func (m *MarketLotSizeFilter) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint16, doRangeCheck bool) error { + m.FilterType = FilterType.MarketLotSize + if !m.QtyExponentInActingVersion(actingVersion) { + m.QtyExponent = m.QtyExponentNullValue() + } else { + if err := _m.ReadInt8(_r, &m.QtyExponent); err != nil { + return err + } + } + if !m.MinQtyInActingVersion(actingVersion) { + m.MinQty = m.MinQtyNullValue() + } else { + if err := _m.ReadInt64(_r, &m.MinQty); err != nil { + return err + } + } + if !m.MaxQtyInActingVersion(actingVersion) { + m.MaxQty = m.MaxQtyNullValue() + } else { + if err := _m.ReadInt64(_r, &m.MaxQty); err != nil { + return err + } + } + if !m.StepSizeInActingVersion(actingVersion) { + m.StepSize = m.StepSizeNullValue() + } else { + if err := _m.ReadInt64(_r, &m.StepSize); err != nil { + return err + } + } + if actingVersion > m.SbeSchemaVersion() && blockLength > m.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-m.SbeBlockLength())) + } + if doRangeCheck { + if err := m.RangeCheck(actingVersion, m.SbeSchemaVersion()); err != nil { + return err + } + } + return nil +} + +func (m *MarketLotSizeFilter) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if err := m.FilterType.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if m.QtyExponentInActingVersion(actingVersion) { + if m.QtyExponent < m.QtyExponentMinValue() || m.QtyExponent > m.QtyExponentMaxValue() { + return fmt.Errorf("Range check failed on m.QtyExponent (%v < %v > %v)", m.QtyExponentMinValue(), m.QtyExponent, m.QtyExponentMaxValue()) + } + } + if m.MinQtyInActingVersion(actingVersion) { + if m.MinQty < m.MinQtyMinValue() || m.MinQty > m.MinQtyMaxValue() { + return fmt.Errorf("Range check failed on m.MinQty (%v < %v > %v)", m.MinQtyMinValue(), m.MinQty, m.MinQtyMaxValue()) + } + } + if m.MaxQtyInActingVersion(actingVersion) { + if m.MaxQty < m.MaxQtyMinValue() || m.MaxQty > m.MaxQtyMaxValue() { + return fmt.Errorf("Range check failed on m.MaxQty (%v < %v > %v)", m.MaxQtyMinValue(), m.MaxQty, m.MaxQtyMaxValue()) + } + } + if m.StepSizeInActingVersion(actingVersion) { + if m.StepSize < m.StepSizeMinValue() || m.StepSize > m.StepSizeMaxValue() { + return fmt.Errorf("Range check failed on m.StepSize (%v < %v > %v)", m.StepSizeMinValue(), m.StepSize, m.StepSizeMaxValue()) + } + } + return nil +} + +func MarketLotSizeFilterInit(m *MarketLotSizeFilter) { + m.FilterType = FilterType.MarketLotSize + return +} + +func (*MarketLotSizeFilter) SbeBlockLength() (blockLength uint16) { + return 25 +} + +func (*MarketLotSizeFilter) SbeTemplateId() (templateId uint16) { + return 8 +} + +func (*MarketLotSizeFilter) SbeSchemaId() (schemaId uint16) { + return 3 +} + +func (*MarketLotSizeFilter) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} + +func (*MarketLotSizeFilter) SbeSemanticType() (semanticType []byte) { + return []byte("") +} + +func (*MarketLotSizeFilter) SbeSemanticVersion() (semanticVersion string) { + return "5.2" +} + +func (*MarketLotSizeFilter) FilterTypeId() uint16 { + return 1 +} + +func (*MarketLotSizeFilter) FilterTypeSinceVersion() uint16 { + return 0 +} + +func (m *MarketLotSizeFilter) FilterTypeInActingVersion(actingVersion uint16) bool { + return actingVersion >= m.FilterTypeSinceVersion() +} + +func (*MarketLotSizeFilter) FilterTypeDeprecated() uint16 { + return 0 +} + +func (*MarketLotSizeFilter) FilterTypeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "constant" + } + return "" +} + +func (*MarketLotSizeFilter) QtyExponentId() uint16 { + return 2 +} + +func (*MarketLotSizeFilter) QtyExponentSinceVersion() uint16 { + return 0 +} + +func (m *MarketLotSizeFilter) QtyExponentInActingVersion(actingVersion uint16) bool { + return actingVersion >= m.QtyExponentSinceVersion() +} + +func (*MarketLotSizeFilter) QtyExponentDeprecated() uint16 { + return 0 +} + +func (*MarketLotSizeFilter) QtyExponentMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*MarketLotSizeFilter) QtyExponentMinValue() int8 { + return math.MinInt8 + 1 +} + +func (*MarketLotSizeFilter) QtyExponentMaxValue() int8 { + return math.MaxInt8 +} + +func (*MarketLotSizeFilter) QtyExponentNullValue() int8 { + return math.MinInt8 +} + +func (*MarketLotSizeFilter) MinQtyId() uint16 { + return 3 +} + +func (*MarketLotSizeFilter) MinQtySinceVersion() uint16 { + return 0 +} + +func (m *MarketLotSizeFilter) MinQtyInActingVersion(actingVersion uint16) bool { + return actingVersion >= m.MinQtySinceVersion() +} + +func (*MarketLotSizeFilter) MinQtyDeprecated() uint16 { + return 0 +} + +func (*MarketLotSizeFilter) MinQtyMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*MarketLotSizeFilter) MinQtyMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*MarketLotSizeFilter) MinQtyMaxValue() int64 { + return math.MaxInt64 +} + +func (*MarketLotSizeFilter) MinQtyNullValue() int64 { + return math.MinInt64 +} + +func (*MarketLotSizeFilter) MaxQtyId() uint16 { + return 4 +} + +func (*MarketLotSizeFilter) MaxQtySinceVersion() uint16 { + return 0 +} + +func (m *MarketLotSizeFilter) MaxQtyInActingVersion(actingVersion uint16) bool { + return actingVersion >= m.MaxQtySinceVersion() +} + +func (*MarketLotSizeFilter) MaxQtyDeprecated() uint16 { + return 0 +} + +func (*MarketLotSizeFilter) MaxQtyMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*MarketLotSizeFilter) MaxQtyMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*MarketLotSizeFilter) MaxQtyMaxValue() int64 { + return math.MaxInt64 +} + +func (*MarketLotSizeFilter) MaxQtyNullValue() int64 { + return math.MinInt64 +} + +func (*MarketLotSizeFilter) StepSizeId() uint16 { + return 5 +} + +func (*MarketLotSizeFilter) StepSizeSinceVersion() uint16 { + return 0 +} + +func (m *MarketLotSizeFilter) StepSizeInActingVersion(actingVersion uint16) bool { + return actingVersion >= m.StepSizeSinceVersion() +} + +func (*MarketLotSizeFilter) StepSizeDeprecated() uint16 { + return 0 +} + +func (*MarketLotSizeFilter) StepSizeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*MarketLotSizeFilter) StepSizeMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*MarketLotSizeFilter) StepSizeMaxValue() int64 { + return math.MaxInt64 +} + +func (*MarketLotSizeFilter) StepSizeNullValue() int64 { + return math.MinInt64 +} diff --git a/v2/sbe/spot_3_1/MatchType.go b/v2/sbe/spot_3_1/MatchType.go new file mode 100644 index 00000000..57a9f8c1 --- /dev/null +++ b/v2/sbe/spot_3_1/MatchType.go @@ -0,0 +1,86 @@ +// Generated SBE (Simple Binary Encoding) message codec + +package sbe + +import ( + "fmt" + "io" + "reflect" +) + +type MatchTypeEnum uint8 +type MatchTypeValues struct { + AutoMatch MatchTypeEnum + OnePartyTradeReport MatchTypeEnum + NonRepresentable MatchTypeEnum + NullValue MatchTypeEnum +} + +var MatchType = MatchTypeValues{1, 2, 254, 255} + +func (m MatchTypeEnum) Encode(_m *SbeGoMarshaller, _w io.Writer) error { + if err := _m.WriteUint8(_w, uint8(m)); err != nil { + return err + } + return nil +} + +func (m *MatchTypeEnum) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16) error { + if err := _m.ReadUint8(_r, (*uint8)(m)); err != nil { + return err + } + return nil +} + +func (m MatchTypeEnum) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if actingVersion > schemaVersion { + return nil + } + value := reflect.ValueOf(MatchType) + for idx := 0; idx < value.NumField(); idx++ { + if m == value.Field(idx).Interface() { + return nil + } + } + return fmt.Errorf("Range check failed on MatchType, unknown enumeration value %d", m) +} + +func (*MatchTypeEnum) EncodedLength() int64 { + return 1 +} + +func (*MatchTypeEnum) AutoMatchSinceVersion() uint16 { + return 0 +} + +func (m *MatchTypeEnum) AutoMatchInActingVersion(actingVersion uint16) bool { + return actingVersion >= m.AutoMatchSinceVersion() +} + +func (*MatchTypeEnum) AutoMatchDeprecated() uint16 { + return 0 +} + +func (*MatchTypeEnum) OnePartyTradeReportSinceVersion() uint16 { + return 0 +} + +func (m *MatchTypeEnum) OnePartyTradeReportInActingVersion(actingVersion uint16) bool { + return actingVersion >= m.OnePartyTradeReportSinceVersion() +} + +func (*MatchTypeEnum) OnePartyTradeReportDeprecated() uint16 { + return 0 +} + +func (*MatchTypeEnum) NonRepresentableSinceVersion() uint16 { + return 0 +} + +func (m *MatchTypeEnum) NonRepresentableInActingVersion(actingVersion uint16) bool { + return actingVersion >= m.NonRepresentableSinceVersion() +} + +func (*MatchTypeEnum) NonRepresentableDeprecated() uint16 { + return 0 +} diff --git a/v2/sbe/spot_3_1/MaxAssetFilter.go b/v2/sbe/spot_3_1/MaxAssetFilter.go new file mode 100644 index 00000000..f7723f16 --- /dev/null +++ b/v2/sbe/spot_3_1/MaxAssetFilter.go @@ -0,0 +1,278 @@ +// Generated SBE (Simple Binary Encoding) message codec + +package sbe + +import ( + "errors" + "fmt" + "io" + "io/ioutil" + "math" + "unicode/utf8" +) + +type MaxAssetFilter struct { + FilterType FilterTypeEnum + QtyExponent int8 + MaxQty int64 + Asset []uint8 +} + +func (m *MaxAssetFilter) Encode(_m *SbeGoMarshaller, _w io.Writer, doRangeCheck bool) error { + if doRangeCheck { + if err := m.RangeCheck(m.SbeSchemaVersion(), m.SbeSchemaVersion()); err != nil { + return err + } + } + if err := _m.WriteInt8(_w, m.QtyExponent); err != nil { + return err + } + if err := _m.WriteInt64(_w, m.MaxQty); err != nil { + return err + } + if err := _m.WriteUint8(_w, uint8(len(m.Asset))); err != nil { + return err + } + if err := _m.WriteBytes(_w, m.Asset); err != nil { + return err + } + return nil +} + +func (m *MaxAssetFilter) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint16, doRangeCheck bool) error { + m.FilterType = FilterType.MaxAsset + if !m.QtyExponentInActingVersion(actingVersion) { + m.QtyExponent = m.QtyExponentNullValue() + } else { + if err := _m.ReadInt8(_r, &m.QtyExponent); err != nil { + return err + } + } + if !m.MaxQtyInActingVersion(actingVersion) { + m.MaxQty = m.MaxQtyNullValue() + } else { + if err := _m.ReadInt64(_r, &m.MaxQty); err != nil { + return err + } + } + if actingVersion > m.SbeSchemaVersion() && blockLength > m.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-m.SbeBlockLength())) + } + + if m.AssetInActingVersion(actingVersion) { + var AssetLength uint8 + if err := _m.ReadUint8(_r, &AssetLength); err != nil { + return err + } + if cap(m.Asset) < int(AssetLength) { + m.Asset = make([]uint8, AssetLength) + } + m.Asset = m.Asset[:AssetLength] + if err := _m.ReadBytes(_r, m.Asset); err != nil { + return err + } + } + if doRangeCheck { + if err := m.RangeCheck(actingVersion, m.SbeSchemaVersion()); err != nil { + return err + } + } + return nil +} + +func (m *MaxAssetFilter) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if err := m.FilterType.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if m.QtyExponentInActingVersion(actingVersion) { + if m.QtyExponent < m.QtyExponentMinValue() || m.QtyExponent > m.QtyExponentMaxValue() { + return fmt.Errorf("Range check failed on m.QtyExponent (%v < %v > %v)", m.QtyExponentMinValue(), m.QtyExponent, m.QtyExponentMaxValue()) + } + } + if m.MaxQtyInActingVersion(actingVersion) { + if m.MaxQty < m.MaxQtyMinValue() || m.MaxQty > m.MaxQtyMaxValue() { + return fmt.Errorf("Range check failed on m.MaxQty (%v < %v > %v)", m.MaxQtyMinValue(), m.MaxQty, m.MaxQtyMaxValue()) + } + } + if !utf8.Valid(m.Asset[:]) { + return errors.New("m.Asset failed UTF-8 validation") + } + return nil +} + +func MaxAssetFilterInit(m *MaxAssetFilter) { + m.FilterType = FilterType.MaxAsset + return +} + +func (*MaxAssetFilter) SbeBlockLength() (blockLength uint16) { + return 9 +} + +func (*MaxAssetFilter) SbeTemplateId() (templateId uint16) { + return 21 +} + +func (*MaxAssetFilter) SbeSchemaId() (schemaId uint16) { + return 3 +} + +func (*MaxAssetFilter) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} + +func (*MaxAssetFilter) SbeSemanticType() (semanticType []byte) { + return []byte("") +} + +func (*MaxAssetFilter) SbeSemanticVersion() (semanticVersion string) { + return "5.2" +} + +func (*MaxAssetFilter) FilterTypeId() uint16 { + return 1 +} + +func (*MaxAssetFilter) FilterTypeSinceVersion() uint16 { + return 0 +} + +func (m *MaxAssetFilter) FilterTypeInActingVersion(actingVersion uint16) bool { + return actingVersion >= m.FilterTypeSinceVersion() +} + +func (*MaxAssetFilter) FilterTypeDeprecated() uint16 { + return 0 +} + +func (*MaxAssetFilter) FilterTypeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "constant" + } + return "" +} + +func (*MaxAssetFilter) QtyExponentId() uint16 { + return 2 +} + +func (*MaxAssetFilter) QtyExponentSinceVersion() uint16 { + return 0 +} + +func (m *MaxAssetFilter) QtyExponentInActingVersion(actingVersion uint16) bool { + return actingVersion >= m.QtyExponentSinceVersion() +} + +func (*MaxAssetFilter) QtyExponentDeprecated() uint16 { + return 0 +} + +func (*MaxAssetFilter) QtyExponentMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*MaxAssetFilter) QtyExponentMinValue() int8 { + return math.MinInt8 + 1 +} + +func (*MaxAssetFilter) QtyExponentMaxValue() int8 { + return math.MaxInt8 +} + +func (*MaxAssetFilter) QtyExponentNullValue() int8 { + return math.MinInt8 +} + +func (*MaxAssetFilter) MaxQtyId() uint16 { + return 3 +} + +func (*MaxAssetFilter) MaxQtySinceVersion() uint16 { + return 0 +} + +func (m *MaxAssetFilter) MaxQtyInActingVersion(actingVersion uint16) bool { + return actingVersion >= m.MaxQtySinceVersion() +} + +func (*MaxAssetFilter) MaxQtyDeprecated() uint16 { + return 0 +} + +func (*MaxAssetFilter) MaxQtyMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*MaxAssetFilter) MaxQtyMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*MaxAssetFilter) MaxQtyMaxValue() int64 { + return math.MaxInt64 +} + +func (*MaxAssetFilter) MaxQtyNullValue() int64 { + return math.MinInt64 +} + +func (*MaxAssetFilter) AssetMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*MaxAssetFilter) AssetSinceVersion() uint16 { + return 0 +} + +func (m *MaxAssetFilter) AssetInActingVersion(actingVersion uint16) bool { + return actingVersion >= m.AssetSinceVersion() +} + +func (*MaxAssetFilter) AssetDeprecated() uint16 { + return 0 +} + +func (MaxAssetFilter) AssetCharacterEncoding() string { + return "UTF-8" +} + +func (MaxAssetFilter) AssetHeaderLength() uint64 { + return 1 +} diff --git a/v2/sbe/spot_3_1/MaxNumAlgoOrdersFilter.go b/v2/sbe/spot_3_1/MaxNumAlgoOrdersFilter.go new file mode 100644 index 00000000..383dc91d --- /dev/null +++ b/v2/sbe/spot_3_1/MaxNumAlgoOrdersFilter.go @@ -0,0 +1,160 @@ +// Generated SBE (Simple Binary Encoding) message codec + +package sbe + +import ( + "fmt" + "io" + "io/ioutil" + "math" +) + +type MaxNumAlgoOrdersFilter struct { + FilterType FilterTypeEnum + MaxNumAlgoOrders int64 +} + +func (m *MaxNumAlgoOrdersFilter) Encode(_m *SbeGoMarshaller, _w io.Writer, doRangeCheck bool) error { + if doRangeCheck { + if err := m.RangeCheck(m.SbeSchemaVersion(), m.SbeSchemaVersion()); err != nil { + return err + } + } + if err := _m.WriteInt64(_w, m.MaxNumAlgoOrders); err != nil { + return err + } + return nil +} + +func (m *MaxNumAlgoOrdersFilter) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint16, doRangeCheck bool) error { + m.FilterType = FilterType.MaxNumAlgoOrders + if !m.MaxNumAlgoOrdersInActingVersion(actingVersion) { + m.MaxNumAlgoOrders = m.MaxNumAlgoOrdersNullValue() + } else { + if err := _m.ReadInt64(_r, &m.MaxNumAlgoOrders); err != nil { + return err + } + } + if actingVersion > m.SbeSchemaVersion() && blockLength > m.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-m.SbeBlockLength())) + } + if doRangeCheck { + if err := m.RangeCheck(actingVersion, m.SbeSchemaVersion()); err != nil { + return err + } + } + return nil +} + +func (m *MaxNumAlgoOrdersFilter) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if err := m.FilterType.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if m.MaxNumAlgoOrdersInActingVersion(actingVersion) { + if m.MaxNumAlgoOrders < m.MaxNumAlgoOrdersMinValue() || m.MaxNumAlgoOrders > m.MaxNumAlgoOrdersMaxValue() { + return fmt.Errorf("Range check failed on m.MaxNumAlgoOrders (%v < %v > %v)", m.MaxNumAlgoOrdersMinValue(), m.MaxNumAlgoOrders, m.MaxNumAlgoOrdersMaxValue()) + } + } + return nil +} + +func MaxNumAlgoOrdersFilterInit(m *MaxNumAlgoOrdersFilter) { + m.FilterType = FilterType.MaxNumAlgoOrders + return +} + +func (*MaxNumAlgoOrdersFilter) SbeBlockLength() (blockLength uint16) { + return 8 +} + +func (*MaxNumAlgoOrdersFilter) SbeTemplateId() (templateId uint16) { + return 10 +} + +func (*MaxNumAlgoOrdersFilter) SbeSchemaId() (schemaId uint16) { + return 3 +} + +func (*MaxNumAlgoOrdersFilter) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} + +func (*MaxNumAlgoOrdersFilter) SbeSemanticType() (semanticType []byte) { + return []byte("") +} + +func (*MaxNumAlgoOrdersFilter) SbeSemanticVersion() (semanticVersion string) { + return "5.2" +} + +func (*MaxNumAlgoOrdersFilter) FilterTypeId() uint16 { + return 1 +} + +func (*MaxNumAlgoOrdersFilter) FilterTypeSinceVersion() uint16 { + return 0 +} + +func (m *MaxNumAlgoOrdersFilter) FilterTypeInActingVersion(actingVersion uint16) bool { + return actingVersion >= m.FilterTypeSinceVersion() +} + +func (*MaxNumAlgoOrdersFilter) FilterTypeDeprecated() uint16 { + return 0 +} + +func (*MaxNumAlgoOrdersFilter) FilterTypeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "constant" + } + return "" +} + +func (*MaxNumAlgoOrdersFilter) MaxNumAlgoOrdersId() uint16 { + return 2 +} + +func (*MaxNumAlgoOrdersFilter) MaxNumAlgoOrdersSinceVersion() uint16 { + return 0 +} + +func (m *MaxNumAlgoOrdersFilter) MaxNumAlgoOrdersInActingVersion(actingVersion uint16) bool { + return actingVersion >= m.MaxNumAlgoOrdersSinceVersion() +} + +func (*MaxNumAlgoOrdersFilter) MaxNumAlgoOrdersDeprecated() uint16 { + return 0 +} + +func (*MaxNumAlgoOrdersFilter) MaxNumAlgoOrdersMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*MaxNumAlgoOrdersFilter) MaxNumAlgoOrdersMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*MaxNumAlgoOrdersFilter) MaxNumAlgoOrdersMaxValue() int64 { + return math.MaxInt64 +} + +func (*MaxNumAlgoOrdersFilter) MaxNumAlgoOrdersNullValue() int64 { + return math.MinInt64 +} diff --git a/v2/sbe/spot_3_1/MaxNumIcebergOrdersFilter.go b/v2/sbe/spot_3_1/MaxNumIcebergOrdersFilter.go new file mode 100644 index 00000000..2ec78b6c --- /dev/null +++ b/v2/sbe/spot_3_1/MaxNumIcebergOrdersFilter.go @@ -0,0 +1,160 @@ +// Generated SBE (Simple Binary Encoding) message codec + +package sbe + +import ( + "fmt" + "io" + "io/ioutil" + "math" +) + +type MaxNumIcebergOrdersFilter struct { + FilterType FilterTypeEnum + MaxNumIcebergOrders int64 +} + +func (m *MaxNumIcebergOrdersFilter) Encode(_m *SbeGoMarshaller, _w io.Writer, doRangeCheck bool) error { + if doRangeCheck { + if err := m.RangeCheck(m.SbeSchemaVersion(), m.SbeSchemaVersion()); err != nil { + return err + } + } + if err := _m.WriteInt64(_w, m.MaxNumIcebergOrders); err != nil { + return err + } + return nil +} + +func (m *MaxNumIcebergOrdersFilter) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint16, doRangeCheck bool) error { + m.FilterType = FilterType.MaxNumIcebergOrders + if !m.MaxNumIcebergOrdersInActingVersion(actingVersion) { + m.MaxNumIcebergOrders = m.MaxNumIcebergOrdersNullValue() + } else { + if err := _m.ReadInt64(_r, &m.MaxNumIcebergOrders); err != nil { + return err + } + } + if actingVersion > m.SbeSchemaVersion() && blockLength > m.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-m.SbeBlockLength())) + } + if doRangeCheck { + if err := m.RangeCheck(actingVersion, m.SbeSchemaVersion()); err != nil { + return err + } + } + return nil +} + +func (m *MaxNumIcebergOrdersFilter) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if err := m.FilterType.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if m.MaxNumIcebergOrdersInActingVersion(actingVersion) { + if m.MaxNumIcebergOrders < m.MaxNumIcebergOrdersMinValue() || m.MaxNumIcebergOrders > m.MaxNumIcebergOrdersMaxValue() { + return fmt.Errorf("Range check failed on m.MaxNumIcebergOrders (%v < %v > %v)", m.MaxNumIcebergOrdersMinValue(), m.MaxNumIcebergOrders, m.MaxNumIcebergOrdersMaxValue()) + } + } + return nil +} + +func MaxNumIcebergOrdersFilterInit(m *MaxNumIcebergOrdersFilter) { + m.FilterType = FilterType.MaxNumIcebergOrders + return +} + +func (*MaxNumIcebergOrdersFilter) SbeBlockLength() (blockLength uint16) { + return 8 +} + +func (*MaxNumIcebergOrdersFilter) SbeTemplateId() (templateId uint16) { + return 11 +} + +func (*MaxNumIcebergOrdersFilter) SbeSchemaId() (schemaId uint16) { + return 3 +} + +func (*MaxNumIcebergOrdersFilter) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} + +func (*MaxNumIcebergOrdersFilter) SbeSemanticType() (semanticType []byte) { + return []byte("") +} + +func (*MaxNumIcebergOrdersFilter) SbeSemanticVersion() (semanticVersion string) { + return "5.2" +} + +func (*MaxNumIcebergOrdersFilter) FilterTypeId() uint16 { + return 1 +} + +func (*MaxNumIcebergOrdersFilter) FilterTypeSinceVersion() uint16 { + return 0 +} + +func (m *MaxNumIcebergOrdersFilter) FilterTypeInActingVersion(actingVersion uint16) bool { + return actingVersion >= m.FilterTypeSinceVersion() +} + +func (*MaxNumIcebergOrdersFilter) FilterTypeDeprecated() uint16 { + return 0 +} + +func (*MaxNumIcebergOrdersFilter) FilterTypeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "constant" + } + return "" +} + +func (*MaxNumIcebergOrdersFilter) MaxNumIcebergOrdersId() uint16 { + return 2 +} + +func (*MaxNumIcebergOrdersFilter) MaxNumIcebergOrdersSinceVersion() uint16 { + return 0 +} + +func (m *MaxNumIcebergOrdersFilter) MaxNumIcebergOrdersInActingVersion(actingVersion uint16) bool { + return actingVersion >= m.MaxNumIcebergOrdersSinceVersion() +} + +func (*MaxNumIcebergOrdersFilter) MaxNumIcebergOrdersDeprecated() uint16 { + return 0 +} + +func (*MaxNumIcebergOrdersFilter) MaxNumIcebergOrdersMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*MaxNumIcebergOrdersFilter) MaxNumIcebergOrdersMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*MaxNumIcebergOrdersFilter) MaxNumIcebergOrdersMaxValue() int64 { + return math.MaxInt64 +} + +func (*MaxNumIcebergOrdersFilter) MaxNumIcebergOrdersNullValue() int64 { + return math.MinInt64 +} diff --git a/v2/sbe/spot_3_1/MaxNumOrderAmendsFilter.go b/v2/sbe/spot_3_1/MaxNumOrderAmendsFilter.go new file mode 100644 index 00000000..3348c198 --- /dev/null +++ b/v2/sbe/spot_3_1/MaxNumOrderAmendsFilter.go @@ -0,0 +1,160 @@ +// Generated SBE (Simple Binary Encoding) message codec + +package sbe + +import ( + "fmt" + "io" + "io/ioutil" + "math" +) + +type MaxNumOrderAmendsFilter struct { + FilterType FilterTypeEnum + MaxNumOrderAmends int64 +} + +func (m *MaxNumOrderAmendsFilter) Encode(_m *SbeGoMarshaller, _w io.Writer, doRangeCheck bool) error { + if doRangeCheck { + if err := m.RangeCheck(m.SbeSchemaVersion(), m.SbeSchemaVersion()); err != nil { + return err + } + } + if err := _m.WriteInt64(_w, m.MaxNumOrderAmends); err != nil { + return err + } + return nil +} + +func (m *MaxNumOrderAmendsFilter) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint16, doRangeCheck bool) error { + m.FilterType = FilterType.MaxNumOrderAmends + if !m.MaxNumOrderAmendsInActingVersion(actingVersion) { + m.MaxNumOrderAmends = m.MaxNumOrderAmendsNullValue() + } else { + if err := _m.ReadInt64(_r, &m.MaxNumOrderAmends); err != nil { + return err + } + } + if actingVersion > m.SbeSchemaVersion() && blockLength > m.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-m.SbeBlockLength())) + } + if doRangeCheck { + if err := m.RangeCheck(actingVersion, m.SbeSchemaVersion()); err != nil { + return err + } + } + return nil +} + +func (m *MaxNumOrderAmendsFilter) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if err := m.FilterType.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if m.MaxNumOrderAmendsInActingVersion(actingVersion) { + if m.MaxNumOrderAmends < m.MaxNumOrderAmendsMinValue() || m.MaxNumOrderAmends > m.MaxNumOrderAmendsMaxValue() { + return fmt.Errorf("Range check failed on m.MaxNumOrderAmends (%v < %v > %v)", m.MaxNumOrderAmendsMinValue(), m.MaxNumOrderAmends, m.MaxNumOrderAmendsMaxValue()) + } + } + return nil +} + +func MaxNumOrderAmendsFilterInit(m *MaxNumOrderAmendsFilter) { + m.FilterType = FilterType.MaxNumOrderAmends + return +} + +func (*MaxNumOrderAmendsFilter) SbeBlockLength() (blockLength uint16) { + return 8 +} + +func (*MaxNumOrderAmendsFilter) SbeTemplateId() (templateId uint16) { + return 20 +} + +func (*MaxNumOrderAmendsFilter) SbeSchemaId() (schemaId uint16) { + return 3 +} + +func (*MaxNumOrderAmendsFilter) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} + +func (*MaxNumOrderAmendsFilter) SbeSemanticType() (semanticType []byte) { + return []byte("") +} + +func (*MaxNumOrderAmendsFilter) SbeSemanticVersion() (semanticVersion string) { + return "5.2" +} + +func (*MaxNumOrderAmendsFilter) FilterTypeId() uint16 { + return 1 +} + +func (*MaxNumOrderAmendsFilter) FilterTypeSinceVersion() uint16 { + return 0 +} + +func (m *MaxNumOrderAmendsFilter) FilterTypeInActingVersion(actingVersion uint16) bool { + return actingVersion >= m.FilterTypeSinceVersion() +} + +func (*MaxNumOrderAmendsFilter) FilterTypeDeprecated() uint16 { + return 0 +} + +func (*MaxNumOrderAmendsFilter) FilterTypeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "constant" + } + return "" +} + +func (*MaxNumOrderAmendsFilter) MaxNumOrderAmendsId() uint16 { + return 2 +} + +func (*MaxNumOrderAmendsFilter) MaxNumOrderAmendsSinceVersion() uint16 { + return 0 +} + +func (m *MaxNumOrderAmendsFilter) MaxNumOrderAmendsInActingVersion(actingVersion uint16) bool { + return actingVersion >= m.MaxNumOrderAmendsSinceVersion() +} + +func (*MaxNumOrderAmendsFilter) MaxNumOrderAmendsDeprecated() uint16 { + return 0 +} + +func (*MaxNumOrderAmendsFilter) MaxNumOrderAmendsMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*MaxNumOrderAmendsFilter) MaxNumOrderAmendsMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*MaxNumOrderAmendsFilter) MaxNumOrderAmendsMaxValue() int64 { + return math.MaxInt64 +} + +func (*MaxNumOrderAmendsFilter) MaxNumOrderAmendsNullValue() int64 { + return math.MinInt64 +} diff --git a/v2/sbe/spot_3_1/MaxNumOrderListsFilter.go b/v2/sbe/spot_3_1/MaxNumOrderListsFilter.go new file mode 100644 index 00000000..a9ca00bf --- /dev/null +++ b/v2/sbe/spot_3_1/MaxNumOrderListsFilter.go @@ -0,0 +1,160 @@ +// Generated SBE (Simple Binary Encoding) message codec + +package sbe + +import ( + "fmt" + "io" + "io/ioutil" + "math" +) + +type MaxNumOrderListsFilter struct { + FilterType FilterTypeEnum + MaxNumOrderLists int64 +} + +func (m *MaxNumOrderListsFilter) Encode(_m *SbeGoMarshaller, _w io.Writer, doRangeCheck bool) error { + if doRangeCheck { + if err := m.RangeCheck(m.SbeSchemaVersion(), m.SbeSchemaVersion()); err != nil { + return err + } + } + if err := _m.WriteInt64(_w, m.MaxNumOrderLists); err != nil { + return err + } + return nil +} + +func (m *MaxNumOrderListsFilter) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint16, doRangeCheck bool) error { + m.FilterType = FilterType.MaxNumOrderLists + if !m.MaxNumOrderListsInActingVersion(actingVersion) { + m.MaxNumOrderLists = m.MaxNumOrderListsNullValue() + } else { + if err := _m.ReadInt64(_r, &m.MaxNumOrderLists); err != nil { + return err + } + } + if actingVersion > m.SbeSchemaVersion() && blockLength > m.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-m.SbeBlockLength())) + } + if doRangeCheck { + if err := m.RangeCheck(actingVersion, m.SbeSchemaVersion()); err != nil { + return err + } + } + return nil +} + +func (m *MaxNumOrderListsFilter) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if err := m.FilterType.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if m.MaxNumOrderListsInActingVersion(actingVersion) { + if m.MaxNumOrderLists < m.MaxNumOrderListsMinValue() || m.MaxNumOrderLists > m.MaxNumOrderListsMaxValue() { + return fmt.Errorf("Range check failed on m.MaxNumOrderLists (%v < %v > %v)", m.MaxNumOrderListsMinValue(), m.MaxNumOrderLists, m.MaxNumOrderListsMaxValue()) + } + } + return nil +} + +func MaxNumOrderListsFilterInit(m *MaxNumOrderListsFilter) { + m.FilterType = FilterType.MaxNumOrderLists + return +} + +func (*MaxNumOrderListsFilter) SbeBlockLength() (blockLength uint16) { + return 8 +} + +func (*MaxNumOrderListsFilter) SbeTemplateId() (templateId uint16) { + return 18 +} + +func (*MaxNumOrderListsFilter) SbeSchemaId() (schemaId uint16) { + return 3 +} + +func (*MaxNumOrderListsFilter) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} + +func (*MaxNumOrderListsFilter) SbeSemanticType() (semanticType []byte) { + return []byte("") +} + +func (*MaxNumOrderListsFilter) SbeSemanticVersion() (semanticVersion string) { + return "5.2" +} + +func (*MaxNumOrderListsFilter) FilterTypeId() uint16 { + return 1 +} + +func (*MaxNumOrderListsFilter) FilterTypeSinceVersion() uint16 { + return 0 +} + +func (m *MaxNumOrderListsFilter) FilterTypeInActingVersion(actingVersion uint16) bool { + return actingVersion >= m.FilterTypeSinceVersion() +} + +func (*MaxNumOrderListsFilter) FilterTypeDeprecated() uint16 { + return 0 +} + +func (*MaxNumOrderListsFilter) FilterTypeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "constant" + } + return "" +} + +func (*MaxNumOrderListsFilter) MaxNumOrderListsId() uint16 { + return 2 +} + +func (*MaxNumOrderListsFilter) MaxNumOrderListsSinceVersion() uint16 { + return 0 +} + +func (m *MaxNumOrderListsFilter) MaxNumOrderListsInActingVersion(actingVersion uint16) bool { + return actingVersion >= m.MaxNumOrderListsSinceVersion() +} + +func (*MaxNumOrderListsFilter) MaxNumOrderListsDeprecated() uint16 { + return 0 +} + +func (*MaxNumOrderListsFilter) MaxNumOrderListsMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*MaxNumOrderListsFilter) MaxNumOrderListsMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*MaxNumOrderListsFilter) MaxNumOrderListsMaxValue() int64 { + return math.MaxInt64 +} + +func (*MaxNumOrderListsFilter) MaxNumOrderListsNullValue() int64 { + return math.MinInt64 +} diff --git a/v2/sbe/spot_3_1/MaxNumOrdersFilter.go b/v2/sbe/spot_3_1/MaxNumOrdersFilter.go new file mode 100644 index 00000000..3ea7c46f --- /dev/null +++ b/v2/sbe/spot_3_1/MaxNumOrdersFilter.go @@ -0,0 +1,160 @@ +// Generated SBE (Simple Binary Encoding) message codec + +package sbe + +import ( + "fmt" + "io" + "io/ioutil" + "math" +) + +type MaxNumOrdersFilter struct { + FilterType FilterTypeEnum + MaxNumOrders int64 +} + +func (m *MaxNumOrdersFilter) Encode(_m *SbeGoMarshaller, _w io.Writer, doRangeCheck bool) error { + if doRangeCheck { + if err := m.RangeCheck(m.SbeSchemaVersion(), m.SbeSchemaVersion()); err != nil { + return err + } + } + if err := _m.WriteInt64(_w, m.MaxNumOrders); err != nil { + return err + } + return nil +} + +func (m *MaxNumOrdersFilter) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint16, doRangeCheck bool) error { + m.FilterType = FilterType.MaxNumOrders + if !m.MaxNumOrdersInActingVersion(actingVersion) { + m.MaxNumOrders = m.MaxNumOrdersNullValue() + } else { + if err := _m.ReadInt64(_r, &m.MaxNumOrders); err != nil { + return err + } + } + if actingVersion > m.SbeSchemaVersion() && blockLength > m.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-m.SbeBlockLength())) + } + if doRangeCheck { + if err := m.RangeCheck(actingVersion, m.SbeSchemaVersion()); err != nil { + return err + } + } + return nil +} + +func (m *MaxNumOrdersFilter) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if err := m.FilterType.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if m.MaxNumOrdersInActingVersion(actingVersion) { + if m.MaxNumOrders < m.MaxNumOrdersMinValue() || m.MaxNumOrders > m.MaxNumOrdersMaxValue() { + return fmt.Errorf("Range check failed on m.MaxNumOrders (%v < %v > %v)", m.MaxNumOrdersMinValue(), m.MaxNumOrders, m.MaxNumOrdersMaxValue()) + } + } + return nil +} + +func MaxNumOrdersFilterInit(m *MaxNumOrdersFilter) { + m.FilterType = FilterType.MaxNumOrders + return +} + +func (*MaxNumOrdersFilter) SbeBlockLength() (blockLength uint16) { + return 8 +} + +func (*MaxNumOrdersFilter) SbeTemplateId() (templateId uint16) { + return 9 +} + +func (*MaxNumOrdersFilter) SbeSchemaId() (schemaId uint16) { + return 3 +} + +func (*MaxNumOrdersFilter) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} + +func (*MaxNumOrdersFilter) SbeSemanticType() (semanticType []byte) { + return []byte("") +} + +func (*MaxNumOrdersFilter) SbeSemanticVersion() (semanticVersion string) { + return "5.2" +} + +func (*MaxNumOrdersFilter) FilterTypeId() uint16 { + return 1 +} + +func (*MaxNumOrdersFilter) FilterTypeSinceVersion() uint16 { + return 0 +} + +func (m *MaxNumOrdersFilter) FilterTypeInActingVersion(actingVersion uint16) bool { + return actingVersion >= m.FilterTypeSinceVersion() +} + +func (*MaxNumOrdersFilter) FilterTypeDeprecated() uint16 { + return 0 +} + +func (*MaxNumOrdersFilter) FilterTypeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "constant" + } + return "" +} + +func (*MaxNumOrdersFilter) MaxNumOrdersId() uint16 { + return 2 +} + +func (*MaxNumOrdersFilter) MaxNumOrdersSinceVersion() uint16 { + return 0 +} + +func (m *MaxNumOrdersFilter) MaxNumOrdersInActingVersion(actingVersion uint16) bool { + return actingVersion >= m.MaxNumOrdersSinceVersion() +} + +func (*MaxNumOrdersFilter) MaxNumOrdersDeprecated() uint16 { + return 0 +} + +func (*MaxNumOrdersFilter) MaxNumOrdersMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*MaxNumOrdersFilter) MaxNumOrdersMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*MaxNumOrdersFilter) MaxNumOrdersMaxValue() int64 { + return math.MaxInt64 +} + +func (*MaxNumOrdersFilter) MaxNumOrdersNullValue() int64 { + return math.MinInt64 +} diff --git a/v2/sbe/spot_3_1/MaxPositionFilter.go b/v2/sbe/spot_3_1/MaxPositionFilter.go new file mode 100644 index 00000000..b3ba83cb --- /dev/null +++ b/v2/sbe/spot_3_1/MaxPositionFilter.go @@ -0,0 +1,218 @@ +// Generated SBE (Simple Binary Encoding) message codec + +package sbe + +import ( + "fmt" + "io" + "io/ioutil" + "math" +) + +type MaxPositionFilter struct { + FilterType FilterTypeEnum + QtyExponent int8 + MaxPosition int64 +} + +func (m *MaxPositionFilter) Encode(_m *SbeGoMarshaller, _w io.Writer, doRangeCheck bool) error { + if doRangeCheck { + if err := m.RangeCheck(m.SbeSchemaVersion(), m.SbeSchemaVersion()); err != nil { + return err + } + } + if err := _m.WriteInt8(_w, m.QtyExponent); err != nil { + return err + } + if err := _m.WriteInt64(_w, m.MaxPosition); err != nil { + return err + } + return nil +} + +func (m *MaxPositionFilter) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint16, doRangeCheck bool) error { + m.FilterType = FilterType.MaxPosition + if !m.QtyExponentInActingVersion(actingVersion) { + m.QtyExponent = m.QtyExponentNullValue() + } else { + if err := _m.ReadInt8(_r, &m.QtyExponent); err != nil { + return err + } + } + if !m.MaxPositionInActingVersion(actingVersion) { + m.MaxPosition = m.MaxPositionNullValue() + } else { + if err := _m.ReadInt64(_r, &m.MaxPosition); err != nil { + return err + } + } + if actingVersion > m.SbeSchemaVersion() && blockLength > m.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-m.SbeBlockLength())) + } + if doRangeCheck { + if err := m.RangeCheck(actingVersion, m.SbeSchemaVersion()); err != nil { + return err + } + } + return nil +} + +func (m *MaxPositionFilter) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if err := m.FilterType.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if m.QtyExponentInActingVersion(actingVersion) { + if m.QtyExponent < m.QtyExponentMinValue() || m.QtyExponent > m.QtyExponentMaxValue() { + return fmt.Errorf("Range check failed on m.QtyExponent (%v < %v > %v)", m.QtyExponentMinValue(), m.QtyExponent, m.QtyExponentMaxValue()) + } + } + if m.MaxPositionInActingVersion(actingVersion) { + if m.MaxPosition < m.MaxPositionMinValue() || m.MaxPosition > m.MaxPositionMaxValue() { + return fmt.Errorf("Range check failed on m.MaxPosition (%v < %v > %v)", m.MaxPositionMinValue(), m.MaxPosition, m.MaxPositionMaxValue()) + } + } + return nil +} + +func MaxPositionFilterInit(m *MaxPositionFilter) { + m.FilterType = FilterType.MaxPosition + return +} + +func (*MaxPositionFilter) SbeBlockLength() (blockLength uint16) { + return 9 +} + +func (*MaxPositionFilter) SbeTemplateId() (templateId uint16) { + return 12 +} + +func (*MaxPositionFilter) SbeSchemaId() (schemaId uint16) { + return 3 +} + +func (*MaxPositionFilter) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} + +func (*MaxPositionFilter) SbeSemanticType() (semanticType []byte) { + return []byte("") +} + +func (*MaxPositionFilter) SbeSemanticVersion() (semanticVersion string) { + return "5.2" +} + +func (*MaxPositionFilter) FilterTypeId() uint16 { + return 1 +} + +func (*MaxPositionFilter) FilterTypeSinceVersion() uint16 { + return 0 +} + +func (m *MaxPositionFilter) FilterTypeInActingVersion(actingVersion uint16) bool { + return actingVersion >= m.FilterTypeSinceVersion() +} + +func (*MaxPositionFilter) FilterTypeDeprecated() uint16 { + return 0 +} + +func (*MaxPositionFilter) FilterTypeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "constant" + } + return "" +} + +func (*MaxPositionFilter) QtyExponentId() uint16 { + return 2 +} + +func (*MaxPositionFilter) QtyExponentSinceVersion() uint16 { + return 0 +} + +func (m *MaxPositionFilter) QtyExponentInActingVersion(actingVersion uint16) bool { + return actingVersion >= m.QtyExponentSinceVersion() +} + +func (*MaxPositionFilter) QtyExponentDeprecated() uint16 { + return 0 +} + +func (*MaxPositionFilter) QtyExponentMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*MaxPositionFilter) QtyExponentMinValue() int8 { + return math.MinInt8 + 1 +} + +func (*MaxPositionFilter) QtyExponentMaxValue() int8 { + return math.MaxInt8 +} + +func (*MaxPositionFilter) QtyExponentNullValue() int8 { + return math.MinInt8 +} + +func (*MaxPositionFilter) MaxPositionId() uint16 { + return 3 +} + +func (*MaxPositionFilter) MaxPositionSinceVersion() uint16 { + return 0 +} + +func (m *MaxPositionFilter) MaxPositionInActingVersion(actingVersion uint16) bool { + return actingVersion >= m.MaxPositionSinceVersion() +} + +func (*MaxPositionFilter) MaxPositionDeprecated() uint16 { + return 0 +} + +func (*MaxPositionFilter) MaxPositionMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*MaxPositionFilter) MaxPositionMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*MaxPositionFilter) MaxPositionMaxValue() int64 { + return math.MaxInt64 +} + +func (*MaxPositionFilter) MaxPositionNullValue() int64 { + return math.MinInt64 +} diff --git a/v2/sbe/spot_3_1/MessageData.go b/v2/sbe/spot_3_1/MessageData.go new file mode 100644 index 00000000..225578e1 --- /dev/null +++ b/v2/sbe/spot_3_1/MessageData.go @@ -0,0 +1,112 @@ +// Generated SBE (Simple Binary Encoding) message codec + +package sbe + +import ( + "fmt" + "io" + "math" +) + +type MessageData struct { + Length uint32 + VarData uint8 +} + +func (m *MessageData) Encode(_m *SbeGoMarshaller, _w io.Writer) error { + if err := _m.WriteUint32(_w, m.Length); err != nil { + return err + } + if err := _m.WriteUint8(_w, m.VarData); err != nil { + return err + } + return nil +} + +func (m *MessageData) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16) error { + if !m.LengthInActingVersion(actingVersion) { + m.Length = m.LengthNullValue() + } else { + if err := _m.ReadUint32(_r, &m.Length); err != nil { + return err + } + } + if !m.VarDataInActingVersion(actingVersion) { + m.VarData = m.VarDataNullValue() + } else { + if err := _m.ReadUint8(_r, &m.VarData); err != nil { + return err + } + } + return nil +} + +func (m *MessageData) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if m.LengthInActingVersion(actingVersion) { + if m.Length < m.LengthMinValue() || m.Length > m.LengthMaxValue() { + return fmt.Errorf("Range check failed on m.Length (%v < %v > %v)", m.LengthMinValue(), m.Length, m.LengthMaxValue()) + } + } + if m.VarDataInActingVersion(actingVersion) { + if m.VarData < m.VarDataMinValue() || m.VarData > m.VarDataMaxValue() { + return fmt.Errorf("Range check failed on m.VarData (%v < %v > %v)", m.VarDataMinValue(), m.VarData, m.VarDataMaxValue()) + } + } + return nil +} + +func MessageDataInit(m *MessageData) { + return +} + +func (*MessageData) EncodedLength() int64 { + return -1 +} + +func (*MessageData) LengthMinValue() uint32 { + return 0 +} + +func (*MessageData) LengthMaxValue() uint32 { + return 2147483647 +} + +func (*MessageData) LengthNullValue() uint32 { + return math.MaxUint32 +} + +func (*MessageData) LengthSinceVersion() uint16 { + return 0 +} + +func (m *MessageData) LengthInActingVersion(actingVersion uint16) bool { + return actingVersion >= m.LengthSinceVersion() +} + +func (*MessageData) LengthDeprecated() uint16 { + return 0 +} + +func (*MessageData) VarDataMinValue() uint8 { + return 0 +} + +func (*MessageData) VarDataMaxValue() uint8 { + return math.MaxUint8 - 1 +} + +func (*MessageData) VarDataNullValue() uint8 { + return math.MaxUint8 +} + +func (*MessageData) VarDataSinceVersion() uint16 { + return 0 +} + +func (m *MessageData) VarDataInActingVersion(actingVersion uint16) bool { + return actingVersion >= m.VarDataSinceVersion() +} + +func (*MessageData) VarDataDeprecated() uint16 { + return 0 +} diff --git a/v2/sbe/spot_3_1/MessageData16.go b/v2/sbe/spot_3_1/MessageData16.go new file mode 100644 index 00000000..92d43d55 --- /dev/null +++ b/v2/sbe/spot_3_1/MessageData16.go @@ -0,0 +1,112 @@ +// Generated SBE (Simple Binary Encoding) message codec + +package sbe + +import ( + "fmt" + "io" + "math" +) + +type MessageData16 struct { + Length uint16 + VarData uint8 +} + +func (m *MessageData16) Encode(_m *SbeGoMarshaller, _w io.Writer) error { + if err := _m.WriteUint16(_w, m.Length); err != nil { + return err + } + if err := _m.WriteUint8(_w, m.VarData); err != nil { + return err + } + return nil +} + +func (m *MessageData16) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16) error { + if !m.LengthInActingVersion(actingVersion) { + m.Length = m.LengthNullValue() + } else { + if err := _m.ReadUint16(_r, &m.Length); err != nil { + return err + } + } + if !m.VarDataInActingVersion(actingVersion) { + m.VarData = m.VarDataNullValue() + } else { + if err := _m.ReadUint8(_r, &m.VarData); err != nil { + return err + } + } + return nil +} + +func (m *MessageData16) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if m.LengthInActingVersion(actingVersion) { + if m.Length < m.LengthMinValue() || m.Length > m.LengthMaxValue() { + return fmt.Errorf("Range check failed on m.Length (%v < %v > %v)", m.LengthMinValue(), m.Length, m.LengthMaxValue()) + } + } + if m.VarDataInActingVersion(actingVersion) { + if m.VarData < m.VarDataMinValue() || m.VarData > m.VarDataMaxValue() { + return fmt.Errorf("Range check failed on m.VarData (%v < %v > %v)", m.VarDataMinValue(), m.VarData, m.VarDataMaxValue()) + } + } + return nil +} + +func MessageData16Init(m *MessageData16) { + return +} + +func (*MessageData16) EncodedLength() int64 { + return -1 +} + +func (*MessageData16) LengthMinValue() uint16 { + return 0 +} + +func (*MessageData16) LengthMaxValue() uint16 { + return math.MaxUint16 - 1 +} + +func (*MessageData16) LengthNullValue() uint16 { + return math.MaxUint16 +} + +func (*MessageData16) LengthSinceVersion() uint16 { + return 0 +} + +func (m *MessageData16) LengthInActingVersion(actingVersion uint16) bool { + return actingVersion >= m.LengthSinceVersion() +} + +func (*MessageData16) LengthDeprecated() uint16 { + return 0 +} + +func (*MessageData16) VarDataMinValue() uint8 { + return 0 +} + +func (*MessageData16) VarDataMaxValue() uint8 { + return math.MaxUint8 - 1 +} + +func (*MessageData16) VarDataNullValue() uint8 { + return math.MaxUint8 +} + +func (*MessageData16) VarDataSinceVersion() uint16 { + return 0 +} + +func (m *MessageData16) VarDataInActingVersion(actingVersion uint16) bool { + return actingVersion >= m.VarDataSinceVersion() +} + +func (*MessageData16) VarDataDeprecated() uint16 { + return 0 +} diff --git a/v2/sbe/spot_3_1/MessageData8.go b/v2/sbe/spot_3_1/MessageData8.go new file mode 100644 index 00000000..ff2a17a2 --- /dev/null +++ b/v2/sbe/spot_3_1/MessageData8.go @@ -0,0 +1,112 @@ +// Generated SBE (Simple Binary Encoding) message codec + +package sbe + +import ( + "fmt" + "io" + "math" +) + +type MessageData8 struct { + Length uint8 + VarData uint8 +} + +func (m *MessageData8) Encode(_m *SbeGoMarshaller, _w io.Writer) error { + if err := _m.WriteUint8(_w, m.Length); err != nil { + return err + } + if err := _m.WriteUint8(_w, m.VarData); err != nil { + return err + } + return nil +} + +func (m *MessageData8) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16) error { + if !m.LengthInActingVersion(actingVersion) { + m.Length = m.LengthNullValue() + } else { + if err := _m.ReadUint8(_r, &m.Length); err != nil { + return err + } + } + if !m.VarDataInActingVersion(actingVersion) { + m.VarData = m.VarDataNullValue() + } else { + if err := _m.ReadUint8(_r, &m.VarData); err != nil { + return err + } + } + return nil +} + +func (m *MessageData8) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if m.LengthInActingVersion(actingVersion) { + if m.Length < m.LengthMinValue() || m.Length > m.LengthMaxValue() { + return fmt.Errorf("Range check failed on m.Length (%v < %v > %v)", m.LengthMinValue(), m.Length, m.LengthMaxValue()) + } + } + if m.VarDataInActingVersion(actingVersion) { + if m.VarData < m.VarDataMinValue() || m.VarData > m.VarDataMaxValue() { + return fmt.Errorf("Range check failed on m.VarData (%v < %v > %v)", m.VarDataMinValue(), m.VarData, m.VarDataMaxValue()) + } + } + return nil +} + +func MessageData8Init(m *MessageData8) { + return +} + +func (*MessageData8) EncodedLength() int64 { + return -1 +} + +func (*MessageData8) LengthMinValue() uint8 { + return 0 +} + +func (*MessageData8) LengthMaxValue() uint8 { + return math.MaxUint8 - 1 +} + +func (*MessageData8) LengthNullValue() uint8 { + return math.MaxUint8 +} + +func (*MessageData8) LengthSinceVersion() uint16 { + return 0 +} + +func (m *MessageData8) LengthInActingVersion(actingVersion uint16) bool { + return actingVersion >= m.LengthSinceVersion() +} + +func (*MessageData8) LengthDeprecated() uint16 { + return 0 +} + +func (*MessageData8) VarDataMinValue() uint8 { + return 0 +} + +func (*MessageData8) VarDataMaxValue() uint8 { + return math.MaxUint8 - 1 +} + +func (*MessageData8) VarDataNullValue() uint8 { + return math.MaxUint8 +} + +func (*MessageData8) VarDataSinceVersion() uint16 { + return 0 +} + +func (m *MessageData8) VarDataInActingVersion(actingVersion uint16) bool { + return actingVersion >= m.VarDataSinceVersion() +} + +func (*MessageData8) VarDataDeprecated() uint16 { + return 0 +} diff --git a/v2/sbe/spot_3_1/MessageHeader.go b/v2/sbe/spot_3_1/MessageHeader.go new file mode 100644 index 00000000..953615f4 --- /dev/null +++ b/v2/sbe/spot_3_1/MessageHeader.go @@ -0,0 +1,192 @@ +// Generated SBE (Simple Binary Encoding) message codec + +package sbe + +import ( + "fmt" + "io" + "math" +) + +type MessageHeader struct { + BlockLength uint16 + TemplateId uint16 + SchemaId uint16 + Version uint16 +} + +func (m *MessageHeader) Encode(_m *SbeGoMarshaller, _w io.Writer) error { + if err := _m.WriteUint16(_w, m.BlockLength); err != nil { + return err + } + if err := _m.WriteUint16(_w, m.TemplateId); err != nil { + return err + } + if err := _m.WriteUint16(_w, m.SchemaId); err != nil { + return err + } + if err := _m.WriteUint16(_w, m.Version); err != nil { + return err + } + return nil +} + +func (m *MessageHeader) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16) error { + if !m.BlockLengthInActingVersion(actingVersion) { + m.BlockLength = m.BlockLengthNullValue() + } else { + if err := _m.ReadUint16(_r, &m.BlockLength); err != nil { + return err + } + } + if !m.TemplateIdInActingVersion(actingVersion) { + m.TemplateId = m.TemplateIdNullValue() + } else { + if err := _m.ReadUint16(_r, &m.TemplateId); err != nil { + return err + } + } + if !m.SchemaIdInActingVersion(actingVersion) { + m.SchemaId = m.SchemaIdNullValue() + } else { + if err := _m.ReadUint16(_r, &m.SchemaId); err != nil { + return err + } + } + if !m.VersionInActingVersion(actingVersion) { + m.Version = m.VersionNullValue() + } else { + if err := _m.ReadUint16(_r, &m.Version); err != nil { + return err + } + } + return nil +} + +func (m *MessageHeader) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if m.BlockLengthInActingVersion(actingVersion) { + if m.BlockLength < m.BlockLengthMinValue() || m.BlockLength > m.BlockLengthMaxValue() { + return fmt.Errorf("Range check failed on m.BlockLength (%v < %v > %v)", m.BlockLengthMinValue(), m.BlockLength, m.BlockLengthMaxValue()) + } + } + if m.TemplateIdInActingVersion(actingVersion) { + if m.TemplateId < m.TemplateIdMinValue() || m.TemplateId > m.TemplateIdMaxValue() { + return fmt.Errorf("Range check failed on m.TemplateId (%v < %v > %v)", m.TemplateIdMinValue(), m.TemplateId, m.TemplateIdMaxValue()) + } + } + if m.SchemaIdInActingVersion(actingVersion) { + if m.SchemaId < m.SchemaIdMinValue() || m.SchemaId > m.SchemaIdMaxValue() { + return fmt.Errorf("Range check failed on m.SchemaId (%v < %v > %v)", m.SchemaIdMinValue(), m.SchemaId, m.SchemaIdMaxValue()) + } + } + if m.VersionInActingVersion(actingVersion) { + if m.Version < m.VersionMinValue() || m.Version > m.VersionMaxValue() { + return fmt.Errorf("Range check failed on m.Version (%v < %v > %v)", m.VersionMinValue(), m.Version, m.VersionMaxValue()) + } + } + return nil +} + +func MessageHeaderInit(m *MessageHeader) { + return +} + +func (*MessageHeader) EncodedLength() int64 { + return 8 +} + +func (*MessageHeader) BlockLengthMinValue() uint16 { + return 0 +} + +func (*MessageHeader) BlockLengthMaxValue() uint16 { + return math.MaxUint16 - 1 +} + +func (*MessageHeader) BlockLengthNullValue() uint16 { + return math.MaxUint16 +} + +func (*MessageHeader) BlockLengthSinceVersion() uint16 { + return 0 +} + +func (m *MessageHeader) BlockLengthInActingVersion(actingVersion uint16) bool { + return actingVersion >= m.BlockLengthSinceVersion() +} + +func (*MessageHeader) BlockLengthDeprecated() uint16 { + return 0 +} + +func (*MessageHeader) TemplateIdMinValue() uint16 { + return 0 +} + +func (*MessageHeader) TemplateIdMaxValue() uint16 { + return math.MaxUint16 - 1 +} + +func (*MessageHeader) TemplateIdNullValue() uint16 { + return math.MaxUint16 +} + +func (*MessageHeader) TemplateIdSinceVersion() uint16 { + return 0 +} + +func (m *MessageHeader) TemplateIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= m.TemplateIdSinceVersion() +} + +func (*MessageHeader) TemplateIdDeprecated() uint16 { + return 0 +} + +func (*MessageHeader) SchemaIdMinValue() uint16 { + return 0 +} + +func (*MessageHeader) SchemaIdMaxValue() uint16 { + return math.MaxUint16 - 1 +} + +func (*MessageHeader) SchemaIdNullValue() uint16 { + return math.MaxUint16 +} + +func (*MessageHeader) SchemaIdSinceVersion() uint16 { + return 0 +} + +func (m *MessageHeader) SchemaIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= m.SchemaIdSinceVersion() +} + +func (*MessageHeader) SchemaIdDeprecated() uint16 { + return 0 +} + +func (*MessageHeader) VersionMinValue() uint16 { + return 0 +} + +func (*MessageHeader) VersionMaxValue() uint16 { + return math.MaxUint16 - 1 +} + +func (*MessageHeader) VersionNullValue() uint16 { + return math.MaxUint16 +} + +func (*MessageHeader) VersionSinceVersion() uint16 { + return 0 +} + +func (m *MessageHeader) VersionInActingVersion(actingVersion uint16) bool { + return actingVersion >= m.VersionSinceVersion() +} + +func (*MessageHeader) VersionDeprecated() uint16 { + return 0 +} diff --git a/v2/sbe/spot_3_1/MinNotionalFilter.go b/v2/sbe/spot_3_1/MinNotionalFilter.go new file mode 100644 index 00000000..7d7928c9 --- /dev/null +++ b/v2/sbe/spot_3_1/MinNotionalFilter.go @@ -0,0 +1,318 @@ +// Generated SBE (Simple Binary Encoding) message codec + +package sbe + +import ( + "fmt" + "io" + "io/ioutil" + "math" +) + +type MinNotionalFilter struct { + FilterType FilterTypeEnum + PriceExponent int8 + MinNotional int64 + ApplyToMarket BoolEnumEnum + AvgPriceMins int32 +} + +func (m *MinNotionalFilter) Encode(_m *SbeGoMarshaller, _w io.Writer, doRangeCheck bool) error { + if doRangeCheck { + if err := m.RangeCheck(m.SbeSchemaVersion(), m.SbeSchemaVersion()); err != nil { + return err + } + } + if err := _m.WriteInt8(_w, m.PriceExponent); err != nil { + return err + } + if err := _m.WriteInt64(_w, m.MinNotional); err != nil { + return err + } + if err := m.ApplyToMarket.Encode(_m, _w); err != nil { + return err + } + if err := _m.WriteInt32(_w, m.AvgPriceMins); err != nil { + return err + } + return nil +} + +func (m *MinNotionalFilter) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint16, doRangeCheck bool) error { + m.FilterType = FilterType.MinNotional + if !m.PriceExponentInActingVersion(actingVersion) { + m.PriceExponent = m.PriceExponentNullValue() + } else { + if err := _m.ReadInt8(_r, &m.PriceExponent); err != nil { + return err + } + } + if !m.MinNotionalInActingVersion(actingVersion) { + m.MinNotional = m.MinNotionalNullValue() + } else { + if err := _m.ReadInt64(_r, &m.MinNotional); err != nil { + return err + } + } + if m.ApplyToMarketInActingVersion(actingVersion) { + if err := m.ApplyToMarket.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if !m.AvgPriceMinsInActingVersion(actingVersion) { + m.AvgPriceMins = m.AvgPriceMinsNullValue() + } else { + if err := _m.ReadInt32(_r, &m.AvgPriceMins); err != nil { + return err + } + } + if actingVersion > m.SbeSchemaVersion() && blockLength > m.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-m.SbeBlockLength())) + } + if doRangeCheck { + if err := m.RangeCheck(actingVersion, m.SbeSchemaVersion()); err != nil { + return err + } + } + return nil +} + +func (m *MinNotionalFilter) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if err := m.FilterType.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if m.PriceExponentInActingVersion(actingVersion) { + if m.PriceExponent < m.PriceExponentMinValue() || m.PriceExponent > m.PriceExponentMaxValue() { + return fmt.Errorf("Range check failed on m.PriceExponent (%v < %v > %v)", m.PriceExponentMinValue(), m.PriceExponent, m.PriceExponentMaxValue()) + } + } + if m.MinNotionalInActingVersion(actingVersion) { + if m.MinNotional < m.MinNotionalMinValue() || m.MinNotional > m.MinNotionalMaxValue() { + return fmt.Errorf("Range check failed on m.MinNotional (%v < %v > %v)", m.MinNotionalMinValue(), m.MinNotional, m.MinNotionalMaxValue()) + } + } + if err := m.ApplyToMarket.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if m.AvgPriceMinsInActingVersion(actingVersion) { + if m.AvgPriceMins < m.AvgPriceMinsMinValue() || m.AvgPriceMins > m.AvgPriceMinsMaxValue() { + return fmt.Errorf("Range check failed on m.AvgPriceMins (%v < %v > %v)", m.AvgPriceMinsMinValue(), m.AvgPriceMins, m.AvgPriceMinsMaxValue()) + } + } + return nil +} + +func MinNotionalFilterInit(m *MinNotionalFilter) { + m.FilterType = FilterType.MinNotional + return +} + +func (*MinNotionalFilter) SbeBlockLength() (blockLength uint16) { + return 14 +} + +func (*MinNotionalFilter) SbeTemplateId() (templateId uint16) { + return 5 +} + +func (*MinNotionalFilter) SbeSchemaId() (schemaId uint16) { + return 3 +} + +func (*MinNotionalFilter) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} + +func (*MinNotionalFilter) SbeSemanticType() (semanticType []byte) { + return []byte("") +} + +func (*MinNotionalFilter) SbeSemanticVersion() (semanticVersion string) { + return "5.2" +} + +func (*MinNotionalFilter) FilterTypeId() uint16 { + return 1 +} + +func (*MinNotionalFilter) FilterTypeSinceVersion() uint16 { + return 0 +} + +func (m *MinNotionalFilter) FilterTypeInActingVersion(actingVersion uint16) bool { + return actingVersion >= m.FilterTypeSinceVersion() +} + +func (*MinNotionalFilter) FilterTypeDeprecated() uint16 { + return 0 +} + +func (*MinNotionalFilter) FilterTypeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "constant" + } + return "" +} + +func (*MinNotionalFilter) PriceExponentId() uint16 { + return 2 +} + +func (*MinNotionalFilter) PriceExponentSinceVersion() uint16 { + return 0 +} + +func (m *MinNotionalFilter) PriceExponentInActingVersion(actingVersion uint16) bool { + return actingVersion >= m.PriceExponentSinceVersion() +} + +func (*MinNotionalFilter) PriceExponentDeprecated() uint16 { + return 0 +} + +func (*MinNotionalFilter) PriceExponentMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*MinNotionalFilter) PriceExponentMinValue() int8 { + return math.MinInt8 + 1 +} + +func (*MinNotionalFilter) PriceExponentMaxValue() int8 { + return math.MaxInt8 +} + +func (*MinNotionalFilter) PriceExponentNullValue() int8 { + return math.MinInt8 +} + +func (*MinNotionalFilter) MinNotionalId() uint16 { + return 3 +} + +func (*MinNotionalFilter) MinNotionalSinceVersion() uint16 { + return 0 +} + +func (m *MinNotionalFilter) MinNotionalInActingVersion(actingVersion uint16) bool { + return actingVersion >= m.MinNotionalSinceVersion() +} + +func (*MinNotionalFilter) MinNotionalDeprecated() uint16 { + return 0 +} + +func (*MinNotionalFilter) MinNotionalMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*MinNotionalFilter) MinNotionalMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*MinNotionalFilter) MinNotionalMaxValue() int64 { + return math.MaxInt64 +} + +func (*MinNotionalFilter) MinNotionalNullValue() int64 { + return math.MinInt64 +} + +func (*MinNotionalFilter) ApplyToMarketId() uint16 { + return 4 +} + +func (*MinNotionalFilter) ApplyToMarketSinceVersion() uint16 { + return 0 +} + +func (m *MinNotionalFilter) ApplyToMarketInActingVersion(actingVersion uint16) bool { + return actingVersion >= m.ApplyToMarketSinceVersion() +} + +func (*MinNotionalFilter) ApplyToMarketDeprecated() uint16 { + return 0 +} + +func (*MinNotionalFilter) ApplyToMarketMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*MinNotionalFilter) AvgPriceMinsId() uint16 { + return 5 +} + +func (*MinNotionalFilter) AvgPriceMinsSinceVersion() uint16 { + return 0 +} + +func (m *MinNotionalFilter) AvgPriceMinsInActingVersion(actingVersion uint16) bool { + return actingVersion >= m.AvgPriceMinsSinceVersion() +} + +func (*MinNotionalFilter) AvgPriceMinsDeprecated() uint16 { + return 0 +} + +func (*MinNotionalFilter) AvgPriceMinsMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*MinNotionalFilter) AvgPriceMinsMinValue() int32 { + return math.MinInt32 + 1 +} + +func (*MinNotionalFilter) AvgPriceMinsMaxValue() int32 { + return math.MaxInt32 +} + +func (*MinNotionalFilter) AvgPriceMinsNullValue() int32 { + return math.MinInt32 +} diff --git a/v2/sbe/spot_3_1/MyFiltersResponse.go b/v2/sbe/spot_3_1/MyFiltersResponse.go new file mode 100644 index 00000000..e3c9e806 --- /dev/null +++ b/v2/sbe/spot_3_1/MyFiltersResponse.go @@ -0,0 +1,481 @@ +// Generated SBE (Simple Binary Encoding) message codec + +package sbe + +import ( + "io" + "io/ioutil" +) + +type MyFiltersResponse struct { + ExchangeFilters []MyFiltersResponseExchangeFilters + SymbolFilters []MyFiltersResponseSymbolFilters + AssetFilters []MyFiltersResponseAssetFilters +} +type MyFiltersResponseExchangeFilters struct { + Filter []uint8 +} +type MyFiltersResponseSymbolFilters struct { + Filter []uint8 +} +type MyFiltersResponseAssetFilters struct { + Filter []uint8 +} + +func (m *MyFiltersResponse) Encode(_m *SbeGoMarshaller, _w io.Writer, doRangeCheck bool) error { + if doRangeCheck { + if err := m.RangeCheck(m.SbeSchemaVersion(), m.SbeSchemaVersion()); err != nil { + return err + } + } + var ExchangeFiltersBlockLength uint16 = 0 + if err := _m.WriteUint16(_w, ExchangeFiltersBlockLength); err != nil { + return err + } + var ExchangeFiltersNumInGroup uint32 = uint32(len(m.ExchangeFilters)) + if err := _m.WriteUint32(_w, ExchangeFiltersNumInGroup); err != nil { + return err + } + for i := range m.ExchangeFilters { + if err := m.ExchangeFilters[i].Encode(_m, _w); err != nil { + return err + } + } + var SymbolFiltersBlockLength uint16 = 0 + if err := _m.WriteUint16(_w, SymbolFiltersBlockLength); err != nil { + return err + } + var SymbolFiltersNumInGroup uint32 = uint32(len(m.SymbolFilters)) + if err := _m.WriteUint32(_w, SymbolFiltersNumInGroup); err != nil { + return err + } + for i := range m.SymbolFilters { + if err := m.SymbolFilters[i].Encode(_m, _w); err != nil { + return err + } + } + var AssetFiltersBlockLength uint16 = 0 + if err := _m.WriteUint16(_w, AssetFiltersBlockLength); err != nil { + return err + } + var AssetFiltersNumInGroup uint32 = uint32(len(m.AssetFilters)) + if err := _m.WriteUint32(_w, AssetFiltersNumInGroup); err != nil { + return err + } + for i := range m.AssetFilters { + if err := m.AssetFilters[i].Encode(_m, _w); err != nil { + return err + } + } + return nil +} + +func (m *MyFiltersResponse) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint16, doRangeCheck bool) error { + if actingVersion > m.SbeSchemaVersion() && blockLength > m.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-m.SbeBlockLength())) + } + + if m.ExchangeFiltersInActingVersion(actingVersion) { + var ExchangeFiltersBlockLength uint16 + if err := _m.ReadUint16(_r, &ExchangeFiltersBlockLength); err != nil { + return err + } + var ExchangeFiltersNumInGroup uint32 + if err := _m.ReadUint32(_r, &ExchangeFiltersNumInGroup); err != nil { + return err + } + if cap(m.ExchangeFilters) < int(ExchangeFiltersNumInGroup) { + m.ExchangeFilters = make([]MyFiltersResponseExchangeFilters, ExchangeFiltersNumInGroup) + } + m.ExchangeFilters = m.ExchangeFilters[:ExchangeFiltersNumInGroup] + for i := range m.ExchangeFilters { + if err := m.ExchangeFilters[i].Decode(_m, _r, actingVersion, uint(ExchangeFiltersBlockLength)); err != nil { + return err + } + } + } + + if m.SymbolFiltersInActingVersion(actingVersion) { + var SymbolFiltersBlockLength uint16 + if err := _m.ReadUint16(_r, &SymbolFiltersBlockLength); err != nil { + return err + } + var SymbolFiltersNumInGroup uint32 + if err := _m.ReadUint32(_r, &SymbolFiltersNumInGroup); err != nil { + return err + } + if cap(m.SymbolFilters) < int(SymbolFiltersNumInGroup) { + m.SymbolFilters = make([]MyFiltersResponseSymbolFilters, SymbolFiltersNumInGroup) + } + m.SymbolFilters = m.SymbolFilters[:SymbolFiltersNumInGroup] + for i := range m.SymbolFilters { + if err := m.SymbolFilters[i].Decode(_m, _r, actingVersion, uint(SymbolFiltersBlockLength)); err != nil { + return err + } + } + } + + if m.AssetFiltersInActingVersion(actingVersion) { + var AssetFiltersBlockLength uint16 + if err := _m.ReadUint16(_r, &AssetFiltersBlockLength); err != nil { + return err + } + var AssetFiltersNumInGroup uint32 + if err := _m.ReadUint32(_r, &AssetFiltersNumInGroup); err != nil { + return err + } + if cap(m.AssetFilters) < int(AssetFiltersNumInGroup) { + m.AssetFilters = make([]MyFiltersResponseAssetFilters, AssetFiltersNumInGroup) + } + m.AssetFilters = m.AssetFilters[:AssetFiltersNumInGroup] + for i := range m.AssetFilters { + if err := m.AssetFilters[i].Decode(_m, _r, actingVersion, uint(AssetFiltersBlockLength)); err != nil { + return err + } + } + } + if doRangeCheck { + if err := m.RangeCheck(actingVersion, m.SbeSchemaVersion()); err != nil { + return err + } + } + return nil +} + +func (m *MyFiltersResponse) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + for i := range m.ExchangeFilters { + if err := m.ExchangeFilters[i].RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + } + for i := range m.SymbolFilters { + if err := m.SymbolFilters[i].RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + } + for i := range m.AssetFilters { + if err := m.AssetFilters[i].RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + } + return nil +} + +func MyFiltersResponseInit(m *MyFiltersResponse) { + return +} + +func (m *MyFiltersResponseExchangeFilters) Encode(_m *SbeGoMarshaller, _w io.Writer) error { + if err := _m.WriteUint8(_w, uint8(len(m.Filter))); err != nil { + return err + } + if err := _m.WriteBytes(_w, m.Filter); err != nil { + return err + } + return nil +} + +func (m *MyFiltersResponseExchangeFilters) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint) error { + if actingVersion > m.SbeSchemaVersion() && blockLength > m.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-m.SbeBlockLength())) + } + + if m.FilterInActingVersion(actingVersion) { + var FilterLength uint8 + if err := _m.ReadUint8(_r, &FilterLength); err != nil { + return err + } + if cap(m.Filter) < int(FilterLength) { + m.Filter = make([]uint8, FilterLength) + } + m.Filter = m.Filter[:FilterLength] + if err := _m.ReadBytes(_r, m.Filter); err != nil { + return err + } + } + return nil +} + +func (m *MyFiltersResponseExchangeFilters) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + return nil +} + +func MyFiltersResponseExchangeFiltersInit(m *MyFiltersResponseExchangeFilters) { + return +} + +func (m *MyFiltersResponseSymbolFilters) Encode(_m *SbeGoMarshaller, _w io.Writer) error { + if err := _m.WriteUint8(_w, uint8(len(m.Filter))); err != nil { + return err + } + if err := _m.WriteBytes(_w, m.Filter); err != nil { + return err + } + return nil +} + +func (m *MyFiltersResponseSymbolFilters) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint) error { + if actingVersion > m.SbeSchemaVersion() && blockLength > m.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-m.SbeBlockLength())) + } + + if m.FilterInActingVersion(actingVersion) { + var FilterLength uint8 + if err := _m.ReadUint8(_r, &FilterLength); err != nil { + return err + } + if cap(m.Filter) < int(FilterLength) { + m.Filter = make([]uint8, FilterLength) + } + m.Filter = m.Filter[:FilterLength] + if err := _m.ReadBytes(_r, m.Filter); err != nil { + return err + } + } + return nil +} + +func (m *MyFiltersResponseSymbolFilters) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + return nil +} + +func MyFiltersResponseSymbolFiltersInit(m *MyFiltersResponseSymbolFilters) { + return +} + +func (m *MyFiltersResponseAssetFilters) Encode(_m *SbeGoMarshaller, _w io.Writer) error { + if err := _m.WriteUint8(_w, uint8(len(m.Filter))); err != nil { + return err + } + if err := _m.WriteBytes(_w, m.Filter); err != nil { + return err + } + return nil +} + +func (m *MyFiltersResponseAssetFilters) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint) error { + if actingVersion > m.SbeSchemaVersion() && blockLength > m.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-m.SbeBlockLength())) + } + + if m.FilterInActingVersion(actingVersion) { + var FilterLength uint8 + if err := _m.ReadUint8(_r, &FilterLength); err != nil { + return err + } + if cap(m.Filter) < int(FilterLength) { + m.Filter = make([]uint8, FilterLength) + } + m.Filter = m.Filter[:FilterLength] + if err := _m.ReadBytes(_r, m.Filter); err != nil { + return err + } + } + return nil +} + +func (m *MyFiltersResponseAssetFilters) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + return nil +} + +func MyFiltersResponseAssetFiltersInit(m *MyFiltersResponseAssetFilters) { + return +} + +func (*MyFiltersResponse) SbeBlockLength() (blockLength uint16) { + return 0 +} + +func (*MyFiltersResponse) SbeTemplateId() (templateId uint16) { + return 105 +} + +func (*MyFiltersResponse) SbeSchemaId() (schemaId uint16) { + return 3 +} + +func (*MyFiltersResponse) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} + +func (*MyFiltersResponse) SbeSemanticType() (semanticType []byte) { + return []byte("") +} + +func (*MyFiltersResponse) SbeSemanticVersion() (semanticVersion string) { + return "5.2" +} + +func (*MyFiltersResponseExchangeFilters) FilterMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*MyFiltersResponseExchangeFilters) FilterSinceVersion() uint16 { + return 0 +} + +func (m *MyFiltersResponseExchangeFilters) FilterInActingVersion(actingVersion uint16) bool { + return actingVersion >= m.FilterSinceVersion() +} + +func (*MyFiltersResponseExchangeFilters) FilterDeprecated() uint16 { + return 0 +} + +func (MyFiltersResponseExchangeFilters) FilterCharacterEncoding() string { + return "null" +} + +func (MyFiltersResponseExchangeFilters) FilterHeaderLength() uint64 { + return 1 +} + +func (*MyFiltersResponseSymbolFilters) FilterMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*MyFiltersResponseSymbolFilters) FilterSinceVersion() uint16 { + return 0 +} + +func (m *MyFiltersResponseSymbolFilters) FilterInActingVersion(actingVersion uint16) bool { + return actingVersion >= m.FilterSinceVersion() +} + +func (*MyFiltersResponseSymbolFilters) FilterDeprecated() uint16 { + return 0 +} + +func (MyFiltersResponseSymbolFilters) FilterCharacterEncoding() string { + return "null" +} + +func (MyFiltersResponseSymbolFilters) FilterHeaderLength() uint64 { + return 1 +} + +func (*MyFiltersResponseAssetFilters) FilterMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*MyFiltersResponseAssetFilters) FilterSinceVersion() uint16 { + return 0 +} + +func (m *MyFiltersResponseAssetFilters) FilterInActingVersion(actingVersion uint16) bool { + return actingVersion >= m.FilterSinceVersion() +} + +func (*MyFiltersResponseAssetFilters) FilterDeprecated() uint16 { + return 0 +} + +func (MyFiltersResponseAssetFilters) FilterCharacterEncoding() string { + return "null" +} + +func (MyFiltersResponseAssetFilters) FilterHeaderLength() uint64 { + return 1 +} + +func (*MyFiltersResponse) ExchangeFiltersId() uint16 { + return 100 +} + +func (*MyFiltersResponse) ExchangeFiltersSinceVersion() uint16 { + return 0 +} + +func (m *MyFiltersResponse) ExchangeFiltersInActingVersion(actingVersion uint16) bool { + return actingVersion >= m.ExchangeFiltersSinceVersion() +} + +func (*MyFiltersResponse) ExchangeFiltersDeprecated() uint16 { + return 0 +} + +func (*MyFiltersResponseExchangeFilters) SbeBlockLength() (blockLength uint) { + return 0 +} + +func (*MyFiltersResponseExchangeFilters) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} + +func (*MyFiltersResponse) SymbolFiltersId() uint16 { + return 101 +} + +func (*MyFiltersResponse) SymbolFiltersSinceVersion() uint16 { + return 0 +} + +func (m *MyFiltersResponse) SymbolFiltersInActingVersion(actingVersion uint16) bool { + return actingVersion >= m.SymbolFiltersSinceVersion() +} + +func (*MyFiltersResponse) SymbolFiltersDeprecated() uint16 { + return 0 +} + +func (*MyFiltersResponseSymbolFilters) SbeBlockLength() (blockLength uint) { + return 0 +} + +func (*MyFiltersResponseSymbolFilters) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} + +func (*MyFiltersResponse) AssetFiltersId() uint16 { + return 102 +} + +func (*MyFiltersResponse) AssetFiltersSinceVersion() uint16 { + return 0 +} + +func (m *MyFiltersResponse) AssetFiltersInActingVersion(actingVersion uint16) bool { + return actingVersion >= m.AssetFiltersSinceVersion() +} + +func (*MyFiltersResponse) AssetFiltersDeprecated() uint16 { + return 0 +} + +func (*MyFiltersResponseAssetFilters) SbeBlockLength() (blockLength uint) { + return 0 +} + +func (*MyFiltersResponseAssetFilters) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} diff --git a/v2/sbe/spot_3_1/NewOrderAckResponse.go b/v2/sbe/spot_3_1/NewOrderAckResponse.go new file mode 100644 index 00000000..83f0525e --- /dev/null +++ b/v2/sbe/spot_3_1/NewOrderAckResponse.go @@ -0,0 +1,359 @@ +// Generated SBE (Simple Binary Encoding) message codec + +package sbe + +import ( + "errors" + "fmt" + "io" + "io/ioutil" + "math" + "unicode/utf8" +) + +type NewOrderAckResponse struct { + OrderId int64 + OrderListId int64 + TransactTime int64 + Symbol []uint8 + ClientOrderId []uint8 +} + +func (n *NewOrderAckResponse) Encode(_m *SbeGoMarshaller, _w io.Writer, doRangeCheck bool) error { + if doRangeCheck { + if err := n.RangeCheck(n.SbeSchemaVersion(), n.SbeSchemaVersion()); err != nil { + return err + } + } + if err := _m.WriteInt64(_w, n.OrderId); err != nil { + return err + } + if err := _m.WriteInt64(_w, n.OrderListId); err != nil { + return err + } + if err := _m.WriteInt64(_w, n.TransactTime); err != nil { + return err + } + if err := _m.WriteUint8(_w, uint8(len(n.Symbol))); err != nil { + return err + } + if err := _m.WriteBytes(_w, n.Symbol); err != nil { + return err + } + if err := _m.WriteUint8(_w, uint8(len(n.ClientOrderId))); err != nil { + return err + } + if err := _m.WriteBytes(_w, n.ClientOrderId); err != nil { + return err + } + return nil +} + +func (n *NewOrderAckResponse) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint16, doRangeCheck bool) error { + if !n.OrderIdInActingVersion(actingVersion) { + n.OrderId = n.OrderIdNullValue() + } else { + if err := _m.ReadInt64(_r, &n.OrderId); err != nil { + return err + } + } + if !n.OrderListIdInActingVersion(actingVersion) { + n.OrderListId = n.OrderListIdNullValue() + } else { + if err := _m.ReadInt64(_r, &n.OrderListId); err != nil { + return err + } + } + if !n.TransactTimeInActingVersion(actingVersion) { + n.TransactTime = n.TransactTimeNullValue() + } else { + if err := _m.ReadInt64(_r, &n.TransactTime); err != nil { + return err + } + } + if actingVersion > n.SbeSchemaVersion() && blockLength > n.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-n.SbeBlockLength())) + } + + if n.SymbolInActingVersion(actingVersion) { + var SymbolLength uint8 + if err := _m.ReadUint8(_r, &SymbolLength); err != nil { + return err + } + if cap(n.Symbol) < int(SymbolLength) { + n.Symbol = make([]uint8, SymbolLength) + } + n.Symbol = n.Symbol[:SymbolLength] + if err := _m.ReadBytes(_r, n.Symbol); err != nil { + return err + } + } + + if n.ClientOrderIdInActingVersion(actingVersion) { + var ClientOrderIdLength uint8 + if err := _m.ReadUint8(_r, &ClientOrderIdLength); err != nil { + return err + } + if cap(n.ClientOrderId) < int(ClientOrderIdLength) { + n.ClientOrderId = make([]uint8, ClientOrderIdLength) + } + n.ClientOrderId = n.ClientOrderId[:ClientOrderIdLength] + if err := _m.ReadBytes(_r, n.ClientOrderId); err != nil { + return err + } + } + if doRangeCheck { + if err := n.RangeCheck(actingVersion, n.SbeSchemaVersion()); err != nil { + return err + } + } + return nil +} + +func (n *NewOrderAckResponse) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if n.OrderIdInActingVersion(actingVersion) { + if n.OrderId < n.OrderIdMinValue() || n.OrderId > n.OrderIdMaxValue() { + return fmt.Errorf("Range check failed on n.OrderId (%v < %v > %v)", n.OrderIdMinValue(), n.OrderId, n.OrderIdMaxValue()) + } + } + if n.OrderListIdInActingVersion(actingVersion) { + if n.OrderListId != n.OrderListIdNullValue() && (n.OrderListId < n.OrderListIdMinValue() || n.OrderListId > n.OrderListIdMaxValue()) { + return fmt.Errorf("Range check failed on n.OrderListId (%v < %v > %v)", n.OrderListIdMinValue(), n.OrderListId, n.OrderListIdMaxValue()) + } + } + if n.TransactTimeInActingVersion(actingVersion) { + if n.TransactTime < n.TransactTimeMinValue() || n.TransactTime > n.TransactTimeMaxValue() { + return fmt.Errorf("Range check failed on n.TransactTime (%v < %v > %v)", n.TransactTimeMinValue(), n.TransactTime, n.TransactTimeMaxValue()) + } + } + if !utf8.Valid(n.Symbol[:]) { + return errors.New("n.Symbol failed UTF-8 validation") + } + if !utf8.Valid(n.ClientOrderId[:]) { + return errors.New("n.ClientOrderId failed UTF-8 validation") + } + return nil +} + +func NewOrderAckResponseInit(n *NewOrderAckResponse) { + n.OrderListId = math.MinInt64 + return +} + +func (*NewOrderAckResponse) SbeBlockLength() (blockLength uint16) { + return 24 +} + +func (*NewOrderAckResponse) SbeTemplateId() (templateId uint16) { + return 300 +} + +func (*NewOrderAckResponse) SbeSchemaId() (schemaId uint16) { + return 3 +} + +func (*NewOrderAckResponse) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} + +func (*NewOrderAckResponse) SbeSemanticType() (semanticType []byte) { + return []byte("") +} + +func (*NewOrderAckResponse) SbeSemanticVersion() (semanticVersion string) { + return "5.2" +} + +func (*NewOrderAckResponse) OrderIdId() uint16 { + return 1 +} + +func (*NewOrderAckResponse) OrderIdSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderAckResponse) OrderIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.OrderIdSinceVersion() +} + +func (*NewOrderAckResponse) OrderIdDeprecated() uint16 { + return 0 +} + +func (*NewOrderAckResponse) OrderIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderAckResponse) OrderIdMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*NewOrderAckResponse) OrderIdMaxValue() int64 { + return math.MaxInt64 +} + +func (*NewOrderAckResponse) OrderIdNullValue() int64 { + return math.MinInt64 +} + +func (*NewOrderAckResponse) OrderListIdId() uint16 { + return 2 +} + +func (*NewOrderAckResponse) OrderListIdSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderAckResponse) OrderListIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.OrderListIdSinceVersion() +} + +func (*NewOrderAckResponse) OrderListIdDeprecated() uint16 { + return 0 +} + +func (*NewOrderAckResponse) OrderListIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*NewOrderAckResponse) OrderListIdMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*NewOrderAckResponse) OrderListIdMaxValue() int64 { + return math.MaxInt64 +} + +func (*NewOrderAckResponse) OrderListIdNullValue() int64 { + return math.MinInt64 +} + +func (*NewOrderAckResponse) TransactTimeId() uint16 { + return 3 +} + +func (*NewOrderAckResponse) TransactTimeSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderAckResponse) TransactTimeInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.TransactTimeSinceVersion() +} + +func (*NewOrderAckResponse) TransactTimeDeprecated() uint16 { + return 0 +} + +func (*NewOrderAckResponse) TransactTimeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderAckResponse) TransactTimeMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*NewOrderAckResponse) TransactTimeMaxValue() int64 { + return math.MaxInt64 +} + +func (*NewOrderAckResponse) TransactTimeNullValue() int64 { + return math.MinInt64 +} + +func (*NewOrderAckResponse) SymbolMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderAckResponse) SymbolSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderAckResponse) SymbolInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.SymbolSinceVersion() +} + +func (*NewOrderAckResponse) SymbolDeprecated() uint16 { + return 0 +} + +func (NewOrderAckResponse) SymbolCharacterEncoding() string { + return "UTF-8" +} + +func (NewOrderAckResponse) SymbolHeaderLength() uint64 { + return 1 +} + +func (*NewOrderAckResponse) ClientOrderIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderAckResponse) ClientOrderIdSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderAckResponse) ClientOrderIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.ClientOrderIdSinceVersion() +} + +func (*NewOrderAckResponse) ClientOrderIdDeprecated() uint16 { + return 0 +} + +func (NewOrderAckResponse) ClientOrderIdCharacterEncoding() string { + return "UTF-8" +} + +func (NewOrderAckResponse) ClientOrderIdHeaderLength() uint64 { + return 1 +} diff --git a/v2/sbe/spot_3_1/NewOrderFullResponse.go b/v2/sbe/spot_3_1/NewOrderFullResponse.go new file mode 100644 index 00000000..174b64ef --- /dev/null +++ b/v2/sbe/spot_3_1/NewOrderFullResponse.go @@ -0,0 +1,2803 @@ +// Generated SBE (Simple Binary Encoding) message codec + +package sbe + +import ( + "errors" + "fmt" + "io" + "io/ioutil" + "math" + "unicode/utf8" +) + +type NewOrderFullResponse struct { + PriceExponent int8 + QtyExponent int8 + OrderId int64 + OrderListId int64 + TransactTime int64 + Price int64 + OrigQty int64 + ExecutedQty int64 + CummulativeQuoteQty int64 + Status OrderStatusEnum + TimeInForce TimeInForceEnum + OrderType OrderTypeEnum + Side OrderSideEnum + StopPrice int64 + TrailingDelta int64 + TrailingTime int64 + WorkingTime int64 + IcebergQty int64 + StrategyId int64 + StrategyType int32 + OrderCapacity OrderCapacityEnum + WorkingFloor FloorEnum + SelfTradePreventionMode SelfTradePreventionModeEnum + TradeGroupId int64 + PreventedQuantity int64 + UsedSor BoolEnumEnum + OrigQuoteOrderQty int64 + PegPriceType PegPriceTypeEnum + PegOffsetType PegOffsetTypeEnum + PegOffsetValue uint8 + PeggedPrice int64 + Fills []NewOrderFullResponseFills + PreventedMatches []NewOrderFullResponsePreventedMatches + Symbol []uint8 + ClientOrderId []uint8 +} +type NewOrderFullResponseFills struct { + CommissionExponent int8 + MatchType MatchTypeEnum + Price int64 + Qty int64 + Commission int64 + TradeId int64 + AllocId int64 + CommissionAsset []uint8 +} +type NewOrderFullResponsePreventedMatches struct { + PreventedMatchId int64 + MakerOrderId int64 + Price int64 + TakerPreventedQuantity int64 + MakerPreventedQuantity int64 + MakerSymbol []uint8 +} + +func (n *NewOrderFullResponse) Encode(_m *SbeGoMarshaller, _w io.Writer, doRangeCheck bool) error { + if doRangeCheck { + if err := n.RangeCheck(n.SbeSchemaVersion(), n.SbeSchemaVersion()); err != nil { + return err + } + } + if err := _m.WriteInt8(_w, n.PriceExponent); err != nil { + return err + } + if err := _m.WriteInt8(_w, n.QtyExponent); err != nil { + return err + } + if err := _m.WriteInt64(_w, n.OrderId); err != nil { + return err + } + if err := _m.WriteInt64(_w, n.OrderListId); err != nil { + return err + } + if err := _m.WriteInt64(_w, n.TransactTime); err != nil { + return err + } + if err := _m.WriteInt64(_w, n.Price); err != nil { + return err + } + if err := _m.WriteInt64(_w, n.OrigQty); err != nil { + return err + } + if err := _m.WriteInt64(_w, n.ExecutedQty); err != nil { + return err + } + if err := _m.WriteInt64(_w, n.CummulativeQuoteQty); err != nil { + return err + } + if err := n.Status.Encode(_m, _w); err != nil { + return err + } + if err := n.TimeInForce.Encode(_m, _w); err != nil { + return err + } + if err := n.OrderType.Encode(_m, _w); err != nil { + return err + } + if err := n.Side.Encode(_m, _w); err != nil { + return err + } + if err := _m.WriteInt64(_w, n.StopPrice); err != nil { + return err + } + if err := _m.WriteInt64(_w, n.TrailingDelta); err != nil { + return err + } + if err := _m.WriteInt64(_w, n.TrailingTime); err != nil { + return err + } + if err := _m.WriteInt64(_w, n.WorkingTime); err != nil { + return err + } + if err := _m.WriteInt64(_w, n.IcebergQty); err != nil { + return err + } + if err := _m.WriteInt64(_w, n.StrategyId); err != nil { + return err + } + if err := _m.WriteInt32(_w, n.StrategyType); err != nil { + return err + } + if err := n.OrderCapacity.Encode(_m, _w); err != nil { + return err + } + if err := n.WorkingFloor.Encode(_m, _w); err != nil { + return err + } + if err := n.SelfTradePreventionMode.Encode(_m, _w); err != nil { + return err + } + if err := _m.WriteInt64(_w, n.TradeGroupId); err != nil { + return err + } + if err := _m.WriteInt64(_w, n.PreventedQuantity); err != nil { + return err + } + if err := n.UsedSor.Encode(_m, _w); err != nil { + return err + } + if err := _m.WriteInt64(_w, n.OrigQuoteOrderQty); err != nil { + return err + } + if err := n.PegPriceType.Encode(_m, _w); err != nil { + return err + } + if err := n.PegOffsetType.Encode(_m, _w); err != nil { + return err + } + if err := _m.WriteUint8(_w, n.PegOffsetValue); err != nil { + return err + } + if err := _m.WriteInt64(_w, n.PeggedPrice); err != nil { + return err + } + var FillsBlockLength uint16 = 42 + if err := _m.WriteUint16(_w, FillsBlockLength); err != nil { + return err + } + var FillsNumInGroup uint32 = uint32(len(n.Fills)) + if err := _m.WriteUint32(_w, FillsNumInGroup); err != nil { + return err + } + for i := range n.Fills { + if err := n.Fills[i].Encode(_m, _w); err != nil { + return err + } + } + var PreventedMatchesBlockLength uint16 = 40 + if err := _m.WriteUint16(_w, PreventedMatchesBlockLength); err != nil { + return err + } + var PreventedMatchesNumInGroup uint32 = uint32(len(n.PreventedMatches)) + if err := _m.WriteUint32(_w, PreventedMatchesNumInGroup); err != nil { + return err + } + for i := range n.PreventedMatches { + if err := n.PreventedMatches[i].Encode(_m, _w); err != nil { + return err + } + } + if err := _m.WriteUint8(_w, uint8(len(n.Symbol))); err != nil { + return err + } + if err := _m.WriteBytes(_w, n.Symbol); err != nil { + return err + } + if err := _m.WriteUint8(_w, uint8(len(n.ClientOrderId))); err != nil { + return err + } + if err := _m.WriteBytes(_w, n.ClientOrderId); err != nil { + return err + } + return nil +} + +func (n *NewOrderFullResponse) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint16, doRangeCheck bool) error { + if !n.PriceExponentInActingVersion(actingVersion) { + n.PriceExponent = n.PriceExponentNullValue() + } else { + if err := _m.ReadInt8(_r, &n.PriceExponent); err != nil { + return err + } + } + if !n.QtyExponentInActingVersion(actingVersion) { + n.QtyExponent = n.QtyExponentNullValue() + } else { + if err := _m.ReadInt8(_r, &n.QtyExponent); err != nil { + return err + } + } + if !n.OrderIdInActingVersion(actingVersion) { + n.OrderId = n.OrderIdNullValue() + } else { + if err := _m.ReadInt64(_r, &n.OrderId); err != nil { + return err + } + } + if !n.OrderListIdInActingVersion(actingVersion) { + n.OrderListId = n.OrderListIdNullValue() + } else { + if err := _m.ReadInt64(_r, &n.OrderListId); err != nil { + return err + } + } + if !n.TransactTimeInActingVersion(actingVersion) { + n.TransactTime = n.TransactTimeNullValue() + } else { + if err := _m.ReadInt64(_r, &n.TransactTime); err != nil { + return err + } + } + if !n.PriceInActingVersion(actingVersion) { + n.Price = n.PriceNullValue() + } else { + if err := _m.ReadInt64(_r, &n.Price); err != nil { + return err + } + } + if !n.OrigQtyInActingVersion(actingVersion) { + n.OrigQty = n.OrigQtyNullValue() + } else { + if err := _m.ReadInt64(_r, &n.OrigQty); err != nil { + return err + } + } + if !n.ExecutedQtyInActingVersion(actingVersion) { + n.ExecutedQty = n.ExecutedQtyNullValue() + } else { + if err := _m.ReadInt64(_r, &n.ExecutedQty); err != nil { + return err + } + } + if !n.CummulativeQuoteQtyInActingVersion(actingVersion) { + n.CummulativeQuoteQty = n.CummulativeQuoteQtyNullValue() + } else { + if err := _m.ReadInt64(_r, &n.CummulativeQuoteQty); err != nil { + return err + } + } + if n.StatusInActingVersion(actingVersion) { + if err := n.Status.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if n.TimeInForceInActingVersion(actingVersion) { + if err := n.TimeInForce.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if n.OrderTypeInActingVersion(actingVersion) { + if err := n.OrderType.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if n.SideInActingVersion(actingVersion) { + if err := n.Side.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if !n.StopPriceInActingVersion(actingVersion) { + n.StopPrice = n.StopPriceNullValue() + } else { + if err := _m.ReadInt64(_r, &n.StopPrice); err != nil { + return err + } + } + if !n.TrailingDeltaInActingVersion(actingVersion) { + n.TrailingDelta = n.TrailingDeltaNullValue() + } else { + if err := _m.ReadInt64(_r, &n.TrailingDelta); err != nil { + return err + } + } + if !n.TrailingTimeInActingVersion(actingVersion) { + n.TrailingTime = n.TrailingTimeNullValue() + } else { + if err := _m.ReadInt64(_r, &n.TrailingTime); err != nil { + return err + } + } + if !n.WorkingTimeInActingVersion(actingVersion) { + n.WorkingTime = n.WorkingTimeNullValue() + } else { + if err := _m.ReadInt64(_r, &n.WorkingTime); err != nil { + return err + } + } + if !n.IcebergQtyInActingVersion(actingVersion) { + n.IcebergQty = n.IcebergQtyNullValue() + } else { + if err := _m.ReadInt64(_r, &n.IcebergQty); err != nil { + return err + } + } + if !n.StrategyIdInActingVersion(actingVersion) { + n.StrategyId = n.StrategyIdNullValue() + } else { + if err := _m.ReadInt64(_r, &n.StrategyId); err != nil { + return err + } + } + if !n.StrategyTypeInActingVersion(actingVersion) { + n.StrategyType = n.StrategyTypeNullValue() + } else { + if err := _m.ReadInt32(_r, &n.StrategyType); err != nil { + return err + } + } + if n.OrderCapacityInActingVersion(actingVersion) { + if err := n.OrderCapacity.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if n.WorkingFloorInActingVersion(actingVersion) { + if err := n.WorkingFloor.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if n.SelfTradePreventionModeInActingVersion(actingVersion) { + if err := n.SelfTradePreventionMode.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if !n.TradeGroupIdInActingVersion(actingVersion) { + n.TradeGroupId = n.TradeGroupIdNullValue() + } else { + if err := _m.ReadInt64(_r, &n.TradeGroupId); err != nil { + return err + } + } + if !n.PreventedQuantityInActingVersion(actingVersion) { + n.PreventedQuantity = n.PreventedQuantityNullValue() + } else { + if err := _m.ReadInt64(_r, &n.PreventedQuantity); err != nil { + return err + } + } + if n.UsedSorInActingVersion(actingVersion) { + if err := n.UsedSor.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if !n.OrigQuoteOrderQtyInActingVersion(actingVersion) { + n.OrigQuoteOrderQty = n.OrigQuoteOrderQtyNullValue() + } else { + if err := _m.ReadInt64(_r, &n.OrigQuoteOrderQty); err != nil { + return err + } + } + if n.PegPriceTypeInActingVersion(actingVersion) { + if err := n.PegPriceType.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if n.PegOffsetTypeInActingVersion(actingVersion) { + if err := n.PegOffsetType.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if !n.PegOffsetValueInActingVersion(actingVersion) { + n.PegOffsetValue = n.PegOffsetValueNullValue() + } else { + if err := _m.ReadUint8(_r, &n.PegOffsetValue); err != nil { + return err + } + } + if !n.PeggedPriceInActingVersion(actingVersion) { + n.PeggedPrice = n.PeggedPriceNullValue() + } else { + if err := _m.ReadInt64(_r, &n.PeggedPrice); err != nil { + return err + } + } + if actingVersion > n.SbeSchemaVersion() && blockLength > n.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-n.SbeBlockLength())) + } + + if n.FillsInActingVersion(actingVersion) { + var FillsBlockLength uint16 + if err := _m.ReadUint16(_r, &FillsBlockLength); err != nil { + return err + } + var FillsNumInGroup uint32 + if err := _m.ReadUint32(_r, &FillsNumInGroup); err != nil { + return err + } + if cap(n.Fills) < int(FillsNumInGroup) { + n.Fills = make([]NewOrderFullResponseFills, FillsNumInGroup) + } + n.Fills = n.Fills[:FillsNumInGroup] + for i := range n.Fills { + if err := n.Fills[i].Decode(_m, _r, actingVersion, uint(FillsBlockLength)); err != nil { + return err + } + } + } + + if n.PreventedMatchesInActingVersion(actingVersion) { + var PreventedMatchesBlockLength uint16 + if err := _m.ReadUint16(_r, &PreventedMatchesBlockLength); err != nil { + return err + } + var PreventedMatchesNumInGroup uint32 + if err := _m.ReadUint32(_r, &PreventedMatchesNumInGroup); err != nil { + return err + } + if cap(n.PreventedMatches) < int(PreventedMatchesNumInGroup) { + n.PreventedMatches = make([]NewOrderFullResponsePreventedMatches, PreventedMatchesNumInGroup) + } + n.PreventedMatches = n.PreventedMatches[:PreventedMatchesNumInGroup] + for i := range n.PreventedMatches { + if err := n.PreventedMatches[i].Decode(_m, _r, actingVersion, uint(PreventedMatchesBlockLength)); err != nil { + return err + } + } + } + + if n.SymbolInActingVersion(actingVersion) { + var SymbolLength uint8 + if err := _m.ReadUint8(_r, &SymbolLength); err != nil { + return err + } + if cap(n.Symbol) < int(SymbolLength) { + n.Symbol = make([]uint8, SymbolLength) + } + n.Symbol = n.Symbol[:SymbolLength] + if err := _m.ReadBytes(_r, n.Symbol); err != nil { + return err + } + } + + if n.ClientOrderIdInActingVersion(actingVersion) { + var ClientOrderIdLength uint8 + if err := _m.ReadUint8(_r, &ClientOrderIdLength); err != nil { + return err + } + if cap(n.ClientOrderId) < int(ClientOrderIdLength) { + n.ClientOrderId = make([]uint8, ClientOrderIdLength) + } + n.ClientOrderId = n.ClientOrderId[:ClientOrderIdLength] + if err := _m.ReadBytes(_r, n.ClientOrderId); err != nil { + return err + } + } + if doRangeCheck { + if err := n.RangeCheck(actingVersion, n.SbeSchemaVersion()); err != nil { + return err + } + } + return nil +} + +func (n *NewOrderFullResponse) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if n.PriceExponentInActingVersion(actingVersion) { + if n.PriceExponent < n.PriceExponentMinValue() || n.PriceExponent > n.PriceExponentMaxValue() { + return fmt.Errorf("Range check failed on n.PriceExponent (%v < %v > %v)", n.PriceExponentMinValue(), n.PriceExponent, n.PriceExponentMaxValue()) + } + } + if n.QtyExponentInActingVersion(actingVersion) { + if n.QtyExponent < n.QtyExponentMinValue() || n.QtyExponent > n.QtyExponentMaxValue() { + return fmt.Errorf("Range check failed on n.QtyExponent (%v < %v > %v)", n.QtyExponentMinValue(), n.QtyExponent, n.QtyExponentMaxValue()) + } + } + if n.OrderIdInActingVersion(actingVersion) { + if n.OrderId < n.OrderIdMinValue() || n.OrderId > n.OrderIdMaxValue() { + return fmt.Errorf("Range check failed on n.OrderId (%v < %v > %v)", n.OrderIdMinValue(), n.OrderId, n.OrderIdMaxValue()) + } + } + if n.OrderListIdInActingVersion(actingVersion) { + if n.OrderListId != n.OrderListIdNullValue() && (n.OrderListId < n.OrderListIdMinValue() || n.OrderListId > n.OrderListIdMaxValue()) { + return fmt.Errorf("Range check failed on n.OrderListId (%v < %v > %v)", n.OrderListIdMinValue(), n.OrderListId, n.OrderListIdMaxValue()) + } + } + if n.TransactTimeInActingVersion(actingVersion) { + if n.TransactTime < n.TransactTimeMinValue() || n.TransactTime > n.TransactTimeMaxValue() { + return fmt.Errorf("Range check failed on n.TransactTime (%v < %v > %v)", n.TransactTimeMinValue(), n.TransactTime, n.TransactTimeMaxValue()) + } + } + if n.PriceInActingVersion(actingVersion) { + if n.Price < n.PriceMinValue() || n.Price > n.PriceMaxValue() { + return fmt.Errorf("Range check failed on n.Price (%v < %v > %v)", n.PriceMinValue(), n.Price, n.PriceMaxValue()) + } + } + if n.OrigQtyInActingVersion(actingVersion) { + if n.OrigQty < n.OrigQtyMinValue() || n.OrigQty > n.OrigQtyMaxValue() { + return fmt.Errorf("Range check failed on n.OrigQty (%v < %v > %v)", n.OrigQtyMinValue(), n.OrigQty, n.OrigQtyMaxValue()) + } + } + if n.ExecutedQtyInActingVersion(actingVersion) { + if n.ExecutedQty < n.ExecutedQtyMinValue() || n.ExecutedQty > n.ExecutedQtyMaxValue() { + return fmt.Errorf("Range check failed on n.ExecutedQty (%v < %v > %v)", n.ExecutedQtyMinValue(), n.ExecutedQty, n.ExecutedQtyMaxValue()) + } + } + if n.CummulativeQuoteQtyInActingVersion(actingVersion) { + if n.CummulativeQuoteQty < n.CummulativeQuoteQtyMinValue() || n.CummulativeQuoteQty > n.CummulativeQuoteQtyMaxValue() { + return fmt.Errorf("Range check failed on n.CummulativeQuoteQty (%v < %v > %v)", n.CummulativeQuoteQtyMinValue(), n.CummulativeQuoteQty, n.CummulativeQuoteQtyMaxValue()) + } + } + if err := n.Status.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if err := n.TimeInForce.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if err := n.OrderType.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if err := n.Side.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if n.StopPriceInActingVersion(actingVersion) { + if n.StopPrice != n.StopPriceNullValue() && (n.StopPrice < n.StopPriceMinValue() || n.StopPrice > n.StopPriceMaxValue()) { + return fmt.Errorf("Range check failed on n.StopPrice (%v < %v > %v)", n.StopPriceMinValue(), n.StopPrice, n.StopPriceMaxValue()) + } + } + if n.TrailingDeltaInActingVersion(actingVersion) { + if n.TrailingDelta != n.TrailingDeltaNullValue() && (n.TrailingDelta < n.TrailingDeltaMinValue() || n.TrailingDelta > n.TrailingDeltaMaxValue()) { + return fmt.Errorf("Range check failed on n.TrailingDelta (%v < %v > %v)", n.TrailingDeltaMinValue(), n.TrailingDelta, n.TrailingDeltaMaxValue()) + } + } + if n.TrailingTimeInActingVersion(actingVersion) { + if n.TrailingTime != n.TrailingTimeNullValue() && (n.TrailingTime < n.TrailingTimeMinValue() || n.TrailingTime > n.TrailingTimeMaxValue()) { + return fmt.Errorf("Range check failed on n.TrailingTime (%v < %v > %v)", n.TrailingTimeMinValue(), n.TrailingTime, n.TrailingTimeMaxValue()) + } + } + if n.WorkingTimeInActingVersion(actingVersion) { + if n.WorkingTime != n.WorkingTimeNullValue() && (n.WorkingTime < n.WorkingTimeMinValue() || n.WorkingTime > n.WorkingTimeMaxValue()) { + return fmt.Errorf("Range check failed on n.WorkingTime (%v < %v > %v)", n.WorkingTimeMinValue(), n.WorkingTime, n.WorkingTimeMaxValue()) + } + } + if n.IcebergQtyInActingVersion(actingVersion) { + if n.IcebergQty != n.IcebergQtyNullValue() && (n.IcebergQty < n.IcebergQtyMinValue() || n.IcebergQty > n.IcebergQtyMaxValue()) { + return fmt.Errorf("Range check failed on n.IcebergQty (%v < %v > %v)", n.IcebergQtyMinValue(), n.IcebergQty, n.IcebergQtyMaxValue()) + } + } + if n.StrategyIdInActingVersion(actingVersion) { + if n.StrategyId != n.StrategyIdNullValue() && (n.StrategyId < n.StrategyIdMinValue() || n.StrategyId > n.StrategyIdMaxValue()) { + return fmt.Errorf("Range check failed on n.StrategyId (%v < %v > %v)", n.StrategyIdMinValue(), n.StrategyId, n.StrategyIdMaxValue()) + } + } + if n.StrategyTypeInActingVersion(actingVersion) { + if n.StrategyType != n.StrategyTypeNullValue() && (n.StrategyType < n.StrategyTypeMinValue() || n.StrategyType > n.StrategyTypeMaxValue()) { + return fmt.Errorf("Range check failed on n.StrategyType (%v < %v > %v)", n.StrategyTypeMinValue(), n.StrategyType, n.StrategyTypeMaxValue()) + } + } + if err := n.OrderCapacity.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if err := n.WorkingFloor.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if err := n.SelfTradePreventionMode.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if n.TradeGroupIdInActingVersion(actingVersion) { + if n.TradeGroupId != n.TradeGroupIdNullValue() && (n.TradeGroupId < n.TradeGroupIdMinValue() || n.TradeGroupId > n.TradeGroupIdMaxValue()) { + return fmt.Errorf("Range check failed on n.TradeGroupId (%v < %v > %v)", n.TradeGroupIdMinValue(), n.TradeGroupId, n.TradeGroupIdMaxValue()) + } + } + if n.PreventedQuantityInActingVersion(actingVersion) { + if n.PreventedQuantity < n.PreventedQuantityMinValue() || n.PreventedQuantity > n.PreventedQuantityMaxValue() { + return fmt.Errorf("Range check failed on n.PreventedQuantity (%v < %v > %v)", n.PreventedQuantityMinValue(), n.PreventedQuantity, n.PreventedQuantityMaxValue()) + } + } + if err := n.UsedSor.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if n.OrigQuoteOrderQtyInActingVersion(actingVersion) { + if n.OrigQuoteOrderQty < n.OrigQuoteOrderQtyMinValue() || n.OrigQuoteOrderQty > n.OrigQuoteOrderQtyMaxValue() { + return fmt.Errorf("Range check failed on n.OrigQuoteOrderQty (%v < %v > %v)", n.OrigQuoteOrderQtyMinValue(), n.OrigQuoteOrderQty, n.OrigQuoteOrderQtyMaxValue()) + } + } + if err := n.PegPriceType.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if err := n.PegOffsetType.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if n.PegOffsetValueInActingVersion(actingVersion) { + if n.PegOffsetValue != n.PegOffsetValueNullValue() && (n.PegOffsetValue < n.PegOffsetValueMinValue() || n.PegOffsetValue > n.PegOffsetValueMaxValue()) { + return fmt.Errorf("Range check failed on n.PegOffsetValue (%v < %v > %v)", n.PegOffsetValueMinValue(), n.PegOffsetValue, n.PegOffsetValueMaxValue()) + } + } + if n.PeggedPriceInActingVersion(actingVersion) { + if n.PeggedPrice != n.PeggedPriceNullValue() && (n.PeggedPrice < n.PeggedPriceMinValue() || n.PeggedPrice > n.PeggedPriceMaxValue()) { + return fmt.Errorf("Range check failed on n.PeggedPrice (%v < %v > %v)", n.PeggedPriceMinValue(), n.PeggedPrice, n.PeggedPriceMaxValue()) + } + } + for i := range n.Fills { + if err := n.Fills[i].RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + } + for i := range n.PreventedMatches { + if err := n.PreventedMatches[i].RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + } + if !utf8.Valid(n.Symbol[:]) { + return errors.New("n.Symbol failed UTF-8 validation") + } + if !utf8.Valid(n.ClientOrderId[:]) { + return errors.New("n.ClientOrderId failed UTF-8 validation") + } + return nil +} + +func NewOrderFullResponseInit(n *NewOrderFullResponse) { + n.OrderListId = math.MinInt64 + n.StopPrice = math.MinInt64 + n.TrailingDelta = math.MinInt64 + n.TrailingTime = math.MinInt64 + n.WorkingTime = math.MinInt64 + n.IcebergQty = math.MinInt64 + n.StrategyId = math.MinInt64 + n.StrategyType = math.MinInt32 + n.TradeGroupId = math.MinInt64 + n.PegOffsetValue = math.MaxUint8 + n.PeggedPrice = math.MinInt64 + return +} + +func (n *NewOrderFullResponseFills) Encode(_m *SbeGoMarshaller, _w io.Writer) error { + if err := _m.WriteInt8(_w, n.CommissionExponent); err != nil { + return err + } + if err := n.MatchType.Encode(_m, _w); err != nil { + return err + } + if err := _m.WriteInt64(_w, n.Price); err != nil { + return err + } + if err := _m.WriteInt64(_w, n.Qty); err != nil { + return err + } + if err := _m.WriteInt64(_w, n.Commission); err != nil { + return err + } + if err := _m.WriteInt64(_w, n.TradeId); err != nil { + return err + } + if err := _m.WriteInt64(_w, n.AllocId); err != nil { + return err + } + if err := _m.WriteUint8(_w, uint8(len(n.CommissionAsset))); err != nil { + return err + } + if err := _m.WriteBytes(_w, n.CommissionAsset); err != nil { + return err + } + return nil +} + +func (n *NewOrderFullResponseFills) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint) error { + if !n.CommissionExponentInActingVersion(actingVersion) { + n.CommissionExponent = n.CommissionExponentNullValue() + } else { + if err := _m.ReadInt8(_r, &n.CommissionExponent); err != nil { + return err + } + } + if n.MatchTypeInActingVersion(actingVersion) { + if err := n.MatchType.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if !n.PriceInActingVersion(actingVersion) { + n.Price = n.PriceNullValue() + } else { + if err := _m.ReadInt64(_r, &n.Price); err != nil { + return err + } + } + if !n.QtyInActingVersion(actingVersion) { + n.Qty = n.QtyNullValue() + } else { + if err := _m.ReadInt64(_r, &n.Qty); err != nil { + return err + } + } + if !n.CommissionInActingVersion(actingVersion) { + n.Commission = n.CommissionNullValue() + } else { + if err := _m.ReadInt64(_r, &n.Commission); err != nil { + return err + } + } + if !n.TradeIdInActingVersion(actingVersion) { + n.TradeId = n.TradeIdNullValue() + } else { + if err := _m.ReadInt64(_r, &n.TradeId); err != nil { + return err + } + } + if !n.AllocIdInActingVersion(actingVersion) { + n.AllocId = n.AllocIdNullValue() + } else { + if err := _m.ReadInt64(_r, &n.AllocId); err != nil { + return err + } + } + if actingVersion > n.SbeSchemaVersion() && blockLength > n.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-n.SbeBlockLength())) + } + + if n.CommissionAssetInActingVersion(actingVersion) { + var CommissionAssetLength uint8 + if err := _m.ReadUint8(_r, &CommissionAssetLength); err != nil { + return err + } + if cap(n.CommissionAsset) < int(CommissionAssetLength) { + n.CommissionAsset = make([]uint8, CommissionAssetLength) + } + n.CommissionAsset = n.CommissionAsset[:CommissionAssetLength] + if err := _m.ReadBytes(_r, n.CommissionAsset); err != nil { + return err + } + } + return nil +} + +func (n *NewOrderFullResponseFills) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if n.CommissionExponentInActingVersion(actingVersion) { + if n.CommissionExponent < n.CommissionExponentMinValue() || n.CommissionExponent > n.CommissionExponentMaxValue() { + return fmt.Errorf("Range check failed on n.CommissionExponent (%v < %v > %v)", n.CommissionExponentMinValue(), n.CommissionExponent, n.CommissionExponentMaxValue()) + } + } + if err := n.MatchType.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if n.PriceInActingVersion(actingVersion) { + if n.Price < n.PriceMinValue() || n.Price > n.PriceMaxValue() { + return fmt.Errorf("Range check failed on n.Price (%v < %v > %v)", n.PriceMinValue(), n.Price, n.PriceMaxValue()) + } + } + if n.QtyInActingVersion(actingVersion) { + if n.Qty < n.QtyMinValue() || n.Qty > n.QtyMaxValue() { + return fmt.Errorf("Range check failed on n.Qty (%v < %v > %v)", n.QtyMinValue(), n.Qty, n.QtyMaxValue()) + } + } + if n.CommissionInActingVersion(actingVersion) { + if n.Commission < n.CommissionMinValue() || n.Commission > n.CommissionMaxValue() { + return fmt.Errorf("Range check failed on n.Commission (%v < %v > %v)", n.CommissionMinValue(), n.Commission, n.CommissionMaxValue()) + } + } + if n.TradeIdInActingVersion(actingVersion) { + if n.TradeId != n.TradeIdNullValue() && (n.TradeId < n.TradeIdMinValue() || n.TradeId > n.TradeIdMaxValue()) { + return fmt.Errorf("Range check failed on n.TradeId (%v < %v > %v)", n.TradeIdMinValue(), n.TradeId, n.TradeIdMaxValue()) + } + } + if n.AllocIdInActingVersion(actingVersion) { + if n.AllocId != n.AllocIdNullValue() && (n.AllocId < n.AllocIdMinValue() || n.AllocId > n.AllocIdMaxValue()) { + return fmt.Errorf("Range check failed on n.AllocId (%v < %v > %v)", n.AllocIdMinValue(), n.AllocId, n.AllocIdMaxValue()) + } + } + if !utf8.Valid(n.CommissionAsset[:]) { + return errors.New("n.CommissionAsset failed UTF-8 validation") + } + return nil +} + +func NewOrderFullResponseFillsInit(n *NewOrderFullResponseFills) { + n.TradeId = math.MinInt64 + n.AllocId = math.MinInt64 + return +} + +func (n *NewOrderFullResponsePreventedMatches) Encode(_m *SbeGoMarshaller, _w io.Writer) error { + if err := _m.WriteInt64(_w, n.PreventedMatchId); err != nil { + return err + } + if err := _m.WriteInt64(_w, n.MakerOrderId); err != nil { + return err + } + if err := _m.WriteInt64(_w, n.Price); err != nil { + return err + } + if err := _m.WriteInt64(_w, n.TakerPreventedQuantity); err != nil { + return err + } + if err := _m.WriteInt64(_w, n.MakerPreventedQuantity); err != nil { + return err + } + if err := _m.WriteUint8(_w, uint8(len(n.MakerSymbol))); err != nil { + return err + } + if err := _m.WriteBytes(_w, n.MakerSymbol); err != nil { + return err + } + return nil +} + +func (n *NewOrderFullResponsePreventedMatches) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint) error { + if !n.PreventedMatchIdInActingVersion(actingVersion) { + n.PreventedMatchId = n.PreventedMatchIdNullValue() + } else { + if err := _m.ReadInt64(_r, &n.PreventedMatchId); err != nil { + return err + } + } + if !n.MakerOrderIdInActingVersion(actingVersion) { + n.MakerOrderId = n.MakerOrderIdNullValue() + } else { + if err := _m.ReadInt64(_r, &n.MakerOrderId); err != nil { + return err + } + } + if !n.PriceInActingVersion(actingVersion) { + n.Price = n.PriceNullValue() + } else { + if err := _m.ReadInt64(_r, &n.Price); err != nil { + return err + } + } + if !n.TakerPreventedQuantityInActingVersion(actingVersion) { + n.TakerPreventedQuantity = n.TakerPreventedQuantityNullValue() + } else { + if err := _m.ReadInt64(_r, &n.TakerPreventedQuantity); err != nil { + return err + } + } + if !n.MakerPreventedQuantityInActingVersion(actingVersion) { + n.MakerPreventedQuantity = n.MakerPreventedQuantityNullValue() + } else { + if err := _m.ReadInt64(_r, &n.MakerPreventedQuantity); err != nil { + return err + } + } + if actingVersion > n.SbeSchemaVersion() && blockLength > n.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-n.SbeBlockLength())) + } + + if n.MakerSymbolInActingVersion(actingVersion) { + var MakerSymbolLength uint8 + if err := _m.ReadUint8(_r, &MakerSymbolLength); err != nil { + return err + } + if cap(n.MakerSymbol) < int(MakerSymbolLength) { + n.MakerSymbol = make([]uint8, MakerSymbolLength) + } + n.MakerSymbol = n.MakerSymbol[:MakerSymbolLength] + if err := _m.ReadBytes(_r, n.MakerSymbol); err != nil { + return err + } + } + return nil +} + +func (n *NewOrderFullResponsePreventedMatches) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if n.PreventedMatchIdInActingVersion(actingVersion) { + if n.PreventedMatchId < n.PreventedMatchIdMinValue() || n.PreventedMatchId > n.PreventedMatchIdMaxValue() { + return fmt.Errorf("Range check failed on n.PreventedMatchId (%v < %v > %v)", n.PreventedMatchIdMinValue(), n.PreventedMatchId, n.PreventedMatchIdMaxValue()) + } + } + if n.MakerOrderIdInActingVersion(actingVersion) { + if n.MakerOrderId != n.MakerOrderIdNullValue() && (n.MakerOrderId < n.MakerOrderIdMinValue() || n.MakerOrderId > n.MakerOrderIdMaxValue()) { + return fmt.Errorf("Range check failed on n.MakerOrderId (%v < %v > %v)", n.MakerOrderIdMinValue(), n.MakerOrderId, n.MakerOrderIdMaxValue()) + } + } + if n.PriceInActingVersion(actingVersion) { + if n.Price != n.PriceNullValue() && (n.Price < n.PriceMinValue() || n.Price > n.PriceMaxValue()) { + return fmt.Errorf("Range check failed on n.Price (%v < %v > %v)", n.PriceMinValue(), n.Price, n.PriceMaxValue()) + } + } + if n.TakerPreventedQuantityInActingVersion(actingVersion) { + if n.TakerPreventedQuantity != n.TakerPreventedQuantityNullValue() && (n.TakerPreventedQuantity < n.TakerPreventedQuantityMinValue() || n.TakerPreventedQuantity > n.TakerPreventedQuantityMaxValue()) { + return fmt.Errorf("Range check failed on n.TakerPreventedQuantity (%v < %v > %v)", n.TakerPreventedQuantityMinValue(), n.TakerPreventedQuantity, n.TakerPreventedQuantityMaxValue()) + } + } + if n.MakerPreventedQuantityInActingVersion(actingVersion) { + if n.MakerPreventedQuantity != n.MakerPreventedQuantityNullValue() && (n.MakerPreventedQuantity < n.MakerPreventedQuantityMinValue() || n.MakerPreventedQuantity > n.MakerPreventedQuantityMaxValue()) { + return fmt.Errorf("Range check failed on n.MakerPreventedQuantity (%v < %v > %v)", n.MakerPreventedQuantityMinValue(), n.MakerPreventedQuantity, n.MakerPreventedQuantityMaxValue()) + } + } + if !utf8.Valid(n.MakerSymbol[:]) { + return errors.New("n.MakerSymbol failed UTF-8 validation") + } + return nil +} + +func NewOrderFullResponsePreventedMatchesInit(n *NewOrderFullResponsePreventedMatches) { + n.MakerOrderId = math.MinInt64 + n.Price = math.MinInt64 + n.TakerPreventedQuantity = math.MinInt64 + n.MakerPreventedQuantity = math.MinInt64 + return +} + +func (*NewOrderFullResponse) SbeBlockLength() (blockLength uint16) { + return 153 +} + +func (*NewOrderFullResponse) SbeTemplateId() (templateId uint16) { + return 302 +} + +func (*NewOrderFullResponse) SbeSchemaId() (schemaId uint16) { + return 3 +} + +func (*NewOrderFullResponse) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} + +func (*NewOrderFullResponse) SbeSemanticType() (semanticType []byte) { + return []byte("") +} + +func (*NewOrderFullResponse) SbeSemanticVersion() (semanticVersion string) { + return "5.2" +} + +func (*NewOrderFullResponse) PriceExponentId() uint16 { + return 1 +} + +func (*NewOrderFullResponse) PriceExponentSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderFullResponse) PriceExponentInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.PriceExponentSinceVersion() +} + +func (*NewOrderFullResponse) PriceExponentDeprecated() uint16 { + return 0 +} + +func (*NewOrderFullResponse) PriceExponentMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderFullResponse) PriceExponentMinValue() int8 { + return math.MinInt8 + 1 +} + +func (*NewOrderFullResponse) PriceExponentMaxValue() int8 { + return math.MaxInt8 +} + +func (*NewOrderFullResponse) PriceExponentNullValue() int8 { + return math.MinInt8 +} + +func (*NewOrderFullResponse) QtyExponentId() uint16 { + return 2 +} + +func (*NewOrderFullResponse) QtyExponentSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderFullResponse) QtyExponentInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.QtyExponentSinceVersion() +} + +func (*NewOrderFullResponse) QtyExponentDeprecated() uint16 { + return 0 +} + +func (*NewOrderFullResponse) QtyExponentMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderFullResponse) QtyExponentMinValue() int8 { + return math.MinInt8 + 1 +} + +func (*NewOrderFullResponse) QtyExponentMaxValue() int8 { + return math.MaxInt8 +} + +func (*NewOrderFullResponse) QtyExponentNullValue() int8 { + return math.MinInt8 +} + +func (*NewOrderFullResponse) OrderIdId() uint16 { + return 3 +} + +func (*NewOrderFullResponse) OrderIdSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderFullResponse) OrderIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.OrderIdSinceVersion() +} + +func (*NewOrderFullResponse) OrderIdDeprecated() uint16 { + return 0 +} + +func (*NewOrderFullResponse) OrderIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderFullResponse) OrderIdMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*NewOrderFullResponse) OrderIdMaxValue() int64 { + return math.MaxInt64 +} + +func (*NewOrderFullResponse) OrderIdNullValue() int64 { + return math.MinInt64 +} + +func (*NewOrderFullResponse) OrderListIdId() uint16 { + return 4 +} + +func (*NewOrderFullResponse) OrderListIdSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderFullResponse) OrderListIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.OrderListIdSinceVersion() +} + +func (*NewOrderFullResponse) OrderListIdDeprecated() uint16 { + return 0 +} + +func (*NewOrderFullResponse) OrderListIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*NewOrderFullResponse) OrderListIdMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*NewOrderFullResponse) OrderListIdMaxValue() int64 { + return math.MaxInt64 +} + +func (*NewOrderFullResponse) OrderListIdNullValue() int64 { + return math.MinInt64 +} + +func (*NewOrderFullResponse) TransactTimeId() uint16 { + return 5 +} + +func (*NewOrderFullResponse) TransactTimeSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderFullResponse) TransactTimeInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.TransactTimeSinceVersion() +} + +func (*NewOrderFullResponse) TransactTimeDeprecated() uint16 { + return 0 +} + +func (*NewOrderFullResponse) TransactTimeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderFullResponse) TransactTimeMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*NewOrderFullResponse) TransactTimeMaxValue() int64 { + return math.MaxInt64 +} + +func (*NewOrderFullResponse) TransactTimeNullValue() int64 { + return math.MinInt64 +} + +func (*NewOrderFullResponse) PriceId() uint16 { + return 6 +} + +func (*NewOrderFullResponse) PriceSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderFullResponse) PriceInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.PriceSinceVersion() +} + +func (*NewOrderFullResponse) PriceDeprecated() uint16 { + return 0 +} + +func (*NewOrderFullResponse) PriceMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderFullResponse) PriceMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*NewOrderFullResponse) PriceMaxValue() int64 { + return math.MaxInt64 +} + +func (*NewOrderFullResponse) PriceNullValue() int64 { + return math.MinInt64 +} + +func (*NewOrderFullResponse) OrigQtyId() uint16 { + return 7 +} + +func (*NewOrderFullResponse) OrigQtySinceVersion() uint16 { + return 0 +} + +func (n *NewOrderFullResponse) OrigQtyInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.OrigQtySinceVersion() +} + +func (*NewOrderFullResponse) OrigQtyDeprecated() uint16 { + return 0 +} + +func (*NewOrderFullResponse) OrigQtyMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderFullResponse) OrigQtyMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*NewOrderFullResponse) OrigQtyMaxValue() int64 { + return math.MaxInt64 +} + +func (*NewOrderFullResponse) OrigQtyNullValue() int64 { + return math.MinInt64 +} + +func (*NewOrderFullResponse) ExecutedQtyId() uint16 { + return 8 +} + +func (*NewOrderFullResponse) ExecutedQtySinceVersion() uint16 { + return 0 +} + +func (n *NewOrderFullResponse) ExecutedQtyInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.ExecutedQtySinceVersion() +} + +func (*NewOrderFullResponse) ExecutedQtyDeprecated() uint16 { + return 0 +} + +func (*NewOrderFullResponse) ExecutedQtyMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderFullResponse) ExecutedQtyMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*NewOrderFullResponse) ExecutedQtyMaxValue() int64 { + return math.MaxInt64 +} + +func (*NewOrderFullResponse) ExecutedQtyNullValue() int64 { + return math.MinInt64 +} + +func (*NewOrderFullResponse) CummulativeQuoteQtyId() uint16 { + return 9 +} + +func (*NewOrderFullResponse) CummulativeQuoteQtySinceVersion() uint16 { + return 0 +} + +func (n *NewOrderFullResponse) CummulativeQuoteQtyInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.CummulativeQuoteQtySinceVersion() +} + +func (*NewOrderFullResponse) CummulativeQuoteQtyDeprecated() uint16 { + return 0 +} + +func (*NewOrderFullResponse) CummulativeQuoteQtyMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderFullResponse) CummulativeQuoteQtyMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*NewOrderFullResponse) CummulativeQuoteQtyMaxValue() int64 { + return math.MaxInt64 +} + +func (*NewOrderFullResponse) CummulativeQuoteQtyNullValue() int64 { + return math.MinInt64 +} + +func (*NewOrderFullResponse) StatusId() uint16 { + return 10 +} + +func (*NewOrderFullResponse) StatusSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderFullResponse) StatusInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.StatusSinceVersion() +} + +func (*NewOrderFullResponse) StatusDeprecated() uint16 { + return 0 +} + +func (*NewOrderFullResponse) StatusMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderFullResponse) TimeInForceId() uint16 { + return 11 +} + +func (*NewOrderFullResponse) TimeInForceSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderFullResponse) TimeInForceInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.TimeInForceSinceVersion() +} + +func (*NewOrderFullResponse) TimeInForceDeprecated() uint16 { + return 0 +} + +func (*NewOrderFullResponse) TimeInForceMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderFullResponse) OrderTypeId() uint16 { + return 12 +} + +func (*NewOrderFullResponse) OrderTypeSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderFullResponse) OrderTypeInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.OrderTypeSinceVersion() +} + +func (*NewOrderFullResponse) OrderTypeDeprecated() uint16 { + return 0 +} + +func (*NewOrderFullResponse) OrderTypeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderFullResponse) SideId() uint16 { + return 13 +} + +func (*NewOrderFullResponse) SideSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderFullResponse) SideInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.SideSinceVersion() +} + +func (*NewOrderFullResponse) SideDeprecated() uint16 { + return 0 +} + +func (*NewOrderFullResponse) SideMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderFullResponse) StopPriceId() uint16 { + return 14 +} + +func (*NewOrderFullResponse) StopPriceSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderFullResponse) StopPriceInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.StopPriceSinceVersion() +} + +func (*NewOrderFullResponse) StopPriceDeprecated() uint16 { + return 0 +} + +func (*NewOrderFullResponse) StopPriceMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*NewOrderFullResponse) StopPriceMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*NewOrderFullResponse) StopPriceMaxValue() int64 { + return math.MaxInt64 +} + +func (*NewOrderFullResponse) StopPriceNullValue() int64 { + return math.MinInt64 +} + +func (*NewOrderFullResponse) TrailingDeltaId() uint16 { + return 15 +} + +func (*NewOrderFullResponse) TrailingDeltaSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderFullResponse) TrailingDeltaInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.TrailingDeltaSinceVersion() +} + +func (*NewOrderFullResponse) TrailingDeltaDeprecated() uint16 { + return 0 +} + +func (*NewOrderFullResponse) TrailingDeltaMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*NewOrderFullResponse) TrailingDeltaMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*NewOrderFullResponse) TrailingDeltaMaxValue() int64 { + return math.MaxInt64 +} + +func (*NewOrderFullResponse) TrailingDeltaNullValue() int64 { + return math.MinInt64 +} + +func (*NewOrderFullResponse) TrailingTimeId() uint16 { + return 16 +} + +func (*NewOrderFullResponse) TrailingTimeSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderFullResponse) TrailingTimeInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.TrailingTimeSinceVersion() +} + +func (*NewOrderFullResponse) TrailingTimeDeprecated() uint16 { + return 0 +} + +func (*NewOrderFullResponse) TrailingTimeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*NewOrderFullResponse) TrailingTimeMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*NewOrderFullResponse) TrailingTimeMaxValue() int64 { + return math.MaxInt64 +} + +func (*NewOrderFullResponse) TrailingTimeNullValue() int64 { + return math.MinInt64 +} + +func (*NewOrderFullResponse) WorkingTimeId() uint16 { + return 17 +} + +func (*NewOrderFullResponse) WorkingTimeSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderFullResponse) WorkingTimeInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.WorkingTimeSinceVersion() +} + +func (*NewOrderFullResponse) WorkingTimeDeprecated() uint16 { + return 0 +} + +func (*NewOrderFullResponse) WorkingTimeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*NewOrderFullResponse) WorkingTimeMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*NewOrderFullResponse) WorkingTimeMaxValue() int64 { + return math.MaxInt64 +} + +func (*NewOrderFullResponse) WorkingTimeNullValue() int64 { + return math.MinInt64 +} + +func (*NewOrderFullResponse) IcebergQtyId() uint16 { + return 18 +} + +func (*NewOrderFullResponse) IcebergQtySinceVersion() uint16 { + return 0 +} + +func (n *NewOrderFullResponse) IcebergQtyInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.IcebergQtySinceVersion() +} + +func (*NewOrderFullResponse) IcebergQtyDeprecated() uint16 { + return 0 +} + +func (*NewOrderFullResponse) IcebergQtyMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*NewOrderFullResponse) IcebergQtyMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*NewOrderFullResponse) IcebergQtyMaxValue() int64 { + return math.MaxInt64 +} + +func (*NewOrderFullResponse) IcebergQtyNullValue() int64 { + return math.MinInt64 +} + +func (*NewOrderFullResponse) StrategyIdId() uint16 { + return 19 +} + +func (*NewOrderFullResponse) StrategyIdSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderFullResponse) StrategyIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.StrategyIdSinceVersion() +} + +func (*NewOrderFullResponse) StrategyIdDeprecated() uint16 { + return 0 +} + +func (*NewOrderFullResponse) StrategyIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*NewOrderFullResponse) StrategyIdMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*NewOrderFullResponse) StrategyIdMaxValue() int64 { + return math.MaxInt64 +} + +func (*NewOrderFullResponse) StrategyIdNullValue() int64 { + return math.MinInt64 +} + +func (*NewOrderFullResponse) StrategyTypeId() uint16 { + return 20 +} + +func (*NewOrderFullResponse) StrategyTypeSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderFullResponse) StrategyTypeInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.StrategyTypeSinceVersion() +} + +func (*NewOrderFullResponse) StrategyTypeDeprecated() uint16 { + return 0 +} + +func (*NewOrderFullResponse) StrategyTypeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*NewOrderFullResponse) StrategyTypeMinValue() int32 { + return math.MinInt32 + 1 +} + +func (*NewOrderFullResponse) StrategyTypeMaxValue() int32 { + return math.MaxInt32 +} + +func (*NewOrderFullResponse) StrategyTypeNullValue() int32 { + return math.MinInt32 +} + +func (*NewOrderFullResponse) OrderCapacityId() uint16 { + return 21 +} + +func (*NewOrderFullResponse) OrderCapacitySinceVersion() uint16 { + return 0 +} + +func (n *NewOrderFullResponse) OrderCapacityInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.OrderCapacitySinceVersion() +} + +func (*NewOrderFullResponse) OrderCapacityDeprecated() uint16 { + return 0 +} + +func (*NewOrderFullResponse) OrderCapacityMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderFullResponse) WorkingFloorId() uint16 { + return 22 +} + +func (*NewOrderFullResponse) WorkingFloorSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderFullResponse) WorkingFloorInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.WorkingFloorSinceVersion() +} + +func (*NewOrderFullResponse) WorkingFloorDeprecated() uint16 { + return 0 +} + +func (*NewOrderFullResponse) WorkingFloorMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderFullResponse) SelfTradePreventionModeId() uint16 { + return 23 +} + +func (*NewOrderFullResponse) SelfTradePreventionModeSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderFullResponse) SelfTradePreventionModeInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.SelfTradePreventionModeSinceVersion() +} + +func (*NewOrderFullResponse) SelfTradePreventionModeDeprecated() uint16 { + return 0 +} + +func (*NewOrderFullResponse) SelfTradePreventionModeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderFullResponse) TradeGroupIdId() uint16 { + return 24 +} + +func (*NewOrderFullResponse) TradeGroupIdSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderFullResponse) TradeGroupIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.TradeGroupIdSinceVersion() +} + +func (*NewOrderFullResponse) TradeGroupIdDeprecated() uint16 { + return 0 +} + +func (*NewOrderFullResponse) TradeGroupIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*NewOrderFullResponse) TradeGroupIdMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*NewOrderFullResponse) TradeGroupIdMaxValue() int64 { + return math.MaxInt64 +} + +func (*NewOrderFullResponse) TradeGroupIdNullValue() int64 { + return math.MinInt64 +} + +func (*NewOrderFullResponse) PreventedQuantityId() uint16 { + return 25 +} + +func (*NewOrderFullResponse) PreventedQuantitySinceVersion() uint16 { + return 0 +} + +func (n *NewOrderFullResponse) PreventedQuantityInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.PreventedQuantitySinceVersion() +} + +func (*NewOrderFullResponse) PreventedQuantityDeprecated() uint16 { + return 0 +} + +func (*NewOrderFullResponse) PreventedQuantityMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderFullResponse) PreventedQuantityMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*NewOrderFullResponse) PreventedQuantityMaxValue() int64 { + return math.MaxInt64 +} + +func (*NewOrderFullResponse) PreventedQuantityNullValue() int64 { + return math.MinInt64 +} + +func (*NewOrderFullResponse) UsedSorId() uint16 { + return 26 +} + +func (*NewOrderFullResponse) UsedSorSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderFullResponse) UsedSorInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.UsedSorSinceVersion() +} + +func (*NewOrderFullResponse) UsedSorDeprecated() uint16 { + return 0 +} + +func (*NewOrderFullResponse) UsedSorMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderFullResponse) OrigQuoteOrderQtyId() uint16 { + return 27 +} + +func (*NewOrderFullResponse) OrigQuoteOrderQtySinceVersion() uint16 { + return 0 +} + +func (n *NewOrderFullResponse) OrigQuoteOrderQtyInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.OrigQuoteOrderQtySinceVersion() +} + +func (*NewOrderFullResponse) OrigQuoteOrderQtyDeprecated() uint16 { + return 0 +} + +func (*NewOrderFullResponse) OrigQuoteOrderQtyMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderFullResponse) OrigQuoteOrderQtyMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*NewOrderFullResponse) OrigQuoteOrderQtyMaxValue() int64 { + return math.MaxInt64 +} + +func (*NewOrderFullResponse) OrigQuoteOrderQtyNullValue() int64 { + return math.MinInt64 +} + +func (*NewOrderFullResponse) PegPriceTypeId() uint16 { + return 28 +} + +func (*NewOrderFullResponse) PegPriceTypeSinceVersion() uint16 { + return 1 +} + +func (n *NewOrderFullResponse) PegPriceTypeInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.PegPriceTypeSinceVersion() +} + +func (*NewOrderFullResponse) PegPriceTypeDeprecated() uint16 { + return 0 +} + +func (*NewOrderFullResponse) PegPriceTypeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*NewOrderFullResponse) PegOffsetTypeId() uint16 { + return 29 +} + +func (*NewOrderFullResponse) PegOffsetTypeSinceVersion() uint16 { + return 1 +} + +func (n *NewOrderFullResponse) PegOffsetTypeInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.PegOffsetTypeSinceVersion() +} + +func (*NewOrderFullResponse) PegOffsetTypeDeprecated() uint16 { + return 0 +} + +func (*NewOrderFullResponse) PegOffsetTypeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*NewOrderFullResponse) PegOffsetValueId() uint16 { + return 30 +} + +func (*NewOrderFullResponse) PegOffsetValueSinceVersion() uint16 { + return 1 +} + +func (n *NewOrderFullResponse) PegOffsetValueInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.PegOffsetValueSinceVersion() +} + +func (*NewOrderFullResponse) PegOffsetValueDeprecated() uint16 { + return 0 +} + +func (*NewOrderFullResponse) PegOffsetValueMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*NewOrderFullResponse) PegOffsetValueMinValue() uint8 { + return 0 +} + +func (*NewOrderFullResponse) PegOffsetValueMaxValue() uint8 { + return math.MaxUint8 - 1 +} + +func (*NewOrderFullResponse) PegOffsetValueNullValue() uint8 { + return math.MaxUint8 +} + +func (*NewOrderFullResponse) PeggedPriceId() uint16 { + return 31 +} + +func (*NewOrderFullResponse) PeggedPriceSinceVersion() uint16 { + return 1 +} + +func (n *NewOrderFullResponse) PeggedPriceInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.PeggedPriceSinceVersion() +} + +func (*NewOrderFullResponse) PeggedPriceDeprecated() uint16 { + return 0 +} + +func (*NewOrderFullResponse) PeggedPriceMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*NewOrderFullResponse) PeggedPriceMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*NewOrderFullResponse) PeggedPriceMaxValue() int64 { + return math.MaxInt64 +} + +func (*NewOrderFullResponse) PeggedPriceNullValue() int64 { + return math.MinInt64 +} + +func (*NewOrderFullResponseFills) CommissionExponentId() uint16 { + return 1 +} + +func (*NewOrderFullResponseFills) CommissionExponentSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderFullResponseFills) CommissionExponentInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.CommissionExponentSinceVersion() +} + +func (*NewOrderFullResponseFills) CommissionExponentDeprecated() uint16 { + return 0 +} + +func (*NewOrderFullResponseFills) CommissionExponentMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderFullResponseFills) CommissionExponentMinValue() int8 { + return math.MinInt8 + 1 +} + +func (*NewOrderFullResponseFills) CommissionExponentMaxValue() int8 { + return math.MaxInt8 +} + +func (*NewOrderFullResponseFills) CommissionExponentNullValue() int8 { + return math.MinInt8 +} + +func (*NewOrderFullResponseFills) MatchTypeId() uint16 { + return 2 +} + +func (*NewOrderFullResponseFills) MatchTypeSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderFullResponseFills) MatchTypeInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.MatchTypeSinceVersion() +} + +func (*NewOrderFullResponseFills) MatchTypeDeprecated() uint16 { + return 0 +} + +func (*NewOrderFullResponseFills) MatchTypeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderFullResponseFills) PriceId() uint16 { + return 3 +} + +func (*NewOrderFullResponseFills) PriceSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderFullResponseFills) PriceInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.PriceSinceVersion() +} + +func (*NewOrderFullResponseFills) PriceDeprecated() uint16 { + return 0 +} + +func (*NewOrderFullResponseFills) PriceMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderFullResponseFills) PriceMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*NewOrderFullResponseFills) PriceMaxValue() int64 { + return math.MaxInt64 +} + +func (*NewOrderFullResponseFills) PriceNullValue() int64 { + return math.MinInt64 +} + +func (*NewOrderFullResponseFills) QtyId() uint16 { + return 4 +} + +func (*NewOrderFullResponseFills) QtySinceVersion() uint16 { + return 0 +} + +func (n *NewOrderFullResponseFills) QtyInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.QtySinceVersion() +} + +func (*NewOrderFullResponseFills) QtyDeprecated() uint16 { + return 0 +} + +func (*NewOrderFullResponseFills) QtyMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderFullResponseFills) QtyMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*NewOrderFullResponseFills) QtyMaxValue() int64 { + return math.MaxInt64 +} + +func (*NewOrderFullResponseFills) QtyNullValue() int64 { + return math.MinInt64 +} + +func (*NewOrderFullResponseFills) CommissionId() uint16 { + return 5 +} + +func (*NewOrderFullResponseFills) CommissionSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderFullResponseFills) CommissionInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.CommissionSinceVersion() +} + +func (*NewOrderFullResponseFills) CommissionDeprecated() uint16 { + return 0 +} + +func (*NewOrderFullResponseFills) CommissionMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderFullResponseFills) CommissionMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*NewOrderFullResponseFills) CommissionMaxValue() int64 { + return math.MaxInt64 +} + +func (*NewOrderFullResponseFills) CommissionNullValue() int64 { + return math.MinInt64 +} + +func (*NewOrderFullResponseFills) TradeIdId() uint16 { + return 6 +} + +func (*NewOrderFullResponseFills) TradeIdSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderFullResponseFills) TradeIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.TradeIdSinceVersion() +} + +func (*NewOrderFullResponseFills) TradeIdDeprecated() uint16 { + return 0 +} + +func (*NewOrderFullResponseFills) TradeIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*NewOrderFullResponseFills) TradeIdMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*NewOrderFullResponseFills) TradeIdMaxValue() int64 { + return math.MaxInt64 +} + +func (*NewOrderFullResponseFills) TradeIdNullValue() int64 { + return math.MinInt64 +} + +func (*NewOrderFullResponseFills) AllocIdId() uint16 { + return 7 +} + +func (*NewOrderFullResponseFills) AllocIdSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderFullResponseFills) AllocIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.AllocIdSinceVersion() +} + +func (*NewOrderFullResponseFills) AllocIdDeprecated() uint16 { + return 0 +} + +func (*NewOrderFullResponseFills) AllocIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*NewOrderFullResponseFills) AllocIdMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*NewOrderFullResponseFills) AllocIdMaxValue() int64 { + return math.MaxInt64 +} + +func (*NewOrderFullResponseFills) AllocIdNullValue() int64 { + return math.MinInt64 +} + +func (*NewOrderFullResponseFills) CommissionAssetMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderFullResponseFills) CommissionAssetSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderFullResponseFills) CommissionAssetInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.CommissionAssetSinceVersion() +} + +func (*NewOrderFullResponseFills) CommissionAssetDeprecated() uint16 { + return 0 +} + +func (NewOrderFullResponseFills) CommissionAssetCharacterEncoding() string { + return "UTF-8" +} + +func (NewOrderFullResponseFills) CommissionAssetHeaderLength() uint64 { + return 1 +} + +func (*NewOrderFullResponsePreventedMatches) PreventedMatchIdId() uint16 { + return 1 +} + +func (*NewOrderFullResponsePreventedMatches) PreventedMatchIdSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderFullResponsePreventedMatches) PreventedMatchIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.PreventedMatchIdSinceVersion() +} + +func (*NewOrderFullResponsePreventedMatches) PreventedMatchIdDeprecated() uint16 { + return 0 +} + +func (*NewOrderFullResponsePreventedMatches) PreventedMatchIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderFullResponsePreventedMatches) PreventedMatchIdMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*NewOrderFullResponsePreventedMatches) PreventedMatchIdMaxValue() int64 { + return math.MaxInt64 +} + +func (*NewOrderFullResponsePreventedMatches) PreventedMatchIdNullValue() int64 { + return math.MinInt64 +} + +func (*NewOrderFullResponsePreventedMatches) MakerOrderIdId() uint16 { + return 2 +} + +func (*NewOrderFullResponsePreventedMatches) MakerOrderIdSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderFullResponsePreventedMatches) MakerOrderIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.MakerOrderIdSinceVersion() +} + +func (*NewOrderFullResponsePreventedMatches) MakerOrderIdDeprecated() uint16 { + return 0 +} + +func (*NewOrderFullResponsePreventedMatches) MakerOrderIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*NewOrderFullResponsePreventedMatches) MakerOrderIdMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*NewOrderFullResponsePreventedMatches) MakerOrderIdMaxValue() int64 { + return math.MaxInt64 +} + +func (*NewOrderFullResponsePreventedMatches) MakerOrderIdNullValue() int64 { + return math.MinInt64 +} + +func (*NewOrderFullResponsePreventedMatches) PriceId() uint16 { + return 3 +} + +func (*NewOrderFullResponsePreventedMatches) PriceSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderFullResponsePreventedMatches) PriceInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.PriceSinceVersion() +} + +func (*NewOrderFullResponsePreventedMatches) PriceDeprecated() uint16 { + return 0 +} + +func (*NewOrderFullResponsePreventedMatches) PriceMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*NewOrderFullResponsePreventedMatches) PriceMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*NewOrderFullResponsePreventedMatches) PriceMaxValue() int64 { + return math.MaxInt64 +} + +func (*NewOrderFullResponsePreventedMatches) PriceNullValue() int64 { + return math.MinInt64 +} + +func (*NewOrderFullResponsePreventedMatches) TakerPreventedQuantityId() uint16 { + return 4 +} + +func (*NewOrderFullResponsePreventedMatches) TakerPreventedQuantitySinceVersion() uint16 { + return 0 +} + +func (n *NewOrderFullResponsePreventedMatches) TakerPreventedQuantityInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.TakerPreventedQuantitySinceVersion() +} + +func (*NewOrderFullResponsePreventedMatches) TakerPreventedQuantityDeprecated() uint16 { + return 0 +} + +func (*NewOrderFullResponsePreventedMatches) TakerPreventedQuantityMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*NewOrderFullResponsePreventedMatches) TakerPreventedQuantityMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*NewOrderFullResponsePreventedMatches) TakerPreventedQuantityMaxValue() int64 { + return math.MaxInt64 +} + +func (*NewOrderFullResponsePreventedMatches) TakerPreventedQuantityNullValue() int64 { + return math.MinInt64 +} + +func (*NewOrderFullResponsePreventedMatches) MakerPreventedQuantityId() uint16 { + return 5 +} + +func (*NewOrderFullResponsePreventedMatches) MakerPreventedQuantitySinceVersion() uint16 { + return 0 +} + +func (n *NewOrderFullResponsePreventedMatches) MakerPreventedQuantityInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.MakerPreventedQuantitySinceVersion() +} + +func (*NewOrderFullResponsePreventedMatches) MakerPreventedQuantityDeprecated() uint16 { + return 0 +} + +func (*NewOrderFullResponsePreventedMatches) MakerPreventedQuantityMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*NewOrderFullResponsePreventedMatches) MakerPreventedQuantityMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*NewOrderFullResponsePreventedMatches) MakerPreventedQuantityMaxValue() int64 { + return math.MaxInt64 +} + +func (*NewOrderFullResponsePreventedMatches) MakerPreventedQuantityNullValue() int64 { + return math.MinInt64 +} + +func (*NewOrderFullResponsePreventedMatches) MakerSymbolMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderFullResponsePreventedMatches) MakerSymbolSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderFullResponsePreventedMatches) MakerSymbolInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.MakerSymbolSinceVersion() +} + +func (*NewOrderFullResponsePreventedMatches) MakerSymbolDeprecated() uint16 { + return 0 +} + +func (NewOrderFullResponsePreventedMatches) MakerSymbolCharacterEncoding() string { + return "UTF-8" +} + +func (NewOrderFullResponsePreventedMatches) MakerSymbolHeaderLength() uint64 { + return 1 +} + +func (*NewOrderFullResponse) FillsId() uint16 { + return 100 +} + +func (*NewOrderFullResponse) FillsSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderFullResponse) FillsInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.FillsSinceVersion() +} + +func (*NewOrderFullResponse) FillsDeprecated() uint16 { + return 0 +} + +func (*NewOrderFullResponseFills) SbeBlockLength() (blockLength uint) { + return 42 +} + +func (*NewOrderFullResponseFills) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} + +func (*NewOrderFullResponse) PreventedMatchesId() uint16 { + return 101 +} + +func (*NewOrderFullResponse) PreventedMatchesSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderFullResponse) PreventedMatchesInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.PreventedMatchesSinceVersion() +} + +func (*NewOrderFullResponse) PreventedMatchesDeprecated() uint16 { + return 0 +} + +func (*NewOrderFullResponsePreventedMatches) SbeBlockLength() (blockLength uint) { + return 40 +} + +func (*NewOrderFullResponsePreventedMatches) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} + +func (*NewOrderFullResponse) SymbolMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderFullResponse) SymbolSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderFullResponse) SymbolInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.SymbolSinceVersion() +} + +func (*NewOrderFullResponse) SymbolDeprecated() uint16 { + return 0 +} + +func (NewOrderFullResponse) SymbolCharacterEncoding() string { + return "UTF-8" +} + +func (NewOrderFullResponse) SymbolHeaderLength() uint64 { + return 1 +} + +func (*NewOrderFullResponse) ClientOrderIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderFullResponse) ClientOrderIdSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderFullResponse) ClientOrderIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.ClientOrderIdSinceVersion() +} + +func (*NewOrderFullResponse) ClientOrderIdDeprecated() uint16 { + return 0 +} + +func (NewOrderFullResponse) ClientOrderIdCharacterEncoding() string { + return "UTF-8" +} + +func (NewOrderFullResponse) ClientOrderIdHeaderLength() uint64 { + return 1 +} diff --git a/v2/sbe/spot_3_1/NewOrderListAckResponse.go b/v2/sbe/spot_3_1/NewOrderListAckResponse.go new file mode 100644 index 00000000..382e605d --- /dev/null +++ b/v2/sbe/spot_3_1/NewOrderListAckResponse.go @@ -0,0 +1,1059 @@ +// Generated SBE (Simple Binary Encoding) message codec + +package sbe + +import ( + "errors" + "fmt" + "io" + "io/ioutil" + "math" + "unicode/utf8" +) + +type NewOrderListAckResponse struct { + OrderListId int64 + ContingencyType ContingencyTypeEnum + ListStatusType ListStatusTypeEnum + ListOrderStatus ListOrderStatusEnum + TransactionTime int64 + Orders []NewOrderListAckResponseOrders + OrderReports []NewOrderListAckResponseOrderReports + ListClientOrderId []uint8 + Symbol []uint8 +} +type NewOrderListAckResponseOrders struct { + OrderId int64 + Symbol []uint8 + ClientOrderId []uint8 +} +type NewOrderListAckResponseOrderReports struct { + OrderId int64 + OrderListId int64 + TransactTime int64 + Symbol []uint8 + ClientOrderId []uint8 +} + +func (n *NewOrderListAckResponse) Encode(_m *SbeGoMarshaller, _w io.Writer, doRangeCheck bool) error { + if doRangeCheck { + if err := n.RangeCheck(n.SbeSchemaVersion(), n.SbeSchemaVersion()); err != nil { + return err + } + } + if err := _m.WriteInt64(_w, n.OrderListId); err != nil { + return err + } + if err := n.ContingencyType.Encode(_m, _w); err != nil { + return err + } + if err := n.ListStatusType.Encode(_m, _w); err != nil { + return err + } + if err := n.ListOrderStatus.Encode(_m, _w); err != nil { + return err + } + if err := _m.WriteInt64(_w, n.TransactionTime); err != nil { + return err + } + var OrdersBlockLength uint16 = 8 + if err := _m.WriteUint16(_w, OrdersBlockLength); err != nil { + return err + } + var OrdersNumInGroup uint16 = uint16(len(n.Orders)) + if err := _m.WriteUint16(_w, OrdersNumInGroup); err != nil { + return err + } + for i := range n.Orders { + if err := n.Orders[i].Encode(_m, _w); err != nil { + return err + } + } + var OrderReportsBlockLength uint16 = 24 + if err := _m.WriteUint16(_w, OrderReportsBlockLength); err != nil { + return err + } + var OrderReportsNumInGroup uint16 = uint16(len(n.OrderReports)) + if err := _m.WriteUint16(_w, OrderReportsNumInGroup); err != nil { + return err + } + for i := range n.OrderReports { + if err := n.OrderReports[i].Encode(_m, _w); err != nil { + return err + } + } + if err := _m.WriteUint8(_w, uint8(len(n.ListClientOrderId))); err != nil { + return err + } + if err := _m.WriteBytes(_w, n.ListClientOrderId); err != nil { + return err + } + if err := _m.WriteUint8(_w, uint8(len(n.Symbol))); err != nil { + return err + } + if err := _m.WriteBytes(_w, n.Symbol); err != nil { + return err + } + return nil +} + +func (n *NewOrderListAckResponse) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint16, doRangeCheck bool) error { + if !n.OrderListIdInActingVersion(actingVersion) { + n.OrderListId = n.OrderListIdNullValue() + } else { + if err := _m.ReadInt64(_r, &n.OrderListId); err != nil { + return err + } + } + if n.ContingencyTypeInActingVersion(actingVersion) { + if err := n.ContingencyType.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if n.ListStatusTypeInActingVersion(actingVersion) { + if err := n.ListStatusType.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if n.ListOrderStatusInActingVersion(actingVersion) { + if err := n.ListOrderStatus.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if !n.TransactionTimeInActingVersion(actingVersion) { + n.TransactionTime = n.TransactionTimeNullValue() + } else { + if err := _m.ReadInt64(_r, &n.TransactionTime); err != nil { + return err + } + } + if actingVersion > n.SbeSchemaVersion() && blockLength > n.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-n.SbeBlockLength())) + } + + if n.OrdersInActingVersion(actingVersion) { + var OrdersBlockLength uint16 + if err := _m.ReadUint16(_r, &OrdersBlockLength); err != nil { + return err + } + var OrdersNumInGroup uint16 + if err := _m.ReadUint16(_r, &OrdersNumInGroup); err != nil { + return err + } + if cap(n.Orders) < int(OrdersNumInGroup) { + n.Orders = make([]NewOrderListAckResponseOrders, OrdersNumInGroup) + } + n.Orders = n.Orders[:OrdersNumInGroup] + for i := range n.Orders { + if err := n.Orders[i].Decode(_m, _r, actingVersion, uint(OrdersBlockLength)); err != nil { + return err + } + } + } + + if n.OrderReportsInActingVersion(actingVersion) { + var OrderReportsBlockLength uint16 + if err := _m.ReadUint16(_r, &OrderReportsBlockLength); err != nil { + return err + } + var OrderReportsNumInGroup uint16 + if err := _m.ReadUint16(_r, &OrderReportsNumInGroup); err != nil { + return err + } + if cap(n.OrderReports) < int(OrderReportsNumInGroup) { + n.OrderReports = make([]NewOrderListAckResponseOrderReports, OrderReportsNumInGroup) + } + n.OrderReports = n.OrderReports[:OrderReportsNumInGroup] + for i := range n.OrderReports { + if err := n.OrderReports[i].Decode(_m, _r, actingVersion, uint(OrderReportsBlockLength)); err != nil { + return err + } + } + } + + if n.ListClientOrderIdInActingVersion(actingVersion) { + var ListClientOrderIdLength uint8 + if err := _m.ReadUint8(_r, &ListClientOrderIdLength); err != nil { + return err + } + if cap(n.ListClientOrderId) < int(ListClientOrderIdLength) { + n.ListClientOrderId = make([]uint8, ListClientOrderIdLength) + } + n.ListClientOrderId = n.ListClientOrderId[:ListClientOrderIdLength] + if err := _m.ReadBytes(_r, n.ListClientOrderId); err != nil { + return err + } + } + + if n.SymbolInActingVersion(actingVersion) { + var SymbolLength uint8 + if err := _m.ReadUint8(_r, &SymbolLength); err != nil { + return err + } + if cap(n.Symbol) < int(SymbolLength) { + n.Symbol = make([]uint8, SymbolLength) + } + n.Symbol = n.Symbol[:SymbolLength] + if err := _m.ReadBytes(_r, n.Symbol); err != nil { + return err + } + } + if doRangeCheck { + if err := n.RangeCheck(actingVersion, n.SbeSchemaVersion()); err != nil { + return err + } + } + return nil +} + +func (n *NewOrderListAckResponse) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if n.OrderListIdInActingVersion(actingVersion) { + if n.OrderListId < n.OrderListIdMinValue() || n.OrderListId > n.OrderListIdMaxValue() { + return fmt.Errorf("Range check failed on n.OrderListId (%v < %v > %v)", n.OrderListIdMinValue(), n.OrderListId, n.OrderListIdMaxValue()) + } + } + if err := n.ContingencyType.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if err := n.ListStatusType.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if err := n.ListOrderStatus.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if n.TransactionTimeInActingVersion(actingVersion) { + if n.TransactionTime < n.TransactionTimeMinValue() || n.TransactionTime > n.TransactionTimeMaxValue() { + return fmt.Errorf("Range check failed on n.TransactionTime (%v < %v > %v)", n.TransactionTimeMinValue(), n.TransactionTime, n.TransactionTimeMaxValue()) + } + } + for i := range n.Orders { + if err := n.Orders[i].RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + } + for i := range n.OrderReports { + if err := n.OrderReports[i].RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + } + if !utf8.Valid(n.ListClientOrderId[:]) { + return errors.New("n.ListClientOrderId failed UTF-8 validation") + } + if !utf8.Valid(n.Symbol[:]) { + return errors.New("n.Symbol failed UTF-8 validation") + } + return nil +} + +func NewOrderListAckResponseInit(n *NewOrderListAckResponse) { + return +} + +func (n *NewOrderListAckResponseOrders) Encode(_m *SbeGoMarshaller, _w io.Writer) error { + if err := _m.WriteInt64(_w, n.OrderId); err != nil { + return err + } + if err := _m.WriteUint8(_w, uint8(len(n.Symbol))); err != nil { + return err + } + if err := _m.WriteBytes(_w, n.Symbol); err != nil { + return err + } + if err := _m.WriteUint8(_w, uint8(len(n.ClientOrderId))); err != nil { + return err + } + if err := _m.WriteBytes(_w, n.ClientOrderId); err != nil { + return err + } + return nil +} + +func (n *NewOrderListAckResponseOrders) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint) error { + if !n.OrderIdInActingVersion(actingVersion) { + n.OrderId = n.OrderIdNullValue() + } else { + if err := _m.ReadInt64(_r, &n.OrderId); err != nil { + return err + } + } + if actingVersion > n.SbeSchemaVersion() && blockLength > n.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-n.SbeBlockLength())) + } + + if n.SymbolInActingVersion(actingVersion) { + var SymbolLength uint8 + if err := _m.ReadUint8(_r, &SymbolLength); err != nil { + return err + } + if cap(n.Symbol) < int(SymbolLength) { + n.Symbol = make([]uint8, SymbolLength) + } + n.Symbol = n.Symbol[:SymbolLength] + if err := _m.ReadBytes(_r, n.Symbol); err != nil { + return err + } + } + + if n.ClientOrderIdInActingVersion(actingVersion) { + var ClientOrderIdLength uint8 + if err := _m.ReadUint8(_r, &ClientOrderIdLength); err != nil { + return err + } + if cap(n.ClientOrderId) < int(ClientOrderIdLength) { + n.ClientOrderId = make([]uint8, ClientOrderIdLength) + } + n.ClientOrderId = n.ClientOrderId[:ClientOrderIdLength] + if err := _m.ReadBytes(_r, n.ClientOrderId); err != nil { + return err + } + } + return nil +} + +func (n *NewOrderListAckResponseOrders) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if n.OrderIdInActingVersion(actingVersion) { + if n.OrderId < n.OrderIdMinValue() || n.OrderId > n.OrderIdMaxValue() { + return fmt.Errorf("Range check failed on n.OrderId (%v < %v > %v)", n.OrderIdMinValue(), n.OrderId, n.OrderIdMaxValue()) + } + } + if !utf8.Valid(n.Symbol[:]) { + return errors.New("n.Symbol failed UTF-8 validation") + } + if !utf8.Valid(n.ClientOrderId[:]) { + return errors.New("n.ClientOrderId failed UTF-8 validation") + } + return nil +} + +func NewOrderListAckResponseOrdersInit(n *NewOrderListAckResponseOrders) { + return +} + +func (n *NewOrderListAckResponseOrderReports) Encode(_m *SbeGoMarshaller, _w io.Writer) error { + if err := _m.WriteInt64(_w, n.OrderId); err != nil { + return err + } + if err := _m.WriteInt64(_w, n.OrderListId); err != nil { + return err + } + if err := _m.WriteInt64(_w, n.TransactTime); err != nil { + return err + } + if err := _m.WriteUint8(_w, uint8(len(n.Symbol))); err != nil { + return err + } + if err := _m.WriteBytes(_w, n.Symbol); err != nil { + return err + } + if err := _m.WriteUint8(_w, uint8(len(n.ClientOrderId))); err != nil { + return err + } + if err := _m.WriteBytes(_w, n.ClientOrderId); err != nil { + return err + } + return nil +} + +func (n *NewOrderListAckResponseOrderReports) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint) error { + if !n.OrderIdInActingVersion(actingVersion) { + n.OrderId = n.OrderIdNullValue() + } else { + if err := _m.ReadInt64(_r, &n.OrderId); err != nil { + return err + } + } + if !n.OrderListIdInActingVersion(actingVersion) { + n.OrderListId = n.OrderListIdNullValue() + } else { + if err := _m.ReadInt64(_r, &n.OrderListId); err != nil { + return err + } + } + if !n.TransactTimeInActingVersion(actingVersion) { + n.TransactTime = n.TransactTimeNullValue() + } else { + if err := _m.ReadInt64(_r, &n.TransactTime); err != nil { + return err + } + } + if actingVersion > n.SbeSchemaVersion() && blockLength > n.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-n.SbeBlockLength())) + } + + if n.SymbolInActingVersion(actingVersion) { + var SymbolLength uint8 + if err := _m.ReadUint8(_r, &SymbolLength); err != nil { + return err + } + if cap(n.Symbol) < int(SymbolLength) { + n.Symbol = make([]uint8, SymbolLength) + } + n.Symbol = n.Symbol[:SymbolLength] + if err := _m.ReadBytes(_r, n.Symbol); err != nil { + return err + } + } + + if n.ClientOrderIdInActingVersion(actingVersion) { + var ClientOrderIdLength uint8 + if err := _m.ReadUint8(_r, &ClientOrderIdLength); err != nil { + return err + } + if cap(n.ClientOrderId) < int(ClientOrderIdLength) { + n.ClientOrderId = make([]uint8, ClientOrderIdLength) + } + n.ClientOrderId = n.ClientOrderId[:ClientOrderIdLength] + if err := _m.ReadBytes(_r, n.ClientOrderId); err != nil { + return err + } + } + return nil +} + +func (n *NewOrderListAckResponseOrderReports) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if n.OrderIdInActingVersion(actingVersion) { + if n.OrderId < n.OrderIdMinValue() || n.OrderId > n.OrderIdMaxValue() { + return fmt.Errorf("Range check failed on n.OrderId (%v < %v > %v)", n.OrderIdMinValue(), n.OrderId, n.OrderIdMaxValue()) + } + } + if n.OrderListIdInActingVersion(actingVersion) { + if n.OrderListId != n.OrderListIdNullValue() && (n.OrderListId < n.OrderListIdMinValue() || n.OrderListId > n.OrderListIdMaxValue()) { + return fmt.Errorf("Range check failed on n.OrderListId (%v < %v > %v)", n.OrderListIdMinValue(), n.OrderListId, n.OrderListIdMaxValue()) + } + } + if n.TransactTimeInActingVersion(actingVersion) { + if n.TransactTime < n.TransactTimeMinValue() || n.TransactTime > n.TransactTimeMaxValue() { + return fmt.Errorf("Range check failed on n.TransactTime (%v < %v > %v)", n.TransactTimeMinValue(), n.TransactTime, n.TransactTimeMaxValue()) + } + } + if !utf8.Valid(n.Symbol[:]) { + return errors.New("n.Symbol failed UTF-8 validation") + } + if !utf8.Valid(n.ClientOrderId[:]) { + return errors.New("n.ClientOrderId failed UTF-8 validation") + } + return nil +} + +func NewOrderListAckResponseOrderReportsInit(n *NewOrderListAckResponseOrderReports) { + n.OrderListId = math.MinInt64 + return +} + +func (*NewOrderListAckResponse) SbeBlockLength() (blockLength uint16) { + return 19 +} + +func (*NewOrderListAckResponse) SbeTemplateId() (templateId uint16) { + return 309 +} + +func (*NewOrderListAckResponse) SbeSchemaId() (schemaId uint16) { + return 3 +} + +func (*NewOrderListAckResponse) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} + +func (*NewOrderListAckResponse) SbeSemanticType() (semanticType []byte) { + return []byte("") +} + +func (*NewOrderListAckResponse) SbeSemanticVersion() (semanticVersion string) { + return "5.2" +} + +func (*NewOrderListAckResponse) OrderListIdId() uint16 { + return 1 +} + +func (*NewOrderListAckResponse) OrderListIdSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderListAckResponse) OrderListIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.OrderListIdSinceVersion() +} + +func (*NewOrderListAckResponse) OrderListIdDeprecated() uint16 { + return 0 +} + +func (*NewOrderListAckResponse) OrderListIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderListAckResponse) OrderListIdMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*NewOrderListAckResponse) OrderListIdMaxValue() int64 { + return math.MaxInt64 +} + +func (*NewOrderListAckResponse) OrderListIdNullValue() int64 { + return math.MinInt64 +} + +func (*NewOrderListAckResponse) ContingencyTypeId() uint16 { + return 2 +} + +func (*NewOrderListAckResponse) ContingencyTypeSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderListAckResponse) ContingencyTypeInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.ContingencyTypeSinceVersion() +} + +func (*NewOrderListAckResponse) ContingencyTypeDeprecated() uint16 { + return 0 +} + +func (*NewOrderListAckResponse) ContingencyTypeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderListAckResponse) ListStatusTypeId() uint16 { + return 3 +} + +func (*NewOrderListAckResponse) ListStatusTypeSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderListAckResponse) ListStatusTypeInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.ListStatusTypeSinceVersion() +} + +func (*NewOrderListAckResponse) ListStatusTypeDeprecated() uint16 { + return 0 +} + +func (*NewOrderListAckResponse) ListStatusTypeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderListAckResponse) ListOrderStatusId() uint16 { + return 4 +} + +func (*NewOrderListAckResponse) ListOrderStatusSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderListAckResponse) ListOrderStatusInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.ListOrderStatusSinceVersion() +} + +func (*NewOrderListAckResponse) ListOrderStatusDeprecated() uint16 { + return 0 +} + +func (*NewOrderListAckResponse) ListOrderStatusMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderListAckResponse) TransactionTimeId() uint16 { + return 5 +} + +func (*NewOrderListAckResponse) TransactionTimeSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderListAckResponse) TransactionTimeInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.TransactionTimeSinceVersion() +} + +func (*NewOrderListAckResponse) TransactionTimeDeprecated() uint16 { + return 0 +} + +func (*NewOrderListAckResponse) TransactionTimeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderListAckResponse) TransactionTimeMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*NewOrderListAckResponse) TransactionTimeMaxValue() int64 { + return math.MaxInt64 +} + +func (*NewOrderListAckResponse) TransactionTimeNullValue() int64 { + return math.MinInt64 +} + +func (*NewOrderListAckResponseOrders) OrderIdId() uint16 { + return 1 +} + +func (*NewOrderListAckResponseOrders) OrderIdSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderListAckResponseOrders) OrderIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.OrderIdSinceVersion() +} + +func (*NewOrderListAckResponseOrders) OrderIdDeprecated() uint16 { + return 0 +} + +func (*NewOrderListAckResponseOrders) OrderIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderListAckResponseOrders) OrderIdMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*NewOrderListAckResponseOrders) OrderIdMaxValue() int64 { + return math.MaxInt64 +} + +func (*NewOrderListAckResponseOrders) OrderIdNullValue() int64 { + return math.MinInt64 +} + +func (*NewOrderListAckResponseOrders) SymbolMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderListAckResponseOrders) SymbolSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderListAckResponseOrders) SymbolInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.SymbolSinceVersion() +} + +func (*NewOrderListAckResponseOrders) SymbolDeprecated() uint16 { + return 0 +} + +func (NewOrderListAckResponseOrders) SymbolCharacterEncoding() string { + return "UTF-8" +} + +func (NewOrderListAckResponseOrders) SymbolHeaderLength() uint64 { + return 1 +} + +func (*NewOrderListAckResponseOrders) ClientOrderIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderListAckResponseOrders) ClientOrderIdSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderListAckResponseOrders) ClientOrderIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.ClientOrderIdSinceVersion() +} + +func (*NewOrderListAckResponseOrders) ClientOrderIdDeprecated() uint16 { + return 0 +} + +func (NewOrderListAckResponseOrders) ClientOrderIdCharacterEncoding() string { + return "UTF-8" +} + +func (NewOrderListAckResponseOrders) ClientOrderIdHeaderLength() uint64 { + return 1 +} + +func (*NewOrderListAckResponseOrderReports) OrderIdId() uint16 { + return 1 +} + +func (*NewOrderListAckResponseOrderReports) OrderIdSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderListAckResponseOrderReports) OrderIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.OrderIdSinceVersion() +} + +func (*NewOrderListAckResponseOrderReports) OrderIdDeprecated() uint16 { + return 0 +} + +func (*NewOrderListAckResponseOrderReports) OrderIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderListAckResponseOrderReports) OrderIdMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*NewOrderListAckResponseOrderReports) OrderIdMaxValue() int64 { + return math.MaxInt64 +} + +func (*NewOrderListAckResponseOrderReports) OrderIdNullValue() int64 { + return math.MinInt64 +} + +func (*NewOrderListAckResponseOrderReports) OrderListIdId() uint16 { + return 2 +} + +func (*NewOrderListAckResponseOrderReports) OrderListIdSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderListAckResponseOrderReports) OrderListIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.OrderListIdSinceVersion() +} + +func (*NewOrderListAckResponseOrderReports) OrderListIdDeprecated() uint16 { + return 0 +} + +func (*NewOrderListAckResponseOrderReports) OrderListIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*NewOrderListAckResponseOrderReports) OrderListIdMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*NewOrderListAckResponseOrderReports) OrderListIdMaxValue() int64 { + return math.MaxInt64 +} + +func (*NewOrderListAckResponseOrderReports) OrderListIdNullValue() int64 { + return math.MinInt64 +} + +func (*NewOrderListAckResponseOrderReports) TransactTimeId() uint16 { + return 3 +} + +func (*NewOrderListAckResponseOrderReports) TransactTimeSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderListAckResponseOrderReports) TransactTimeInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.TransactTimeSinceVersion() +} + +func (*NewOrderListAckResponseOrderReports) TransactTimeDeprecated() uint16 { + return 0 +} + +func (*NewOrderListAckResponseOrderReports) TransactTimeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderListAckResponseOrderReports) TransactTimeMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*NewOrderListAckResponseOrderReports) TransactTimeMaxValue() int64 { + return math.MaxInt64 +} + +func (*NewOrderListAckResponseOrderReports) TransactTimeNullValue() int64 { + return math.MinInt64 +} + +func (*NewOrderListAckResponseOrderReports) SymbolMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderListAckResponseOrderReports) SymbolSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderListAckResponseOrderReports) SymbolInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.SymbolSinceVersion() +} + +func (*NewOrderListAckResponseOrderReports) SymbolDeprecated() uint16 { + return 0 +} + +func (NewOrderListAckResponseOrderReports) SymbolCharacterEncoding() string { + return "UTF-8" +} + +func (NewOrderListAckResponseOrderReports) SymbolHeaderLength() uint64 { + return 1 +} + +func (*NewOrderListAckResponseOrderReports) ClientOrderIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderListAckResponseOrderReports) ClientOrderIdSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderListAckResponseOrderReports) ClientOrderIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.ClientOrderIdSinceVersion() +} + +func (*NewOrderListAckResponseOrderReports) ClientOrderIdDeprecated() uint16 { + return 0 +} + +func (NewOrderListAckResponseOrderReports) ClientOrderIdCharacterEncoding() string { + return "UTF-8" +} + +func (NewOrderListAckResponseOrderReports) ClientOrderIdHeaderLength() uint64 { + return 1 +} + +func (*NewOrderListAckResponse) OrdersId() uint16 { + return 100 +} + +func (*NewOrderListAckResponse) OrdersSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderListAckResponse) OrdersInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.OrdersSinceVersion() +} + +func (*NewOrderListAckResponse) OrdersDeprecated() uint16 { + return 0 +} + +func (*NewOrderListAckResponseOrders) SbeBlockLength() (blockLength uint) { + return 8 +} + +func (*NewOrderListAckResponseOrders) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} + +func (*NewOrderListAckResponse) OrderReportsId() uint16 { + return 101 +} + +func (*NewOrderListAckResponse) OrderReportsSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderListAckResponse) OrderReportsInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.OrderReportsSinceVersion() +} + +func (*NewOrderListAckResponse) OrderReportsDeprecated() uint16 { + return 0 +} + +func (*NewOrderListAckResponseOrderReports) SbeBlockLength() (blockLength uint) { + return 24 +} + +func (*NewOrderListAckResponseOrderReports) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} + +func (*NewOrderListAckResponse) ListClientOrderIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderListAckResponse) ListClientOrderIdSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderListAckResponse) ListClientOrderIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.ListClientOrderIdSinceVersion() +} + +func (*NewOrderListAckResponse) ListClientOrderIdDeprecated() uint16 { + return 0 +} + +func (NewOrderListAckResponse) ListClientOrderIdCharacterEncoding() string { + return "UTF-8" +} + +func (NewOrderListAckResponse) ListClientOrderIdHeaderLength() uint64 { + return 1 +} + +func (*NewOrderListAckResponse) SymbolMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderListAckResponse) SymbolSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderListAckResponse) SymbolInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.SymbolSinceVersion() +} + +func (*NewOrderListAckResponse) SymbolDeprecated() uint16 { + return 0 +} + +func (NewOrderListAckResponse) SymbolCharacterEncoding() string { + return "UTF-8" +} + +func (NewOrderListAckResponse) SymbolHeaderLength() uint64 { + return 1 +} diff --git a/v2/sbe/spot_3_1/NewOrderListFullResponse.go b/v2/sbe/spot_3_1/NewOrderListFullResponse.go new file mode 100644 index 00000000..2e88318a --- /dev/null +++ b/v2/sbe/spot_3_1/NewOrderListFullResponse.go @@ -0,0 +1,3503 @@ +// Generated SBE (Simple Binary Encoding) message codec + +package sbe + +import ( + "errors" + "fmt" + "io" + "io/ioutil" + "math" + "unicode/utf8" +) + +type NewOrderListFullResponse struct { + OrderListId int64 + ContingencyType ContingencyTypeEnum + ListStatusType ListStatusTypeEnum + ListOrderStatus ListOrderStatusEnum + TransactionTime int64 + PriceExponent int8 + QtyExponent int8 + Orders []NewOrderListFullResponseOrders + OrderReports []NewOrderListFullResponseOrderReports + ListClientOrderId []uint8 + Symbol []uint8 +} +type NewOrderListFullResponseOrders struct { + OrderId int64 + Symbol []uint8 + ClientOrderId []uint8 +} +type NewOrderListFullResponseOrderReports struct { + OrderId int64 + OrderListId int64 + TransactTime int64 + Price int64 + OrigQty int64 + ExecutedQty int64 + CummulativeQuoteQty int64 + Status OrderStatusEnum + TimeInForce TimeInForceEnum + OrderType OrderTypeEnum + Side OrderSideEnum + StopPrice int64 + TrailingDelta int64 + TrailingTime int64 + WorkingTime int64 + IcebergQty int64 + StrategyId int64 + StrategyType int32 + OrderCapacity OrderCapacityEnum + WorkingFloor FloorEnum + SelfTradePreventionMode SelfTradePreventionModeEnum + TradeGroupId int64 + PreventedQuantity int64 + UsedSor BoolEnumEnum + OrigQuoteOrderQty int64 + PegPriceType PegPriceTypeEnum + PegOffsetType PegOffsetTypeEnum + PegOffsetValue uint8 + PeggedPrice int64 + Fills []NewOrderListFullResponseOrderReportsFills + PreventedMatches []NewOrderListFullResponseOrderReportsPreventedMatches + Symbol []uint8 + ClientOrderId []uint8 +} +type NewOrderListFullResponseOrderReportsFills struct { + CommissionExponent int8 + MatchType MatchTypeEnum + Price int64 + Qty int64 + Commission int64 + TradeId int64 + AllocId int64 + CommissionAsset []uint8 +} +type NewOrderListFullResponseOrderReportsPreventedMatches struct { + PreventedMatchId int64 + MakerOrderId int64 + Price int64 + TakerPreventedQuantity int64 + MakerPreventedQuantity int64 + MakerSymbol []uint8 +} + +func (n *NewOrderListFullResponse) Encode(_m *SbeGoMarshaller, _w io.Writer, doRangeCheck bool) error { + if doRangeCheck { + if err := n.RangeCheck(n.SbeSchemaVersion(), n.SbeSchemaVersion()); err != nil { + return err + } + } + if err := _m.WriteInt64(_w, n.OrderListId); err != nil { + return err + } + if err := n.ContingencyType.Encode(_m, _w); err != nil { + return err + } + if err := n.ListStatusType.Encode(_m, _w); err != nil { + return err + } + if err := n.ListOrderStatus.Encode(_m, _w); err != nil { + return err + } + if err := _m.WriteInt64(_w, n.TransactionTime); err != nil { + return err + } + if err := _m.WriteInt8(_w, n.PriceExponent); err != nil { + return err + } + if err := _m.WriteInt8(_w, n.QtyExponent); err != nil { + return err + } + var OrdersBlockLength uint16 = 8 + if err := _m.WriteUint16(_w, OrdersBlockLength); err != nil { + return err + } + var OrdersNumInGroup uint16 = uint16(len(n.Orders)) + if err := _m.WriteUint16(_w, OrdersNumInGroup); err != nil { + return err + } + for i := range n.Orders { + if err := n.Orders[i].Encode(_m, _w); err != nil { + return err + } + } + var OrderReportsBlockLength uint16 = 151 + if err := _m.WriteUint16(_w, OrderReportsBlockLength); err != nil { + return err + } + var OrderReportsNumInGroup uint16 = uint16(len(n.OrderReports)) + if err := _m.WriteUint16(_w, OrderReportsNumInGroup); err != nil { + return err + } + for i := range n.OrderReports { + if err := n.OrderReports[i].Encode(_m, _w); err != nil { + return err + } + } + if err := _m.WriteUint8(_w, uint8(len(n.ListClientOrderId))); err != nil { + return err + } + if err := _m.WriteBytes(_w, n.ListClientOrderId); err != nil { + return err + } + if err := _m.WriteUint8(_w, uint8(len(n.Symbol))); err != nil { + return err + } + if err := _m.WriteBytes(_w, n.Symbol); err != nil { + return err + } + return nil +} + +func (n *NewOrderListFullResponse) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint16, doRangeCheck bool) error { + if !n.OrderListIdInActingVersion(actingVersion) { + n.OrderListId = n.OrderListIdNullValue() + } else { + if err := _m.ReadInt64(_r, &n.OrderListId); err != nil { + return err + } + } + if n.ContingencyTypeInActingVersion(actingVersion) { + if err := n.ContingencyType.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if n.ListStatusTypeInActingVersion(actingVersion) { + if err := n.ListStatusType.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if n.ListOrderStatusInActingVersion(actingVersion) { + if err := n.ListOrderStatus.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if !n.TransactionTimeInActingVersion(actingVersion) { + n.TransactionTime = n.TransactionTimeNullValue() + } else { + if err := _m.ReadInt64(_r, &n.TransactionTime); err != nil { + return err + } + } + if !n.PriceExponentInActingVersion(actingVersion) { + n.PriceExponent = n.PriceExponentNullValue() + } else { + if err := _m.ReadInt8(_r, &n.PriceExponent); err != nil { + return err + } + } + if !n.QtyExponentInActingVersion(actingVersion) { + n.QtyExponent = n.QtyExponentNullValue() + } else { + if err := _m.ReadInt8(_r, &n.QtyExponent); err != nil { + return err + } + } + if actingVersion > n.SbeSchemaVersion() && blockLength > n.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-n.SbeBlockLength())) + } + + if n.OrdersInActingVersion(actingVersion) { + var OrdersBlockLength uint16 + if err := _m.ReadUint16(_r, &OrdersBlockLength); err != nil { + return err + } + var OrdersNumInGroup uint16 + if err := _m.ReadUint16(_r, &OrdersNumInGroup); err != nil { + return err + } + if cap(n.Orders) < int(OrdersNumInGroup) { + n.Orders = make([]NewOrderListFullResponseOrders, OrdersNumInGroup) + } + n.Orders = n.Orders[:OrdersNumInGroup] + for i := range n.Orders { + if err := n.Orders[i].Decode(_m, _r, actingVersion, uint(OrdersBlockLength)); err != nil { + return err + } + } + } + + if n.OrderReportsInActingVersion(actingVersion) { + var OrderReportsBlockLength uint16 + if err := _m.ReadUint16(_r, &OrderReportsBlockLength); err != nil { + return err + } + var OrderReportsNumInGroup uint16 + if err := _m.ReadUint16(_r, &OrderReportsNumInGroup); err != nil { + return err + } + if cap(n.OrderReports) < int(OrderReportsNumInGroup) { + n.OrderReports = make([]NewOrderListFullResponseOrderReports, OrderReportsNumInGroup) + } + n.OrderReports = n.OrderReports[:OrderReportsNumInGroup] + for i := range n.OrderReports { + if err := n.OrderReports[i].Decode(_m, _r, actingVersion, uint(OrderReportsBlockLength)); err != nil { + return err + } + } + } + + if n.ListClientOrderIdInActingVersion(actingVersion) { + var ListClientOrderIdLength uint8 + if err := _m.ReadUint8(_r, &ListClientOrderIdLength); err != nil { + return err + } + if cap(n.ListClientOrderId) < int(ListClientOrderIdLength) { + n.ListClientOrderId = make([]uint8, ListClientOrderIdLength) + } + n.ListClientOrderId = n.ListClientOrderId[:ListClientOrderIdLength] + if err := _m.ReadBytes(_r, n.ListClientOrderId); err != nil { + return err + } + } + + if n.SymbolInActingVersion(actingVersion) { + var SymbolLength uint8 + if err := _m.ReadUint8(_r, &SymbolLength); err != nil { + return err + } + if cap(n.Symbol) < int(SymbolLength) { + n.Symbol = make([]uint8, SymbolLength) + } + n.Symbol = n.Symbol[:SymbolLength] + if err := _m.ReadBytes(_r, n.Symbol); err != nil { + return err + } + } + if doRangeCheck { + if err := n.RangeCheck(actingVersion, n.SbeSchemaVersion()); err != nil { + return err + } + } + return nil +} + +func (n *NewOrderListFullResponse) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if n.OrderListIdInActingVersion(actingVersion) { + if n.OrderListId < n.OrderListIdMinValue() || n.OrderListId > n.OrderListIdMaxValue() { + return fmt.Errorf("Range check failed on n.OrderListId (%v < %v > %v)", n.OrderListIdMinValue(), n.OrderListId, n.OrderListIdMaxValue()) + } + } + if err := n.ContingencyType.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if err := n.ListStatusType.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if err := n.ListOrderStatus.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if n.TransactionTimeInActingVersion(actingVersion) { + if n.TransactionTime < n.TransactionTimeMinValue() || n.TransactionTime > n.TransactionTimeMaxValue() { + return fmt.Errorf("Range check failed on n.TransactionTime (%v < %v > %v)", n.TransactionTimeMinValue(), n.TransactionTime, n.TransactionTimeMaxValue()) + } + } + if n.PriceExponentInActingVersion(actingVersion) { + if n.PriceExponent < n.PriceExponentMinValue() || n.PriceExponent > n.PriceExponentMaxValue() { + return fmt.Errorf("Range check failed on n.PriceExponent (%v < %v > %v)", n.PriceExponentMinValue(), n.PriceExponent, n.PriceExponentMaxValue()) + } + } + if n.QtyExponentInActingVersion(actingVersion) { + if n.QtyExponent < n.QtyExponentMinValue() || n.QtyExponent > n.QtyExponentMaxValue() { + return fmt.Errorf("Range check failed on n.QtyExponent (%v < %v > %v)", n.QtyExponentMinValue(), n.QtyExponent, n.QtyExponentMaxValue()) + } + } + for i := range n.Orders { + if err := n.Orders[i].RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + } + for i := range n.OrderReports { + if err := n.OrderReports[i].RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + } + if !utf8.Valid(n.ListClientOrderId[:]) { + return errors.New("n.ListClientOrderId failed UTF-8 validation") + } + if !utf8.Valid(n.Symbol[:]) { + return errors.New("n.Symbol failed UTF-8 validation") + } + return nil +} + +func NewOrderListFullResponseInit(n *NewOrderListFullResponse) { + return +} + +func (n *NewOrderListFullResponseOrders) Encode(_m *SbeGoMarshaller, _w io.Writer) error { + if err := _m.WriteInt64(_w, n.OrderId); err != nil { + return err + } + if err := _m.WriteUint8(_w, uint8(len(n.Symbol))); err != nil { + return err + } + if err := _m.WriteBytes(_w, n.Symbol); err != nil { + return err + } + if err := _m.WriteUint8(_w, uint8(len(n.ClientOrderId))); err != nil { + return err + } + if err := _m.WriteBytes(_w, n.ClientOrderId); err != nil { + return err + } + return nil +} + +func (n *NewOrderListFullResponseOrders) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint) error { + if !n.OrderIdInActingVersion(actingVersion) { + n.OrderId = n.OrderIdNullValue() + } else { + if err := _m.ReadInt64(_r, &n.OrderId); err != nil { + return err + } + } + if actingVersion > n.SbeSchemaVersion() && blockLength > n.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-n.SbeBlockLength())) + } + + if n.SymbolInActingVersion(actingVersion) { + var SymbolLength uint8 + if err := _m.ReadUint8(_r, &SymbolLength); err != nil { + return err + } + if cap(n.Symbol) < int(SymbolLength) { + n.Symbol = make([]uint8, SymbolLength) + } + n.Symbol = n.Symbol[:SymbolLength] + if err := _m.ReadBytes(_r, n.Symbol); err != nil { + return err + } + } + + if n.ClientOrderIdInActingVersion(actingVersion) { + var ClientOrderIdLength uint8 + if err := _m.ReadUint8(_r, &ClientOrderIdLength); err != nil { + return err + } + if cap(n.ClientOrderId) < int(ClientOrderIdLength) { + n.ClientOrderId = make([]uint8, ClientOrderIdLength) + } + n.ClientOrderId = n.ClientOrderId[:ClientOrderIdLength] + if err := _m.ReadBytes(_r, n.ClientOrderId); err != nil { + return err + } + } + return nil +} + +func (n *NewOrderListFullResponseOrders) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if n.OrderIdInActingVersion(actingVersion) { + if n.OrderId < n.OrderIdMinValue() || n.OrderId > n.OrderIdMaxValue() { + return fmt.Errorf("Range check failed on n.OrderId (%v < %v > %v)", n.OrderIdMinValue(), n.OrderId, n.OrderIdMaxValue()) + } + } + if !utf8.Valid(n.Symbol[:]) { + return errors.New("n.Symbol failed UTF-8 validation") + } + if !utf8.Valid(n.ClientOrderId[:]) { + return errors.New("n.ClientOrderId failed UTF-8 validation") + } + return nil +} + +func NewOrderListFullResponseOrdersInit(n *NewOrderListFullResponseOrders) { + return +} + +func (n *NewOrderListFullResponseOrderReports) Encode(_m *SbeGoMarshaller, _w io.Writer) error { + if err := _m.WriteInt64(_w, n.OrderId); err != nil { + return err + } + if err := _m.WriteInt64(_w, n.OrderListId); err != nil { + return err + } + if err := _m.WriteInt64(_w, n.TransactTime); err != nil { + return err + } + if err := _m.WriteInt64(_w, n.Price); err != nil { + return err + } + if err := _m.WriteInt64(_w, n.OrigQty); err != nil { + return err + } + if err := _m.WriteInt64(_w, n.ExecutedQty); err != nil { + return err + } + if err := _m.WriteInt64(_w, n.CummulativeQuoteQty); err != nil { + return err + } + if err := n.Status.Encode(_m, _w); err != nil { + return err + } + if err := n.TimeInForce.Encode(_m, _w); err != nil { + return err + } + if err := n.OrderType.Encode(_m, _w); err != nil { + return err + } + if err := n.Side.Encode(_m, _w); err != nil { + return err + } + if err := _m.WriteInt64(_w, n.StopPrice); err != nil { + return err + } + if err := _m.WriteInt64(_w, n.TrailingDelta); err != nil { + return err + } + if err := _m.WriteInt64(_w, n.TrailingTime); err != nil { + return err + } + if err := _m.WriteInt64(_w, n.WorkingTime); err != nil { + return err + } + if err := _m.WriteInt64(_w, n.IcebergQty); err != nil { + return err + } + if err := _m.WriteInt64(_w, n.StrategyId); err != nil { + return err + } + if err := _m.WriteInt32(_w, n.StrategyType); err != nil { + return err + } + if err := n.OrderCapacity.Encode(_m, _w); err != nil { + return err + } + if err := n.WorkingFloor.Encode(_m, _w); err != nil { + return err + } + if err := n.SelfTradePreventionMode.Encode(_m, _w); err != nil { + return err + } + if err := _m.WriteInt64(_w, n.TradeGroupId); err != nil { + return err + } + if err := _m.WriteInt64(_w, n.PreventedQuantity); err != nil { + return err + } + if err := n.UsedSor.Encode(_m, _w); err != nil { + return err + } + if err := _m.WriteInt64(_w, n.OrigQuoteOrderQty); err != nil { + return err + } + if err := n.PegPriceType.Encode(_m, _w); err != nil { + return err + } + if err := n.PegOffsetType.Encode(_m, _w); err != nil { + return err + } + if err := _m.WriteUint8(_w, n.PegOffsetValue); err != nil { + return err + } + if err := _m.WriteInt64(_w, n.PeggedPrice); err != nil { + return err + } + var FillsBlockLength uint16 = 42 + if err := _m.WriteUint16(_w, FillsBlockLength); err != nil { + return err + } + var FillsNumInGroup uint32 = uint32(len(n.Fills)) + if err := _m.WriteUint32(_w, FillsNumInGroup); err != nil { + return err + } + for i := range n.Fills { + if err := n.Fills[i].Encode(_m, _w); err != nil { + return err + } + } + var PreventedMatchesBlockLength uint16 = 40 + if err := _m.WriteUint16(_w, PreventedMatchesBlockLength); err != nil { + return err + } + var PreventedMatchesNumInGroup uint32 = uint32(len(n.PreventedMatches)) + if err := _m.WriteUint32(_w, PreventedMatchesNumInGroup); err != nil { + return err + } + for i := range n.PreventedMatches { + if err := n.PreventedMatches[i].Encode(_m, _w); err != nil { + return err + } + } + if err := _m.WriteUint8(_w, uint8(len(n.Symbol))); err != nil { + return err + } + if err := _m.WriteBytes(_w, n.Symbol); err != nil { + return err + } + if err := _m.WriteUint8(_w, uint8(len(n.ClientOrderId))); err != nil { + return err + } + if err := _m.WriteBytes(_w, n.ClientOrderId); err != nil { + return err + } + return nil +} + +func (n *NewOrderListFullResponseOrderReports) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint) error { + if !n.OrderIdInActingVersion(actingVersion) { + n.OrderId = n.OrderIdNullValue() + } else { + if err := _m.ReadInt64(_r, &n.OrderId); err != nil { + return err + } + } + if !n.OrderListIdInActingVersion(actingVersion) { + n.OrderListId = n.OrderListIdNullValue() + } else { + if err := _m.ReadInt64(_r, &n.OrderListId); err != nil { + return err + } + } + if !n.TransactTimeInActingVersion(actingVersion) { + n.TransactTime = n.TransactTimeNullValue() + } else { + if err := _m.ReadInt64(_r, &n.TransactTime); err != nil { + return err + } + } + if !n.PriceInActingVersion(actingVersion) { + n.Price = n.PriceNullValue() + } else { + if err := _m.ReadInt64(_r, &n.Price); err != nil { + return err + } + } + if !n.OrigQtyInActingVersion(actingVersion) { + n.OrigQty = n.OrigQtyNullValue() + } else { + if err := _m.ReadInt64(_r, &n.OrigQty); err != nil { + return err + } + } + if !n.ExecutedQtyInActingVersion(actingVersion) { + n.ExecutedQty = n.ExecutedQtyNullValue() + } else { + if err := _m.ReadInt64(_r, &n.ExecutedQty); err != nil { + return err + } + } + if !n.CummulativeQuoteQtyInActingVersion(actingVersion) { + n.CummulativeQuoteQty = n.CummulativeQuoteQtyNullValue() + } else { + if err := _m.ReadInt64(_r, &n.CummulativeQuoteQty); err != nil { + return err + } + } + if n.StatusInActingVersion(actingVersion) { + if err := n.Status.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if n.TimeInForceInActingVersion(actingVersion) { + if err := n.TimeInForce.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if n.OrderTypeInActingVersion(actingVersion) { + if err := n.OrderType.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if n.SideInActingVersion(actingVersion) { + if err := n.Side.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if !n.StopPriceInActingVersion(actingVersion) { + n.StopPrice = n.StopPriceNullValue() + } else { + if err := _m.ReadInt64(_r, &n.StopPrice); err != nil { + return err + } + } + if !n.TrailingDeltaInActingVersion(actingVersion) { + n.TrailingDelta = n.TrailingDeltaNullValue() + } else { + if err := _m.ReadInt64(_r, &n.TrailingDelta); err != nil { + return err + } + } + if !n.TrailingTimeInActingVersion(actingVersion) { + n.TrailingTime = n.TrailingTimeNullValue() + } else { + if err := _m.ReadInt64(_r, &n.TrailingTime); err != nil { + return err + } + } + if !n.WorkingTimeInActingVersion(actingVersion) { + n.WorkingTime = n.WorkingTimeNullValue() + } else { + if err := _m.ReadInt64(_r, &n.WorkingTime); err != nil { + return err + } + } + if !n.IcebergQtyInActingVersion(actingVersion) { + n.IcebergQty = n.IcebergQtyNullValue() + } else { + if err := _m.ReadInt64(_r, &n.IcebergQty); err != nil { + return err + } + } + if !n.StrategyIdInActingVersion(actingVersion) { + n.StrategyId = n.StrategyIdNullValue() + } else { + if err := _m.ReadInt64(_r, &n.StrategyId); err != nil { + return err + } + } + if !n.StrategyTypeInActingVersion(actingVersion) { + n.StrategyType = n.StrategyTypeNullValue() + } else { + if err := _m.ReadInt32(_r, &n.StrategyType); err != nil { + return err + } + } + if n.OrderCapacityInActingVersion(actingVersion) { + if err := n.OrderCapacity.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if n.WorkingFloorInActingVersion(actingVersion) { + if err := n.WorkingFloor.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if n.SelfTradePreventionModeInActingVersion(actingVersion) { + if err := n.SelfTradePreventionMode.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if !n.TradeGroupIdInActingVersion(actingVersion) { + n.TradeGroupId = n.TradeGroupIdNullValue() + } else { + if err := _m.ReadInt64(_r, &n.TradeGroupId); err != nil { + return err + } + } + if !n.PreventedQuantityInActingVersion(actingVersion) { + n.PreventedQuantity = n.PreventedQuantityNullValue() + } else { + if err := _m.ReadInt64(_r, &n.PreventedQuantity); err != nil { + return err + } + } + if n.UsedSorInActingVersion(actingVersion) { + if err := n.UsedSor.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if !n.OrigQuoteOrderQtyInActingVersion(actingVersion) { + n.OrigQuoteOrderQty = n.OrigQuoteOrderQtyNullValue() + } else { + if err := _m.ReadInt64(_r, &n.OrigQuoteOrderQty); err != nil { + return err + } + } + if n.PegPriceTypeInActingVersion(actingVersion) { + if err := n.PegPriceType.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if n.PegOffsetTypeInActingVersion(actingVersion) { + if err := n.PegOffsetType.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if !n.PegOffsetValueInActingVersion(actingVersion) { + n.PegOffsetValue = n.PegOffsetValueNullValue() + } else { + if err := _m.ReadUint8(_r, &n.PegOffsetValue); err != nil { + return err + } + } + if !n.PeggedPriceInActingVersion(actingVersion) { + n.PeggedPrice = n.PeggedPriceNullValue() + } else { + if err := _m.ReadInt64(_r, &n.PeggedPrice); err != nil { + return err + } + } + if actingVersion > n.SbeSchemaVersion() && blockLength > n.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-n.SbeBlockLength())) + } + + if n.FillsInActingVersion(actingVersion) { + var FillsBlockLength uint16 + if err := _m.ReadUint16(_r, &FillsBlockLength); err != nil { + return err + } + var FillsNumInGroup uint32 + if err := _m.ReadUint32(_r, &FillsNumInGroup); err != nil { + return err + } + if cap(n.Fills) < int(FillsNumInGroup) { + n.Fills = make([]NewOrderListFullResponseOrderReportsFills, FillsNumInGroup) + } + n.Fills = n.Fills[:FillsNumInGroup] + for i := range n.Fills { + if err := n.Fills[i].Decode(_m, _r, actingVersion, uint(FillsBlockLength)); err != nil { + return err + } + } + } + + if n.PreventedMatchesInActingVersion(actingVersion) { + var PreventedMatchesBlockLength uint16 + if err := _m.ReadUint16(_r, &PreventedMatchesBlockLength); err != nil { + return err + } + var PreventedMatchesNumInGroup uint32 + if err := _m.ReadUint32(_r, &PreventedMatchesNumInGroup); err != nil { + return err + } + if cap(n.PreventedMatches) < int(PreventedMatchesNumInGroup) { + n.PreventedMatches = make([]NewOrderListFullResponseOrderReportsPreventedMatches, PreventedMatchesNumInGroup) + } + n.PreventedMatches = n.PreventedMatches[:PreventedMatchesNumInGroup] + for i := range n.PreventedMatches { + if err := n.PreventedMatches[i].Decode(_m, _r, actingVersion, uint(PreventedMatchesBlockLength)); err != nil { + return err + } + } + } + + if n.SymbolInActingVersion(actingVersion) { + var SymbolLength uint8 + if err := _m.ReadUint8(_r, &SymbolLength); err != nil { + return err + } + if cap(n.Symbol) < int(SymbolLength) { + n.Symbol = make([]uint8, SymbolLength) + } + n.Symbol = n.Symbol[:SymbolLength] + if err := _m.ReadBytes(_r, n.Symbol); err != nil { + return err + } + } + + if n.ClientOrderIdInActingVersion(actingVersion) { + var ClientOrderIdLength uint8 + if err := _m.ReadUint8(_r, &ClientOrderIdLength); err != nil { + return err + } + if cap(n.ClientOrderId) < int(ClientOrderIdLength) { + n.ClientOrderId = make([]uint8, ClientOrderIdLength) + } + n.ClientOrderId = n.ClientOrderId[:ClientOrderIdLength] + if err := _m.ReadBytes(_r, n.ClientOrderId); err != nil { + return err + } + } + return nil +} + +func (n *NewOrderListFullResponseOrderReports) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if n.OrderIdInActingVersion(actingVersion) { + if n.OrderId < n.OrderIdMinValue() || n.OrderId > n.OrderIdMaxValue() { + return fmt.Errorf("Range check failed on n.OrderId (%v < %v > %v)", n.OrderIdMinValue(), n.OrderId, n.OrderIdMaxValue()) + } + } + if n.OrderListIdInActingVersion(actingVersion) { + if n.OrderListId != n.OrderListIdNullValue() && (n.OrderListId < n.OrderListIdMinValue() || n.OrderListId > n.OrderListIdMaxValue()) { + return fmt.Errorf("Range check failed on n.OrderListId (%v < %v > %v)", n.OrderListIdMinValue(), n.OrderListId, n.OrderListIdMaxValue()) + } + } + if n.TransactTimeInActingVersion(actingVersion) { + if n.TransactTime < n.TransactTimeMinValue() || n.TransactTime > n.TransactTimeMaxValue() { + return fmt.Errorf("Range check failed on n.TransactTime (%v < %v > %v)", n.TransactTimeMinValue(), n.TransactTime, n.TransactTimeMaxValue()) + } + } + if n.PriceInActingVersion(actingVersion) { + if n.Price < n.PriceMinValue() || n.Price > n.PriceMaxValue() { + return fmt.Errorf("Range check failed on n.Price (%v < %v > %v)", n.PriceMinValue(), n.Price, n.PriceMaxValue()) + } + } + if n.OrigQtyInActingVersion(actingVersion) { + if n.OrigQty < n.OrigQtyMinValue() || n.OrigQty > n.OrigQtyMaxValue() { + return fmt.Errorf("Range check failed on n.OrigQty (%v < %v > %v)", n.OrigQtyMinValue(), n.OrigQty, n.OrigQtyMaxValue()) + } + } + if n.ExecutedQtyInActingVersion(actingVersion) { + if n.ExecutedQty < n.ExecutedQtyMinValue() || n.ExecutedQty > n.ExecutedQtyMaxValue() { + return fmt.Errorf("Range check failed on n.ExecutedQty (%v < %v > %v)", n.ExecutedQtyMinValue(), n.ExecutedQty, n.ExecutedQtyMaxValue()) + } + } + if n.CummulativeQuoteQtyInActingVersion(actingVersion) { + if n.CummulativeQuoteQty < n.CummulativeQuoteQtyMinValue() || n.CummulativeQuoteQty > n.CummulativeQuoteQtyMaxValue() { + return fmt.Errorf("Range check failed on n.CummulativeQuoteQty (%v < %v > %v)", n.CummulativeQuoteQtyMinValue(), n.CummulativeQuoteQty, n.CummulativeQuoteQtyMaxValue()) + } + } + if err := n.Status.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if err := n.TimeInForce.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if err := n.OrderType.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if err := n.Side.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if n.StopPriceInActingVersion(actingVersion) { + if n.StopPrice != n.StopPriceNullValue() && (n.StopPrice < n.StopPriceMinValue() || n.StopPrice > n.StopPriceMaxValue()) { + return fmt.Errorf("Range check failed on n.StopPrice (%v < %v > %v)", n.StopPriceMinValue(), n.StopPrice, n.StopPriceMaxValue()) + } + } + if n.TrailingDeltaInActingVersion(actingVersion) { + if n.TrailingDelta != n.TrailingDeltaNullValue() && (n.TrailingDelta < n.TrailingDeltaMinValue() || n.TrailingDelta > n.TrailingDeltaMaxValue()) { + return fmt.Errorf("Range check failed on n.TrailingDelta (%v < %v > %v)", n.TrailingDeltaMinValue(), n.TrailingDelta, n.TrailingDeltaMaxValue()) + } + } + if n.TrailingTimeInActingVersion(actingVersion) { + if n.TrailingTime != n.TrailingTimeNullValue() && (n.TrailingTime < n.TrailingTimeMinValue() || n.TrailingTime > n.TrailingTimeMaxValue()) { + return fmt.Errorf("Range check failed on n.TrailingTime (%v < %v > %v)", n.TrailingTimeMinValue(), n.TrailingTime, n.TrailingTimeMaxValue()) + } + } + if n.WorkingTimeInActingVersion(actingVersion) { + if n.WorkingTime != n.WorkingTimeNullValue() && (n.WorkingTime < n.WorkingTimeMinValue() || n.WorkingTime > n.WorkingTimeMaxValue()) { + return fmt.Errorf("Range check failed on n.WorkingTime (%v < %v > %v)", n.WorkingTimeMinValue(), n.WorkingTime, n.WorkingTimeMaxValue()) + } + } + if n.IcebergQtyInActingVersion(actingVersion) { + if n.IcebergQty != n.IcebergQtyNullValue() && (n.IcebergQty < n.IcebergQtyMinValue() || n.IcebergQty > n.IcebergQtyMaxValue()) { + return fmt.Errorf("Range check failed on n.IcebergQty (%v < %v > %v)", n.IcebergQtyMinValue(), n.IcebergQty, n.IcebergQtyMaxValue()) + } + } + if n.StrategyIdInActingVersion(actingVersion) { + if n.StrategyId != n.StrategyIdNullValue() && (n.StrategyId < n.StrategyIdMinValue() || n.StrategyId > n.StrategyIdMaxValue()) { + return fmt.Errorf("Range check failed on n.StrategyId (%v < %v > %v)", n.StrategyIdMinValue(), n.StrategyId, n.StrategyIdMaxValue()) + } + } + if n.StrategyTypeInActingVersion(actingVersion) { + if n.StrategyType != n.StrategyTypeNullValue() && (n.StrategyType < n.StrategyTypeMinValue() || n.StrategyType > n.StrategyTypeMaxValue()) { + return fmt.Errorf("Range check failed on n.StrategyType (%v < %v > %v)", n.StrategyTypeMinValue(), n.StrategyType, n.StrategyTypeMaxValue()) + } + } + if err := n.OrderCapacity.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if err := n.WorkingFloor.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if err := n.SelfTradePreventionMode.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if n.TradeGroupIdInActingVersion(actingVersion) { + if n.TradeGroupId != n.TradeGroupIdNullValue() && (n.TradeGroupId < n.TradeGroupIdMinValue() || n.TradeGroupId > n.TradeGroupIdMaxValue()) { + return fmt.Errorf("Range check failed on n.TradeGroupId (%v < %v > %v)", n.TradeGroupIdMinValue(), n.TradeGroupId, n.TradeGroupIdMaxValue()) + } + } + if n.PreventedQuantityInActingVersion(actingVersion) { + if n.PreventedQuantity < n.PreventedQuantityMinValue() || n.PreventedQuantity > n.PreventedQuantityMaxValue() { + return fmt.Errorf("Range check failed on n.PreventedQuantity (%v < %v > %v)", n.PreventedQuantityMinValue(), n.PreventedQuantity, n.PreventedQuantityMaxValue()) + } + } + if err := n.UsedSor.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if n.OrigQuoteOrderQtyInActingVersion(actingVersion) { + if n.OrigQuoteOrderQty < n.OrigQuoteOrderQtyMinValue() || n.OrigQuoteOrderQty > n.OrigQuoteOrderQtyMaxValue() { + return fmt.Errorf("Range check failed on n.OrigQuoteOrderQty (%v < %v > %v)", n.OrigQuoteOrderQtyMinValue(), n.OrigQuoteOrderQty, n.OrigQuoteOrderQtyMaxValue()) + } + } + if err := n.PegPriceType.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if err := n.PegOffsetType.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if n.PegOffsetValueInActingVersion(actingVersion) { + if n.PegOffsetValue != n.PegOffsetValueNullValue() && (n.PegOffsetValue < n.PegOffsetValueMinValue() || n.PegOffsetValue > n.PegOffsetValueMaxValue()) { + return fmt.Errorf("Range check failed on n.PegOffsetValue (%v < %v > %v)", n.PegOffsetValueMinValue(), n.PegOffsetValue, n.PegOffsetValueMaxValue()) + } + } + if n.PeggedPriceInActingVersion(actingVersion) { + if n.PeggedPrice != n.PeggedPriceNullValue() && (n.PeggedPrice < n.PeggedPriceMinValue() || n.PeggedPrice > n.PeggedPriceMaxValue()) { + return fmt.Errorf("Range check failed on n.PeggedPrice (%v < %v > %v)", n.PeggedPriceMinValue(), n.PeggedPrice, n.PeggedPriceMaxValue()) + } + } + for i := range n.Fills { + if err := n.Fills[i].RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + } + for i := range n.PreventedMatches { + if err := n.PreventedMatches[i].RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + } + if !utf8.Valid(n.Symbol[:]) { + return errors.New("n.Symbol failed UTF-8 validation") + } + if !utf8.Valid(n.ClientOrderId[:]) { + return errors.New("n.ClientOrderId failed UTF-8 validation") + } + return nil +} + +func NewOrderListFullResponseOrderReportsInit(n *NewOrderListFullResponseOrderReports) { + n.OrderListId = math.MinInt64 + n.StopPrice = math.MinInt64 + n.TrailingDelta = math.MinInt64 + n.TrailingTime = math.MinInt64 + n.WorkingTime = math.MinInt64 + n.IcebergQty = math.MinInt64 + n.StrategyId = math.MinInt64 + n.StrategyType = math.MinInt32 + n.TradeGroupId = math.MinInt64 + n.PegOffsetValue = math.MaxUint8 + n.PeggedPrice = math.MinInt64 + return +} + +func (n *NewOrderListFullResponseOrderReportsFills) Encode(_m *SbeGoMarshaller, _w io.Writer) error { + if err := _m.WriteInt8(_w, n.CommissionExponent); err != nil { + return err + } + if err := n.MatchType.Encode(_m, _w); err != nil { + return err + } + if err := _m.WriteInt64(_w, n.Price); err != nil { + return err + } + if err := _m.WriteInt64(_w, n.Qty); err != nil { + return err + } + if err := _m.WriteInt64(_w, n.Commission); err != nil { + return err + } + if err := _m.WriteInt64(_w, n.TradeId); err != nil { + return err + } + if err := _m.WriteInt64(_w, n.AllocId); err != nil { + return err + } + if err := _m.WriteUint8(_w, uint8(len(n.CommissionAsset))); err != nil { + return err + } + if err := _m.WriteBytes(_w, n.CommissionAsset); err != nil { + return err + } + return nil +} + +func (n *NewOrderListFullResponseOrderReportsFills) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint) error { + if !n.CommissionExponentInActingVersion(actingVersion) { + n.CommissionExponent = n.CommissionExponentNullValue() + } else { + if err := _m.ReadInt8(_r, &n.CommissionExponent); err != nil { + return err + } + } + if n.MatchTypeInActingVersion(actingVersion) { + if err := n.MatchType.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if !n.PriceInActingVersion(actingVersion) { + n.Price = n.PriceNullValue() + } else { + if err := _m.ReadInt64(_r, &n.Price); err != nil { + return err + } + } + if !n.QtyInActingVersion(actingVersion) { + n.Qty = n.QtyNullValue() + } else { + if err := _m.ReadInt64(_r, &n.Qty); err != nil { + return err + } + } + if !n.CommissionInActingVersion(actingVersion) { + n.Commission = n.CommissionNullValue() + } else { + if err := _m.ReadInt64(_r, &n.Commission); err != nil { + return err + } + } + if !n.TradeIdInActingVersion(actingVersion) { + n.TradeId = n.TradeIdNullValue() + } else { + if err := _m.ReadInt64(_r, &n.TradeId); err != nil { + return err + } + } + if !n.AllocIdInActingVersion(actingVersion) { + n.AllocId = n.AllocIdNullValue() + } else { + if err := _m.ReadInt64(_r, &n.AllocId); err != nil { + return err + } + } + if actingVersion > n.SbeSchemaVersion() && blockLength > n.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-n.SbeBlockLength())) + } + + if n.CommissionAssetInActingVersion(actingVersion) { + var CommissionAssetLength uint8 + if err := _m.ReadUint8(_r, &CommissionAssetLength); err != nil { + return err + } + if cap(n.CommissionAsset) < int(CommissionAssetLength) { + n.CommissionAsset = make([]uint8, CommissionAssetLength) + } + n.CommissionAsset = n.CommissionAsset[:CommissionAssetLength] + if err := _m.ReadBytes(_r, n.CommissionAsset); err != nil { + return err + } + } + return nil +} + +func (n *NewOrderListFullResponseOrderReportsFills) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if n.CommissionExponentInActingVersion(actingVersion) { + if n.CommissionExponent < n.CommissionExponentMinValue() || n.CommissionExponent > n.CommissionExponentMaxValue() { + return fmt.Errorf("Range check failed on n.CommissionExponent (%v < %v > %v)", n.CommissionExponentMinValue(), n.CommissionExponent, n.CommissionExponentMaxValue()) + } + } + if err := n.MatchType.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if n.PriceInActingVersion(actingVersion) { + if n.Price < n.PriceMinValue() || n.Price > n.PriceMaxValue() { + return fmt.Errorf("Range check failed on n.Price (%v < %v > %v)", n.PriceMinValue(), n.Price, n.PriceMaxValue()) + } + } + if n.QtyInActingVersion(actingVersion) { + if n.Qty < n.QtyMinValue() || n.Qty > n.QtyMaxValue() { + return fmt.Errorf("Range check failed on n.Qty (%v < %v > %v)", n.QtyMinValue(), n.Qty, n.QtyMaxValue()) + } + } + if n.CommissionInActingVersion(actingVersion) { + if n.Commission < n.CommissionMinValue() || n.Commission > n.CommissionMaxValue() { + return fmt.Errorf("Range check failed on n.Commission (%v < %v > %v)", n.CommissionMinValue(), n.Commission, n.CommissionMaxValue()) + } + } + if n.TradeIdInActingVersion(actingVersion) { + if n.TradeId != n.TradeIdNullValue() && (n.TradeId < n.TradeIdMinValue() || n.TradeId > n.TradeIdMaxValue()) { + return fmt.Errorf("Range check failed on n.TradeId (%v < %v > %v)", n.TradeIdMinValue(), n.TradeId, n.TradeIdMaxValue()) + } + } + if n.AllocIdInActingVersion(actingVersion) { + if n.AllocId != n.AllocIdNullValue() && (n.AllocId < n.AllocIdMinValue() || n.AllocId > n.AllocIdMaxValue()) { + return fmt.Errorf("Range check failed on n.AllocId (%v < %v > %v)", n.AllocIdMinValue(), n.AllocId, n.AllocIdMaxValue()) + } + } + if !utf8.Valid(n.CommissionAsset[:]) { + return errors.New("n.CommissionAsset failed UTF-8 validation") + } + return nil +} + +func NewOrderListFullResponseOrderReportsFillsInit(n *NewOrderListFullResponseOrderReportsFills) { + n.TradeId = math.MinInt64 + n.AllocId = math.MinInt64 + return +} + +func (n *NewOrderListFullResponseOrderReportsPreventedMatches) Encode(_m *SbeGoMarshaller, _w io.Writer) error { + if err := _m.WriteInt64(_w, n.PreventedMatchId); err != nil { + return err + } + if err := _m.WriteInt64(_w, n.MakerOrderId); err != nil { + return err + } + if err := _m.WriteInt64(_w, n.Price); err != nil { + return err + } + if err := _m.WriteInt64(_w, n.TakerPreventedQuantity); err != nil { + return err + } + if err := _m.WriteInt64(_w, n.MakerPreventedQuantity); err != nil { + return err + } + if err := _m.WriteUint8(_w, uint8(len(n.MakerSymbol))); err != nil { + return err + } + if err := _m.WriteBytes(_w, n.MakerSymbol); err != nil { + return err + } + return nil +} + +func (n *NewOrderListFullResponseOrderReportsPreventedMatches) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint) error { + if !n.PreventedMatchIdInActingVersion(actingVersion) { + n.PreventedMatchId = n.PreventedMatchIdNullValue() + } else { + if err := _m.ReadInt64(_r, &n.PreventedMatchId); err != nil { + return err + } + } + if !n.MakerOrderIdInActingVersion(actingVersion) { + n.MakerOrderId = n.MakerOrderIdNullValue() + } else { + if err := _m.ReadInt64(_r, &n.MakerOrderId); err != nil { + return err + } + } + if !n.PriceInActingVersion(actingVersion) { + n.Price = n.PriceNullValue() + } else { + if err := _m.ReadInt64(_r, &n.Price); err != nil { + return err + } + } + if !n.TakerPreventedQuantityInActingVersion(actingVersion) { + n.TakerPreventedQuantity = n.TakerPreventedQuantityNullValue() + } else { + if err := _m.ReadInt64(_r, &n.TakerPreventedQuantity); err != nil { + return err + } + } + if !n.MakerPreventedQuantityInActingVersion(actingVersion) { + n.MakerPreventedQuantity = n.MakerPreventedQuantityNullValue() + } else { + if err := _m.ReadInt64(_r, &n.MakerPreventedQuantity); err != nil { + return err + } + } + if actingVersion > n.SbeSchemaVersion() && blockLength > n.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-n.SbeBlockLength())) + } + + if n.MakerSymbolInActingVersion(actingVersion) { + var MakerSymbolLength uint8 + if err := _m.ReadUint8(_r, &MakerSymbolLength); err != nil { + return err + } + if cap(n.MakerSymbol) < int(MakerSymbolLength) { + n.MakerSymbol = make([]uint8, MakerSymbolLength) + } + n.MakerSymbol = n.MakerSymbol[:MakerSymbolLength] + if err := _m.ReadBytes(_r, n.MakerSymbol); err != nil { + return err + } + } + return nil +} + +func (n *NewOrderListFullResponseOrderReportsPreventedMatches) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if n.PreventedMatchIdInActingVersion(actingVersion) { + if n.PreventedMatchId < n.PreventedMatchIdMinValue() || n.PreventedMatchId > n.PreventedMatchIdMaxValue() { + return fmt.Errorf("Range check failed on n.PreventedMatchId (%v < %v > %v)", n.PreventedMatchIdMinValue(), n.PreventedMatchId, n.PreventedMatchIdMaxValue()) + } + } + if n.MakerOrderIdInActingVersion(actingVersion) { + if n.MakerOrderId != n.MakerOrderIdNullValue() && (n.MakerOrderId < n.MakerOrderIdMinValue() || n.MakerOrderId > n.MakerOrderIdMaxValue()) { + return fmt.Errorf("Range check failed on n.MakerOrderId (%v < %v > %v)", n.MakerOrderIdMinValue(), n.MakerOrderId, n.MakerOrderIdMaxValue()) + } + } + if n.PriceInActingVersion(actingVersion) { + if n.Price != n.PriceNullValue() && (n.Price < n.PriceMinValue() || n.Price > n.PriceMaxValue()) { + return fmt.Errorf("Range check failed on n.Price (%v < %v > %v)", n.PriceMinValue(), n.Price, n.PriceMaxValue()) + } + } + if n.TakerPreventedQuantityInActingVersion(actingVersion) { + if n.TakerPreventedQuantity != n.TakerPreventedQuantityNullValue() && (n.TakerPreventedQuantity < n.TakerPreventedQuantityMinValue() || n.TakerPreventedQuantity > n.TakerPreventedQuantityMaxValue()) { + return fmt.Errorf("Range check failed on n.TakerPreventedQuantity (%v < %v > %v)", n.TakerPreventedQuantityMinValue(), n.TakerPreventedQuantity, n.TakerPreventedQuantityMaxValue()) + } + } + if n.MakerPreventedQuantityInActingVersion(actingVersion) { + if n.MakerPreventedQuantity != n.MakerPreventedQuantityNullValue() && (n.MakerPreventedQuantity < n.MakerPreventedQuantityMinValue() || n.MakerPreventedQuantity > n.MakerPreventedQuantityMaxValue()) { + return fmt.Errorf("Range check failed on n.MakerPreventedQuantity (%v < %v > %v)", n.MakerPreventedQuantityMinValue(), n.MakerPreventedQuantity, n.MakerPreventedQuantityMaxValue()) + } + } + if !utf8.Valid(n.MakerSymbol[:]) { + return errors.New("n.MakerSymbol failed UTF-8 validation") + } + return nil +} + +func NewOrderListFullResponseOrderReportsPreventedMatchesInit(n *NewOrderListFullResponseOrderReportsPreventedMatches) { + n.MakerOrderId = math.MinInt64 + n.Price = math.MinInt64 + n.TakerPreventedQuantity = math.MinInt64 + n.MakerPreventedQuantity = math.MinInt64 + return +} + +func (*NewOrderListFullResponse) SbeBlockLength() (blockLength uint16) { + return 21 +} + +func (*NewOrderListFullResponse) SbeTemplateId() (templateId uint16) { + return 311 +} + +func (*NewOrderListFullResponse) SbeSchemaId() (schemaId uint16) { + return 3 +} + +func (*NewOrderListFullResponse) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} + +func (*NewOrderListFullResponse) SbeSemanticType() (semanticType []byte) { + return []byte("") +} + +func (*NewOrderListFullResponse) SbeSemanticVersion() (semanticVersion string) { + return "5.2" +} + +func (*NewOrderListFullResponse) OrderListIdId() uint16 { + return 1 +} + +func (*NewOrderListFullResponse) OrderListIdSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderListFullResponse) OrderListIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.OrderListIdSinceVersion() +} + +func (*NewOrderListFullResponse) OrderListIdDeprecated() uint16 { + return 0 +} + +func (*NewOrderListFullResponse) OrderListIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderListFullResponse) OrderListIdMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*NewOrderListFullResponse) OrderListIdMaxValue() int64 { + return math.MaxInt64 +} + +func (*NewOrderListFullResponse) OrderListIdNullValue() int64 { + return math.MinInt64 +} + +func (*NewOrderListFullResponse) ContingencyTypeId() uint16 { + return 2 +} + +func (*NewOrderListFullResponse) ContingencyTypeSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderListFullResponse) ContingencyTypeInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.ContingencyTypeSinceVersion() +} + +func (*NewOrderListFullResponse) ContingencyTypeDeprecated() uint16 { + return 0 +} + +func (*NewOrderListFullResponse) ContingencyTypeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderListFullResponse) ListStatusTypeId() uint16 { + return 3 +} + +func (*NewOrderListFullResponse) ListStatusTypeSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderListFullResponse) ListStatusTypeInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.ListStatusTypeSinceVersion() +} + +func (*NewOrderListFullResponse) ListStatusTypeDeprecated() uint16 { + return 0 +} + +func (*NewOrderListFullResponse) ListStatusTypeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderListFullResponse) ListOrderStatusId() uint16 { + return 4 +} + +func (*NewOrderListFullResponse) ListOrderStatusSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderListFullResponse) ListOrderStatusInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.ListOrderStatusSinceVersion() +} + +func (*NewOrderListFullResponse) ListOrderStatusDeprecated() uint16 { + return 0 +} + +func (*NewOrderListFullResponse) ListOrderStatusMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderListFullResponse) TransactionTimeId() uint16 { + return 5 +} + +func (*NewOrderListFullResponse) TransactionTimeSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderListFullResponse) TransactionTimeInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.TransactionTimeSinceVersion() +} + +func (*NewOrderListFullResponse) TransactionTimeDeprecated() uint16 { + return 0 +} + +func (*NewOrderListFullResponse) TransactionTimeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderListFullResponse) TransactionTimeMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*NewOrderListFullResponse) TransactionTimeMaxValue() int64 { + return math.MaxInt64 +} + +func (*NewOrderListFullResponse) TransactionTimeNullValue() int64 { + return math.MinInt64 +} + +func (*NewOrderListFullResponse) PriceExponentId() uint16 { + return 6 +} + +func (*NewOrderListFullResponse) PriceExponentSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderListFullResponse) PriceExponentInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.PriceExponentSinceVersion() +} + +func (*NewOrderListFullResponse) PriceExponentDeprecated() uint16 { + return 0 +} + +func (*NewOrderListFullResponse) PriceExponentMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderListFullResponse) PriceExponentMinValue() int8 { + return math.MinInt8 + 1 +} + +func (*NewOrderListFullResponse) PriceExponentMaxValue() int8 { + return math.MaxInt8 +} + +func (*NewOrderListFullResponse) PriceExponentNullValue() int8 { + return math.MinInt8 +} + +func (*NewOrderListFullResponse) QtyExponentId() uint16 { + return 7 +} + +func (*NewOrderListFullResponse) QtyExponentSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderListFullResponse) QtyExponentInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.QtyExponentSinceVersion() +} + +func (*NewOrderListFullResponse) QtyExponentDeprecated() uint16 { + return 0 +} + +func (*NewOrderListFullResponse) QtyExponentMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderListFullResponse) QtyExponentMinValue() int8 { + return math.MinInt8 + 1 +} + +func (*NewOrderListFullResponse) QtyExponentMaxValue() int8 { + return math.MaxInt8 +} + +func (*NewOrderListFullResponse) QtyExponentNullValue() int8 { + return math.MinInt8 +} + +func (*NewOrderListFullResponseOrders) OrderIdId() uint16 { + return 1 +} + +func (*NewOrderListFullResponseOrders) OrderIdSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderListFullResponseOrders) OrderIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.OrderIdSinceVersion() +} + +func (*NewOrderListFullResponseOrders) OrderIdDeprecated() uint16 { + return 0 +} + +func (*NewOrderListFullResponseOrders) OrderIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderListFullResponseOrders) OrderIdMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*NewOrderListFullResponseOrders) OrderIdMaxValue() int64 { + return math.MaxInt64 +} + +func (*NewOrderListFullResponseOrders) OrderIdNullValue() int64 { + return math.MinInt64 +} + +func (*NewOrderListFullResponseOrders) SymbolMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderListFullResponseOrders) SymbolSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderListFullResponseOrders) SymbolInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.SymbolSinceVersion() +} + +func (*NewOrderListFullResponseOrders) SymbolDeprecated() uint16 { + return 0 +} + +func (NewOrderListFullResponseOrders) SymbolCharacterEncoding() string { + return "UTF-8" +} + +func (NewOrderListFullResponseOrders) SymbolHeaderLength() uint64 { + return 1 +} + +func (*NewOrderListFullResponseOrders) ClientOrderIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderListFullResponseOrders) ClientOrderIdSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderListFullResponseOrders) ClientOrderIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.ClientOrderIdSinceVersion() +} + +func (*NewOrderListFullResponseOrders) ClientOrderIdDeprecated() uint16 { + return 0 +} + +func (NewOrderListFullResponseOrders) ClientOrderIdCharacterEncoding() string { + return "UTF-8" +} + +func (NewOrderListFullResponseOrders) ClientOrderIdHeaderLength() uint64 { + return 1 +} + +func (*NewOrderListFullResponseOrderReports) OrderIdId() uint16 { + return 1 +} + +func (*NewOrderListFullResponseOrderReports) OrderIdSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderListFullResponseOrderReports) OrderIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.OrderIdSinceVersion() +} + +func (*NewOrderListFullResponseOrderReports) OrderIdDeprecated() uint16 { + return 0 +} + +func (*NewOrderListFullResponseOrderReports) OrderIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderListFullResponseOrderReports) OrderIdMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*NewOrderListFullResponseOrderReports) OrderIdMaxValue() int64 { + return math.MaxInt64 +} + +func (*NewOrderListFullResponseOrderReports) OrderIdNullValue() int64 { + return math.MinInt64 +} + +func (*NewOrderListFullResponseOrderReports) OrderListIdId() uint16 { + return 2 +} + +func (*NewOrderListFullResponseOrderReports) OrderListIdSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderListFullResponseOrderReports) OrderListIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.OrderListIdSinceVersion() +} + +func (*NewOrderListFullResponseOrderReports) OrderListIdDeprecated() uint16 { + return 0 +} + +func (*NewOrderListFullResponseOrderReports) OrderListIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*NewOrderListFullResponseOrderReports) OrderListIdMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*NewOrderListFullResponseOrderReports) OrderListIdMaxValue() int64 { + return math.MaxInt64 +} + +func (*NewOrderListFullResponseOrderReports) OrderListIdNullValue() int64 { + return math.MinInt64 +} + +func (*NewOrderListFullResponseOrderReports) TransactTimeId() uint16 { + return 3 +} + +func (*NewOrderListFullResponseOrderReports) TransactTimeSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderListFullResponseOrderReports) TransactTimeInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.TransactTimeSinceVersion() +} + +func (*NewOrderListFullResponseOrderReports) TransactTimeDeprecated() uint16 { + return 0 +} + +func (*NewOrderListFullResponseOrderReports) TransactTimeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderListFullResponseOrderReports) TransactTimeMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*NewOrderListFullResponseOrderReports) TransactTimeMaxValue() int64 { + return math.MaxInt64 +} + +func (*NewOrderListFullResponseOrderReports) TransactTimeNullValue() int64 { + return math.MinInt64 +} + +func (*NewOrderListFullResponseOrderReports) PriceId() uint16 { + return 4 +} + +func (*NewOrderListFullResponseOrderReports) PriceSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderListFullResponseOrderReports) PriceInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.PriceSinceVersion() +} + +func (*NewOrderListFullResponseOrderReports) PriceDeprecated() uint16 { + return 0 +} + +func (*NewOrderListFullResponseOrderReports) PriceMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderListFullResponseOrderReports) PriceMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*NewOrderListFullResponseOrderReports) PriceMaxValue() int64 { + return math.MaxInt64 +} + +func (*NewOrderListFullResponseOrderReports) PriceNullValue() int64 { + return math.MinInt64 +} + +func (*NewOrderListFullResponseOrderReports) OrigQtyId() uint16 { + return 5 +} + +func (*NewOrderListFullResponseOrderReports) OrigQtySinceVersion() uint16 { + return 0 +} + +func (n *NewOrderListFullResponseOrderReports) OrigQtyInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.OrigQtySinceVersion() +} + +func (*NewOrderListFullResponseOrderReports) OrigQtyDeprecated() uint16 { + return 0 +} + +func (*NewOrderListFullResponseOrderReports) OrigQtyMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderListFullResponseOrderReports) OrigQtyMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*NewOrderListFullResponseOrderReports) OrigQtyMaxValue() int64 { + return math.MaxInt64 +} + +func (*NewOrderListFullResponseOrderReports) OrigQtyNullValue() int64 { + return math.MinInt64 +} + +func (*NewOrderListFullResponseOrderReports) ExecutedQtyId() uint16 { + return 6 +} + +func (*NewOrderListFullResponseOrderReports) ExecutedQtySinceVersion() uint16 { + return 0 +} + +func (n *NewOrderListFullResponseOrderReports) ExecutedQtyInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.ExecutedQtySinceVersion() +} + +func (*NewOrderListFullResponseOrderReports) ExecutedQtyDeprecated() uint16 { + return 0 +} + +func (*NewOrderListFullResponseOrderReports) ExecutedQtyMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderListFullResponseOrderReports) ExecutedQtyMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*NewOrderListFullResponseOrderReports) ExecutedQtyMaxValue() int64 { + return math.MaxInt64 +} + +func (*NewOrderListFullResponseOrderReports) ExecutedQtyNullValue() int64 { + return math.MinInt64 +} + +func (*NewOrderListFullResponseOrderReports) CummulativeQuoteQtyId() uint16 { + return 7 +} + +func (*NewOrderListFullResponseOrderReports) CummulativeQuoteQtySinceVersion() uint16 { + return 0 +} + +func (n *NewOrderListFullResponseOrderReports) CummulativeQuoteQtyInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.CummulativeQuoteQtySinceVersion() +} + +func (*NewOrderListFullResponseOrderReports) CummulativeQuoteQtyDeprecated() uint16 { + return 0 +} + +func (*NewOrderListFullResponseOrderReports) CummulativeQuoteQtyMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderListFullResponseOrderReports) CummulativeQuoteQtyMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*NewOrderListFullResponseOrderReports) CummulativeQuoteQtyMaxValue() int64 { + return math.MaxInt64 +} + +func (*NewOrderListFullResponseOrderReports) CummulativeQuoteQtyNullValue() int64 { + return math.MinInt64 +} + +func (*NewOrderListFullResponseOrderReports) StatusId() uint16 { + return 8 +} + +func (*NewOrderListFullResponseOrderReports) StatusSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderListFullResponseOrderReports) StatusInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.StatusSinceVersion() +} + +func (*NewOrderListFullResponseOrderReports) StatusDeprecated() uint16 { + return 0 +} + +func (*NewOrderListFullResponseOrderReports) StatusMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderListFullResponseOrderReports) TimeInForceId() uint16 { + return 9 +} + +func (*NewOrderListFullResponseOrderReports) TimeInForceSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderListFullResponseOrderReports) TimeInForceInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.TimeInForceSinceVersion() +} + +func (*NewOrderListFullResponseOrderReports) TimeInForceDeprecated() uint16 { + return 0 +} + +func (*NewOrderListFullResponseOrderReports) TimeInForceMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderListFullResponseOrderReports) OrderTypeId() uint16 { + return 10 +} + +func (*NewOrderListFullResponseOrderReports) OrderTypeSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderListFullResponseOrderReports) OrderTypeInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.OrderTypeSinceVersion() +} + +func (*NewOrderListFullResponseOrderReports) OrderTypeDeprecated() uint16 { + return 0 +} + +func (*NewOrderListFullResponseOrderReports) OrderTypeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderListFullResponseOrderReports) SideId() uint16 { + return 11 +} + +func (*NewOrderListFullResponseOrderReports) SideSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderListFullResponseOrderReports) SideInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.SideSinceVersion() +} + +func (*NewOrderListFullResponseOrderReports) SideDeprecated() uint16 { + return 0 +} + +func (*NewOrderListFullResponseOrderReports) SideMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderListFullResponseOrderReports) StopPriceId() uint16 { + return 12 +} + +func (*NewOrderListFullResponseOrderReports) StopPriceSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderListFullResponseOrderReports) StopPriceInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.StopPriceSinceVersion() +} + +func (*NewOrderListFullResponseOrderReports) StopPriceDeprecated() uint16 { + return 0 +} + +func (*NewOrderListFullResponseOrderReports) StopPriceMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*NewOrderListFullResponseOrderReports) StopPriceMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*NewOrderListFullResponseOrderReports) StopPriceMaxValue() int64 { + return math.MaxInt64 +} + +func (*NewOrderListFullResponseOrderReports) StopPriceNullValue() int64 { + return math.MinInt64 +} + +func (*NewOrderListFullResponseOrderReports) TrailingDeltaId() uint16 { + return 13 +} + +func (*NewOrderListFullResponseOrderReports) TrailingDeltaSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderListFullResponseOrderReports) TrailingDeltaInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.TrailingDeltaSinceVersion() +} + +func (*NewOrderListFullResponseOrderReports) TrailingDeltaDeprecated() uint16 { + return 0 +} + +func (*NewOrderListFullResponseOrderReports) TrailingDeltaMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*NewOrderListFullResponseOrderReports) TrailingDeltaMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*NewOrderListFullResponseOrderReports) TrailingDeltaMaxValue() int64 { + return math.MaxInt64 +} + +func (*NewOrderListFullResponseOrderReports) TrailingDeltaNullValue() int64 { + return math.MinInt64 +} + +func (*NewOrderListFullResponseOrderReports) TrailingTimeId() uint16 { + return 14 +} + +func (*NewOrderListFullResponseOrderReports) TrailingTimeSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderListFullResponseOrderReports) TrailingTimeInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.TrailingTimeSinceVersion() +} + +func (*NewOrderListFullResponseOrderReports) TrailingTimeDeprecated() uint16 { + return 0 +} + +func (*NewOrderListFullResponseOrderReports) TrailingTimeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*NewOrderListFullResponseOrderReports) TrailingTimeMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*NewOrderListFullResponseOrderReports) TrailingTimeMaxValue() int64 { + return math.MaxInt64 +} + +func (*NewOrderListFullResponseOrderReports) TrailingTimeNullValue() int64 { + return math.MinInt64 +} + +func (*NewOrderListFullResponseOrderReports) WorkingTimeId() uint16 { + return 15 +} + +func (*NewOrderListFullResponseOrderReports) WorkingTimeSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderListFullResponseOrderReports) WorkingTimeInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.WorkingTimeSinceVersion() +} + +func (*NewOrderListFullResponseOrderReports) WorkingTimeDeprecated() uint16 { + return 0 +} + +func (*NewOrderListFullResponseOrderReports) WorkingTimeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*NewOrderListFullResponseOrderReports) WorkingTimeMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*NewOrderListFullResponseOrderReports) WorkingTimeMaxValue() int64 { + return math.MaxInt64 +} + +func (*NewOrderListFullResponseOrderReports) WorkingTimeNullValue() int64 { + return math.MinInt64 +} + +func (*NewOrderListFullResponseOrderReports) IcebergQtyId() uint16 { + return 16 +} + +func (*NewOrderListFullResponseOrderReports) IcebergQtySinceVersion() uint16 { + return 0 +} + +func (n *NewOrderListFullResponseOrderReports) IcebergQtyInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.IcebergQtySinceVersion() +} + +func (*NewOrderListFullResponseOrderReports) IcebergQtyDeprecated() uint16 { + return 0 +} + +func (*NewOrderListFullResponseOrderReports) IcebergQtyMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*NewOrderListFullResponseOrderReports) IcebergQtyMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*NewOrderListFullResponseOrderReports) IcebergQtyMaxValue() int64 { + return math.MaxInt64 +} + +func (*NewOrderListFullResponseOrderReports) IcebergQtyNullValue() int64 { + return math.MinInt64 +} + +func (*NewOrderListFullResponseOrderReports) StrategyIdId() uint16 { + return 17 +} + +func (*NewOrderListFullResponseOrderReports) StrategyIdSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderListFullResponseOrderReports) StrategyIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.StrategyIdSinceVersion() +} + +func (*NewOrderListFullResponseOrderReports) StrategyIdDeprecated() uint16 { + return 0 +} + +func (*NewOrderListFullResponseOrderReports) StrategyIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*NewOrderListFullResponseOrderReports) StrategyIdMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*NewOrderListFullResponseOrderReports) StrategyIdMaxValue() int64 { + return math.MaxInt64 +} + +func (*NewOrderListFullResponseOrderReports) StrategyIdNullValue() int64 { + return math.MinInt64 +} + +func (*NewOrderListFullResponseOrderReports) StrategyTypeId() uint16 { + return 18 +} + +func (*NewOrderListFullResponseOrderReports) StrategyTypeSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderListFullResponseOrderReports) StrategyTypeInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.StrategyTypeSinceVersion() +} + +func (*NewOrderListFullResponseOrderReports) StrategyTypeDeprecated() uint16 { + return 0 +} + +func (*NewOrderListFullResponseOrderReports) StrategyTypeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*NewOrderListFullResponseOrderReports) StrategyTypeMinValue() int32 { + return math.MinInt32 + 1 +} + +func (*NewOrderListFullResponseOrderReports) StrategyTypeMaxValue() int32 { + return math.MaxInt32 +} + +func (*NewOrderListFullResponseOrderReports) StrategyTypeNullValue() int32 { + return math.MinInt32 +} + +func (*NewOrderListFullResponseOrderReports) OrderCapacityId() uint16 { + return 19 +} + +func (*NewOrderListFullResponseOrderReports) OrderCapacitySinceVersion() uint16 { + return 0 +} + +func (n *NewOrderListFullResponseOrderReports) OrderCapacityInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.OrderCapacitySinceVersion() +} + +func (*NewOrderListFullResponseOrderReports) OrderCapacityDeprecated() uint16 { + return 0 +} + +func (*NewOrderListFullResponseOrderReports) OrderCapacityMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderListFullResponseOrderReports) WorkingFloorId() uint16 { + return 20 +} + +func (*NewOrderListFullResponseOrderReports) WorkingFloorSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderListFullResponseOrderReports) WorkingFloorInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.WorkingFloorSinceVersion() +} + +func (*NewOrderListFullResponseOrderReports) WorkingFloorDeprecated() uint16 { + return 0 +} + +func (*NewOrderListFullResponseOrderReports) WorkingFloorMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderListFullResponseOrderReports) SelfTradePreventionModeId() uint16 { + return 21 +} + +func (*NewOrderListFullResponseOrderReports) SelfTradePreventionModeSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderListFullResponseOrderReports) SelfTradePreventionModeInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.SelfTradePreventionModeSinceVersion() +} + +func (*NewOrderListFullResponseOrderReports) SelfTradePreventionModeDeprecated() uint16 { + return 0 +} + +func (*NewOrderListFullResponseOrderReports) SelfTradePreventionModeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderListFullResponseOrderReports) TradeGroupIdId() uint16 { + return 22 +} + +func (*NewOrderListFullResponseOrderReports) TradeGroupIdSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderListFullResponseOrderReports) TradeGroupIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.TradeGroupIdSinceVersion() +} + +func (*NewOrderListFullResponseOrderReports) TradeGroupIdDeprecated() uint16 { + return 0 +} + +func (*NewOrderListFullResponseOrderReports) TradeGroupIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*NewOrderListFullResponseOrderReports) TradeGroupIdMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*NewOrderListFullResponseOrderReports) TradeGroupIdMaxValue() int64 { + return math.MaxInt64 +} + +func (*NewOrderListFullResponseOrderReports) TradeGroupIdNullValue() int64 { + return math.MinInt64 +} + +func (*NewOrderListFullResponseOrderReports) PreventedQuantityId() uint16 { + return 23 +} + +func (*NewOrderListFullResponseOrderReports) PreventedQuantitySinceVersion() uint16 { + return 0 +} + +func (n *NewOrderListFullResponseOrderReports) PreventedQuantityInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.PreventedQuantitySinceVersion() +} + +func (*NewOrderListFullResponseOrderReports) PreventedQuantityDeprecated() uint16 { + return 0 +} + +func (*NewOrderListFullResponseOrderReports) PreventedQuantityMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderListFullResponseOrderReports) PreventedQuantityMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*NewOrderListFullResponseOrderReports) PreventedQuantityMaxValue() int64 { + return math.MaxInt64 +} + +func (*NewOrderListFullResponseOrderReports) PreventedQuantityNullValue() int64 { + return math.MinInt64 +} + +func (*NewOrderListFullResponseOrderReports) UsedSorId() uint16 { + return 24 +} + +func (*NewOrderListFullResponseOrderReports) UsedSorSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderListFullResponseOrderReports) UsedSorInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.UsedSorSinceVersion() +} + +func (*NewOrderListFullResponseOrderReports) UsedSorDeprecated() uint16 { + return 0 +} + +func (*NewOrderListFullResponseOrderReports) UsedSorMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderListFullResponseOrderReports) OrigQuoteOrderQtyId() uint16 { + return 25 +} + +func (*NewOrderListFullResponseOrderReports) OrigQuoteOrderQtySinceVersion() uint16 { + return 0 +} + +func (n *NewOrderListFullResponseOrderReports) OrigQuoteOrderQtyInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.OrigQuoteOrderQtySinceVersion() +} + +func (*NewOrderListFullResponseOrderReports) OrigQuoteOrderQtyDeprecated() uint16 { + return 0 +} + +func (*NewOrderListFullResponseOrderReports) OrigQuoteOrderQtyMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderListFullResponseOrderReports) OrigQuoteOrderQtyMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*NewOrderListFullResponseOrderReports) OrigQuoteOrderQtyMaxValue() int64 { + return math.MaxInt64 +} + +func (*NewOrderListFullResponseOrderReports) OrigQuoteOrderQtyNullValue() int64 { + return math.MinInt64 +} + +func (*NewOrderListFullResponseOrderReports) PegPriceTypeId() uint16 { + return 26 +} + +func (*NewOrderListFullResponseOrderReports) PegPriceTypeSinceVersion() uint16 { + return 1 +} + +func (n *NewOrderListFullResponseOrderReports) PegPriceTypeInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.PegPriceTypeSinceVersion() +} + +func (*NewOrderListFullResponseOrderReports) PegPriceTypeDeprecated() uint16 { + return 0 +} + +func (*NewOrderListFullResponseOrderReports) PegPriceTypeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*NewOrderListFullResponseOrderReports) PegOffsetTypeId() uint16 { + return 27 +} + +func (*NewOrderListFullResponseOrderReports) PegOffsetTypeSinceVersion() uint16 { + return 1 +} + +func (n *NewOrderListFullResponseOrderReports) PegOffsetTypeInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.PegOffsetTypeSinceVersion() +} + +func (*NewOrderListFullResponseOrderReports) PegOffsetTypeDeprecated() uint16 { + return 0 +} + +func (*NewOrderListFullResponseOrderReports) PegOffsetTypeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*NewOrderListFullResponseOrderReports) PegOffsetValueId() uint16 { + return 28 +} + +func (*NewOrderListFullResponseOrderReports) PegOffsetValueSinceVersion() uint16 { + return 1 +} + +func (n *NewOrderListFullResponseOrderReports) PegOffsetValueInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.PegOffsetValueSinceVersion() +} + +func (*NewOrderListFullResponseOrderReports) PegOffsetValueDeprecated() uint16 { + return 0 +} + +func (*NewOrderListFullResponseOrderReports) PegOffsetValueMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*NewOrderListFullResponseOrderReports) PegOffsetValueMinValue() uint8 { + return 0 +} + +func (*NewOrderListFullResponseOrderReports) PegOffsetValueMaxValue() uint8 { + return math.MaxUint8 - 1 +} + +func (*NewOrderListFullResponseOrderReports) PegOffsetValueNullValue() uint8 { + return math.MaxUint8 +} + +func (*NewOrderListFullResponseOrderReports) PeggedPriceId() uint16 { + return 29 +} + +func (*NewOrderListFullResponseOrderReports) PeggedPriceSinceVersion() uint16 { + return 1 +} + +func (n *NewOrderListFullResponseOrderReports) PeggedPriceInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.PeggedPriceSinceVersion() +} + +func (*NewOrderListFullResponseOrderReports) PeggedPriceDeprecated() uint16 { + return 0 +} + +func (*NewOrderListFullResponseOrderReports) PeggedPriceMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*NewOrderListFullResponseOrderReports) PeggedPriceMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*NewOrderListFullResponseOrderReports) PeggedPriceMaxValue() int64 { + return math.MaxInt64 +} + +func (*NewOrderListFullResponseOrderReports) PeggedPriceNullValue() int64 { + return math.MinInt64 +} + +func (*NewOrderListFullResponseOrderReportsFills) CommissionExponentId() uint16 { + return 1 +} + +func (*NewOrderListFullResponseOrderReportsFills) CommissionExponentSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderListFullResponseOrderReportsFills) CommissionExponentInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.CommissionExponentSinceVersion() +} + +func (*NewOrderListFullResponseOrderReportsFills) CommissionExponentDeprecated() uint16 { + return 0 +} + +func (*NewOrderListFullResponseOrderReportsFills) CommissionExponentMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderListFullResponseOrderReportsFills) CommissionExponentMinValue() int8 { + return math.MinInt8 + 1 +} + +func (*NewOrderListFullResponseOrderReportsFills) CommissionExponentMaxValue() int8 { + return math.MaxInt8 +} + +func (*NewOrderListFullResponseOrderReportsFills) CommissionExponentNullValue() int8 { + return math.MinInt8 +} + +func (*NewOrderListFullResponseOrderReportsFills) MatchTypeId() uint16 { + return 2 +} + +func (*NewOrderListFullResponseOrderReportsFills) MatchTypeSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderListFullResponseOrderReportsFills) MatchTypeInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.MatchTypeSinceVersion() +} + +func (*NewOrderListFullResponseOrderReportsFills) MatchTypeDeprecated() uint16 { + return 0 +} + +func (*NewOrderListFullResponseOrderReportsFills) MatchTypeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderListFullResponseOrderReportsFills) PriceId() uint16 { + return 3 +} + +func (*NewOrderListFullResponseOrderReportsFills) PriceSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderListFullResponseOrderReportsFills) PriceInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.PriceSinceVersion() +} + +func (*NewOrderListFullResponseOrderReportsFills) PriceDeprecated() uint16 { + return 0 +} + +func (*NewOrderListFullResponseOrderReportsFills) PriceMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderListFullResponseOrderReportsFills) PriceMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*NewOrderListFullResponseOrderReportsFills) PriceMaxValue() int64 { + return math.MaxInt64 +} + +func (*NewOrderListFullResponseOrderReportsFills) PriceNullValue() int64 { + return math.MinInt64 +} + +func (*NewOrderListFullResponseOrderReportsFills) QtyId() uint16 { + return 4 +} + +func (*NewOrderListFullResponseOrderReportsFills) QtySinceVersion() uint16 { + return 0 +} + +func (n *NewOrderListFullResponseOrderReportsFills) QtyInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.QtySinceVersion() +} + +func (*NewOrderListFullResponseOrderReportsFills) QtyDeprecated() uint16 { + return 0 +} + +func (*NewOrderListFullResponseOrderReportsFills) QtyMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderListFullResponseOrderReportsFills) QtyMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*NewOrderListFullResponseOrderReportsFills) QtyMaxValue() int64 { + return math.MaxInt64 +} + +func (*NewOrderListFullResponseOrderReportsFills) QtyNullValue() int64 { + return math.MinInt64 +} + +func (*NewOrderListFullResponseOrderReportsFills) CommissionId() uint16 { + return 5 +} + +func (*NewOrderListFullResponseOrderReportsFills) CommissionSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderListFullResponseOrderReportsFills) CommissionInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.CommissionSinceVersion() +} + +func (*NewOrderListFullResponseOrderReportsFills) CommissionDeprecated() uint16 { + return 0 +} + +func (*NewOrderListFullResponseOrderReportsFills) CommissionMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderListFullResponseOrderReportsFills) CommissionMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*NewOrderListFullResponseOrderReportsFills) CommissionMaxValue() int64 { + return math.MaxInt64 +} + +func (*NewOrderListFullResponseOrderReportsFills) CommissionNullValue() int64 { + return math.MinInt64 +} + +func (*NewOrderListFullResponseOrderReportsFills) TradeIdId() uint16 { + return 6 +} + +func (*NewOrderListFullResponseOrderReportsFills) TradeIdSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderListFullResponseOrderReportsFills) TradeIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.TradeIdSinceVersion() +} + +func (*NewOrderListFullResponseOrderReportsFills) TradeIdDeprecated() uint16 { + return 0 +} + +func (*NewOrderListFullResponseOrderReportsFills) TradeIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*NewOrderListFullResponseOrderReportsFills) TradeIdMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*NewOrderListFullResponseOrderReportsFills) TradeIdMaxValue() int64 { + return math.MaxInt64 +} + +func (*NewOrderListFullResponseOrderReportsFills) TradeIdNullValue() int64 { + return math.MinInt64 +} + +func (*NewOrderListFullResponseOrderReportsFills) AllocIdId() uint16 { + return 7 +} + +func (*NewOrderListFullResponseOrderReportsFills) AllocIdSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderListFullResponseOrderReportsFills) AllocIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.AllocIdSinceVersion() +} + +func (*NewOrderListFullResponseOrderReportsFills) AllocIdDeprecated() uint16 { + return 0 +} + +func (*NewOrderListFullResponseOrderReportsFills) AllocIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*NewOrderListFullResponseOrderReportsFills) AllocIdMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*NewOrderListFullResponseOrderReportsFills) AllocIdMaxValue() int64 { + return math.MaxInt64 +} + +func (*NewOrderListFullResponseOrderReportsFills) AllocIdNullValue() int64 { + return math.MinInt64 +} + +func (*NewOrderListFullResponseOrderReportsFills) CommissionAssetMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderListFullResponseOrderReportsFills) CommissionAssetSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderListFullResponseOrderReportsFills) CommissionAssetInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.CommissionAssetSinceVersion() +} + +func (*NewOrderListFullResponseOrderReportsFills) CommissionAssetDeprecated() uint16 { + return 0 +} + +func (NewOrderListFullResponseOrderReportsFills) CommissionAssetCharacterEncoding() string { + return "UTF-8" +} + +func (NewOrderListFullResponseOrderReportsFills) CommissionAssetHeaderLength() uint64 { + return 1 +} + +func (*NewOrderListFullResponseOrderReportsPreventedMatches) PreventedMatchIdId() uint16 { + return 1 +} + +func (*NewOrderListFullResponseOrderReportsPreventedMatches) PreventedMatchIdSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderListFullResponseOrderReportsPreventedMatches) PreventedMatchIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.PreventedMatchIdSinceVersion() +} + +func (*NewOrderListFullResponseOrderReportsPreventedMatches) PreventedMatchIdDeprecated() uint16 { + return 0 +} + +func (*NewOrderListFullResponseOrderReportsPreventedMatches) PreventedMatchIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderListFullResponseOrderReportsPreventedMatches) PreventedMatchIdMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*NewOrderListFullResponseOrderReportsPreventedMatches) PreventedMatchIdMaxValue() int64 { + return math.MaxInt64 +} + +func (*NewOrderListFullResponseOrderReportsPreventedMatches) PreventedMatchIdNullValue() int64 { + return math.MinInt64 +} + +func (*NewOrderListFullResponseOrderReportsPreventedMatches) MakerOrderIdId() uint16 { + return 2 +} + +func (*NewOrderListFullResponseOrderReportsPreventedMatches) MakerOrderIdSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderListFullResponseOrderReportsPreventedMatches) MakerOrderIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.MakerOrderIdSinceVersion() +} + +func (*NewOrderListFullResponseOrderReportsPreventedMatches) MakerOrderIdDeprecated() uint16 { + return 0 +} + +func (*NewOrderListFullResponseOrderReportsPreventedMatches) MakerOrderIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*NewOrderListFullResponseOrderReportsPreventedMatches) MakerOrderIdMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*NewOrderListFullResponseOrderReportsPreventedMatches) MakerOrderIdMaxValue() int64 { + return math.MaxInt64 +} + +func (*NewOrderListFullResponseOrderReportsPreventedMatches) MakerOrderIdNullValue() int64 { + return math.MinInt64 +} + +func (*NewOrderListFullResponseOrderReportsPreventedMatches) PriceId() uint16 { + return 3 +} + +func (*NewOrderListFullResponseOrderReportsPreventedMatches) PriceSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderListFullResponseOrderReportsPreventedMatches) PriceInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.PriceSinceVersion() +} + +func (*NewOrderListFullResponseOrderReportsPreventedMatches) PriceDeprecated() uint16 { + return 0 +} + +func (*NewOrderListFullResponseOrderReportsPreventedMatches) PriceMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*NewOrderListFullResponseOrderReportsPreventedMatches) PriceMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*NewOrderListFullResponseOrderReportsPreventedMatches) PriceMaxValue() int64 { + return math.MaxInt64 +} + +func (*NewOrderListFullResponseOrderReportsPreventedMatches) PriceNullValue() int64 { + return math.MinInt64 +} + +func (*NewOrderListFullResponseOrderReportsPreventedMatches) TakerPreventedQuantityId() uint16 { + return 4 +} + +func (*NewOrderListFullResponseOrderReportsPreventedMatches) TakerPreventedQuantitySinceVersion() uint16 { + return 0 +} + +func (n *NewOrderListFullResponseOrderReportsPreventedMatches) TakerPreventedQuantityInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.TakerPreventedQuantitySinceVersion() +} + +func (*NewOrderListFullResponseOrderReportsPreventedMatches) TakerPreventedQuantityDeprecated() uint16 { + return 0 +} + +func (*NewOrderListFullResponseOrderReportsPreventedMatches) TakerPreventedQuantityMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*NewOrderListFullResponseOrderReportsPreventedMatches) TakerPreventedQuantityMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*NewOrderListFullResponseOrderReportsPreventedMatches) TakerPreventedQuantityMaxValue() int64 { + return math.MaxInt64 +} + +func (*NewOrderListFullResponseOrderReportsPreventedMatches) TakerPreventedQuantityNullValue() int64 { + return math.MinInt64 +} + +func (*NewOrderListFullResponseOrderReportsPreventedMatches) MakerPreventedQuantityId() uint16 { + return 5 +} + +func (*NewOrderListFullResponseOrderReportsPreventedMatches) MakerPreventedQuantitySinceVersion() uint16 { + return 0 +} + +func (n *NewOrderListFullResponseOrderReportsPreventedMatches) MakerPreventedQuantityInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.MakerPreventedQuantitySinceVersion() +} + +func (*NewOrderListFullResponseOrderReportsPreventedMatches) MakerPreventedQuantityDeprecated() uint16 { + return 0 +} + +func (*NewOrderListFullResponseOrderReportsPreventedMatches) MakerPreventedQuantityMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*NewOrderListFullResponseOrderReportsPreventedMatches) MakerPreventedQuantityMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*NewOrderListFullResponseOrderReportsPreventedMatches) MakerPreventedQuantityMaxValue() int64 { + return math.MaxInt64 +} + +func (*NewOrderListFullResponseOrderReportsPreventedMatches) MakerPreventedQuantityNullValue() int64 { + return math.MinInt64 +} + +func (*NewOrderListFullResponseOrderReportsPreventedMatches) MakerSymbolMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderListFullResponseOrderReportsPreventedMatches) MakerSymbolSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderListFullResponseOrderReportsPreventedMatches) MakerSymbolInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.MakerSymbolSinceVersion() +} + +func (*NewOrderListFullResponseOrderReportsPreventedMatches) MakerSymbolDeprecated() uint16 { + return 0 +} + +func (NewOrderListFullResponseOrderReportsPreventedMatches) MakerSymbolCharacterEncoding() string { + return "UTF-8" +} + +func (NewOrderListFullResponseOrderReportsPreventedMatches) MakerSymbolHeaderLength() uint64 { + return 1 +} + +func (*NewOrderListFullResponseOrderReports) SymbolMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderListFullResponseOrderReports) SymbolSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderListFullResponseOrderReports) SymbolInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.SymbolSinceVersion() +} + +func (*NewOrderListFullResponseOrderReports) SymbolDeprecated() uint16 { + return 0 +} + +func (NewOrderListFullResponseOrderReports) SymbolCharacterEncoding() string { + return "UTF-8" +} + +func (NewOrderListFullResponseOrderReports) SymbolHeaderLength() uint64 { + return 1 +} + +func (*NewOrderListFullResponseOrderReports) ClientOrderIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderListFullResponseOrderReports) ClientOrderIdSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderListFullResponseOrderReports) ClientOrderIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.ClientOrderIdSinceVersion() +} + +func (*NewOrderListFullResponseOrderReports) ClientOrderIdDeprecated() uint16 { + return 0 +} + +func (NewOrderListFullResponseOrderReports) ClientOrderIdCharacterEncoding() string { + return "UTF-8" +} + +func (NewOrderListFullResponseOrderReports) ClientOrderIdHeaderLength() uint64 { + return 1 +} + +func (*NewOrderListFullResponse) OrdersId() uint16 { + return 100 +} + +func (*NewOrderListFullResponse) OrdersSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderListFullResponse) OrdersInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.OrdersSinceVersion() +} + +func (*NewOrderListFullResponse) OrdersDeprecated() uint16 { + return 0 +} + +func (*NewOrderListFullResponseOrders) SbeBlockLength() (blockLength uint) { + return 8 +} + +func (*NewOrderListFullResponseOrders) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} + +func (*NewOrderListFullResponse) OrderReportsId() uint16 { + return 101 +} + +func (*NewOrderListFullResponse) OrderReportsSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderListFullResponse) OrderReportsInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.OrderReportsSinceVersion() +} + +func (*NewOrderListFullResponse) OrderReportsDeprecated() uint16 { + return 0 +} + +func (*NewOrderListFullResponseOrderReports) SbeBlockLength() (blockLength uint) { + return 151 +} + +func (*NewOrderListFullResponseOrderReports) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} + +func (*NewOrderListFullResponseOrderReports) FillsId() uint16 { + return 100 +} + +func (*NewOrderListFullResponseOrderReports) FillsSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderListFullResponseOrderReports) FillsInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.FillsSinceVersion() +} + +func (*NewOrderListFullResponseOrderReports) FillsDeprecated() uint16 { + return 0 +} + +func (*NewOrderListFullResponseOrderReportsFills) SbeBlockLength() (blockLength uint) { + return 42 +} + +func (*NewOrderListFullResponseOrderReportsFills) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} + +func (*NewOrderListFullResponseOrderReports) PreventedMatchesId() uint16 { + return 101 +} + +func (*NewOrderListFullResponseOrderReports) PreventedMatchesSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderListFullResponseOrderReports) PreventedMatchesInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.PreventedMatchesSinceVersion() +} + +func (*NewOrderListFullResponseOrderReports) PreventedMatchesDeprecated() uint16 { + return 0 +} + +func (*NewOrderListFullResponseOrderReportsPreventedMatches) SbeBlockLength() (blockLength uint) { + return 40 +} + +func (*NewOrderListFullResponseOrderReportsPreventedMatches) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} + +func (*NewOrderListFullResponse) ListClientOrderIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderListFullResponse) ListClientOrderIdSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderListFullResponse) ListClientOrderIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.ListClientOrderIdSinceVersion() +} + +func (*NewOrderListFullResponse) ListClientOrderIdDeprecated() uint16 { + return 0 +} + +func (NewOrderListFullResponse) ListClientOrderIdCharacterEncoding() string { + return "UTF-8" +} + +func (NewOrderListFullResponse) ListClientOrderIdHeaderLength() uint64 { + return 1 +} + +func (*NewOrderListFullResponse) SymbolMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderListFullResponse) SymbolSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderListFullResponse) SymbolInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.SymbolSinceVersion() +} + +func (*NewOrderListFullResponse) SymbolDeprecated() uint16 { + return 0 +} + +func (NewOrderListFullResponse) SymbolCharacterEncoding() string { + return "UTF-8" +} + +func (NewOrderListFullResponse) SymbolHeaderLength() uint64 { + return 1 +} diff --git a/v2/sbe/spot_3_1/NewOrderListResultResponse.go b/v2/sbe/spot_3_1/NewOrderListResultResponse.go new file mode 100644 index 00000000..92c8b313 --- /dev/null +++ b/v2/sbe/spot_3_1/NewOrderListResultResponse.go @@ -0,0 +1,2533 @@ +// Generated SBE (Simple Binary Encoding) message codec + +package sbe + +import ( + "errors" + "fmt" + "io" + "io/ioutil" + "math" + "unicode/utf8" +) + +type NewOrderListResultResponse struct { + OrderListId int64 + ContingencyType ContingencyTypeEnum + ListStatusType ListStatusTypeEnum + ListOrderStatus ListOrderStatusEnum + TransactionTime int64 + PriceExponent int8 + QtyExponent int8 + Orders []NewOrderListResultResponseOrders + OrderReports []NewOrderListResultResponseOrderReports + ListClientOrderId []uint8 + Symbol []uint8 +} +type NewOrderListResultResponseOrders struct { + OrderId int64 + Symbol []uint8 + ClientOrderId []uint8 +} +type NewOrderListResultResponseOrderReports struct { + OrderId int64 + OrderListId int64 + TransactTime int64 + Price int64 + OrigQty int64 + ExecutedQty int64 + CummulativeQuoteQty int64 + Status OrderStatusEnum + TimeInForce TimeInForceEnum + OrderType OrderTypeEnum + Side OrderSideEnum + StopPrice int64 + TrailingDelta int64 + TrailingTime int64 + WorkingTime int64 + IcebergQty int64 + StrategyId int64 + StrategyType int32 + OrderCapacity OrderCapacityEnum + WorkingFloor FloorEnum + SelfTradePreventionMode SelfTradePreventionModeEnum + TradeGroupId int64 + PreventedQuantity int64 + UsedSor BoolEnumEnum + OrigQuoteOrderQty int64 + PegPriceType PegPriceTypeEnum + PegOffsetType PegOffsetTypeEnum + PegOffsetValue uint8 + PeggedPrice int64 + Symbol []uint8 + ClientOrderId []uint8 +} + +func (n *NewOrderListResultResponse) Encode(_m *SbeGoMarshaller, _w io.Writer, doRangeCheck bool) error { + if doRangeCheck { + if err := n.RangeCheck(n.SbeSchemaVersion(), n.SbeSchemaVersion()); err != nil { + return err + } + } + if err := _m.WriteInt64(_w, n.OrderListId); err != nil { + return err + } + if err := n.ContingencyType.Encode(_m, _w); err != nil { + return err + } + if err := n.ListStatusType.Encode(_m, _w); err != nil { + return err + } + if err := n.ListOrderStatus.Encode(_m, _w); err != nil { + return err + } + if err := _m.WriteInt64(_w, n.TransactionTime); err != nil { + return err + } + if err := _m.WriteInt8(_w, n.PriceExponent); err != nil { + return err + } + if err := _m.WriteInt8(_w, n.QtyExponent); err != nil { + return err + } + var OrdersBlockLength uint16 = 8 + if err := _m.WriteUint16(_w, OrdersBlockLength); err != nil { + return err + } + var OrdersNumInGroup uint16 = uint16(len(n.Orders)) + if err := _m.WriteUint16(_w, OrdersNumInGroup); err != nil { + return err + } + for i := range n.Orders { + if err := n.Orders[i].Encode(_m, _w); err != nil { + return err + } + } + var OrderReportsBlockLength uint16 = 151 + if err := _m.WriteUint16(_w, OrderReportsBlockLength); err != nil { + return err + } + var OrderReportsNumInGroup uint16 = uint16(len(n.OrderReports)) + if err := _m.WriteUint16(_w, OrderReportsNumInGroup); err != nil { + return err + } + for i := range n.OrderReports { + if err := n.OrderReports[i].Encode(_m, _w); err != nil { + return err + } + } + if err := _m.WriteUint8(_w, uint8(len(n.ListClientOrderId))); err != nil { + return err + } + if err := _m.WriteBytes(_w, n.ListClientOrderId); err != nil { + return err + } + if err := _m.WriteUint8(_w, uint8(len(n.Symbol))); err != nil { + return err + } + if err := _m.WriteBytes(_w, n.Symbol); err != nil { + return err + } + return nil +} + +func (n *NewOrderListResultResponse) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint16, doRangeCheck bool) error { + if !n.OrderListIdInActingVersion(actingVersion) { + n.OrderListId = n.OrderListIdNullValue() + } else { + if err := _m.ReadInt64(_r, &n.OrderListId); err != nil { + return err + } + } + if n.ContingencyTypeInActingVersion(actingVersion) { + if err := n.ContingencyType.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if n.ListStatusTypeInActingVersion(actingVersion) { + if err := n.ListStatusType.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if n.ListOrderStatusInActingVersion(actingVersion) { + if err := n.ListOrderStatus.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if !n.TransactionTimeInActingVersion(actingVersion) { + n.TransactionTime = n.TransactionTimeNullValue() + } else { + if err := _m.ReadInt64(_r, &n.TransactionTime); err != nil { + return err + } + } + if !n.PriceExponentInActingVersion(actingVersion) { + n.PriceExponent = n.PriceExponentNullValue() + } else { + if err := _m.ReadInt8(_r, &n.PriceExponent); err != nil { + return err + } + } + if !n.QtyExponentInActingVersion(actingVersion) { + n.QtyExponent = n.QtyExponentNullValue() + } else { + if err := _m.ReadInt8(_r, &n.QtyExponent); err != nil { + return err + } + } + if actingVersion > n.SbeSchemaVersion() && blockLength > n.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-n.SbeBlockLength())) + } + + if n.OrdersInActingVersion(actingVersion) { + var OrdersBlockLength uint16 + if err := _m.ReadUint16(_r, &OrdersBlockLength); err != nil { + return err + } + var OrdersNumInGroup uint16 + if err := _m.ReadUint16(_r, &OrdersNumInGroup); err != nil { + return err + } + if cap(n.Orders) < int(OrdersNumInGroup) { + n.Orders = make([]NewOrderListResultResponseOrders, OrdersNumInGroup) + } + n.Orders = n.Orders[:OrdersNumInGroup] + for i := range n.Orders { + if err := n.Orders[i].Decode(_m, _r, actingVersion, uint(OrdersBlockLength)); err != nil { + return err + } + } + } + + if n.OrderReportsInActingVersion(actingVersion) { + var OrderReportsBlockLength uint16 + if err := _m.ReadUint16(_r, &OrderReportsBlockLength); err != nil { + return err + } + var OrderReportsNumInGroup uint16 + if err := _m.ReadUint16(_r, &OrderReportsNumInGroup); err != nil { + return err + } + if cap(n.OrderReports) < int(OrderReportsNumInGroup) { + n.OrderReports = make([]NewOrderListResultResponseOrderReports, OrderReportsNumInGroup) + } + n.OrderReports = n.OrderReports[:OrderReportsNumInGroup] + for i := range n.OrderReports { + if err := n.OrderReports[i].Decode(_m, _r, actingVersion, uint(OrderReportsBlockLength)); err != nil { + return err + } + } + } + + if n.ListClientOrderIdInActingVersion(actingVersion) { + var ListClientOrderIdLength uint8 + if err := _m.ReadUint8(_r, &ListClientOrderIdLength); err != nil { + return err + } + if cap(n.ListClientOrderId) < int(ListClientOrderIdLength) { + n.ListClientOrderId = make([]uint8, ListClientOrderIdLength) + } + n.ListClientOrderId = n.ListClientOrderId[:ListClientOrderIdLength] + if err := _m.ReadBytes(_r, n.ListClientOrderId); err != nil { + return err + } + } + + if n.SymbolInActingVersion(actingVersion) { + var SymbolLength uint8 + if err := _m.ReadUint8(_r, &SymbolLength); err != nil { + return err + } + if cap(n.Symbol) < int(SymbolLength) { + n.Symbol = make([]uint8, SymbolLength) + } + n.Symbol = n.Symbol[:SymbolLength] + if err := _m.ReadBytes(_r, n.Symbol); err != nil { + return err + } + } + if doRangeCheck { + if err := n.RangeCheck(actingVersion, n.SbeSchemaVersion()); err != nil { + return err + } + } + return nil +} + +func (n *NewOrderListResultResponse) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if n.OrderListIdInActingVersion(actingVersion) { + if n.OrderListId < n.OrderListIdMinValue() || n.OrderListId > n.OrderListIdMaxValue() { + return fmt.Errorf("Range check failed on n.OrderListId (%v < %v > %v)", n.OrderListIdMinValue(), n.OrderListId, n.OrderListIdMaxValue()) + } + } + if err := n.ContingencyType.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if err := n.ListStatusType.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if err := n.ListOrderStatus.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if n.TransactionTimeInActingVersion(actingVersion) { + if n.TransactionTime < n.TransactionTimeMinValue() || n.TransactionTime > n.TransactionTimeMaxValue() { + return fmt.Errorf("Range check failed on n.TransactionTime (%v < %v > %v)", n.TransactionTimeMinValue(), n.TransactionTime, n.TransactionTimeMaxValue()) + } + } + if n.PriceExponentInActingVersion(actingVersion) { + if n.PriceExponent < n.PriceExponentMinValue() || n.PriceExponent > n.PriceExponentMaxValue() { + return fmt.Errorf("Range check failed on n.PriceExponent (%v < %v > %v)", n.PriceExponentMinValue(), n.PriceExponent, n.PriceExponentMaxValue()) + } + } + if n.QtyExponentInActingVersion(actingVersion) { + if n.QtyExponent < n.QtyExponentMinValue() || n.QtyExponent > n.QtyExponentMaxValue() { + return fmt.Errorf("Range check failed on n.QtyExponent (%v < %v > %v)", n.QtyExponentMinValue(), n.QtyExponent, n.QtyExponentMaxValue()) + } + } + for i := range n.Orders { + if err := n.Orders[i].RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + } + for i := range n.OrderReports { + if err := n.OrderReports[i].RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + } + if !utf8.Valid(n.ListClientOrderId[:]) { + return errors.New("n.ListClientOrderId failed UTF-8 validation") + } + if !utf8.Valid(n.Symbol[:]) { + return errors.New("n.Symbol failed UTF-8 validation") + } + return nil +} + +func NewOrderListResultResponseInit(n *NewOrderListResultResponse) { + return +} + +func (n *NewOrderListResultResponseOrders) Encode(_m *SbeGoMarshaller, _w io.Writer) error { + if err := _m.WriteInt64(_w, n.OrderId); err != nil { + return err + } + if err := _m.WriteUint8(_w, uint8(len(n.Symbol))); err != nil { + return err + } + if err := _m.WriteBytes(_w, n.Symbol); err != nil { + return err + } + if err := _m.WriteUint8(_w, uint8(len(n.ClientOrderId))); err != nil { + return err + } + if err := _m.WriteBytes(_w, n.ClientOrderId); err != nil { + return err + } + return nil +} + +func (n *NewOrderListResultResponseOrders) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint) error { + if !n.OrderIdInActingVersion(actingVersion) { + n.OrderId = n.OrderIdNullValue() + } else { + if err := _m.ReadInt64(_r, &n.OrderId); err != nil { + return err + } + } + if actingVersion > n.SbeSchemaVersion() && blockLength > n.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-n.SbeBlockLength())) + } + + if n.SymbolInActingVersion(actingVersion) { + var SymbolLength uint8 + if err := _m.ReadUint8(_r, &SymbolLength); err != nil { + return err + } + if cap(n.Symbol) < int(SymbolLength) { + n.Symbol = make([]uint8, SymbolLength) + } + n.Symbol = n.Symbol[:SymbolLength] + if err := _m.ReadBytes(_r, n.Symbol); err != nil { + return err + } + } + + if n.ClientOrderIdInActingVersion(actingVersion) { + var ClientOrderIdLength uint8 + if err := _m.ReadUint8(_r, &ClientOrderIdLength); err != nil { + return err + } + if cap(n.ClientOrderId) < int(ClientOrderIdLength) { + n.ClientOrderId = make([]uint8, ClientOrderIdLength) + } + n.ClientOrderId = n.ClientOrderId[:ClientOrderIdLength] + if err := _m.ReadBytes(_r, n.ClientOrderId); err != nil { + return err + } + } + return nil +} + +func (n *NewOrderListResultResponseOrders) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if n.OrderIdInActingVersion(actingVersion) { + if n.OrderId < n.OrderIdMinValue() || n.OrderId > n.OrderIdMaxValue() { + return fmt.Errorf("Range check failed on n.OrderId (%v < %v > %v)", n.OrderIdMinValue(), n.OrderId, n.OrderIdMaxValue()) + } + } + if !utf8.Valid(n.Symbol[:]) { + return errors.New("n.Symbol failed UTF-8 validation") + } + if !utf8.Valid(n.ClientOrderId[:]) { + return errors.New("n.ClientOrderId failed UTF-8 validation") + } + return nil +} + +func NewOrderListResultResponseOrdersInit(n *NewOrderListResultResponseOrders) { + return +} + +func (n *NewOrderListResultResponseOrderReports) Encode(_m *SbeGoMarshaller, _w io.Writer) error { + if err := _m.WriteInt64(_w, n.OrderId); err != nil { + return err + } + if err := _m.WriteInt64(_w, n.OrderListId); err != nil { + return err + } + if err := _m.WriteInt64(_w, n.TransactTime); err != nil { + return err + } + if err := _m.WriteInt64(_w, n.Price); err != nil { + return err + } + if err := _m.WriteInt64(_w, n.OrigQty); err != nil { + return err + } + if err := _m.WriteInt64(_w, n.ExecutedQty); err != nil { + return err + } + if err := _m.WriteInt64(_w, n.CummulativeQuoteQty); err != nil { + return err + } + if err := n.Status.Encode(_m, _w); err != nil { + return err + } + if err := n.TimeInForce.Encode(_m, _w); err != nil { + return err + } + if err := n.OrderType.Encode(_m, _w); err != nil { + return err + } + if err := n.Side.Encode(_m, _w); err != nil { + return err + } + if err := _m.WriteInt64(_w, n.StopPrice); err != nil { + return err + } + if err := _m.WriteInt64(_w, n.TrailingDelta); err != nil { + return err + } + if err := _m.WriteInt64(_w, n.TrailingTime); err != nil { + return err + } + if err := _m.WriteInt64(_w, n.WorkingTime); err != nil { + return err + } + if err := _m.WriteInt64(_w, n.IcebergQty); err != nil { + return err + } + if err := _m.WriteInt64(_w, n.StrategyId); err != nil { + return err + } + if err := _m.WriteInt32(_w, n.StrategyType); err != nil { + return err + } + if err := n.OrderCapacity.Encode(_m, _w); err != nil { + return err + } + if err := n.WorkingFloor.Encode(_m, _w); err != nil { + return err + } + if err := n.SelfTradePreventionMode.Encode(_m, _w); err != nil { + return err + } + if err := _m.WriteInt64(_w, n.TradeGroupId); err != nil { + return err + } + if err := _m.WriteInt64(_w, n.PreventedQuantity); err != nil { + return err + } + if err := n.UsedSor.Encode(_m, _w); err != nil { + return err + } + if err := _m.WriteInt64(_w, n.OrigQuoteOrderQty); err != nil { + return err + } + if err := n.PegPriceType.Encode(_m, _w); err != nil { + return err + } + if err := n.PegOffsetType.Encode(_m, _w); err != nil { + return err + } + if err := _m.WriteUint8(_w, n.PegOffsetValue); err != nil { + return err + } + if err := _m.WriteInt64(_w, n.PeggedPrice); err != nil { + return err + } + if err := _m.WriteUint8(_w, uint8(len(n.Symbol))); err != nil { + return err + } + if err := _m.WriteBytes(_w, n.Symbol); err != nil { + return err + } + if err := _m.WriteUint8(_w, uint8(len(n.ClientOrderId))); err != nil { + return err + } + if err := _m.WriteBytes(_w, n.ClientOrderId); err != nil { + return err + } + return nil +} + +func (n *NewOrderListResultResponseOrderReports) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint) error { + if !n.OrderIdInActingVersion(actingVersion) { + n.OrderId = n.OrderIdNullValue() + } else { + if err := _m.ReadInt64(_r, &n.OrderId); err != nil { + return err + } + } + if !n.OrderListIdInActingVersion(actingVersion) { + n.OrderListId = n.OrderListIdNullValue() + } else { + if err := _m.ReadInt64(_r, &n.OrderListId); err != nil { + return err + } + } + if !n.TransactTimeInActingVersion(actingVersion) { + n.TransactTime = n.TransactTimeNullValue() + } else { + if err := _m.ReadInt64(_r, &n.TransactTime); err != nil { + return err + } + } + if !n.PriceInActingVersion(actingVersion) { + n.Price = n.PriceNullValue() + } else { + if err := _m.ReadInt64(_r, &n.Price); err != nil { + return err + } + } + if !n.OrigQtyInActingVersion(actingVersion) { + n.OrigQty = n.OrigQtyNullValue() + } else { + if err := _m.ReadInt64(_r, &n.OrigQty); err != nil { + return err + } + } + if !n.ExecutedQtyInActingVersion(actingVersion) { + n.ExecutedQty = n.ExecutedQtyNullValue() + } else { + if err := _m.ReadInt64(_r, &n.ExecutedQty); err != nil { + return err + } + } + if !n.CummulativeQuoteQtyInActingVersion(actingVersion) { + n.CummulativeQuoteQty = n.CummulativeQuoteQtyNullValue() + } else { + if err := _m.ReadInt64(_r, &n.CummulativeQuoteQty); err != nil { + return err + } + } + if n.StatusInActingVersion(actingVersion) { + if err := n.Status.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if n.TimeInForceInActingVersion(actingVersion) { + if err := n.TimeInForce.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if n.OrderTypeInActingVersion(actingVersion) { + if err := n.OrderType.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if n.SideInActingVersion(actingVersion) { + if err := n.Side.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if !n.StopPriceInActingVersion(actingVersion) { + n.StopPrice = n.StopPriceNullValue() + } else { + if err := _m.ReadInt64(_r, &n.StopPrice); err != nil { + return err + } + } + if !n.TrailingDeltaInActingVersion(actingVersion) { + n.TrailingDelta = n.TrailingDeltaNullValue() + } else { + if err := _m.ReadInt64(_r, &n.TrailingDelta); err != nil { + return err + } + } + if !n.TrailingTimeInActingVersion(actingVersion) { + n.TrailingTime = n.TrailingTimeNullValue() + } else { + if err := _m.ReadInt64(_r, &n.TrailingTime); err != nil { + return err + } + } + if !n.WorkingTimeInActingVersion(actingVersion) { + n.WorkingTime = n.WorkingTimeNullValue() + } else { + if err := _m.ReadInt64(_r, &n.WorkingTime); err != nil { + return err + } + } + if !n.IcebergQtyInActingVersion(actingVersion) { + n.IcebergQty = n.IcebergQtyNullValue() + } else { + if err := _m.ReadInt64(_r, &n.IcebergQty); err != nil { + return err + } + } + if !n.StrategyIdInActingVersion(actingVersion) { + n.StrategyId = n.StrategyIdNullValue() + } else { + if err := _m.ReadInt64(_r, &n.StrategyId); err != nil { + return err + } + } + if !n.StrategyTypeInActingVersion(actingVersion) { + n.StrategyType = n.StrategyTypeNullValue() + } else { + if err := _m.ReadInt32(_r, &n.StrategyType); err != nil { + return err + } + } + if n.OrderCapacityInActingVersion(actingVersion) { + if err := n.OrderCapacity.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if n.WorkingFloorInActingVersion(actingVersion) { + if err := n.WorkingFloor.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if n.SelfTradePreventionModeInActingVersion(actingVersion) { + if err := n.SelfTradePreventionMode.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if !n.TradeGroupIdInActingVersion(actingVersion) { + n.TradeGroupId = n.TradeGroupIdNullValue() + } else { + if err := _m.ReadInt64(_r, &n.TradeGroupId); err != nil { + return err + } + } + if !n.PreventedQuantityInActingVersion(actingVersion) { + n.PreventedQuantity = n.PreventedQuantityNullValue() + } else { + if err := _m.ReadInt64(_r, &n.PreventedQuantity); err != nil { + return err + } + } + if n.UsedSorInActingVersion(actingVersion) { + if err := n.UsedSor.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if !n.OrigQuoteOrderQtyInActingVersion(actingVersion) { + n.OrigQuoteOrderQty = n.OrigQuoteOrderQtyNullValue() + } else { + if err := _m.ReadInt64(_r, &n.OrigQuoteOrderQty); err != nil { + return err + } + } + if n.PegPriceTypeInActingVersion(actingVersion) { + if err := n.PegPriceType.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if n.PegOffsetTypeInActingVersion(actingVersion) { + if err := n.PegOffsetType.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if !n.PegOffsetValueInActingVersion(actingVersion) { + n.PegOffsetValue = n.PegOffsetValueNullValue() + } else { + if err := _m.ReadUint8(_r, &n.PegOffsetValue); err != nil { + return err + } + } + if !n.PeggedPriceInActingVersion(actingVersion) { + n.PeggedPrice = n.PeggedPriceNullValue() + } else { + if err := _m.ReadInt64(_r, &n.PeggedPrice); err != nil { + return err + } + } + if actingVersion > n.SbeSchemaVersion() && blockLength > n.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-n.SbeBlockLength())) + } + + if n.SymbolInActingVersion(actingVersion) { + var SymbolLength uint8 + if err := _m.ReadUint8(_r, &SymbolLength); err != nil { + return err + } + if cap(n.Symbol) < int(SymbolLength) { + n.Symbol = make([]uint8, SymbolLength) + } + n.Symbol = n.Symbol[:SymbolLength] + if err := _m.ReadBytes(_r, n.Symbol); err != nil { + return err + } + } + + if n.ClientOrderIdInActingVersion(actingVersion) { + var ClientOrderIdLength uint8 + if err := _m.ReadUint8(_r, &ClientOrderIdLength); err != nil { + return err + } + if cap(n.ClientOrderId) < int(ClientOrderIdLength) { + n.ClientOrderId = make([]uint8, ClientOrderIdLength) + } + n.ClientOrderId = n.ClientOrderId[:ClientOrderIdLength] + if err := _m.ReadBytes(_r, n.ClientOrderId); err != nil { + return err + } + } + return nil +} + +func (n *NewOrderListResultResponseOrderReports) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if n.OrderIdInActingVersion(actingVersion) { + if n.OrderId < n.OrderIdMinValue() || n.OrderId > n.OrderIdMaxValue() { + return fmt.Errorf("Range check failed on n.OrderId (%v < %v > %v)", n.OrderIdMinValue(), n.OrderId, n.OrderIdMaxValue()) + } + } + if n.OrderListIdInActingVersion(actingVersion) { + if n.OrderListId != n.OrderListIdNullValue() && (n.OrderListId < n.OrderListIdMinValue() || n.OrderListId > n.OrderListIdMaxValue()) { + return fmt.Errorf("Range check failed on n.OrderListId (%v < %v > %v)", n.OrderListIdMinValue(), n.OrderListId, n.OrderListIdMaxValue()) + } + } + if n.TransactTimeInActingVersion(actingVersion) { + if n.TransactTime < n.TransactTimeMinValue() || n.TransactTime > n.TransactTimeMaxValue() { + return fmt.Errorf("Range check failed on n.TransactTime (%v < %v > %v)", n.TransactTimeMinValue(), n.TransactTime, n.TransactTimeMaxValue()) + } + } + if n.PriceInActingVersion(actingVersion) { + if n.Price < n.PriceMinValue() || n.Price > n.PriceMaxValue() { + return fmt.Errorf("Range check failed on n.Price (%v < %v > %v)", n.PriceMinValue(), n.Price, n.PriceMaxValue()) + } + } + if n.OrigQtyInActingVersion(actingVersion) { + if n.OrigQty < n.OrigQtyMinValue() || n.OrigQty > n.OrigQtyMaxValue() { + return fmt.Errorf("Range check failed on n.OrigQty (%v < %v > %v)", n.OrigQtyMinValue(), n.OrigQty, n.OrigQtyMaxValue()) + } + } + if n.ExecutedQtyInActingVersion(actingVersion) { + if n.ExecutedQty < n.ExecutedQtyMinValue() || n.ExecutedQty > n.ExecutedQtyMaxValue() { + return fmt.Errorf("Range check failed on n.ExecutedQty (%v < %v > %v)", n.ExecutedQtyMinValue(), n.ExecutedQty, n.ExecutedQtyMaxValue()) + } + } + if n.CummulativeQuoteQtyInActingVersion(actingVersion) { + if n.CummulativeQuoteQty < n.CummulativeQuoteQtyMinValue() || n.CummulativeQuoteQty > n.CummulativeQuoteQtyMaxValue() { + return fmt.Errorf("Range check failed on n.CummulativeQuoteQty (%v < %v > %v)", n.CummulativeQuoteQtyMinValue(), n.CummulativeQuoteQty, n.CummulativeQuoteQtyMaxValue()) + } + } + if err := n.Status.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if err := n.TimeInForce.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if err := n.OrderType.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if err := n.Side.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if n.StopPriceInActingVersion(actingVersion) { + if n.StopPrice != n.StopPriceNullValue() && (n.StopPrice < n.StopPriceMinValue() || n.StopPrice > n.StopPriceMaxValue()) { + return fmt.Errorf("Range check failed on n.StopPrice (%v < %v > %v)", n.StopPriceMinValue(), n.StopPrice, n.StopPriceMaxValue()) + } + } + if n.TrailingDeltaInActingVersion(actingVersion) { + if n.TrailingDelta != n.TrailingDeltaNullValue() && (n.TrailingDelta < n.TrailingDeltaMinValue() || n.TrailingDelta > n.TrailingDeltaMaxValue()) { + return fmt.Errorf("Range check failed on n.TrailingDelta (%v < %v > %v)", n.TrailingDeltaMinValue(), n.TrailingDelta, n.TrailingDeltaMaxValue()) + } + } + if n.TrailingTimeInActingVersion(actingVersion) { + if n.TrailingTime != n.TrailingTimeNullValue() && (n.TrailingTime < n.TrailingTimeMinValue() || n.TrailingTime > n.TrailingTimeMaxValue()) { + return fmt.Errorf("Range check failed on n.TrailingTime (%v < %v > %v)", n.TrailingTimeMinValue(), n.TrailingTime, n.TrailingTimeMaxValue()) + } + } + if n.WorkingTimeInActingVersion(actingVersion) { + if n.WorkingTime != n.WorkingTimeNullValue() && (n.WorkingTime < n.WorkingTimeMinValue() || n.WorkingTime > n.WorkingTimeMaxValue()) { + return fmt.Errorf("Range check failed on n.WorkingTime (%v < %v > %v)", n.WorkingTimeMinValue(), n.WorkingTime, n.WorkingTimeMaxValue()) + } + } + if n.IcebergQtyInActingVersion(actingVersion) { + if n.IcebergQty != n.IcebergQtyNullValue() && (n.IcebergQty < n.IcebergQtyMinValue() || n.IcebergQty > n.IcebergQtyMaxValue()) { + return fmt.Errorf("Range check failed on n.IcebergQty (%v < %v > %v)", n.IcebergQtyMinValue(), n.IcebergQty, n.IcebergQtyMaxValue()) + } + } + if n.StrategyIdInActingVersion(actingVersion) { + if n.StrategyId != n.StrategyIdNullValue() && (n.StrategyId < n.StrategyIdMinValue() || n.StrategyId > n.StrategyIdMaxValue()) { + return fmt.Errorf("Range check failed on n.StrategyId (%v < %v > %v)", n.StrategyIdMinValue(), n.StrategyId, n.StrategyIdMaxValue()) + } + } + if n.StrategyTypeInActingVersion(actingVersion) { + if n.StrategyType != n.StrategyTypeNullValue() && (n.StrategyType < n.StrategyTypeMinValue() || n.StrategyType > n.StrategyTypeMaxValue()) { + return fmt.Errorf("Range check failed on n.StrategyType (%v < %v > %v)", n.StrategyTypeMinValue(), n.StrategyType, n.StrategyTypeMaxValue()) + } + } + if err := n.OrderCapacity.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if err := n.WorkingFloor.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if err := n.SelfTradePreventionMode.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if n.TradeGroupIdInActingVersion(actingVersion) { + if n.TradeGroupId != n.TradeGroupIdNullValue() && (n.TradeGroupId < n.TradeGroupIdMinValue() || n.TradeGroupId > n.TradeGroupIdMaxValue()) { + return fmt.Errorf("Range check failed on n.TradeGroupId (%v < %v > %v)", n.TradeGroupIdMinValue(), n.TradeGroupId, n.TradeGroupIdMaxValue()) + } + } + if n.PreventedQuantityInActingVersion(actingVersion) { + if n.PreventedQuantity < n.PreventedQuantityMinValue() || n.PreventedQuantity > n.PreventedQuantityMaxValue() { + return fmt.Errorf("Range check failed on n.PreventedQuantity (%v < %v > %v)", n.PreventedQuantityMinValue(), n.PreventedQuantity, n.PreventedQuantityMaxValue()) + } + } + if err := n.UsedSor.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if n.OrigQuoteOrderQtyInActingVersion(actingVersion) { + if n.OrigQuoteOrderQty < n.OrigQuoteOrderQtyMinValue() || n.OrigQuoteOrderQty > n.OrigQuoteOrderQtyMaxValue() { + return fmt.Errorf("Range check failed on n.OrigQuoteOrderQty (%v < %v > %v)", n.OrigQuoteOrderQtyMinValue(), n.OrigQuoteOrderQty, n.OrigQuoteOrderQtyMaxValue()) + } + } + if err := n.PegPriceType.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if err := n.PegOffsetType.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if n.PegOffsetValueInActingVersion(actingVersion) { + if n.PegOffsetValue != n.PegOffsetValueNullValue() && (n.PegOffsetValue < n.PegOffsetValueMinValue() || n.PegOffsetValue > n.PegOffsetValueMaxValue()) { + return fmt.Errorf("Range check failed on n.PegOffsetValue (%v < %v > %v)", n.PegOffsetValueMinValue(), n.PegOffsetValue, n.PegOffsetValueMaxValue()) + } + } + if n.PeggedPriceInActingVersion(actingVersion) { + if n.PeggedPrice != n.PeggedPriceNullValue() && (n.PeggedPrice < n.PeggedPriceMinValue() || n.PeggedPrice > n.PeggedPriceMaxValue()) { + return fmt.Errorf("Range check failed on n.PeggedPrice (%v < %v > %v)", n.PeggedPriceMinValue(), n.PeggedPrice, n.PeggedPriceMaxValue()) + } + } + if !utf8.Valid(n.Symbol[:]) { + return errors.New("n.Symbol failed UTF-8 validation") + } + if !utf8.Valid(n.ClientOrderId[:]) { + return errors.New("n.ClientOrderId failed UTF-8 validation") + } + return nil +} + +func NewOrderListResultResponseOrderReportsInit(n *NewOrderListResultResponseOrderReports) { + n.OrderListId = math.MinInt64 + n.StopPrice = math.MinInt64 + n.TrailingDelta = math.MinInt64 + n.TrailingTime = math.MinInt64 + n.WorkingTime = math.MinInt64 + n.IcebergQty = math.MinInt64 + n.StrategyId = math.MinInt64 + n.StrategyType = math.MinInt32 + n.TradeGroupId = math.MinInt64 + n.PegOffsetValue = math.MaxUint8 + n.PeggedPrice = math.MinInt64 + return +} + +func (*NewOrderListResultResponse) SbeBlockLength() (blockLength uint16) { + return 21 +} + +func (*NewOrderListResultResponse) SbeTemplateId() (templateId uint16) { + return 310 +} + +func (*NewOrderListResultResponse) SbeSchemaId() (schemaId uint16) { + return 3 +} + +func (*NewOrderListResultResponse) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} + +func (*NewOrderListResultResponse) SbeSemanticType() (semanticType []byte) { + return []byte("") +} + +func (*NewOrderListResultResponse) SbeSemanticVersion() (semanticVersion string) { + return "5.2" +} + +func (*NewOrderListResultResponse) OrderListIdId() uint16 { + return 1 +} + +func (*NewOrderListResultResponse) OrderListIdSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderListResultResponse) OrderListIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.OrderListIdSinceVersion() +} + +func (*NewOrderListResultResponse) OrderListIdDeprecated() uint16 { + return 0 +} + +func (*NewOrderListResultResponse) OrderListIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderListResultResponse) OrderListIdMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*NewOrderListResultResponse) OrderListIdMaxValue() int64 { + return math.MaxInt64 +} + +func (*NewOrderListResultResponse) OrderListIdNullValue() int64 { + return math.MinInt64 +} + +func (*NewOrderListResultResponse) ContingencyTypeId() uint16 { + return 2 +} + +func (*NewOrderListResultResponse) ContingencyTypeSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderListResultResponse) ContingencyTypeInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.ContingencyTypeSinceVersion() +} + +func (*NewOrderListResultResponse) ContingencyTypeDeprecated() uint16 { + return 0 +} + +func (*NewOrderListResultResponse) ContingencyTypeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderListResultResponse) ListStatusTypeId() uint16 { + return 3 +} + +func (*NewOrderListResultResponse) ListStatusTypeSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderListResultResponse) ListStatusTypeInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.ListStatusTypeSinceVersion() +} + +func (*NewOrderListResultResponse) ListStatusTypeDeprecated() uint16 { + return 0 +} + +func (*NewOrderListResultResponse) ListStatusTypeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderListResultResponse) ListOrderStatusId() uint16 { + return 4 +} + +func (*NewOrderListResultResponse) ListOrderStatusSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderListResultResponse) ListOrderStatusInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.ListOrderStatusSinceVersion() +} + +func (*NewOrderListResultResponse) ListOrderStatusDeprecated() uint16 { + return 0 +} + +func (*NewOrderListResultResponse) ListOrderStatusMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderListResultResponse) TransactionTimeId() uint16 { + return 5 +} + +func (*NewOrderListResultResponse) TransactionTimeSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderListResultResponse) TransactionTimeInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.TransactionTimeSinceVersion() +} + +func (*NewOrderListResultResponse) TransactionTimeDeprecated() uint16 { + return 0 +} + +func (*NewOrderListResultResponse) TransactionTimeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderListResultResponse) TransactionTimeMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*NewOrderListResultResponse) TransactionTimeMaxValue() int64 { + return math.MaxInt64 +} + +func (*NewOrderListResultResponse) TransactionTimeNullValue() int64 { + return math.MinInt64 +} + +func (*NewOrderListResultResponse) PriceExponentId() uint16 { + return 6 +} + +func (*NewOrderListResultResponse) PriceExponentSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderListResultResponse) PriceExponentInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.PriceExponentSinceVersion() +} + +func (*NewOrderListResultResponse) PriceExponentDeprecated() uint16 { + return 0 +} + +func (*NewOrderListResultResponse) PriceExponentMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderListResultResponse) PriceExponentMinValue() int8 { + return math.MinInt8 + 1 +} + +func (*NewOrderListResultResponse) PriceExponentMaxValue() int8 { + return math.MaxInt8 +} + +func (*NewOrderListResultResponse) PriceExponentNullValue() int8 { + return math.MinInt8 +} + +func (*NewOrderListResultResponse) QtyExponentId() uint16 { + return 7 +} + +func (*NewOrderListResultResponse) QtyExponentSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderListResultResponse) QtyExponentInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.QtyExponentSinceVersion() +} + +func (*NewOrderListResultResponse) QtyExponentDeprecated() uint16 { + return 0 +} + +func (*NewOrderListResultResponse) QtyExponentMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderListResultResponse) QtyExponentMinValue() int8 { + return math.MinInt8 + 1 +} + +func (*NewOrderListResultResponse) QtyExponentMaxValue() int8 { + return math.MaxInt8 +} + +func (*NewOrderListResultResponse) QtyExponentNullValue() int8 { + return math.MinInt8 +} + +func (*NewOrderListResultResponseOrders) OrderIdId() uint16 { + return 1 +} + +func (*NewOrderListResultResponseOrders) OrderIdSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderListResultResponseOrders) OrderIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.OrderIdSinceVersion() +} + +func (*NewOrderListResultResponseOrders) OrderIdDeprecated() uint16 { + return 0 +} + +func (*NewOrderListResultResponseOrders) OrderIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderListResultResponseOrders) OrderIdMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*NewOrderListResultResponseOrders) OrderIdMaxValue() int64 { + return math.MaxInt64 +} + +func (*NewOrderListResultResponseOrders) OrderIdNullValue() int64 { + return math.MinInt64 +} + +func (*NewOrderListResultResponseOrders) SymbolMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderListResultResponseOrders) SymbolSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderListResultResponseOrders) SymbolInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.SymbolSinceVersion() +} + +func (*NewOrderListResultResponseOrders) SymbolDeprecated() uint16 { + return 0 +} + +func (NewOrderListResultResponseOrders) SymbolCharacterEncoding() string { + return "UTF-8" +} + +func (NewOrderListResultResponseOrders) SymbolHeaderLength() uint64 { + return 1 +} + +func (*NewOrderListResultResponseOrders) ClientOrderIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderListResultResponseOrders) ClientOrderIdSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderListResultResponseOrders) ClientOrderIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.ClientOrderIdSinceVersion() +} + +func (*NewOrderListResultResponseOrders) ClientOrderIdDeprecated() uint16 { + return 0 +} + +func (NewOrderListResultResponseOrders) ClientOrderIdCharacterEncoding() string { + return "UTF-8" +} + +func (NewOrderListResultResponseOrders) ClientOrderIdHeaderLength() uint64 { + return 1 +} + +func (*NewOrderListResultResponseOrderReports) OrderIdId() uint16 { + return 1 +} + +func (*NewOrderListResultResponseOrderReports) OrderIdSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderListResultResponseOrderReports) OrderIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.OrderIdSinceVersion() +} + +func (*NewOrderListResultResponseOrderReports) OrderIdDeprecated() uint16 { + return 0 +} + +func (*NewOrderListResultResponseOrderReports) OrderIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderListResultResponseOrderReports) OrderIdMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*NewOrderListResultResponseOrderReports) OrderIdMaxValue() int64 { + return math.MaxInt64 +} + +func (*NewOrderListResultResponseOrderReports) OrderIdNullValue() int64 { + return math.MinInt64 +} + +func (*NewOrderListResultResponseOrderReports) OrderListIdId() uint16 { + return 2 +} + +func (*NewOrderListResultResponseOrderReports) OrderListIdSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderListResultResponseOrderReports) OrderListIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.OrderListIdSinceVersion() +} + +func (*NewOrderListResultResponseOrderReports) OrderListIdDeprecated() uint16 { + return 0 +} + +func (*NewOrderListResultResponseOrderReports) OrderListIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*NewOrderListResultResponseOrderReports) OrderListIdMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*NewOrderListResultResponseOrderReports) OrderListIdMaxValue() int64 { + return math.MaxInt64 +} + +func (*NewOrderListResultResponseOrderReports) OrderListIdNullValue() int64 { + return math.MinInt64 +} + +func (*NewOrderListResultResponseOrderReports) TransactTimeId() uint16 { + return 3 +} + +func (*NewOrderListResultResponseOrderReports) TransactTimeSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderListResultResponseOrderReports) TransactTimeInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.TransactTimeSinceVersion() +} + +func (*NewOrderListResultResponseOrderReports) TransactTimeDeprecated() uint16 { + return 0 +} + +func (*NewOrderListResultResponseOrderReports) TransactTimeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderListResultResponseOrderReports) TransactTimeMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*NewOrderListResultResponseOrderReports) TransactTimeMaxValue() int64 { + return math.MaxInt64 +} + +func (*NewOrderListResultResponseOrderReports) TransactTimeNullValue() int64 { + return math.MinInt64 +} + +func (*NewOrderListResultResponseOrderReports) PriceId() uint16 { + return 4 +} + +func (*NewOrderListResultResponseOrderReports) PriceSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderListResultResponseOrderReports) PriceInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.PriceSinceVersion() +} + +func (*NewOrderListResultResponseOrderReports) PriceDeprecated() uint16 { + return 0 +} + +func (*NewOrderListResultResponseOrderReports) PriceMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderListResultResponseOrderReports) PriceMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*NewOrderListResultResponseOrderReports) PriceMaxValue() int64 { + return math.MaxInt64 +} + +func (*NewOrderListResultResponseOrderReports) PriceNullValue() int64 { + return math.MinInt64 +} + +func (*NewOrderListResultResponseOrderReports) OrigQtyId() uint16 { + return 5 +} + +func (*NewOrderListResultResponseOrderReports) OrigQtySinceVersion() uint16 { + return 0 +} + +func (n *NewOrderListResultResponseOrderReports) OrigQtyInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.OrigQtySinceVersion() +} + +func (*NewOrderListResultResponseOrderReports) OrigQtyDeprecated() uint16 { + return 0 +} + +func (*NewOrderListResultResponseOrderReports) OrigQtyMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderListResultResponseOrderReports) OrigQtyMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*NewOrderListResultResponseOrderReports) OrigQtyMaxValue() int64 { + return math.MaxInt64 +} + +func (*NewOrderListResultResponseOrderReports) OrigQtyNullValue() int64 { + return math.MinInt64 +} + +func (*NewOrderListResultResponseOrderReports) ExecutedQtyId() uint16 { + return 6 +} + +func (*NewOrderListResultResponseOrderReports) ExecutedQtySinceVersion() uint16 { + return 0 +} + +func (n *NewOrderListResultResponseOrderReports) ExecutedQtyInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.ExecutedQtySinceVersion() +} + +func (*NewOrderListResultResponseOrderReports) ExecutedQtyDeprecated() uint16 { + return 0 +} + +func (*NewOrderListResultResponseOrderReports) ExecutedQtyMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderListResultResponseOrderReports) ExecutedQtyMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*NewOrderListResultResponseOrderReports) ExecutedQtyMaxValue() int64 { + return math.MaxInt64 +} + +func (*NewOrderListResultResponseOrderReports) ExecutedQtyNullValue() int64 { + return math.MinInt64 +} + +func (*NewOrderListResultResponseOrderReports) CummulativeQuoteQtyId() uint16 { + return 7 +} + +func (*NewOrderListResultResponseOrderReports) CummulativeQuoteQtySinceVersion() uint16 { + return 0 +} + +func (n *NewOrderListResultResponseOrderReports) CummulativeQuoteQtyInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.CummulativeQuoteQtySinceVersion() +} + +func (*NewOrderListResultResponseOrderReports) CummulativeQuoteQtyDeprecated() uint16 { + return 0 +} + +func (*NewOrderListResultResponseOrderReports) CummulativeQuoteQtyMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderListResultResponseOrderReports) CummulativeQuoteQtyMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*NewOrderListResultResponseOrderReports) CummulativeQuoteQtyMaxValue() int64 { + return math.MaxInt64 +} + +func (*NewOrderListResultResponseOrderReports) CummulativeQuoteQtyNullValue() int64 { + return math.MinInt64 +} + +func (*NewOrderListResultResponseOrderReports) StatusId() uint16 { + return 8 +} + +func (*NewOrderListResultResponseOrderReports) StatusSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderListResultResponseOrderReports) StatusInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.StatusSinceVersion() +} + +func (*NewOrderListResultResponseOrderReports) StatusDeprecated() uint16 { + return 0 +} + +func (*NewOrderListResultResponseOrderReports) StatusMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderListResultResponseOrderReports) TimeInForceId() uint16 { + return 9 +} + +func (*NewOrderListResultResponseOrderReports) TimeInForceSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderListResultResponseOrderReports) TimeInForceInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.TimeInForceSinceVersion() +} + +func (*NewOrderListResultResponseOrderReports) TimeInForceDeprecated() uint16 { + return 0 +} + +func (*NewOrderListResultResponseOrderReports) TimeInForceMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderListResultResponseOrderReports) OrderTypeId() uint16 { + return 10 +} + +func (*NewOrderListResultResponseOrderReports) OrderTypeSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderListResultResponseOrderReports) OrderTypeInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.OrderTypeSinceVersion() +} + +func (*NewOrderListResultResponseOrderReports) OrderTypeDeprecated() uint16 { + return 0 +} + +func (*NewOrderListResultResponseOrderReports) OrderTypeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderListResultResponseOrderReports) SideId() uint16 { + return 11 +} + +func (*NewOrderListResultResponseOrderReports) SideSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderListResultResponseOrderReports) SideInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.SideSinceVersion() +} + +func (*NewOrderListResultResponseOrderReports) SideDeprecated() uint16 { + return 0 +} + +func (*NewOrderListResultResponseOrderReports) SideMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderListResultResponseOrderReports) StopPriceId() uint16 { + return 12 +} + +func (*NewOrderListResultResponseOrderReports) StopPriceSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderListResultResponseOrderReports) StopPriceInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.StopPriceSinceVersion() +} + +func (*NewOrderListResultResponseOrderReports) StopPriceDeprecated() uint16 { + return 0 +} + +func (*NewOrderListResultResponseOrderReports) StopPriceMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*NewOrderListResultResponseOrderReports) StopPriceMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*NewOrderListResultResponseOrderReports) StopPriceMaxValue() int64 { + return math.MaxInt64 +} + +func (*NewOrderListResultResponseOrderReports) StopPriceNullValue() int64 { + return math.MinInt64 +} + +func (*NewOrderListResultResponseOrderReports) TrailingDeltaId() uint16 { + return 13 +} + +func (*NewOrderListResultResponseOrderReports) TrailingDeltaSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderListResultResponseOrderReports) TrailingDeltaInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.TrailingDeltaSinceVersion() +} + +func (*NewOrderListResultResponseOrderReports) TrailingDeltaDeprecated() uint16 { + return 0 +} + +func (*NewOrderListResultResponseOrderReports) TrailingDeltaMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*NewOrderListResultResponseOrderReports) TrailingDeltaMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*NewOrderListResultResponseOrderReports) TrailingDeltaMaxValue() int64 { + return math.MaxInt64 +} + +func (*NewOrderListResultResponseOrderReports) TrailingDeltaNullValue() int64 { + return math.MinInt64 +} + +func (*NewOrderListResultResponseOrderReports) TrailingTimeId() uint16 { + return 14 +} + +func (*NewOrderListResultResponseOrderReports) TrailingTimeSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderListResultResponseOrderReports) TrailingTimeInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.TrailingTimeSinceVersion() +} + +func (*NewOrderListResultResponseOrderReports) TrailingTimeDeprecated() uint16 { + return 0 +} + +func (*NewOrderListResultResponseOrderReports) TrailingTimeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*NewOrderListResultResponseOrderReports) TrailingTimeMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*NewOrderListResultResponseOrderReports) TrailingTimeMaxValue() int64 { + return math.MaxInt64 +} + +func (*NewOrderListResultResponseOrderReports) TrailingTimeNullValue() int64 { + return math.MinInt64 +} + +func (*NewOrderListResultResponseOrderReports) WorkingTimeId() uint16 { + return 15 +} + +func (*NewOrderListResultResponseOrderReports) WorkingTimeSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderListResultResponseOrderReports) WorkingTimeInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.WorkingTimeSinceVersion() +} + +func (*NewOrderListResultResponseOrderReports) WorkingTimeDeprecated() uint16 { + return 0 +} + +func (*NewOrderListResultResponseOrderReports) WorkingTimeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*NewOrderListResultResponseOrderReports) WorkingTimeMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*NewOrderListResultResponseOrderReports) WorkingTimeMaxValue() int64 { + return math.MaxInt64 +} + +func (*NewOrderListResultResponseOrderReports) WorkingTimeNullValue() int64 { + return math.MinInt64 +} + +func (*NewOrderListResultResponseOrderReports) IcebergQtyId() uint16 { + return 16 +} + +func (*NewOrderListResultResponseOrderReports) IcebergQtySinceVersion() uint16 { + return 0 +} + +func (n *NewOrderListResultResponseOrderReports) IcebergQtyInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.IcebergQtySinceVersion() +} + +func (*NewOrderListResultResponseOrderReports) IcebergQtyDeprecated() uint16 { + return 0 +} + +func (*NewOrderListResultResponseOrderReports) IcebergQtyMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*NewOrderListResultResponseOrderReports) IcebergQtyMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*NewOrderListResultResponseOrderReports) IcebergQtyMaxValue() int64 { + return math.MaxInt64 +} + +func (*NewOrderListResultResponseOrderReports) IcebergQtyNullValue() int64 { + return math.MinInt64 +} + +func (*NewOrderListResultResponseOrderReports) StrategyIdId() uint16 { + return 17 +} + +func (*NewOrderListResultResponseOrderReports) StrategyIdSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderListResultResponseOrderReports) StrategyIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.StrategyIdSinceVersion() +} + +func (*NewOrderListResultResponseOrderReports) StrategyIdDeprecated() uint16 { + return 0 +} + +func (*NewOrderListResultResponseOrderReports) StrategyIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*NewOrderListResultResponseOrderReports) StrategyIdMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*NewOrderListResultResponseOrderReports) StrategyIdMaxValue() int64 { + return math.MaxInt64 +} + +func (*NewOrderListResultResponseOrderReports) StrategyIdNullValue() int64 { + return math.MinInt64 +} + +func (*NewOrderListResultResponseOrderReports) StrategyTypeId() uint16 { + return 18 +} + +func (*NewOrderListResultResponseOrderReports) StrategyTypeSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderListResultResponseOrderReports) StrategyTypeInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.StrategyTypeSinceVersion() +} + +func (*NewOrderListResultResponseOrderReports) StrategyTypeDeprecated() uint16 { + return 0 +} + +func (*NewOrderListResultResponseOrderReports) StrategyTypeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*NewOrderListResultResponseOrderReports) StrategyTypeMinValue() int32 { + return math.MinInt32 + 1 +} + +func (*NewOrderListResultResponseOrderReports) StrategyTypeMaxValue() int32 { + return math.MaxInt32 +} + +func (*NewOrderListResultResponseOrderReports) StrategyTypeNullValue() int32 { + return math.MinInt32 +} + +func (*NewOrderListResultResponseOrderReports) OrderCapacityId() uint16 { + return 19 +} + +func (*NewOrderListResultResponseOrderReports) OrderCapacitySinceVersion() uint16 { + return 0 +} + +func (n *NewOrderListResultResponseOrderReports) OrderCapacityInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.OrderCapacitySinceVersion() +} + +func (*NewOrderListResultResponseOrderReports) OrderCapacityDeprecated() uint16 { + return 0 +} + +func (*NewOrderListResultResponseOrderReports) OrderCapacityMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderListResultResponseOrderReports) WorkingFloorId() uint16 { + return 20 +} + +func (*NewOrderListResultResponseOrderReports) WorkingFloorSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderListResultResponseOrderReports) WorkingFloorInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.WorkingFloorSinceVersion() +} + +func (*NewOrderListResultResponseOrderReports) WorkingFloorDeprecated() uint16 { + return 0 +} + +func (*NewOrderListResultResponseOrderReports) WorkingFloorMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderListResultResponseOrderReports) SelfTradePreventionModeId() uint16 { + return 21 +} + +func (*NewOrderListResultResponseOrderReports) SelfTradePreventionModeSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderListResultResponseOrderReports) SelfTradePreventionModeInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.SelfTradePreventionModeSinceVersion() +} + +func (*NewOrderListResultResponseOrderReports) SelfTradePreventionModeDeprecated() uint16 { + return 0 +} + +func (*NewOrderListResultResponseOrderReports) SelfTradePreventionModeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderListResultResponseOrderReports) TradeGroupIdId() uint16 { + return 22 +} + +func (*NewOrderListResultResponseOrderReports) TradeGroupIdSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderListResultResponseOrderReports) TradeGroupIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.TradeGroupIdSinceVersion() +} + +func (*NewOrderListResultResponseOrderReports) TradeGroupIdDeprecated() uint16 { + return 0 +} + +func (*NewOrderListResultResponseOrderReports) TradeGroupIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*NewOrderListResultResponseOrderReports) TradeGroupIdMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*NewOrderListResultResponseOrderReports) TradeGroupIdMaxValue() int64 { + return math.MaxInt64 +} + +func (*NewOrderListResultResponseOrderReports) TradeGroupIdNullValue() int64 { + return math.MinInt64 +} + +func (*NewOrderListResultResponseOrderReports) PreventedQuantityId() uint16 { + return 23 +} + +func (*NewOrderListResultResponseOrderReports) PreventedQuantitySinceVersion() uint16 { + return 0 +} + +func (n *NewOrderListResultResponseOrderReports) PreventedQuantityInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.PreventedQuantitySinceVersion() +} + +func (*NewOrderListResultResponseOrderReports) PreventedQuantityDeprecated() uint16 { + return 0 +} + +func (*NewOrderListResultResponseOrderReports) PreventedQuantityMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderListResultResponseOrderReports) PreventedQuantityMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*NewOrderListResultResponseOrderReports) PreventedQuantityMaxValue() int64 { + return math.MaxInt64 +} + +func (*NewOrderListResultResponseOrderReports) PreventedQuantityNullValue() int64 { + return math.MinInt64 +} + +func (*NewOrderListResultResponseOrderReports) UsedSorId() uint16 { + return 24 +} + +func (*NewOrderListResultResponseOrderReports) UsedSorSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderListResultResponseOrderReports) UsedSorInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.UsedSorSinceVersion() +} + +func (*NewOrderListResultResponseOrderReports) UsedSorDeprecated() uint16 { + return 0 +} + +func (*NewOrderListResultResponseOrderReports) UsedSorMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderListResultResponseOrderReports) OrigQuoteOrderQtyId() uint16 { + return 25 +} + +func (*NewOrderListResultResponseOrderReports) OrigQuoteOrderQtySinceVersion() uint16 { + return 0 +} + +func (n *NewOrderListResultResponseOrderReports) OrigQuoteOrderQtyInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.OrigQuoteOrderQtySinceVersion() +} + +func (*NewOrderListResultResponseOrderReports) OrigQuoteOrderQtyDeprecated() uint16 { + return 0 +} + +func (*NewOrderListResultResponseOrderReports) OrigQuoteOrderQtyMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderListResultResponseOrderReports) OrigQuoteOrderQtyMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*NewOrderListResultResponseOrderReports) OrigQuoteOrderQtyMaxValue() int64 { + return math.MaxInt64 +} + +func (*NewOrderListResultResponseOrderReports) OrigQuoteOrderQtyNullValue() int64 { + return math.MinInt64 +} + +func (*NewOrderListResultResponseOrderReports) PegPriceTypeId() uint16 { + return 26 +} + +func (*NewOrderListResultResponseOrderReports) PegPriceTypeSinceVersion() uint16 { + return 1 +} + +func (n *NewOrderListResultResponseOrderReports) PegPriceTypeInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.PegPriceTypeSinceVersion() +} + +func (*NewOrderListResultResponseOrderReports) PegPriceTypeDeprecated() uint16 { + return 0 +} + +func (*NewOrderListResultResponseOrderReports) PegPriceTypeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*NewOrderListResultResponseOrderReports) PegOffsetTypeId() uint16 { + return 27 +} + +func (*NewOrderListResultResponseOrderReports) PegOffsetTypeSinceVersion() uint16 { + return 1 +} + +func (n *NewOrderListResultResponseOrderReports) PegOffsetTypeInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.PegOffsetTypeSinceVersion() +} + +func (*NewOrderListResultResponseOrderReports) PegOffsetTypeDeprecated() uint16 { + return 0 +} + +func (*NewOrderListResultResponseOrderReports) PegOffsetTypeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*NewOrderListResultResponseOrderReports) PegOffsetValueId() uint16 { + return 28 +} + +func (*NewOrderListResultResponseOrderReports) PegOffsetValueSinceVersion() uint16 { + return 1 +} + +func (n *NewOrderListResultResponseOrderReports) PegOffsetValueInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.PegOffsetValueSinceVersion() +} + +func (*NewOrderListResultResponseOrderReports) PegOffsetValueDeprecated() uint16 { + return 0 +} + +func (*NewOrderListResultResponseOrderReports) PegOffsetValueMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*NewOrderListResultResponseOrderReports) PegOffsetValueMinValue() uint8 { + return 0 +} + +func (*NewOrderListResultResponseOrderReports) PegOffsetValueMaxValue() uint8 { + return math.MaxUint8 - 1 +} + +func (*NewOrderListResultResponseOrderReports) PegOffsetValueNullValue() uint8 { + return math.MaxUint8 +} + +func (*NewOrderListResultResponseOrderReports) PeggedPriceId() uint16 { + return 29 +} + +func (*NewOrderListResultResponseOrderReports) PeggedPriceSinceVersion() uint16 { + return 1 +} + +func (n *NewOrderListResultResponseOrderReports) PeggedPriceInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.PeggedPriceSinceVersion() +} + +func (*NewOrderListResultResponseOrderReports) PeggedPriceDeprecated() uint16 { + return 0 +} + +func (*NewOrderListResultResponseOrderReports) PeggedPriceMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*NewOrderListResultResponseOrderReports) PeggedPriceMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*NewOrderListResultResponseOrderReports) PeggedPriceMaxValue() int64 { + return math.MaxInt64 +} + +func (*NewOrderListResultResponseOrderReports) PeggedPriceNullValue() int64 { + return math.MinInt64 +} + +func (*NewOrderListResultResponseOrderReports) SymbolMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderListResultResponseOrderReports) SymbolSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderListResultResponseOrderReports) SymbolInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.SymbolSinceVersion() +} + +func (*NewOrderListResultResponseOrderReports) SymbolDeprecated() uint16 { + return 0 +} + +func (NewOrderListResultResponseOrderReports) SymbolCharacterEncoding() string { + return "UTF-8" +} + +func (NewOrderListResultResponseOrderReports) SymbolHeaderLength() uint64 { + return 1 +} + +func (*NewOrderListResultResponseOrderReports) ClientOrderIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderListResultResponseOrderReports) ClientOrderIdSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderListResultResponseOrderReports) ClientOrderIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.ClientOrderIdSinceVersion() +} + +func (*NewOrderListResultResponseOrderReports) ClientOrderIdDeprecated() uint16 { + return 0 +} + +func (NewOrderListResultResponseOrderReports) ClientOrderIdCharacterEncoding() string { + return "UTF-8" +} + +func (NewOrderListResultResponseOrderReports) ClientOrderIdHeaderLength() uint64 { + return 1 +} + +func (*NewOrderListResultResponse) OrdersId() uint16 { + return 100 +} + +func (*NewOrderListResultResponse) OrdersSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderListResultResponse) OrdersInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.OrdersSinceVersion() +} + +func (*NewOrderListResultResponse) OrdersDeprecated() uint16 { + return 0 +} + +func (*NewOrderListResultResponseOrders) SbeBlockLength() (blockLength uint) { + return 8 +} + +func (*NewOrderListResultResponseOrders) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} + +func (*NewOrderListResultResponse) OrderReportsId() uint16 { + return 101 +} + +func (*NewOrderListResultResponse) OrderReportsSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderListResultResponse) OrderReportsInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.OrderReportsSinceVersion() +} + +func (*NewOrderListResultResponse) OrderReportsDeprecated() uint16 { + return 0 +} + +func (*NewOrderListResultResponseOrderReports) SbeBlockLength() (blockLength uint) { + return 151 +} + +func (*NewOrderListResultResponseOrderReports) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} + +func (*NewOrderListResultResponse) ListClientOrderIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderListResultResponse) ListClientOrderIdSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderListResultResponse) ListClientOrderIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.ListClientOrderIdSinceVersion() +} + +func (*NewOrderListResultResponse) ListClientOrderIdDeprecated() uint16 { + return 0 +} + +func (NewOrderListResultResponse) ListClientOrderIdCharacterEncoding() string { + return "UTF-8" +} + +func (NewOrderListResultResponse) ListClientOrderIdHeaderLength() uint64 { + return 1 +} + +func (*NewOrderListResultResponse) SymbolMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderListResultResponse) SymbolSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderListResultResponse) SymbolInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.SymbolSinceVersion() +} + +func (*NewOrderListResultResponse) SymbolDeprecated() uint16 { + return 0 +} + +func (NewOrderListResultResponse) SymbolCharacterEncoding() string { + return "UTF-8" +} + +func (NewOrderListResultResponse) SymbolHeaderLength() uint64 { + return 1 +} diff --git a/v2/sbe/spot_3_1/NewOrderResultResponse.go b/v2/sbe/spot_3_1/NewOrderResultResponse.go new file mode 100644 index 00000000..3c24a2f2 --- /dev/null +++ b/v2/sbe/spot_3_1/NewOrderResultResponse.go @@ -0,0 +1,1833 @@ +// Generated SBE (Simple Binary Encoding) message codec + +package sbe + +import ( + "errors" + "fmt" + "io" + "io/ioutil" + "math" + "unicode/utf8" +) + +type NewOrderResultResponse struct { + PriceExponent int8 + QtyExponent int8 + OrderId int64 + OrderListId int64 + TransactTime int64 + Price int64 + OrigQty int64 + ExecutedQty int64 + CummulativeQuoteQty int64 + Status OrderStatusEnum + TimeInForce TimeInForceEnum + OrderType OrderTypeEnum + Side OrderSideEnum + StopPrice int64 + TrailingDelta int64 + TrailingTime int64 + WorkingTime int64 + IcebergQty int64 + StrategyId int64 + StrategyType int32 + OrderCapacity OrderCapacityEnum + WorkingFloor FloorEnum + SelfTradePreventionMode SelfTradePreventionModeEnum + TradeGroupId int64 + PreventedQuantity int64 + UsedSor BoolEnumEnum + OrigQuoteOrderQty int64 + PegPriceType PegPriceTypeEnum + PegOffsetType PegOffsetTypeEnum + PegOffsetValue uint8 + PeggedPrice int64 + Symbol []uint8 + ClientOrderId []uint8 +} + +func (n *NewOrderResultResponse) Encode(_m *SbeGoMarshaller, _w io.Writer, doRangeCheck bool) error { + if doRangeCheck { + if err := n.RangeCheck(n.SbeSchemaVersion(), n.SbeSchemaVersion()); err != nil { + return err + } + } + if err := _m.WriteInt8(_w, n.PriceExponent); err != nil { + return err + } + if err := _m.WriteInt8(_w, n.QtyExponent); err != nil { + return err + } + if err := _m.WriteInt64(_w, n.OrderId); err != nil { + return err + } + if err := _m.WriteInt64(_w, n.OrderListId); err != nil { + return err + } + if err := _m.WriteInt64(_w, n.TransactTime); err != nil { + return err + } + if err := _m.WriteInt64(_w, n.Price); err != nil { + return err + } + if err := _m.WriteInt64(_w, n.OrigQty); err != nil { + return err + } + if err := _m.WriteInt64(_w, n.ExecutedQty); err != nil { + return err + } + if err := _m.WriteInt64(_w, n.CummulativeQuoteQty); err != nil { + return err + } + if err := n.Status.Encode(_m, _w); err != nil { + return err + } + if err := n.TimeInForce.Encode(_m, _w); err != nil { + return err + } + if err := n.OrderType.Encode(_m, _w); err != nil { + return err + } + if err := n.Side.Encode(_m, _w); err != nil { + return err + } + if err := _m.WriteInt64(_w, n.StopPrice); err != nil { + return err + } + if err := _m.WriteInt64(_w, n.TrailingDelta); err != nil { + return err + } + if err := _m.WriteInt64(_w, n.TrailingTime); err != nil { + return err + } + if err := _m.WriteInt64(_w, n.WorkingTime); err != nil { + return err + } + if err := _m.WriteInt64(_w, n.IcebergQty); err != nil { + return err + } + if err := _m.WriteInt64(_w, n.StrategyId); err != nil { + return err + } + if err := _m.WriteInt32(_w, n.StrategyType); err != nil { + return err + } + if err := n.OrderCapacity.Encode(_m, _w); err != nil { + return err + } + if err := n.WorkingFloor.Encode(_m, _w); err != nil { + return err + } + if err := n.SelfTradePreventionMode.Encode(_m, _w); err != nil { + return err + } + if err := _m.WriteInt64(_w, n.TradeGroupId); err != nil { + return err + } + if err := _m.WriteInt64(_w, n.PreventedQuantity); err != nil { + return err + } + if err := n.UsedSor.Encode(_m, _w); err != nil { + return err + } + if err := _m.WriteInt64(_w, n.OrigQuoteOrderQty); err != nil { + return err + } + if err := n.PegPriceType.Encode(_m, _w); err != nil { + return err + } + if err := n.PegOffsetType.Encode(_m, _w); err != nil { + return err + } + if err := _m.WriteUint8(_w, n.PegOffsetValue); err != nil { + return err + } + if err := _m.WriteInt64(_w, n.PeggedPrice); err != nil { + return err + } + if err := _m.WriteUint8(_w, uint8(len(n.Symbol))); err != nil { + return err + } + if err := _m.WriteBytes(_w, n.Symbol); err != nil { + return err + } + if err := _m.WriteUint8(_w, uint8(len(n.ClientOrderId))); err != nil { + return err + } + if err := _m.WriteBytes(_w, n.ClientOrderId); err != nil { + return err + } + return nil +} + +func (n *NewOrderResultResponse) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint16, doRangeCheck bool) error { + if !n.PriceExponentInActingVersion(actingVersion) { + n.PriceExponent = n.PriceExponentNullValue() + } else { + if err := _m.ReadInt8(_r, &n.PriceExponent); err != nil { + return err + } + } + if !n.QtyExponentInActingVersion(actingVersion) { + n.QtyExponent = n.QtyExponentNullValue() + } else { + if err := _m.ReadInt8(_r, &n.QtyExponent); err != nil { + return err + } + } + if !n.OrderIdInActingVersion(actingVersion) { + n.OrderId = n.OrderIdNullValue() + } else { + if err := _m.ReadInt64(_r, &n.OrderId); err != nil { + return err + } + } + if !n.OrderListIdInActingVersion(actingVersion) { + n.OrderListId = n.OrderListIdNullValue() + } else { + if err := _m.ReadInt64(_r, &n.OrderListId); err != nil { + return err + } + } + if !n.TransactTimeInActingVersion(actingVersion) { + n.TransactTime = n.TransactTimeNullValue() + } else { + if err := _m.ReadInt64(_r, &n.TransactTime); err != nil { + return err + } + } + if !n.PriceInActingVersion(actingVersion) { + n.Price = n.PriceNullValue() + } else { + if err := _m.ReadInt64(_r, &n.Price); err != nil { + return err + } + } + if !n.OrigQtyInActingVersion(actingVersion) { + n.OrigQty = n.OrigQtyNullValue() + } else { + if err := _m.ReadInt64(_r, &n.OrigQty); err != nil { + return err + } + } + if !n.ExecutedQtyInActingVersion(actingVersion) { + n.ExecutedQty = n.ExecutedQtyNullValue() + } else { + if err := _m.ReadInt64(_r, &n.ExecutedQty); err != nil { + return err + } + } + if !n.CummulativeQuoteQtyInActingVersion(actingVersion) { + n.CummulativeQuoteQty = n.CummulativeQuoteQtyNullValue() + } else { + if err := _m.ReadInt64(_r, &n.CummulativeQuoteQty); err != nil { + return err + } + } + if n.StatusInActingVersion(actingVersion) { + if err := n.Status.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if n.TimeInForceInActingVersion(actingVersion) { + if err := n.TimeInForce.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if n.OrderTypeInActingVersion(actingVersion) { + if err := n.OrderType.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if n.SideInActingVersion(actingVersion) { + if err := n.Side.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if !n.StopPriceInActingVersion(actingVersion) { + n.StopPrice = n.StopPriceNullValue() + } else { + if err := _m.ReadInt64(_r, &n.StopPrice); err != nil { + return err + } + } + if !n.TrailingDeltaInActingVersion(actingVersion) { + n.TrailingDelta = n.TrailingDeltaNullValue() + } else { + if err := _m.ReadInt64(_r, &n.TrailingDelta); err != nil { + return err + } + } + if !n.TrailingTimeInActingVersion(actingVersion) { + n.TrailingTime = n.TrailingTimeNullValue() + } else { + if err := _m.ReadInt64(_r, &n.TrailingTime); err != nil { + return err + } + } + if !n.WorkingTimeInActingVersion(actingVersion) { + n.WorkingTime = n.WorkingTimeNullValue() + } else { + if err := _m.ReadInt64(_r, &n.WorkingTime); err != nil { + return err + } + } + if !n.IcebergQtyInActingVersion(actingVersion) { + n.IcebergQty = n.IcebergQtyNullValue() + } else { + if err := _m.ReadInt64(_r, &n.IcebergQty); err != nil { + return err + } + } + if !n.StrategyIdInActingVersion(actingVersion) { + n.StrategyId = n.StrategyIdNullValue() + } else { + if err := _m.ReadInt64(_r, &n.StrategyId); err != nil { + return err + } + } + if !n.StrategyTypeInActingVersion(actingVersion) { + n.StrategyType = n.StrategyTypeNullValue() + } else { + if err := _m.ReadInt32(_r, &n.StrategyType); err != nil { + return err + } + } + if n.OrderCapacityInActingVersion(actingVersion) { + if err := n.OrderCapacity.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if n.WorkingFloorInActingVersion(actingVersion) { + if err := n.WorkingFloor.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if n.SelfTradePreventionModeInActingVersion(actingVersion) { + if err := n.SelfTradePreventionMode.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if !n.TradeGroupIdInActingVersion(actingVersion) { + n.TradeGroupId = n.TradeGroupIdNullValue() + } else { + if err := _m.ReadInt64(_r, &n.TradeGroupId); err != nil { + return err + } + } + if !n.PreventedQuantityInActingVersion(actingVersion) { + n.PreventedQuantity = n.PreventedQuantityNullValue() + } else { + if err := _m.ReadInt64(_r, &n.PreventedQuantity); err != nil { + return err + } + } + if n.UsedSorInActingVersion(actingVersion) { + if err := n.UsedSor.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if !n.OrigQuoteOrderQtyInActingVersion(actingVersion) { + n.OrigQuoteOrderQty = n.OrigQuoteOrderQtyNullValue() + } else { + if err := _m.ReadInt64(_r, &n.OrigQuoteOrderQty); err != nil { + return err + } + } + if n.PegPriceTypeInActingVersion(actingVersion) { + if err := n.PegPriceType.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if n.PegOffsetTypeInActingVersion(actingVersion) { + if err := n.PegOffsetType.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if !n.PegOffsetValueInActingVersion(actingVersion) { + n.PegOffsetValue = n.PegOffsetValueNullValue() + } else { + if err := _m.ReadUint8(_r, &n.PegOffsetValue); err != nil { + return err + } + } + if !n.PeggedPriceInActingVersion(actingVersion) { + n.PeggedPrice = n.PeggedPriceNullValue() + } else { + if err := _m.ReadInt64(_r, &n.PeggedPrice); err != nil { + return err + } + } + if actingVersion > n.SbeSchemaVersion() && blockLength > n.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-n.SbeBlockLength())) + } + + if n.SymbolInActingVersion(actingVersion) { + var SymbolLength uint8 + if err := _m.ReadUint8(_r, &SymbolLength); err != nil { + return err + } + if cap(n.Symbol) < int(SymbolLength) { + n.Symbol = make([]uint8, SymbolLength) + } + n.Symbol = n.Symbol[:SymbolLength] + if err := _m.ReadBytes(_r, n.Symbol); err != nil { + return err + } + } + + if n.ClientOrderIdInActingVersion(actingVersion) { + var ClientOrderIdLength uint8 + if err := _m.ReadUint8(_r, &ClientOrderIdLength); err != nil { + return err + } + if cap(n.ClientOrderId) < int(ClientOrderIdLength) { + n.ClientOrderId = make([]uint8, ClientOrderIdLength) + } + n.ClientOrderId = n.ClientOrderId[:ClientOrderIdLength] + if err := _m.ReadBytes(_r, n.ClientOrderId); err != nil { + return err + } + } + if doRangeCheck { + if err := n.RangeCheck(actingVersion, n.SbeSchemaVersion()); err != nil { + return err + } + } + return nil +} + +func (n *NewOrderResultResponse) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if n.PriceExponentInActingVersion(actingVersion) { + if n.PriceExponent < n.PriceExponentMinValue() || n.PriceExponent > n.PriceExponentMaxValue() { + return fmt.Errorf("Range check failed on n.PriceExponent (%v < %v > %v)", n.PriceExponentMinValue(), n.PriceExponent, n.PriceExponentMaxValue()) + } + } + if n.QtyExponentInActingVersion(actingVersion) { + if n.QtyExponent < n.QtyExponentMinValue() || n.QtyExponent > n.QtyExponentMaxValue() { + return fmt.Errorf("Range check failed on n.QtyExponent (%v < %v > %v)", n.QtyExponentMinValue(), n.QtyExponent, n.QtyExponentMaxValue()) + } + } + if n.OrderIdInActingVersion(actingVersion) { + if n.OrderId < n.OrderIdMinValue() || n.OrderId > n.OrderIdMaxValue() { + return fmt.Errorf("Range check failed on n.OrderId (%v < %v > %v)", n.OrderIdMinValue(), n.OrderId, n.OrderIdMaxValue()) + } + } + if n.OrderListIdInActingVersion(actingVersion) { + if n.OrderListId != n.OrderListIdNullValue() && (n.OrderListId < n.OrderListIdMinValue() || n.OrderListId > n.OrderListIdMaxValue()) { + return fmt.Errorf("Range check failed on n.OrderListId (%v < %v > %v)", n.OrderListIdMinValue(), n.OrderListId, n.OrderListIdMaxValue()) + } + } + if n.TransactTimeInActingVersion(actingVersion) { + if n.TransactTime < n.TransactTimeMinValue() || n.TransactTime > n.TransactTimeMaxValue() { + return fmt.Errorf("Range check failed on n.TransactTime (%v < %v > %v)", n.TransactTimeMinValue(), n.TransactTime, n.TransactTimeMaxValue()) + } + } + if n.PriceInActingVersion(actingVersion) { + if n.Price < n.PriceMinValue() || n.Price > n.PriceMaxValue() { + return fmt.Errorf("Range check failed on n.Price (%v < %v > %v)", n.PriceMinValue(), n.Price, n.PriceMaxValue()) + } + } + if n.OrigQtyInActingVersion(actingVersion) { + if n.OrigQty < n.OrigQtyMinValue() || n.OrigQty > n.OrigQtyMaxValue() { + return fmt.Errorf("Range check failed on n.OrigQty (%v < %v > %v)", n.OrigQtyMinValue(), n.OrigQty, n.OrigQtyMaxValue()) + } + } + if n.ExecutedQtyInActingVersion(actingVersion) { + if n.ExecutedQty < n.ExecutedQtyMinValue() || n.ExecutedQty > n.ExecutedQtyMaxValue() { + return fmt.Errorf("Range check failed on n.ExecutedQty (%v < %v > %v)", n.ExecutedQtyMinValue(), n.ExecutedQty, n.ExecutedQtyMaxValue()) + } + } + if n.CummulativeQuoteQtyInActingVersion(actingVersion) { + if n.CummulativeQuoteQty < n.CummulativeQuoteQtyMinValue() || n.CummulativeQuoteQty > n.CummulativeQuoteQtyMaxValue() { + return fmt.Errorf("Range check failed on n.CummulativeQuoteQty (%v < %v > %v)", n.CummulativeQuoteQtyMinValue(), n.CummulativeQuoteQty, n.CummulativeQuoteQtyMaxValue()) + } + } + if err := n.Status.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if err := n.TimeInForce.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if err := n.OrderType.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if err := n.Side.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if n.StopPriceInActingVersion(actingVersion) { + if n.StopPrice != n.StopPriceNullValue() && (n.StopPrice < n.StopPriceMinValue() || n.StopPrice > n.StopPriceMaxValue()) { + return fmt.Errorf("Range check failed on n.StopPrice (%v < %v > %v)", n.StopPriceMinValue(), n.StopPrice, n.StopPriceMaxValue()) + } + } + if n.TrailingDeltaInActingVersion(actingVersion) { + if n.TrailingDelta != n.TrailingDeltaNullValue() && (n.TrailingDelta < n.TrailingDeltaMinValue() || n.TrailingDelta > n.TrailingDeltaMaxValue()) { + return fmt.Errorf("Range check failed on n.TrailingDelta (%v < %v > %v)", n.TrailingDeltaMinValue(), n.TrailingDelta, n.TrailingDeltaMaxValue()) + } + } + if n.TrailingTimeInActingVersion(actingVersion) { + if n.TrailingTime != n.TrailingTimeNullValue() && (n.TrailingTime < n.TrailingTimeMinValue() || n.TrailingTime > n.TrailingTimeMaxValue()) { + return fmt.Errorf("Range check failed on n.TrailingTime (%v < %v > %v)", n.TrailingTimeMinValue(), n.TrailingTime, n.TrailingTimeMaxValue()) + } + } + if n.WorkingTimeInActingVersion(actingVersion) { + if n.WorkingTime != n.WorkingTimeNullValue() && (n.WorkingTime < n.WorkingTimeMinValue() || n.WorkingTime > n.WorkingTimeMaxValue()) { + return fmt.Errorf("Range check failed on n.WorkingTime (%v < %v > %v)", n.WorkingTimeMinValue(), n.WorkingTime, n.WorkingTimeMaxValue()) + } + } + if n.IcebergQtyInActingVersion(actingVersion) { + if n.IcebergQty != n.IcebergQtyNullValue() && (n.IcebergQty < n.IcebergQtyMinValue() || n.IcebergQty > n.IcebergQtyMaxValue()) { + return fmt.Errorf("Range check failed on n.IcebergQty (%v < %v > %v)", n.IcebergQtyMinValue(), n.IcebergQty, n.IcebergQtyMaxValue()) + } + } + if n.StrategyIdInActingVersion(actingVersion) { + if n.StrategyId != n.StrategyIdNullValue() && (n.StrategyId < n.StrategyIdMinValue() || n.StrategyId > n.StrategyIdMaxValue()) { + return fmt.Errorf("Range check failed on n.StrategyId (%v < %v > %v)", n.StrategyIdMinValue(), n.StrategyId, n.StrategyIdMaxValue()) + } + } + if n.StrategyTypeInActingVersion(actingVersion) { + if n.StrategyType != n.StrategyTypeNullValue() && (n.StrategyType < n.StrategyTypeMinValue() || n.StrategyType > n.StrategyTypeMaxValue()) { + return fmt.Errorf("Range check failed on n.StrategyType (%v < %v > %v)", n.StrategyTypeMinValue(), n.StrategyType, n.StrategyTypeMaxValue()) + } + } + if err := n.OrderCapacity.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if err := n.WorkingFloor.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if err := n.SelfTradePreventionMode.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if n.TradeGroupIdInActingVersion(actingVersion) { + if n.TradeGroupId != n.TradeGroupIdNullValue() && (n.TradeGroupId < n.TradeGroupIdMinValue() || n.TradeGroupId > n.TradeGroupIdMaxValue()) { + return fmt.Errorf("Range check failed on n.TradeGroupId (%v < %v > %v)", n.TradeGroupIdMinValue(), n.TradeGroupId, n.TradeGroupIdMaxValue()) + } + } + if n.PreventedQuantityInActingVersion(actingVersion) { + if n.PreventedQuantity < n.PreventedQuantityMinValue() || n.PreventedQuantity > n.PreventedQuantityMaxValue() { + return fmt.Errorf("Range check failed on n.PreventedQuantity (%v < %v > %v)", n.PreventedQuantityMinValue(), n.PreventedQuantity, n.PreventedQuantityMaxValue()) + } + } + if err := n.UsedSor.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if n.OrigQuoteOrderQtyInActingVersion(actingVersion) { + if n.OrigQuoteOrderQty < n.OrigQuoteOrderQtyMinValue() || n.OrigQuoteOrderQty > n.OrigQuoteOrderQtyMaxValue() { + return fmt.Errorf("Range check failed on n.OrigQuoteOrderQty (%v < %v > %v)", n.OrigQuoteOrderQtyMinValue(), n.OrigQuoteOrderQty, n.OrigQuoteOrderQtyMaxValue()) + } + } + if err := n.PegPriceType.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if err := n.PegOffsetType.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if n.PegOffsetValueInActingVersion(actingVersion) { + if n.PegOffsetValue != n.PegOffsetValueNullValue() && (n.PegOffsetValue < n.PegOffsetValueMinValue() || n.PegOffsetValue > n.PegOffsetValueMaxValue()) { + return fmt.Errorf("Range check failed on n.PegOffsetValue (%v < %v > %v)", n.PegOffsetValueMinValue(), n.PegOffsetValue, n.PegOffsetValueMaxValue()) + } + } + if n.PeggedPriceInActingVersion(actingVersion) { + if n.PeggedPrice != n.PeggedPriceNullValue() && (n.PeggedPrice < n.PeggedPriceMinValue() || n.PeggedPrice > n.PeggedPriceMaxValue()) { + return fmt.Errorf("Range check failed on n.PeggedPrice (%v < %v > %v)", n.PeggedPriceMinValue(), n.PeggedPrice, n.PeggedPriceMaxValue()) + } + } + if !utf8.Valid(n.Symbol[:]) { + return errors.New("n.Symbol failed UTF-8 validation") + } + if !utf8.Valid(n.ClientOrderId[:]) { + return errors.New("n.ClientOrderId failed UTF-8 validation") + } + return nil +} + +func NewOrderResultResponseInit(n *NewOrderResultResponse) { + n.OrderListId = math.MinInt64 + n.StopPrice = math.MinInt64 + n.TrailingDelta = math.MinInt64 + n.TrailingTime = math.MinInt64 + n.WorkingTime = math.MinInt64 + n.IcebergQty = math.MinInt64 + n.StrategyId = math.MinInt64 + n.StrategyType = math.MinInt32 + n.TradeGroupId = math.MinInt64 + n.PegOffsetValue = math.MaxUint8 + n.PeggedPrice = math.MinInt64 + return +} + +func (*NewOrderResultResponse) SbeBlockLength() (blockLength uint16) { + return 153 +} + +func (*NewOrderResultResponse) SbeTemplateId() (templateId uint16) { + return 301 +} + +func (*NewOrderResultResponse) SbeSchemaId() (schemaId uint16) { + return 3 +} + +func (*NewOrderResultResponse) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} + +func (*NewOrderResultResponse) SbeSemanticType() (semanticType []byte) { + return []byte("") +} + +func (*NewOrderResultResponse) SbeSemanticVersion() (semanticVersion string) { + return "5.2" +} + +func (*NewOrderResultResponse) PriceExponentId() uint16 { + return 1 +} + +func (*NewOrderResultResponse) PriceExponentSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderResultResponse) PriceExponentInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.PriceExponentSinceVersion() +} + +func (*NewOrderResultResponse) PriceExponentDeprecated() uint16 { + return 0 +} + +func (*NewOrderResultResponse) PriceExponentMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderResultResponse) PriceExponentMinValue() int8 { + return math.MinInt8 + 1 +} + +func (*NewOrderResultResponse) PriceExponentMaxValue() int8 { + return math.MaxInt8 +} + +func (*NewOrderResultResponse) PriceExponentNullValue() int8 { + return math.MinInt8 +} + +func (*NewOrderResultResponse) QtyExponentId() uint16 { + return 2 +} + +func (*NewOrderResultResponse) QtyExponentSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderResultResponse) QtyExponentInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.QtyExponentSinceVersion() +} + +func (*NewOrderResultResponse) QtyExponentDeprecated() uint16 { + return 0 +} + +func (*NewOrderResultResponse) QtyExponentMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderResultResponse) QtyExponentMinValue() int8 { + return math.MinInt8 + 1 +} + +func (*NewOrderResultResponse) QtyExponentMaxValue() int8 { + return math.MaxInt8 +} + +func (*NewOrderResultResponse) QtyExponentNullValue() int8 { + return math.MinInt8 +} + +func (*NewOrderResultResponse) OrderIdId() uint16 { + return 3 +} + +func (*NewOrderResultResponse) OrderIdSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderResultResponse) OrderIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.OrderIdSinceVersion() +} + +func (*NewOrderResultResponse) OrderIdDeprecated() uint16 { + return 0 +} + +func (*NewOrderResultResponse) OrderIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderResultResponse) OrderIdMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*NewOrderResultResponse) OrderIdMaxValue() int64 { + return math.MaxInt64 +} + +func (*NewOrderResultResponse) OrderIdNullValue() int64 { + return math.MinInt64 +} + +func (*NewOrderResultResponse) OrderListIdId() uint16 { + return 4 +} + +func (*NewOrderResultResponse) OrderListIdSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderResultResponse) OrderListIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.OrderListIdSinceVersion() +} + +func (*NewOrderResultResponse) OrderListIdDeprecated() uint16 { + return 0 +} + +func (*NewOrderResultResponse) OrderListIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*NewOrderResultResponse) OrderListIdMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*NewOrderResultResponse) OrderListIdMaxValue() int64 { + return math.MaxInt64 +} + +func (*NewOrderResultResponse) OrderListIdNullValue() int64 { + return math.MinInt64 +} + +func (*NewOrderResultResponse) TransactTimeId() uint16 { + return 5 +} + +func (*NewOrderResultResponse) TransactTimeSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderResultResponse) TransactTimeInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.TransactTimeSinceVersion() +} + +func (*NewOrderResultResponse) TransactTimeDeprecated() uint16 { + return 0 +} + +func (*NewOrderResultResponse) TransactTimeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderResultResponse) TransactTimeMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*NewOrderResultResponse) TransactTimeMaxValue() int64 { + return math.MaxInt64 +} + +func (*NewOrderResultResponse) TransactTimeNullValue() int64 { + return math.MinInt64 +} + +func (*NewOrderResultResponse) PriceId() uint16 { + return 6 +} + +func (*NewOrderResultResponse) PriceSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderResultResponse) PriceInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.PriceSinceVersion() +} + +func (*NewOrderResultResponse) PriceDeprecated() uint16 { + return 0 +} + +func (*NewOrderResultResponse) PriceMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderResultResponse) PriceMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*NewOrderResultResponse) PriceMaxValue() int64 { + return math.MaxInt64 +} + +func (*NewOrderResultResponse) PriceNullValue() int64 { + return math.MinInt64 +} + +func (*NewOrderResultResponse) OrigQtyId() uint16 { + return 7 +} + +func (*NewOrderResultResponse) OrigQtySinceVersion() uint16 { + return 0 +} + +func (n *NewOrderResultResponse) OrigQtyInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.OrigQtySinceVersion() +} + +func (*NewOrderResultResponse) OrigQtyDeprecated() uint16 { + return 0 +} + +func (*NewOrderResultResponse) OrigQtyMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderResultResponse) OrigQtyMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*NewOrderResultResponse) OrigQtyMaxValue() int64 { + return math.MaxInt64 +} + +func (*NewOrderResultResponse) OrigQtyNullValue() int64 { + return math.MinInt64 +} + +func (*NewOrderResultResponse) ExecutedQtyId() uint16 { + return 8 +} + +func (*NewOrderResultResponse) ExecutedQtySinceVersion() uint16 { + return 0 +} + +func (n *NewOrderResultResponse) ExecutedQtyInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.ExecutedQtySinceVersion() +} + +func (*NewOrderResultResponse) ExecutedQtyDeprecated() uint16 { + return 0 +} + +func (*NewOrderResultResponse) ExecutedQtyMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderResultResponse) ExecutedQtyMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*NewOrderResultResponse) ExecutedQtyMaxValue() int64 { + return math.MaxInt64 +} + +func (*NewOrderResultResponse) ExecutedQtyNullValue() int64 { + return math.MinInt64 +} + +func (*NewOrderResultResponse) CummulativeQuoteQtyId() uint16 { + return 9 +} + +func (*NewOrderResultResponse) CummulativeQuoteQtySinceVersion() uint16 { + return 0 +} + +func (n *NewOrderResultResponse) CummulativeQuoteQtyInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.CummulativeQuoteQtySinceVersion() +} + +func (*NewOrderResultResponse) CummulativeQuoteQtyDeprecated() uint16 { + return 0 +} + +func (*NewOrderResultResponse) CummulativeQuoteQtyMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderResultResponse) CummulativeQuoteQtyMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*NewOrderResultResponse) CummulativeQuoteQtyMaxValue() int64 { + return math.MaxInt64 +} + +func (*NewOrderResultResponse) CummulativeQuoteQtyNullValue() int64 { + return math.MinInt64 +} + +func (*NewOrderResultResponse) StatusId() uint16 { + return 10 +} + +func (*NewOrderResultResponse) StatusSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderResultResponse) StatusInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.StatusSinceVersion() +} + +func (*NewOrderResultResponse) StatusDeprecated() uint16 { + return 0 +} + +func (*NewOrderResultResponse) StatusMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderResultResponse) TimeInForceId() uint16 { + return 11 +} + +func (*NewOrderResultResponse) TimeInForceSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderResultResponse) TimeInForceInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.TimeInForceSinceVersion() +} + +func (*NewOrderResultResponse) TimeInForceDeprecated() uint16 { + return 0 +} + +func (*NewOrderResultResponse) TimeInForceMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderResultResponse) OrderTypeId() uint16 { + return 12 +} + +func (*NewOrderResultResponse) OrderTypeSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderResultResponse) OrderTypeInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.OrderTypeSinceVersion() +} + +func (*NewOrderResultResponse) OrderTypeDeprecated() uint16 { + return 0 +} + +func (*NewOrderResultResponse) OrderTypeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderResultResponse) SideId() uint16 { + return 13 +} + +func (*NewOrderResultResponse) SideSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderResultResponse) SideInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.SideSinceVersion() +} + +func (*NewOrderResultResponse) SideDeprecated() uint16 { + return 0 +} + +func (*NewOrderResultResponse) SideMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderResultResponse) StopPriceId() uint16 { + return 14 +} + +func (*NewOrderResultResponse) StopPriceSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderResultResponse) StopPriceInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.StopPriceSinceVersion() +} + +func (*NewOrderResultResponse) StopPriceDeprecated() uint16 { + return 0 +} + +func (*NewOrderResultResponse) StopPriceMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*NewOrderResultResponse) StopPriceMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*NewOrderResultResponse) StopPriceMaxValue() int64 { + return math.MaxInt64 +} + +func (*NewOrderResultResponse) StopPriceNullValue() int64 { + return math.MinInt64 +} + +func (*NewOrderResultResponse) TrailingDeltaId() uint16 { + return 15 +} + +func (*NewOrderResultResponse) TrailingDeltaSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderResultResponse) TrailingDeltaInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.TrailingDeltaSinceVersion() +} + +func (*NewOrderResultResponse) TrailingDeltaDeprecated() uint16 { + return 0 +} + +func (*NewOrderResultResponse) TrailingDeltaMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*NewOrderResultResponse) TrailingDeltaMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*NewOrderResultResponse) TrailingDeltaMaxValue() int64 { + return math.MaxInt64 +} + +func (*NewOrderResultResponse) TrailingDeltaNullValue() int64 { + return math.MinInt64 +} + +func (*NewOrderResultResponse) TrailingTimeId() uint16 { + return 16 +} + +func (*NewOrderResultResponse) TrailingTimeSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderResultResponse) TrailingTimeInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.TrailingTimeSinceVersion() +} + +func (*NewOrderResultResponse) TrailingTimeDeprecated() uint16 { + return 0 +} + +func (*NewOrderResultResponse) TrailingTimeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*NewOrderResultResponse) TrailingTimeMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*NewOrderResultResponse) TrailingTimeMaxValue() int64 { + return math.MaxInt64 +} + +func (*NewOrderResultResponse) TrailingTimeNullValue() int64 { + return math.MinInt64 +} + +func (*NewOrderResultResponse) WorkingTimeId() uint16 { + return 17 +} + +func (*NewOrderResultResponse) WorkingTimeSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderResultResponse) WorkingTimeInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.WorkingTimeSinceVersion() +} + +func (*NewOrderResultResponse) WorkingTimeDeprecated() uint16 { + return 0 +} + +func (*NewOrderResultResponse) WorkingTimeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*NewOrderResultResponse) WorkingTimeMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*NewOrderResultResponse) WorkingTimeMaxValue() int64 { + return math.MaxInt64 +} + +func (*NewOrderResultResponse) WorkingTimeNullValue() int64 { + return math.MinInt64 +} + +func (*NewOrderResultResponse) IcebergQtyId() uint16 { + return 18 +} + +func (*NewOrderResultResponse) IcebergQtySinceVersion() uint16 { + return 0 +} + +func (n *NewOrderResultResponse) IcebergQtyInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.IcebergQtySinceVersion() +} + +func (*NewOrderResultResponse) IcebergQtyDeprecated() uint16 { + return 0 +} + +func (*NewOrderResultResponse) IcebergQtyMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*NewOrderResultResponse) IcebergQtyMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*NewOrderResultResponse) IcebergQtyMaxValue() int64 { + return math.MaxInt64 +} + +func (*NewOrderResultResponse) IcebergQtyNullValue() int64 { + return math.MinInt64 +} + +func (*NewOrderResultResponse) StrategyIdId() uint16 { + return 19 +} + +func (*NewOrderResultResponse) StrategyIdSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderResultResponse) StrategyIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.StrategyIdSinceVersion() +} + +func (*NewOrderResultResponse) StrategyIdDeprecated() uint16 { + return 0 +} + +func (*NewOrderResultResponse) StrategyIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*NewOrderResultResponse) StrategyIdMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*NewOrderResultResponse) StrategyIdMaxValue() int64 { + return math.MaxInt64 +} + +func (*NewOrderResultResponse) StrategyIdNullValue() int64 { + return math.MinInt64 +} + +func (*NewOrderResultResponse) StrategyTypeId() uint16 { + return 20 +} + +func (*NewOrderResultResponse) StrategyTypeSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderResultResponse) StrategyTypeInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.StrategyTypeSinceVersion() +} + +func (*NewOrderResultResponse) StrategyTypeDeprecated() uint16 { + return 0 +} + +func (*NewOrderResultResponse) StrategyTypeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*NewOrderResultResponse) StrategyTypeMinValue() int32 { + return math.MinInt32 + 1 +} + +func (*NewOrderResultResponse) StrategyTypeMaxValue() int32 { + return math.MaxInt32 +} + +func (*NewOrderResultResponse) StrategyTypeNullValue() int32 { + return math.MinInt32 +} + +func (*NewOrderResultResponse) OrderCapacityId() uint16 { + return 21 +} + +func (*NewOrderResultResponse) OrderCapacitySinceVersion() uint16 { + return 0 +} + +func (n *NewOrderResultResponse) OrderCapacityInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.OrderCapacitySinceVersion() +} + +func (*NewOrderResultResponse) OrderCapacityDeprecated() uint16 { + return 0 +} + +func (*NewOrderResultResponse) OrderCapacityMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderResultResponse) WorkingFloorId() uint16 { + return 22 +} + +func (*NewOrderResultResponse) WorkingFloorSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderResultResponse) WorkingFloorInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.WorkingFloorSinceVersion() +} + +func (*NewOrderResultResponse) WorkingFloorDeprecated() uint16 { + return 0 +} + +func (*NewOrderResultResponse) WorkingFloorMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderResultResponse) SelfTradePreventionModeId() uint16 { + return 23 +} + +func (*NewOrderResultResponse) SelfTradePreventionModeSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderResultResponse) SelfTradePreventionModeInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.SelfTradePreventionModeSinceVersion() +} + +func (*NewOrderResultResponse) SelfTradePreventionModeDeprecated() uint16 { + return 0 +} + +func (*NewOrderResultResponse) SelfTradePreventionModeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderResultResponse) TradeGroupIdId() uint16 { + return 24 +} + +func (*NewOrderResultResponse) TradeGroupIdSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderResultResponse) TradeGroupIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.TradeGroupIdSinceVersion() +} + +func (*NewOrderResultResponse) TradeGroupIdDeprecated() uint16 { + return 0 +} + +func (*NewOrderResultResponse) TradeGroupIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*NewOrderResultResponse) TradeGroupIdMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*NewOrderResultResponse) TradeGroupIdMaxValue() int64 { + return math.MaxInt64 +} + +func (*NewOrderResultResponse) TradeGroupIdNullValue() int64 { + return math.MinInt64 +} + +func (*NewOrderResultResponse) PreventedQuantityId() uint16 { + return 25 +} + +func (*NewOrderResultResponse) PreventedQuantitySinceVersion() uint16 { + return 0 +} + +func (n *NewOrderResultResponse) PreventedQuantityInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.PreventedQuantitySinceVersion() +} + +func (*NewOrderResultResponse) PreventedQuantityDeprecated() uint16 { + return 0 +} + +func (*NewOrderResultResponse) PreventedQuantityMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderResultResponse) PreventedQuantityMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*NewOrderResultResponse) PreventedQuantityMaxValue() int64 { + return math.MaxInt64 +} + +func (*NewOrderResultResponse) PreventedQuantityNullValue() int64 { + return math.MinInt64 +} + +func (*NewOrderResultResponse) UsedSorId() uint16 { + return 26 +} + +func (*NewOrderResultResponse) UsedSorSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderResultResponse) UsedSorInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.UsedSorSinceVersion() +} + +func (*NewOrderResultResponse) UsedSorDeprecated() uint16 { + return 0 +} + +func (*NewOrderResultResponse) UsedSorMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderResultResponse) OrigQuoteOrderQtyId() uint16 { + return 27 +} + +func (*NewOrderResultResponse) OrigQuoteOrderQtySinceVersion() uint16 { + return 0 +} + +func (n *NewOrderResultResponse) OrigQuoteOrderQtyInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.OrigQuoteOrderQtySinceVersion() +} + +func (*NewOrderResultResponse) OrigQuoteOrderQtyDeprecated() uint16 { + return 0 +} + +func (*NewOrderResultResponse) OrigQuoteOrderQtyMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderResultResponse) OrigQuoteOrderQtyMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*NewOrderResultResponse) OrigQuoteOrderQtyMaxValue() int64 { + return math.MaxInt64 +} + +func (*NewOrderResultResponse) OrigQuoteOrderQtyNullValue() int64 { + return math.MinInt64 +} + +func (*NewOrderResultResponse) PegPriceTypeId() uint16 { + return 28 +} + +func (*NewOrderResultResponse) PegPriceTypeSinceVersion() uint16 { + return 1 +} + +func (n *NewOrderResultResponse) PegPriceTypeInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.PegPriceTypeSinceVersion() +} + +func (*NewOrderResultResponse) PegPriceTypeDeprecated() uint16 { + return 0 +} + +func (*NewOrderResultResponse) PegPriceTypeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*NewOrderResultResponse) PegOffsetTypeId() uint16 { + return 29 +} + +func (*NewOrderResultResponse) PegOffsetTypeSinceVersion() uint16 { + return 1 +} + +func (n *NewOrderResultResponse) PegOffsetTypeInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.PegOffsetTypeSinceVersion() +} + +func (*NewOrderResultResponse) PegOffsetTypeDeprecated() uint16 { + return 0 +} + +func (*NewOrderResultResponse) PegOffsetTypeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*NewOrderResultResponse) PegOffsetValueId() uint16 { + return 30 +} + +func (*NewOrderResultResponse) PegOffsetValueSinceVersion() uint16 { + return 1 +} + +func (n *NewOrderResultResponse) PegOffsetValueInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.PegOffsetValueSinceVersion() +} + +func (*NewOrderResultResponse) PegOffsetValueDeprecated() uint16 { + return 0 +} + +func (*NewOrderResultResponse) PegOffsetValueMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*NewOrderResultResponse) PegOffsetValueMinValue() uint8 { + return 0 +} + +func (*NewOrderResultResponse) PegOffsetValueMaxValue() uint8 { + return math.MaxUint8 - 1 +} + +func (*NewOrderResultResponse) PegOffsetValueNullValue() uint8 { + return math.MaxUint8 +} + +func (*NewOrderResultResponse) PeggedPriceId() uint16 { + return 31 +} + +func (*NewOrderResultResponse) PeggedPriceSinceVersion() uint16 { + return 1 +} + +func (n *NewOrderResultResponse) PeggedPriceInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.PeggedPriceSinceVersion() +} + +func (*NewOrderResultResponse) PeggedPriceDeprecated() uint16 { + return 0 +} + +func (*NewOrderResultResponse) PeggedPriceMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*NewOrderResultResponse) PeggedPriceMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*NewOrderResultResponse) PeggedPriceMaxValue() int64 { + return math.MaxInt64 +} + +func (*NewOrderResultResponse) PeggedPriceNullValue() int64 { + return math.MinInt64 +} + +func (*NewOrderResultResponse) SymbolMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderResultResponse) SymbolSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderResultResponse) SymbolInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.SymbolSinceVersion() +} + +func (*NewOrderResultResponse) SymbolDeprecated() uint16 { + return 0 +} + +func (NewOrderResultResponse) SymbolCharacterEncoding() string { + return "UTF-8" +} + +func (NewOrderResultResponse) SymbolHeaderLength() uint64 { + return 1 +} + +func (*NewOrderResultResponse) ClientOrderIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NewOrderResultResponse) ClientOrderIdSinceVersion() uint16 { + return 0 +} + +func (n *NewOrderResultResponse) ClientOrderIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.ClientOrderIdSinceVersion() +} + +func (*NewOrderResultResponse) ClientOrderIdDeprecated() uint16 { + return 0 +} + +func (NewOrderResultResponse) ClientOrderIdCharacterEncoding() string { + return "UTF-8" +} + +func (NewOrderResultResponse) ClientOrderIdHeaderLength() uint64 { + return 1 +} diff --git a/v2/sbe/spot_3_1/NonRepresentableMessage.go b/v2/sbe/spot_3_1/NonRepresentableMessage.go new file mode 100644 index 00000000..7fe6e937 --- /dev/null +++ b/v2/sbe/spot_3_1/NonRepresentableMessage.go @@ -0,0 +1,64 @@ +// Generated SBE (Simple Binary Encoding) message codec + +package sbe + +import ( + "io" + "io/ioutil" +) + +type NonRepresentableMessage struct { +} + +func (n *NonRepresentableMessage) Encode(_m *SbeGoMarshaller, _w io.Writer, doRangeCheck bool) error { + if doRangeCheck { + if err := n.RangeCheck(n.SbeSchemaVersion(), n.SbeSchemaVersion()); err != nil { + return err + } + } + return nil +} + +func (n *NonRepresentableMessage) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint16, doRangeCheck bool) error { + if actingVersion > n.SbeSchemaVersion() && blockLength > n.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-n.SbeBlockLength())) + } + if doRangeCheck { + if err := n.RangeCheck(actingVersion, n.SbeSchemaVersion()); err != nil { + return err + } + } + return nil +} + +func (n *NonRepresentableMessage) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + return nil +} + +func NonRepresentableMessageInit(n *NonRepresentableMessage) { + return +} + +func (*NonRepresentableMessage) SbeBlockLength() (blockLength uint16) { + return 0 +} + +func (*NonRepresentableMessage) SbeTemplateId() (templateId uint16) { + return 999 +} + +func (*NonRepresentableMessage) SbeSchemaId() (schemaId uint16) { + return 3 +} + +func (*NonRepresentableMessage) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} + +func (*NonRepresentableMessage) SbeSemanticType() (semanticType []byte) { + return []byte("") +} + +func (*NonRepresentableMessage) SbeSemanticVersion() (semanticVersion string) { + return "5.2" +} diff --git a/v2/sbe/spot_3_1/NotionalFilter.go b/v2/sbe/spot_3_1/NotionalFilter.go new file mode 100644 index 00000000..c68d0d23 --- /dev/null +++ b/v2/sbe/spot_3_1/NotionalFilter.go @@ -0,0 +1,418 @@ +// Generated SBE (Simple Binary Encoding) message codec + +package sbe + +import ( + "fmt" + "io" + "io/ioutil" + "math" +) + +type NotionalFilter struct { + FilterType FilterTypeEnum + PriceExponent int8 + MinNotional int64 + ApplyMinToMarket BoolEnumEnum + MaxNotional int64 + ApplyMaxToMarket BoolEnumEnum + AvgPriceMins int32 +} + +func (n *NotionalFilter) Encode(_m *SbeGoMarshaller, _w io.Writer, doRangeCheck bool) error { + if doRangeCheck { + if err := n.RangeCheck(n.SbeSchemaVersion(), n.SbeSchemaVersion()); err != nil { + return err + } + } + if err := _m.WriteInt8(_w, n.PriceExponent); err != nil { + return err + } + if err := _m.WriteInt64(_w, n.MinNotional); err != nil { + return err + } + if err := n.ApplyMinToMarket.Encode(_m, _w); err != nil { + return err + } + if err := _m.WriteInt64(_w, n.MaxNotional); err != nil { + return err + } + if err := n.ApplyMaxToMarket.Encode(_m, _w); err != nil { + return err + } + if err := _m.WriteInt32(_w, n.AvgPriceMins); err != nil { + return err + } + return nil +} + +func (n *NotionalFilter) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint16, doRangeCheck bool) error { + n.FilterType = FilterType.Notional + if !n.PriceExponentInActingVersion(actingVersion) { + n.PriceExponent = n.PriceExponentNullValue() + } else { + if err := _m.ReadInt8(_r, &n.PriceExponent); err != nil { + return err + } + } + if !n.MinNotionalInActingVersion(actingVersion) { + n.MinNotional = n.MinNotionalNullValue() + } else { + if err := _m.ReadInt64(_r, &n.MinNotional); err != nil { + return err + } + } + if n.ApplyMinToMarketInActingVersion(actingVersion) { + if err := n.ApplyMinToMarket.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if !n.MaxNotionalInActingVersion(actingVersion) { + n.MaxNotional = n.MaxNotionalNullValue() + } else { + if err := _m.ReadInt64(_r, &n.MaxNotional); err != nil { + return err + } + } + if n.ApplyMaxToMarketInActingVersion(actingVersion) { + if err := n.ApplyMaxToMarket.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if !n.AvgPriceMinsInActingVersion(actingVersion) { + n.AvgPriceMins = n.AvgPriceMinsNullValue() + } else { + if err := _m.ReadInt32(_r, &n.AvgPriceMins); err != nil { + return err + } + } + if actingVersion > n.SbeSchemaVersion() && blockLength > n.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-n.SbeBlockLength())) + } + if doRangeCheck { + if err := n.RangeCheck(actingVersion, n.SbeSchemaVersion()); err != nil { + return err + } + } + return nil +} + +func (n *NotionalFilter) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if err := n.FilterType.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if n.PriceExponentInActingVersion(actingVersion) { + if n.PriceExponent < n.PriceExponentMinValue() || n.PriceExponent > n.PriceExponentMaxValue() { + return fmt.Errorf("Range check failed on n.PriceExponent (%v < %v > %v)", n.PriceExponentMinValue(), n.PriceExponent, n.PriceExponentMaxValue()) + } + } + if n.MinNotionalInActingVersion(actingVersion) { + if n.MinNotional < n.MinNotionalMinValue() || n.MinNotional > n.MinNotionalMaxValue() { + return fmt.Errorf("Range check failed on n.MinNotional (%v < %v > %v)", n.MinNotionalMinValue(), n.MinNotional, n.MinNotionalMaxValue()) + } + } + if err := n.ApplyMinToMarket.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if n.MaxNotionalInActingVersion(actingVersion) { + if n.MaxNotional < n.MaxNotionalMinValue() || n.MaxNotional > n.MaxNotionalMaxValue() { + return fmt.Errorf("Range check failed on n.MaxNotional (%v < %v > %v)", n.MaxNotionalMinValue(), n.MaxNotional, n.MaxNotionalMaxValue()) + } + } + if err := n.ApplyMaxToMarket.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if n.AvgPriceMinsInActingVersion(actingVersion) { + if n.AvgPriceMins < n.AvgPriceMinsMinValue() || n.AvgPriceMins > n.AvgPriceMinsMaxValue() { + return fmt.Errorf("Range check failed on n.AvgPriceMins (%v < %v > %v)", n.AvgPriceMinsMinValue(), n.AvgPriceMins, n.AvgPriceMinsMaxValue()) + } + } + return nil +} + +func NotionalFilterInit(n *NotionalFilter) { + n.FilterType = FilterType.Notional + return +} + +func (*NotionalFilter) SbeBlockLength() (blockLength uint16) { + return 23 +} + +func (*NotionalFilter) SbeTemplateId() (templateId uint16) { + return 6 +} + +func (*NotionalFilter) SbeSchemaId() (schemaId uint16) { + return 3 +} + +func (*NotionalFilter) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} + +func (*NotionalFilter) SbeSemanticType() (semanticType []byte) { + return []byte("") +} + +func (*NotionalFilter) SbeSemanticVersion() (semanticVersion string) { + return "5.2" +} + +func (*NotionalFilter) FilterTypeId() uint16 { + return 1 +} + +func (*NotionalFilter) FilterTypeSinceVersion() uint16 { + return 0 +} + +func (n *NotionalFilter) FilterTypeInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.FilterTypeSinceVersion() +} + +func (*NotionalFilter) FilterTypeDeprecated() uint16 { + return 0 +} + +func (*NotionalFilter) FilterTypeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "constant" + } + return "" +} + +func (*NotionalFilter) PriceExponentId() uint16 { + return 2 +} + +func (*NotionalFilter) PriceExponentSinceVersion() uint16 { + return 0 +} + +func (n *NotionalFilter) PriceExponentInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.PriceExponentSinceVersion() +} + +func (*NotionalFilter) PriceExponentDeprecated() uint16 { + return 0 +} + +func (*NotionalFilter) PriceExponentMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NotionalFilter) PriceExponentMinValue() int8 { + return math.MinInt8 + 1 +} + +func (*NotionalFilter) PriceExponentMaxValue() int8 { + return math.MaxInt8 +} + +func (*NotionalFilter) PriceExponentNullValue() int8 { + return math.MinInt8 +} + +func (*NotionalFilter) MinNotionalId() uint16 { + return 3 +} + +func (*NotionalFilter) MinNotionalSinceVersion() uint16 { + return 0 +} + +func (n *NotionalFilter) MinNotionalInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.MinNotionalSinceVersion() +} + +func (*NotionalFilter) MinNotionalDeprecated() uint16 { + return 0 +} + +func (*NotionalFilter) MinNotionalMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NotionalFilter) MinNotionalMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*NotionalFilter) MinNotionalMaxValue() int64 { + return math.MaxInt64 +} + +func (*NotionalFilter) MinNotionalNullValue() int64 { + return math.MinInt64 +} + +func (*NotionalFilter) ApplyMinToMarketId() uint16 { + return 4 +} + +func (*NotionalFilter) ApplyMinToMarketSinceVersion() uint16 { + return 0 +} + +func (n *NotionalFilter) ApplyMinToMarketInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.ApplyMinToMarketSinceVersion() +} + +func (*NotionalFilter) ApplyMinToMarketDeprecated() uint16 { + return 0 +} + +func (*NotionalFilter) ApplyMinToMarketMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NotionalFilter) MaxNotionalId() uint16 { + return 5 +} + +func (*NotionalFilter) MaxNotionalSinceVersion() uint16 { + return 0 +} + +func (n *NotionalFilter) MaxNotionalInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.MaxNotionalSinceVersion() +} + +func (*NotionalFilter) MaxNotionalDeprecated() uint16 { + return 0 +} + +func (*NotionalFilter) MaxNotionalMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NotionalFilter) MaxNotionalMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*NotionalFilter) MaxNotionalMaxValue() int64 { + return math.MaxInt64 +} + +func (*NotionalFilter) MaxNotionalNullValue() int64 { + return math.MinInt64 +} + +func (*NotionalFilter) ApplyMaxToMarketId() uint16 { + return 6 +} + +func (*NotionalFilter) ApplyMaxToMarketSinceVersion() uint16 { + return 0 +} + +func (n *NotionalFilter) ApplyMaxToMarketInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.ApplyMaxToMarketSinceVersion() +} + +func (*NotionalFilter) ApplyMaxToMarketDeprecated() uint16 { + return 0 +} + +func (*NotionalFilter) ApplyMaxToMarketMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NotionalFilter) AvgPriceMinsId() uint16 { + return 7 +} + +func (*NotionalFilter) AvgPriceMinsSinceVersion() uint16 { + return 0 +} + +func (n *NotionalFilter) AvgPriceMinsInActingVersion(actingVersion uint16) bool { + return actingVersion >= n.AvgPriceMinsSinceVersion() +} + +func (*NotionalFilter) AvgPriceMinsDeprecated() uint16 { + return 0 +} + +func (*NotionalFilter) AvgPriceMinsMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*NotionalFilter) AvgPriceMinsMinValue() int32 { + return math.MinInt32 + 1 +} + +func (*NotionalFilter) AvgPriceMinsMaxValue() int32 { + return math.MaxInt32 +} + +func (*NotionalFilter) AvgPriceMinsNullValue() int32 { + return math.MinInt32 +} diff --git a/v2/sbe/spot_3_1/OptionalMessageData.go b/v2/sbe/spot_3_1/OptionalMessageData.go new file mode 100644 index 00000000..b556d7e2 --- /dev/null +++ b/v2/sbe/spot_3_1/OptionalMessageData.go @@ -0,0 +1,112 @@ +// Generated SBE (Simple Binary Encoding) message codec + +package sbe + +import ( + "fmt" + "io" + "math" +) + +type OptionalMessageData struct { + Length uint32 + VarData uint8 +} + +func (o *OptionalMessageData) Encode(_m *SbeGoMarshaller, _w io.Writer) error { + if err := _m.WriteUint32(_w, o.Length); err != nil { + return err + } + if err := _m.WriteUint8(_w, o.VarData); err != nil { + return err + } + return nil +} + +func (o *OptionalMessageData) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16) error { + if !o.LengthInActingVersion(actingVersion) { + o.Length = o.LengthNullValue() + } else { + if err := _m.ReadUint32(_r, &o.Length); err != nil { + return err + } + } + if !o.VarDataInActingVersion(actingVersion) { + o.VarData = o.VarDataNullValue() + } else { + if err := _m.ReadUint8(_r, &o.VarData); err != nil { + return err + } + } + return nil +} + +func (o *OptionalMessageData) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if o.LengthInActingVersion(actingVersion) { + if o.Length < o.LengthMinValue() || o.Length > o.LengthMaxValue() { + return fmt.Errorf("Range check failed on o.Length (%v < %v > %v)", o.LengthMinValue(), o.Length, o.LengthMaxValue()) + } + } + if o.VarDataInActingVersion(actingVersion) { + if o.VarData < o.VarDataMinValue() || o.VarData > o.VarDataMaxValue() { + return fmt.Errorf("Range check failed on o.VarData (%v < %v > %v)", o.VarDataMinValue(), o.VarData, o.VarDataMaxValue()) + } + } + return nil +} + +func OptionalMessageDataInit(o *OptionalMessageData) { + return +} + +func (*OptionalMessageData) EncodedLength() int64 { + return -1 +} + +func (*OptionalMessageData) LengthMinValue() uint32 { + return 0 +} + +func (*OptionalMessageData) LengthMaxValue() uint32 { + return 2147483647 +} + +func (*OptionalMessageData) LengthNullValue() uint32 { + return math.MaxUint32 +} + +func (*OptionalMessageData) LengthSinceVersion() uint16 { + return 0 +} + +func (o *OptionalMessageData) LengthInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.LengthSinceVersion() +} + +func (*OptionalMessageData) LengthDeprecated() uint16 { + return 0 +} + +func (*OptionalMessageData) VarDataMinValue() uint8 { + return 0 +} + +func (*OptionalMessageData) VarDataMaxValue() uint8 { + return math.MaxUint8 - 1 +} + +func (*OptionalMessageData) VarDataNullValue() uint8 { + return math.MaxUint8 +} + +func (*OptionalMessageData) VarDataSinceVersion() uint16 { + return 0 +} + +func (o *OptionalMessageData) VarDataInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.VarDataSinceVersion() +} + +func (*OptionalMessageData) VarDataDeprecated() uint16 { + return 0 +} diff --git a/v2/sbe/spot_3_1/OptionalMessageData16.go b/v2/sbe/spot_3_1/OptionalMessageData16.go new file mode 100644 index 00000000..212f168d --- /dev/null +++ b/v2/sbe/spot_3_1/OptionalMessageData16.go @@ -0,0 +1,112 @@ +// Generated SBE (Simple Binary Encoding) message codec + +package sbe + +import ( + "fmt" + "io" + "math" +) + +type OptionalMessageData16 struct { + Length uint16 + VarData uint8 +} + +func (o *OptionalMessageData16) Encode(_m *SbeGoMarshaller, _w io.Writer) error { + if err := _m.WriteUint16(_w, o.Length); err != nil { + return err + } + if err := _m.WriteUint8(_w, o.VarData); err != nil { + return err + } + return nil +} + +func (o *OptionalMessageData16) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16) error { + if !o.LengthInActingVersion(actingVersion) { + o.Length = o.LengthNullValue() + } else { + if err := _m.ReadUint16(_r, &o.Length); err != nil { + return err + } + } + if !o.VarDataInActingVersion(actingVersion) { + o.VarData = o.VarDataNullValue() + } else { + if err := _m.ReadUint8(_r, &o.VarData); err != nil { + return err + } + } + return nil +} + +func (o *OptionalMessageData16) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if o.LengthInActingVersion(actingVersion) { + if o.Length < o.LengthMinValue() || o.Length > o.LengthMaxValue() { + return fmt.Errorf("Range check failed on o.Length (%v < %v > %v)", o.LengthMinValue(), o.Length, o.LengthMaxValue()) + } + } + if o.VarDataInActingVersion(actingVersion) { + if o.VarData < o.VarDataMinValue() || o.VarData > o.VarDataMaxValue() { + return fmt.Errorf("Range check failed on o.VarData (%v < %v > %v)", o.VarDataMinValue(), o.VarData, o.VarDataMaxValue()) + } + } + return nil +} + +func OptionalMessageData16Init(o *OptionalMessageData16) { + return +} + +func (*OptionalMessageData16) EncodedLength() int64 { + return -1 +} + +func (*OptionalMessageData16) LengthMinValue() uint16 { + return 0 +} + +func (*OptionalMessageData16) LengthMaxValue() uint16 { + return math.MaxUint16 - 1 +} + +func (*OptionalMessageData16) LengthNullValue() uint16 { + return math.MaxUint16 +} + +func (*OptionalMessageData16) LengthSinceVersion() uint16 { + return 0 +} + +func (o *OptionalMessageData16) LengthInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.LengthSinceVersion() +} + +func (*OptionalMessageData16) LengthDeprecated() uint16 { + return 0 +} + +func (*OptionalMessageData16) VarDataMinValue() uint8 { + return 0 +} + +func (*OptionalMessageData16) VarDataMaxValue() uint8 { + return math.MaxUint8 - 1 +} + +func (*OptionalMessageData16) VarDataNullValue() uint8 { + return math.MaxUint8 +} + +func (*OptionalMessageData16) VarDataSinceVersion() uint16 { + return 0 +} + +func (o *OptionalMessageData16) VarDataInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.VarDataSinceVersion() +} + +func (*OptionalMessageData16) VarDataDeprecated() uint16 { + return 0 +} diff --git a/v2/sbe/spot_3_1/OptionalVarString.go b/v2/sbe/spot_3_1/OptionalVarString.go new file mode 100644 index 00000000..9f72c474 --- /dev/null +++ b/v2/sbe/spot_3_1/OptionalVarString.go @@ -0,0 +1,112 @@ +// Generated SBE (Simple Binary Encoding) message codec + +package sbe + +import ( + "fmt" + "io" + "math" +) + +type OptionalVarString struct { + Length uint16 + VarData uint8 +} + +func (o *OptionalVarString) Encode(_m *SbeGoMarshaller, _w io.Writer) error { + if err := _m.WriteUint16(_w, o.Length); err != nil { + return err + } + if err := _m.WriteUint8(_w, o.VarData); err != nil { + return err + } + return nil +} + +func (o *OptionalVarString) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16) error { + if !o.LengthInActingVersion(actingVersion) { + o.Length = o.LengthNullValue() + } else { + if err := _m.ReadUint16(_r, &o.Length); err != nil { + return err + } + } + if !o.VarDataInActingVersion(actingVersion) { + o.VarData = o.VarDataNullValue() + } else { + if err := _m.ReadUint8(_r, &o.VarData); err != nil { + return err + } + } + return nil +} + +func (o *OptionalVarString) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if o.LengthInActingVersion(actingVersion) { + if o.Length < o.LengthMinValue() || o.Length > o.LengthMaxValue() { + return fmt.Errorf("Range check failed on o.Length (%v < %v > %v)", o.LengthMinValue(), o.Length, o.LengthMaxValue()) + } + } + if o.VarDataInActingVersion(actingVersion) { + if o.VarData < o.VarDataMinValue() || o.VarData > o.VarDataMaxValue() { + return fmt.Errorf("Range check failed on o.VarData (%v < %v > %v)", o.VarDataMinValue(), o.VarData, o.VarDataMaxValue()) + } + } + return nil +} + +func OptionalVarStringInit(o *OptionalVarString) { + return +} + +func (*OptionalVarString) EncodedLength() int64 { + return -1 +} + +func (*OptionalVarString) LengthMinValue() uint16 { + return 0 +} + +func (*OptionalVarString) LengthMaxValue() uint16 { + return math.MaxUint16 - 1 +} + +func (*OptionalVarString) LengthNullValue() uint16 { + return math.MaxUint16 +} + +func (*OptionalVarString) LengthSinceVersion() uint16 { + return 0 +} + +func (o *OptionalVarString) LengthInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.LengthSinceVersion() +} + +func (*OptionalVarString) LengthDeprecated() uint16 { + return 0 +} + +func (*OptionalVarString) VarDataMinValue() uint8 { + return 0 +} + +func (*OptionalVarString) VarDataMaxValue() uint8 { + return math.MaxUint8 - 1 +} + +func (*OptionalVarString) VarDataNullValue() uint8 { + return math.MaxUint8 +} + +func (*OptionalVarString) VarDataSinceVersion() uint16 { + return 0 +} + +func (o *OptionalVarString) VarDataInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.VarDataSinceVersion() +} + +func (*OptionalVarString) VarDataDeprecated() uint16 { + return 0 +} diff --git a/v2/sbe/spot_3_1/OptionalVarString8.go b/v2/sbe/spot_3_1/OptionalVarString8.go new file mode 100644 index 00000000..986daa03 --- /dev/null +++ b/v2/sbe/spot_3_1/OptionalVarString8.go @@ -0,0 +1,112 @@ +// Generated SBE (Simple Binary Encoding) message codec + +package sbe + +import ( + "fmt" + "io" + "math" +) + +type OptionalVarString8 struct { + Length uint8 + VarData uint8 +} + +func (o *OptionalVarString8) Encode(_m *SbeGoMarshaller, _w io.Writer) error { + if err := _m.WriteUint8(_w, o.Length); err != nil { + return err + } + if err := _m.WriteUint8(_w, o.VarData); err != nil { + return err + } + return nil +} + +func (o *OptionalVarString8) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16) error { + if !o.LengthInActingVersion(actingVersion) { + o.Length = o.LengthNullValue() + } else { + if err := _m.ReadUint8(_r, &o.Length); err != nil { + return err + } + } + if !o.VarDataInActingVersion(actingVersion) { + o.VarData = o.VarDataNullValue() + } else { + if err := _m.ReadUint8(_r, &o.VarData); err != nil { + return err + } + } + return nil +} + +func (o *OptionalVarString8) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if o.LengthInActingVersion(actingVersion) { + if o.Length < o.LengthMinValue() || o.Length > o.LengthMaxValue() { + return fmt.Errorf("Range check failed on o.Length (%v < %v > %v)", o.LengthMinValue(), o.Length, o.LengthMaxValue()) + } + } + if o.VarDataInActingVersion(actingVersion) { + if o.VarData < o.VarDataMinValue() || o.VarData > o.VarDataMaxValue() { + return fmt.Errorf("Range check failed on o.VarData (%v < %v > %v)", o.VarDataMinValue(), o.VarData, o.VarDataMaxValue()) + } + } + return nil +} + +func OptionalVarString8Init(o *OptionalVarString8) { + return +} + +func (*OptionalVarString8) EncodedLength() int64 { + return -1 +} + +func (*OptionalVarString8) LengthMinValue() uint8 { + return 0 +} + +func (*OptionalVarString8) LengthMaxValue() uint8 { + return math.MaxUint8 - 1 +} + +func (*OptionalVarString8) LengthNullValue() uint8 { + return math.MaxUint8 +} + +func (*OptionalVarString8) LengthSinceVersion() uint16 { + return 0 +} + +func (o *OptionalVarString8) LengthInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.LengthSinceVersion() +} + +func (*OptionalVarString8) LengthDeprecated() uint16 { + return 0 +} + +func (*OptionalVarString8) VarDataMinValue() uint8 { + return 0 +} + +func (*OptionalVarString8) VarDataMaxValue() uint8 { + return math.MaxUint8 - 1 +} + +func (*OptionalVarString8) VarDataNullValue() uint8 { + return math.MaxUint8 +} + +func (*OptionalVarString8) VarDataSinceVersion() uint16 { + return 0 +} + +func (o *OptionalVarString8) VarDataInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.VarDataSinceVersion() +} + +func (*OptionalVarString8) VarDataDeprecated() uint16 { + return 0 +} diff --git a/v2/sbe/spot_3_1/OrderAmendKeepPriorityResponse.go b/v2/sbe/spot_3_1/OrderAmendKeepPriorityResponse.go new file mode 100644 index 00000000..3cc37dd8 --- /dev/null +++ b/v2/sbe/spot_3_1/OrderAmendKeepPriorityResponse.go @@ -0,0 +1,3990 @@ +// Generated SBE (Simple Binary Encoding) message codec + +package sbe + +import ( + "errors" + "fmt" + "io" + "io/ioutil" + "math" + "unicode/utf8" +) + +type OrderAmendKeepPriorityResponse struct { + TransactTime int64 + ExecutionId int64 + PriceExponent int8 + QtyExponent int8 + OrderId int64 + OrderListId int64 + Price int64 + Qty int64 + ExecutedQty int64 + PreventedQty int64 + CumulativeQuoteQty int64 + Status OrderStatusEnum + TimeInForce TimeInForceEnum + OrderType OrderTypeEnum + Side OrderSideEnum + StopPrice int64 + TrailingDelta int64 + TrailingTime int64 + IcebergQty int64 + WorkingTime int64 + StrategyId int64 + StrategyType int32 + OrderCapacity OrderCapacityEnum + WorkingFloor FloorEnum + SelfTradePreventionMode SelfTradePreventionModeEnum + UsedSor BoolEnumEnum + PegPriceType PegPriceTypeEnum + PegOffsetType PegOffsetTypeEnum + PegOffsetValue uint8 + PeggedPrice int64 + ListStatus []OrderAmendKeepPriorityResponseListStatus + RelatedOrders []OrderAmendKeepPriorityResponseRelatedOrders + Symbol []uint8 + OrigClientOrderId []uint8 + ClientOrderId []uint8 +} +type OrderAmendKeepPriorityResponseListStatus struct { + OrderListId int64 + ContingencyType ContingencyTypeEnum + ListOrderStatus ListOrderStatusEnum + Orders []OrderAmendKeepPriorityResponseListStatusOrders + ListClientOrderId []uint8 + Symbol []uint8 +} +type OrderAmendKeepPriorityResponseListStatusOrders struct { + OrderId int64 + Symbol []uint8 + ClientOrderId []uint8 +} +type OrderAmendKeepPriorityResponseRelatedOrders struct { + OrderId int64 + OrderListId int64 + Price int64 + Qty int64 + ExecutedQty int64 + PreventedQty int64 + CumulativeQuoteQty int64 + Status OrderStatusEnum + TimeInForce TimeInForceEnum + OrderType OrderTypeEnum + Side OrderSideEnum + StopPrice int64 + TrailingDelta int64 + TrailingTime int64 + IcebergQty int64 + WorkingTime int64 + StrategyId int64 + StrategyType int32 + OrderCapacity OrderCapacityEnum + WorkingFloor FloorEnum + SelfTradePreventionMode SelfTradePreventionModeEnum + UsedSor BoolEnumEnum + PegPriceType PegPriceTypeEnum + PegOffsetType PegOffsetTypeEnum + PegOffsetValue uint8 + PeggedPrice int64 + Symbol []uint8 + ClientOrderId []uint8 +} + +func (o *OrderAmendKeepPriorityResponse) Encode(_m *SbeGoMarshaller, _w io.Writer, doRangeCheck bool) error { + if doRangeCheck { + if err := o.RangeCheck(o.SbeSchemaVersion(), o.SbeSchemaVersion()); err != nil { + return err + } + } + if err := _m.WriteInt64(_w, o.TransactTime); err != nil { + return err + } + if err := _m.WriteInt64(_w, o.ExecutionId); err != nil { + return err + } + if err := _m.WriteInt8(_w, o.PriceExponent); err != nil { + return err + } + if err := _m.WriteInt8(_w, o.QtyExponent); err != nil { + return err + } + if err := _m.WriteInt64(_w, o.OrderId); err != nil { + return err + } + if err := _m.WriteInt64(_w, o.OrderListId); err != nil { + return err + } + if err := _m.WriteInt64(_w, o.Price); err != nil { + return err + } + if err := _m.WriteInt64(_w, o.Qty); err != nil { + return err + } + if err := _m.WriteInt64(_w, o.ExecutedQty); err != nil { + return err + } + if err := _m.WriteInt64(_w, o.PreventedQty); err != nil { + return err + } + if err := _m.WriteInt64(_w, o.CumulativeQuoteQty); err != nil { + return err + } + if err := o.Status.Encode(_m, _w); err != nil { + return err + } + if err := o.TimeInForce.Encode(_m, _w); err != nil { + return err + } + if err := o.OrderType.Encode(_m, _w); err != nil { + return err + } + if err := o.Side.Encode(_m, _w); err != nil { + return err + } + if err := _m.WriteInt64(_w, o.StopPrice); err != nil { + return err + } + if err := _m.WriteInt64(_w, o.TrailingDelta); err != nil { + return err + } + if err := _m.WriteInt64(_w, o.TrailingTime); err != nil { + return err + } + if err := _m.WriteInt64(_w, o.IcebergQty); err != nil { + return err + } + if err := _m.WriteInt64(_w, o.WorkingTime); err != nil { + return err + } + if err := _m.WriteInt64(_w, o.StrategyId); err != nil { + return err + } + if err := _m.WriteInt32(_w, o.StrategyType); err != nil { + return err + } + if err := o.OrderCapacity.Encode(_m, _w); err != nil { + return err + } + if err := o.WorkingFloor.Encode(_m, _w); err != nil { + return err + } + if err := o.SelfTradePreventionMode.Encode(_m, _w); err != nil { + return err + } + if err := o.UsedSor.Encode(_m, _w); err != nil { + return err + } + if err := o.PegPriceType.Encode(_m, _w); err != nil { + return err + } + if err := o.PegOffsetType.Encode(_m, _w); err != nil { + return err + } + if err := _m.WriteUint8(_w, o.PegOffsetValue); err != nil { + return err + } + if err := _m.WriteInt64(_w, o.PeggedPrice); err != nil { + return err + } + var ListStatusBlockLength uint16 = 10 + if err := _m.WriteUint16(_w, ListStatusBlockLength); err != nil { + return err + } + var ListStatusNumInGroup uint16 = uint16(len(o.ListStatus)) + if err := _m.WriteUint16(_w, ListStatusNumInGroup); err != nil { + return err + } + for i := range o.ListStatus { + if err := o.ListStatus[i].Encode(_m, _w); err != nil { + return err + } + } + var RelatedOrdersBlockLength uint16 = 127 + if err := _m.WriteUint16(_w, RelatedOrdersBlockLength); err != nil { + return err + } + var RelatedOrdersNumInGroup uint16 = uint16(len(o.RelatedOrders)) + if err := _m.WriteUint16(_w, RelatedOrdersNumInGroup); err != nil { + return err + } + for i := range o.RelatedOrders { + if err := o.RelatedOrders[i].Encode(_m, _w); err != nil { + return err + } + } + if err := _m.WriteUint8(_w, uint8(len(o.Symbol))); err != nil { + return err + } + if err := _m.WriteBytes(_w, o.Symbol); err != nil { + return err + } + if err := _m.WriteUint8(_w, uint8(len(o.OrigClientOrderId))); err != nil { + return err + } + if err := _m.WriteBytes(_w, o.OrigClientOrderId); err != nil { + return err + } + if err := _m.WriteUint8(_w, uint8(len(o.ClientOrderId))); err != nil { + return err + } + if err := _m.WriteBytes(_w, o.ClientOrderId); err != nil { + return err + } + return nil +} + +func (o *OrderAmendKeepPriorityResponse) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint16, doRangeCheck bool) error { + if !o.TransactTimeInActingVersion(actingVersion) { + o.TransactTime = o.TransactTimeNullValue() + } else { + if err := _m.ReadInt64(_r, &o.TransactTime); err != nil { + return err + } + } + if !o.ExecutionIdInActingVersion(actingVersion) { + o.ExecutionId = o.ExecutionIdNullValue() + } else { + if err := _m.ReadInt64(_r, &o.ExecutionId); err != nil { + return err + } + } + if !o.PriceExponentInActingVersion(actingVersion) { + o.PriceExponent = o.PriceExponentNullValue() + } else { + if err := _m.ReadInt8(_r, &o.PriceExponent); err != nil { + return err + } + } + if !o.QtyExponentInActingVersion(actingVersion) { + o.QtyExponent = o.QtyExponentNullValue() + } else { + if err := _m.ReadInt8(_r, &o.QtyExponent); err != nil { + return err + } + } + if !o.OrderIdInActingVersion(actingVersion) { + o.OrderId = o.OrderIdNullValue() + } else { + if err := _m.ReadInt64(_r, &o.OrderId); err != nil { + return err + } + } + if !o.OrderListIdInActingVersion(actingVersion) { + o.OrderListId = o.OrderListIdNullValue() + } else { + if err := _m.ReadInt64(_r, &o.OrderListId); err != nil { + return err + } + } + if !o.PriceInActingVersion(actingVersion) { + o.Price = o.PriceNullValue() + } else { + if err := _m.ReadInt64(_r, &o.Price); err != nil { + return err + } + } + if !o.QtyInActingVersion(actingVersion) { + o.Qty = o.QtyNullValue() + } else { + if err := _m.ReadInt64(_r, &o.Qty); err != nil { + return err + } + } + if !o.ExecutedQtyInActingVersion(actingVersion) { + o.ExecutedQty = o.ExecutedQtyNullValue() + } else { + if err := _m.ReadInt64(_r, &o.ExecutedQty); err != nil { + return err + } + } + if !o.PreventedQtyInActingVersion(actingVersion) { + o.PreventedQty = o.PreventedQtyNullValue() + } else { + if err := _m.ReadInt64(_r, &o.PreventedQty); err != nil { + return err + } + } + if !o.CumulativeQuoteQtyInActingVersion(actingVersion) { + o.CumulativeQuoteQty = o.CumulativeQuoteQtyNullValue() + } else { + if err := _m.ReadInt64(_r, &o.CumulativeQuoteQty); err != nil { + return err + } + } + if o.StatusInActingVersion(actingVersion) { + if err := o.Status.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if o.TimeInForceInActingVersion(actingVersion) { + if err := o.TimeInForce.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if o.OrderTypeInActingVersion(actingVersion) { + if err := o.OrderType.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if o.SideInActingVersion(actingVersion) { + if err := o.Side.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if !o.StopPriceInActingVersion(actingVersion) { + o.StopPrice = o.StopPriceNullValue() + } else { + if err := _m.ReadInt64(_r, &o.StopPrice); err != nil { + return err + } + } + if !o.TrailingDeltaInActingVersion(actingVersion) { + o.TrailingDelta = o.TrailingDeltaNullValue() + } else { + if err := _m.ReadInt64(_r, &o.TrailingDelta); err != nil { + return err + } + } + if !o.TrailingTimeInActingVersion(actingVersion) { + o.TrailingTime = o.TrailingTimeNullValue() + } else { + if err := _m.ReadInt64(_r, &o.TrailingTime); err != nil { + return err + } + } + if !o.IcebergQtyInActingVersion(actingVersion) { + o.IcebergQty = o.IcebergQtyNullValue() + } else { + if err := _m.ReadInt64(_r, &o.IcebergQty); err != nil { + return err + } + } + if !o.WorkingTimeInActingVersion(actingVersion) { + o.WorkingTime = o.WorkingTimeNullValue() + } else { + if err := _m.ReadInt64(_r, &o.WorkingTime); err != nil { + return err + } + } + if !o.StrategyIdInActingVersion(actingVersion) { + o.StrategyId = o.StrategyIdNullValue() + } else { + if err := _m.ReadInt64(_r, &o.StrategyId); err != nil { + return err + } + } + if !o.StrategyTypeInActingVersion(actingVersion) { + o.StrategyType = o.StrategyTypeNullValue() + } else { + if err := _m.ReadInt32(_r, &o.StrategyType); err != nil { + return err + } + } + if o.OrderCapacityInActingVersion(actingVersion) { + if err := o.OrderCapacity.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if o.WorkingFloorInActingVersion(actingVersion) { + if err := o.WorkingFloor.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if o.SelfTradePreventionModeInActingVersion(actingVersion) { + if err := o.SelfTradePreventionMode.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if o.UsedSorInActingVersion(actingVersion) { + if err := o.UsedSor.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if o.PegPriceTypeInActingVersion(actingVersion) { + if err := o.PegPriceType.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if o.PegOffsetTypeInActingVersion(actingVersion) { + if err := o.PegOffsetType.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if !o.PegOffsetValueInActingVersion(actingVersion) { + o.PegOffsetValue = o.PegOffsetValueNullValue() + } else { + if err := _m.ReadUint8(_r, &o.PegOffsetValue); err != nil { + return err + } + } + if !o.PeggedPriceInActingVersion(actingVersion) { + o.PeggedPrice = o.PeggedPriceNullValue() + } else { + if err := _m.ReadInt64(_r, &o.PeggedPrice); err != nil { + return err + } + } + if actingVersion > o.SbeSchemaVersion() && blockLength > o.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-o.SbeBlockLength())) + } + + if o.ListStatusInActingVersion(actingVersion) { + var ListStatusBlockLength uint16 + if err := _m.ReadUint16(_r, &ListStatusBlockLength); err != nil { + return err + } + var ListStatusNumInGroup uint16 + if err := _m.ReadUint16(_r, &ListStatusNumInGroup); err != nil { + return err + } + if cap(o.ListStatus) < int(ListStatusNumInGroup) { + o.ListStatus = make([]OrderAmendKeepPriorityResponseListStatus, ListStatusNumInGroup) + } + o.ListStatus = o.ListStatus[:ListStatusNumInGroup] + for i := range o.ListStatus { + if err := o.ListStatus[i].Decode(_m, _r, actingVersion, uint(ListStatusBlockLength)); err != nil { + return err + } + } + } + + if o.RelatedOrdersInActingVersion(actingVersion) { + var RelatedOrdersBlockLength uint16 + if err := _m.ReadUint16(_r, &RelatedOrdersBlockLength); err != nil { + return err + } + var RelatedOrdersNumInGroup uint16 + if err := _m.ReadUint16(_r, &RelatedOrdersNumInGroup); err != nil { + return err + } + if cap(o.RelatedOrders) < int(RelatedOrdersNumInGroup) { + o.RelatedOrders = make([]OrderAmendKeepPriorityResponseRelatedOrders, RelatedOrdersNumInGroup) + } + o.RelatedOrders = o.RelatedOrders[:RelatedOrdersNumInGroup] + for i := range o.RelatedOrders { + if err := o.RelatedOrders[i].Decode(_m, _r, actingVersion, uint(RelatedOrdersBlockLength)); err != nil { + return err + } + } + } + + if o.SymbolInActingVersion(actingVersion) { + var SymbolLength uint8 + if err := _m.ReadUint8(_r, &SymbolLength); err != nil { + return err + } + if cap(o.Symbol) < int(SymbolLength) { + o.Symbol = make([]uint8, SymbolLength) + } + o.Symbol = o.Symbol[:SymbolLength] + if err := _m.ReadBytes(_r, o.Symbol); err != nil { + return err + } + } + + if o.OrigClientOrderIdInActingVersion(actingVersion) { + var OrigClientOrderIdLength uint8 + if err := _m.ReadUint8(_r, &OrigClientOrderIdLength); err != nil { + return err + } + if cap(o.OrigClientOrderId) < int(OrigClientOrderIdLength) { + o.OrigClientOrderId = make([]uint8, OrigClientOrderIdLength) + } + o.OrigClientOrderId = o.OrigClientOrderId[:OrigClientOrderIdLength] + if err := _m.ReadBytes(_r, o.OrigClientOrderId); err != nil { + return err + } + } + + if o.ClientOrderIdInActingVersion(actingVersion) { + var ClientOrderIdLength uint8 + if err := _m.ReadUint8(_r, &ClientOrderIdLength); err != nil { + return err + } + if cap(o.ClientOrderId) < int(ClientOrderIdLength) { + o.ClientOrderId = make([]uint8, ClientOrderIdLength) + } + o.ClientOrderId = o.ClientOrderId[:ClientOrderIdLength] + if err := _m.ReadBytes(_r, o.ClientOrderId); err != nil { + return err + } + } + if doRangeCheck { + if err := o.RangeCheck(actingVersion, o.SbeSchemaVersion()); err != nil { + return err + } + } + return nil +} + +func (o *OrderAmendKeepPriorityResponse) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if o.TransactTimeInActingVersion(actingVersion) { + if o.TransactTime < o.TransactTimeMinValue() || o.TransactTime > o.TransactTimeMaxValue() { + return fmt.Errorf("Range check failed on o.TransactTime (%v < %v > %v)", o.TransactTimeMinValue(), o.TransactTime, o.TransactTimeMaxValue()) + } + } + if o.ExecutionIdInActingVersion(actingVersion) { + if o.ExecutionId < o.ExecutionIdMinValue() || o.ExecutionId > o.ExecutionIdMaxValue() { + return fmt.Errorf("Range check failed on o.ExecutionId (%v < %v > %v)", o.ExecutionIdMinValue(), o.ExecutionId, o.ExecutionIdMaxValue()) + } + } + if o.PriceExponentInActingVersion(actingVersion) { + if o.PriceExponent < o.PriceExponentMinValue() || o.PriceExponent > o.PriceExponentMaxValue() { + return fmt.Errorf("Range check failed on o.PriceExponent (%v < %v > %v)", o.PriceExponentMinValue(), o.PriceExponent, o.PriceExponentMaxValue()) + } + } + if o.QtyExponentInActingVersion(actingVersion) { + if o.QtyExponent < o.QtyExponentMinValue() || o.QtyExponent > o.QtyExponentMaxValue() { + return fmt.Errorf("Range check failed on o.QtyExponent (%v < %v > %v)", o.QtyExponentMinValue(), o.QtyExponent, o.QtyExponentMaxValue()) + } + } + if o.OrderIdInActingVersion(actingVersion) { + if o.OrderId < o.OrderIdMinValue() || o.OrderId > o.OrderIdMaxValue() { + return fmt.Errorf("Range check failed on o.OrderId (%v < %v > %v)", o.OrderIdMinValue(), o.OrderId, o.OrderIdMaxValue()) + } + } + if o.OrderListIdInActingVersion(actingVersion) { + if o.OrderListId != o.OrderListIdNullValue() && (o.OrderListId < o.OrderListIdMinValue() || o.OrderListId > o.OrderListIdMaxValue()) { + return fmt.Errorf("Range check failed on o.OrderListId (%v < %v > %v)", o.OrderListIdMinValue(), o.OrderListId, o.OrderListIdMaxValue()) + } + } + if o.PriceInActingVersion(actingVersion) { + if o.Price < o.PriceMinValue() || o.Price > o.PriceMaxValue() { + return fmt.Errorf("Range check failed on o.Price (%v < %v > %v)", o.PriceMinValue(), o.Price, o.PriceMaxValue()) + } + } + if o.QtyInActingVersion(actingVersion) { + if o.Qty < o.QtyMinValue() || o.Qty > o.QtyMaxValue() { + return fmt.Errorf("Range check failed on o.Qty (%v < %v > %v)", o.QtyMinValue(), o.Qty, o.QtyMaxValue()) + } + } + if o.ExecutedQtyInActingVersion(actingVersion) { + if o.ExecutedQty < o.ExecutedQtyMinValue() || o.ExecutedQty > o.ExecutedQtyMaxValue() { + return fmt.Errorf("Range check failed on o.ExecutedQty (%v < %v > %v)", o.ExecutedQtyMinValue(), o.ExecutedQty, o.ExecutedQtyMaxValue()) + } + } + if o.PreventedQtyInActingVersion(actingVersion) { + if o.PreventedQty < o.PreventedQtyMinValue() || o.PreventedQty > o.PreventedQtyMaxValue() { + return fmt.Errorf("Range check failed on o.PreventedQty (%v < %v > %v)", o.PreventedQtyMinValue(), o.PreventedQty, o.PreventedQtyMaxValue()) + } + } + if o.CumulativeQuoteQtyInActingVersion(actingVersion) { + if o.CumulativeQuoteQty < o.CumulativeQuoteQtyMinValue() || o.CumulativeQuoteQty > o.CumulativeQuoteQtyMaxValue() { + return fmt.Errorf("Range check failed on o.CumulativeQuoteQty (%v < %v > %v)", o.CumulativeQuoteQtyMinValue(), o.CumulativeQuoteQty, o.CumulativeQuoteQtyMaxValue()) + } + } + if err := o.Status.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if err := o.TimeInForce.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if err := o.OrderType.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if err := o.Side.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if o.StopPriceInActingVersion(actingVersion) { + if o.StopPrice != o.StopPriceNullValue() && (o.StopPrice < o.StopPriceMinValue() || o.StopPrice > o.StopPriceMaxValue()) { + return fmt.Errorf("Range check failed on o.StopPrice (%v < %v > %v)", o.StopPriceMinValue(), o.StopPrice, o.StopPriceMaxValue()) + } + } + if o.TrailingDeltaInActingVersion(actingVersion) { + if o.TrailingDelta != o.TrailingDeltaNullValue() && (o.TrailingDelta < o.TrailingDeltaMinValue() || o.TrailingDelta > o.TrailingDeltaMaxValue()) { + return fmt.Errorf("Range check failed on o.TrailingDelta (%v < %v > %v)", o.TrailingDeltaMinValue(), o.TrailingDelta, o.TrailingDeltaMaxValue()) + } + } + if o.TrailingTimeInActingVersion(actingVersion) { + if o.TrailingTime != o.TrailingTimeNullValue() && (o.TrailingTime < o.TrailingTimeMinValue() || o.TrailingTime > o.TrailingTimeMaxValue()) { + return fmt.Errorf("Range check failed on o.TrailingTime (%v < %v > %v)", o.TrailingTimeMinValue(), o.TrailingTime, o.TrailingTimeMaxValue()) + } + } + if o.IcebergQtyInActingVersion(actingVersion) { + if o.IcebergQty != o.IcebergQtyNullValue() && (o.IcebergQty < o.IcebergQtyMinValue() || o.IcebergQty > o.IcebergQtyMaxValue()) { + return fmt.Errorf("Range check failed on o.IcebergQty (%v < %v > %v)", o.IcebergQtyMinValue(), o.IcebergQty, o.IcebergQtyMaxValue()) + } + } + if o.WorkingTimeInActingVersion(actingVersion) { + if o.WorkingTime != o.WorkingTimeNullValue() && (o.WorkingTime < o.WorkingTimeMinValue() || o.WorkingTime > o.WorkingTimeMaxValue()) { + return fmt.Errorf("Range check failed on o.WorkingTime (%v < %v > %v)", o.WorkingTimeMinValue(), o.WorkingTime, o.WorkingTimeMaxValue()) + } + } + if o.StrategyIdInActingVersion(actingVersion) { + if o.StrategyId != o.StrategyIdNullValue() && (o.StrategyId < o.StrategyIdMinValue() || o.StrategyId > o.StrategyIdMaxValue()) { + return fmt.Errorf("Range check failed on o.StrategyId (%v < %v > %v)", o.StrategyIdMinValue(), o.StrategyId, o.StrategyIdMaxValue()) + } + } + if o.StrategyTypeInActingVersion(actingVersion) { + if o.StrategyType != o.StrategyTypeNullValue() && (o.StrategyType < o.StrategyTypeMinValue() || o.StrategyType > o.StrategyTypeMaxValue()) { + return fmt.Errorf("Range check failed on o.StrategyType (%v < %v > %v)", o.StrategyTypeMinValue(), o.StrategyType, o.StrategyTypeMaxValue()) + } + } + if err := o.OrderCapacity.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if err := o.WorkingFloor.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if err := o.SelfTradePreventionMode.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if err := o.UsedSor.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if err := o.PegPriceType.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if err := o.PegOffsetType.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if o.PegOffsetValueInActingVersion(actingVersion) { + if o.PegOffsetValue != o.PegOffsetValueNullValue() && (o.PegOffsetValue < o.PegOffsetValueMinValue() || o.PegOffsetValue > o.PegOffsetValueMaxValue()) { + return fmt.Errorf("Range check failed on o.PegOffsetValue (%v < %v > %v)", o.PegOffsetValueMinValue(), o.PegOffsetValue, o.PegOffsetValueMaxValue()) + } + } + if o.PeggedPriceInActingVersion(actingVersion) { + if o.PeggedPrice != o.PeggedPriceNullValue() && (o.PeggedPrice < o.PeggedPriceMinValue() || o.PeggedPrice > o.PeggedPriceMaxValue()) { + return fmt.Errorf("Range check failed on o.PeggedPrice (%v < %v > %v)", o.PeggedPriceMinValue(), o.PeggedPrice, o.PeggedPriceMaxValue()) + } + } + for i := range o.ListStatus { + if err := o.ListStatus[i].RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + } + for i := range o.RelatedOrders { + if err := o.RelatedOrders[i].RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + } + if !utf8.Valid(o.Symbol[:]) { + return errors.New("o.Symbol failed UTF-8 validation") + } + if !utf8.Valid(o.OrigClientOrderId[:]) { + return errors.New("o.OrigClientOrderId failed UTF-8 validation") + } + if !utf8.Valid(o.ClientOrderId[:]) { + return errors.New("o.ClientOrderId failed UTF-8 validation") + } + return nil +} + +func OrderAmendKeepPriorityResponseInit(o *OrderAmendKeepPriorityResponse) { + o.OrderListId = math.MinInt64 + o.StopPrice = math.MinInt64 + o.TrailingDelta = math.MinInt64 + o.TrailingTime = math.MinInt64 + o.IcebergQty = math.MinInt64 + o.WorkingTime = math.MinInt64 + o.StrategyId = math.MinInt64 + o.StrategyType = math.MinInt32 + o.PegOffsetValue = math.MaxUint8 + o.PeggedPrice = math.MinInt64 + return +} + +func (o *OrderAmendKeepPriorityResponseListStatus) Encode(_m *SbeGoMarshaller, _w io.Writer) error { + if err := _m.WriteInt64(_w, o.OrderListId); err != nil { + return err + } + if err := o.ContingencyType.Encode(_m, _w); err != nil { + return err + } + if err := o.ListOrderStatus.Encode(_m, _w); err != nil { + return err + } + var OrdersBlockLength uint16 = 8 + if err := _m.WriteUint16(_w, OrdersBlockLength); err != nil { + return err + } + var OrdersNumInGroup uint16 = uint16(len(o.Orders)) + if err := _m.WriteUint16(_w, OrdersNumInGroup); err != nil { + return err + } + for i := range o.Orders { + if err := o.Orders[i].Encode(_m, _w); err != nil { + return err + } + } + if err := _m.WriteUint8(_w, uint8(len(o.ListClientOrderId))); err != nil { + return err + } + if err := _m.WriteBytes(_w, o.ListClientOrderId); err != nil { + return err + } + if err := _m.WriteUint8(_w, uint8(len(o.Symbol))); err != nil { + return err + } + if err := _m.WriteBytes(_w, o.Symbol); err != nil { + return err + } + return nil +} + +func (o *OrderAmendKeepPriorityResponseListStatus) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint) error { + if !o.OrderListIdInActingVersion(actingVersion) { + o.OrderListId = o.OrderListIdNullValue() + } else { + if err := _m.ReadInt64(_r, &o.OrderListId); err != nil { + return err + } + } + if o.ContingencyTypeInActingVersion(actingVersion) { + if err := o.ContingencyType.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if o.ListOrderStatusInActingVersion(actingVersion) { + if err := o.ListOrderStatus.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if actingVersion > o.SbeSchemaVersion() && blockLength > o.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-o.SbeBlockLength())) + } + + if o.OrdersInActingVersion(actingVersion) { + var OrdersBlockLength uint16 + if err := _m.ReadUint16(_r, &OrdersBlockLength); err != nil { + return err + } + var OrdersNumInGroup uint16 + if err := _m.ReadUint16(_r, &OrdersNumInGroup); err != nil { + return err + } + if cap(o.Orders) < int(OrdersNumInGroup) { + o.Orders = make([]OrderAmendKeepPriorityResponseListStatusOrders, OrdersNumInGroup) + } + o.Orders = o.Orders[:OrdersNumInGroup] + for i := range o.Orders { + if err := o.Orders[i].Decode(_m, _r, actingVersion, uint(OrdersBlockLength)); err != nil { + return err + } + } + } + + if o.ListClientOrderIdInActingVersion(actingVersion) { + var ListClientOrderIdLength uint8 + if err := _m.ReadUint8(_r, &ListClientOrderIdLength); err != nil { + return err + } + if cap(o.ListClientOrderId) < int(ListClientOrderIdLength) { + o.ListClientOrderId = make([]uint8, ListClientOrderIdLength) + } + o.ListClientOrderId = o.ListClientOrderId[:ListClientOrderIdLength] + if err := _m.ReadBytes(_r, o.ListClientOrderId); err != nil { + return err + } + } + + if o.SymbolInActingVersion(actingVersion) { + var SymbolLength uint8 + if err := _m.ReadUint8(_r, &SymbolLength); err != nil { + return err + } + if cap(o.Symbol) < int(SymbolLength) { + o.Symbol = make([]uint8, SymbolLength) + } + o.Symbol = o.Symbol[:SymbolLength] + if err := _m.ReadBytes(_r, o.Symbol); err != nil { + return err + } + } + return nil +} + +func (o *OrderAmendKeepPriorityResponseListStatus) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if o.OrderListIdInActingVersion(actingVersion) { + if o.OrderListId < o.OrderListIdMinValue() || o.OrderListId > o.OrderListIdMaxValue() { + return fmt.Errorf("Range check failed on o.OrderListId (%v < %v > %v)", o.OrderListIdMinValue(), o.OrderListId, o.OrderListIdMaxValue()) + } + } + if err := o.ContingencyType.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if err := o.ListOrderStatus.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + for i := range o.Orders { + if err := o.Orders[i].RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + } + if !utf8.Valid(o.ListClientOrderId[:]) { + return errors.New("o.ListClientOrderId failed UTF-8 validation") + } + if !utf8.Valid(o.Symbol[:]) { + return errors.New("o.Symbol failed UTF-8 validation") + } + return nil +} + +func OrderAmendKeepPriorityResponseListStatusInit(o *OrderAmendKeepPriorityResponseListStatus) { + return +} + +func (o *OrderAmendKeepPriorityResponseListStatusOrders) Encode(_m *SbeGoMarshaller, _w io.Writer) error { + if err := _m.WriteInt64(_w, o.OrderId); err != nil { + return err + } + if err := _m.WriteUint8(_w, uint8(len(o.Symbol))); err != nil { + return err + } + if err := _m.WriteBytes(_w, o.Symbol); err != nil { + return err + } + if err := _m.WriteUint8(_w, uint8(len(o.ClientOrderId))); err != nil { + return err + } + if err := _m.WriteBytes(_w, o.ClientOrderId); err != nil { + return err + } + return nil +} + +func (o *OrderAmendKeepPriorityResponseListStatusOrders) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint) error { + if !o.OrderIdInActingVersion(actingVersion) { + o.OrderId = o.OrderIdNullValue() + } else { + if err := _m.ReadInt64(_r, &o.OrderId); err != nil { + return err + } + } + if actingVersion > o.SbeSchemaVersion() && blockLength > o.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-o.SbeBlockLength())) + } + + if o.SymbolInActingVersion(actingVersion) { + var SymbolLength uint8 + if err := _m.ReadUint8(_r, &SymbolLength); err != nil { + return err + } + if cap(o.Symbol) < int(SymbolLength) { + o.Symbol = make([]uint8, SymbolLength) + } + o.Symbol = o.Symbol[:SymbolLength] + if err := _m.ReadBytes(_r, o.Symbol); err != nil { + return err + } + } + + if o.ClientOrderIdInActingVersion(actingVersion) { + var ClientOrderIdLength uint8 + if err := _m.ReadUint8(_r, &ClientOrderIdLength); err != nil { + return err + } + if cap(o.ClientOrderId) < int(ClientOrderIdLength) { + o.ClientOrderId = make([]uint8, ClientOrderIdLength) + } + o.ClientOrderId = o.ClientOrderId[:ClientOrderIdLength] + if err := _m.ReadBytes(_r, o.ClientOrderId); err != nil { + return err + } + } + return nil +} + +func (o *OrderAmendKeepPriorityResponseListStatusOrders) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if o.OrderIdInActingVersion(actingVersion) { + if o.OrderId < o.OrderIdMinValue() || o.OrderId > o.OrderIdMaxValue() { + return fmt.Errorf("Range check failed on o.OrderId (%v < %v > %v)", o.OrderIdMinValue(), o.OrderId, o.OrderIdMaxValue()) + } + } + if !utf8.Valid(o.Symbol[:]) { + return errors.New("o.Symbol failed UTF-8 validation") + } + if !utf8.Valid(o.ClientOrderId[:]) { + return errors.New("o.ClientOrderId failed UTF-8 validation") + } + return nil +} + +func OrderAmendKeepPriorityResponseListStatusOrdersInit(o *OrderAmendKeepPriorityResponseListStatusOrders) { + return +} + +func (o *OrderAmendKeepPriorityResponseRelatedOrders) Encode(_m *SbeGoMarshaller, _w io.Writer) error { + if err := _m.WriteInt64(_w, o.OrderId); err != nil { + return err + } + if err := _m.WriteInt64(_w, o.OrderListId); err != nil { + return err + } + if err := _m.WriteInt64(_w, o.Price); err != nil { + return err + } + if err := _m.WriteInt64(_w, o.Qty); err != nil { + return err + } + if err := _m.WriteInt64(_w, o.ExecutedQty); err != nil { + return err + } + if err := _m.WriteInt64(_w, o.PreventedQty); err != nil { + return err + } + if err := _m.WriteInt64(_w, o.CumulativeQuoteQty); err != nil { + return err + } + if err := o.Status.Encode(_m, _w); err != nil { + return err + } + if err := o.TimeInForce.Encode(_m, _w); err != nil { + return err + } + if err := o.OrderType.Encode(_m, _w); err != nil { + return err + } + if err := o.Side.Encode(_m, _w); err != nil { + return err + } + if err := _m.WriteInt64(_w, o.StopPrice); err != nil { + return err + } + if err := _m.WriteInt64(_w, o.TrailingDelta); err != nil { + return err + } + if err := _m.WriteInt64(_w, o.TrailingTime); err != nil { + return err + } + if err := _m.WriteInt64(_w, o.IcebergQty); err != nil { + return err + } + if err := _m.WriteInt64(_w, o.WorkingTime); err != nil { + return err + } + if err := _m.WriteInt64(_w, o.StrategyId); err != nil { + return err + } + if err := _m.WriteInt32(_w, o.StrategyType); err != nil { + return err + } + if err := o.OrderCapacity.Encode(_m, _w); err != nil { + return err + } + if err := o.WorkingFloor.Encode(_m, _w); err != nil { + return err + } + if err := o.SelfTradePreventionMode.Encode(_m, _w); err != nil { + return err + } + if err := o.UsedSor.Encode(_m, _w); err != nil { + return err + } + if err := o.PegPriceType.Encode(_m, _w); err != nil { + return err + } + if err := o.PegOffsetType.Encode(_m, _w); err != nil { + return err + } + if err := _m.WriteUint8(_w, o.PegOffsetValue); err != nil { + return err + } + if err := _m.WriteInt64(_w, o.PeggedPrice); err != nil { + return err + } + if err := _m.WriteUint8(_w, uint8(len(o.Symbol))); err != nil { + return err + } + if err := _m.WriteBytes(_w, o.Symbol); err != nil { + return err + } + if err := _m.WriteUint8(_w, uint8(len(o.ClientOrderId))); err != nil { + return err + } + if err := _m.WriteBytes(_w, o.ClientOrderId); err != nil { + return err + } + return nil +} + +func (o *OrderAmendKeepPriorityResponseRelatedOrders) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint) error { + if !o.OrderIdInActingVersion(actingVersion) { + o.OrderId = o.OrderIdNullValue() + } else { + if err := _m.ReadInt64(_r, &o.OrderId); err != nil { + return err + } + } + if !o.OrderListIdInActingVersion(actingVersion) { + o.OrderListId = o.OrderListIdNullValue() + } else { + if err := _m.ReadInt64(_r, &o.OrderListId); err != nil { + return err + } + } + if !o.PriceInActingVersion(actingVersion) { + o.Price = o.PriceNullValue() + } else { + if err := _m.ReadInt64(_r, &o.Price); err != nil { + return err + } + } + if !o.QtyInActingVersion(actingVersion) { + o.Qty = o.QtyNullValue() + } else { + if err := _m.ReadInt64(_r, &o.Qty); err != nil { + return err + } + } + if !o.ExecutedQtyInActingVersion(actingVersion) { + o.ExecutedQty = o.ExecutedQtyNullValue() + } else { + if err := _m.ReadInt64(_r, &o.ExecutedQty); err != nil { + return err + } + } + if !o.PreventedQtyInActingVersion(actingVersion) { + o.PreventedQty = o.PreventedQtyNullValue() + } else { + if err := _m.ReadInt64(_r, &o.PreventedQty); err != nil { + return err + } + } + if !o.CumulativeQuoteQtyInActingVersion(actingVersion) { + o.CumulativeQuoteQty = o.CumulativeQuoteQtyNullValue() + } else { + if err := _m.ReadInt64(_r, &o.CumulativeQuoteQty); err != nil { + return err + } + } + if o.StatusInActingVersion(actingVersion) { + if err := o.Status.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if o.TimeInForceInActingVersion(actingVersion) { + if err := o.TimeInForce.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if o.OrderTypeInActingVersion(actingVersion) { + if err := o.OrderType.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if o.SideInActingVersion(actingVersion) { + if err := o.Side.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if !o.StopPriceInActingVersion(actingVersion) { + o.StopPrice = o.StopPriceNullValue() + } else { + if err := _m.ReadInt64(_r, &o.StopPrice); err != nil { + return err + } + } + if !o.TrailingDeltaInActingVersion(actingVersion) { + o.TrailingDelta = o.TrailingDeltaNullValue() + } else { + if err := _m.ReadInt64(_r, &o.TrailingDelta); err != nil { + return err + } + } + if !o.TrailingTimeInActingVersion(actingVersion) { + o.TrailingTime = o.TrailingTimeNullValue() + } else { + if err := _m.ReadInt64(_r, &o.TrailingTime); err != nil { + return err + } + } + if !o.IcebergQtyInActingVersion(actingVersion) { + o.IcebergQty = o.IcebergQtyNullValue() + } else { + if err := _m.ReadInt64(_r, &o.IcebergQty); err != nil { + return err + } + } + if !o.WorkingTimeInActingVersion(actingVersion) { + o.WorkingTime = o.WorkingTimeNullValue() + } else { + if err := _m.ReadInt64(_r, &o.WorkingTime); err != nil { + return err + } + } + if !o.StrategyIdInActingVersion(actingVersion) { + o.StrategyId = o.StrategyIdNullValue() + } else { + if err := _m.ReadInt64(_r, &o.StrategyId); err != nil { + return err + } + } + if !o.StrategyTypeInActingVersion(actingVersion) { + o.StrategyType = o.StrategyTypeNullValue() + } else { + if err := _m.ReadInt32(_r, &o.StrategyType); err != nil { + return err + } + } + if o.OrderCapacityInActingVersion(actingVersion) { + if err := o.OrderCapacity.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if o.WorkingFloorInActingVersion(actingVersion) { + if err := o.WorkingFloor.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if o.SelfTradePreventionModeInActingVersion(actingVersion) { + if err := o.SelfTradePreventionMode.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if o.UsedSorInActingVersion(actingVersion) { + if err := o.UsedSor.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if o.PegPriceTypeInActingVersion(actingVersion) { + if err := o.PegPriceType.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if o.PegOffsetTypeInActingVersion(actingVersion) { + if err := o.PegOffsetType.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if !o.PegOffsetValueInActingVersion(actingVersion) { + o.PegOffsetValue = o.PegOffsetValueNullValue() + } else { + if err := _m.ReadUint8(_r, &o.PegOffsetValue); err != nil { + return err + } + } + if !o.PeggedPriceInActingVersion(actingVersion) { + o.PeggedPrice = o.PeggedPriceNullValue() + } else { + if err := _m.ReadInt64(_r, &o.PeggedPrice); err != nil { + return err + } + } + if actingVersion > o.SbeSchemaVersion() && blockLength > o.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-o.SbeBlockLength())) + } + + if o.SymbolInActingVersion(actingVersion) { + var SymbolLength uint8 + if err := _m.ReadUint8(_r, &SymbolLength); err != nil { + return err + } + if cap(o.Symbol) < int(SymbolLength) { + o.Symbol = make([]uint8, SymbolLength) + } + o.Symbol = o.Symbol[:SymbolLength] + if err := _m.ReadBytes(_r, o.Symbol); err != nil { + return err + } + } + + if o.ClientOrderIdInActingVersion(actingVersion) { + var ClientOrderIdLength uint8 + if err := _m.ReadUint8(_r, &ClientOrderIdLength); err != nil { + return err + } + if cap(o.ClientOrderId) < int(ClientOrderIdLength) { + o.ClientOrderId = make([]uint8, ClientOrderIdLength) + } + o.ClientOrderId = o.ClientOrderId[:ClientOrderIdLength] + if err := _m.ReadBytes(_r, o.ClientOrderId); err != nil { + return err + } + } + return nil +} + +func (o *OrderAmendKeepPriorityResponseRelatedOrders) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if o.OrderIdInActingVersion(actingVersion) { + if o.OrderId < o.OrderIdMinValue() || o.OrderId > o.OrderIdMaxValue() { + return fmt.Errorf("Range check failed on o.OrderId (%v < %v > %v)", o.OrderIdMinValue(), o.OrderId, o.OrderIdMaxValue()) + } + } + if o.OrderListIdInActingVersion(actingVersion) { + if o.OrderListId != o.OrderListIdNullValue() && (o.OrderListId < o.OrderListIdMinValue() || o.OrderListId > o.OrderListIdMaxValue()) { + return fmt.Errorf("Range check failed on o.OrderListId (%v < %v > %v)", o.OrderListIdMinValue(), o.OrderListId, o.OrderListIdMaxValue()) + } + } + if o.PriceInActingVersion(actingVersion) { + if o.Price < o.PriceMinValue() || o.Price > o.PriceMaxValue() { + return fmt.Errorf("Range check failed on o.Price (%v < %v > %v)", o.PriceMinValue(), o.Price, o.PriceMaxValue()) + } + } + if o.QtyInActingVersion(actingVersion) { + if o.Qty < o.QtyMinValue() || o.Qty > o.QtyMaxValue() { + return fmt.Errorf("Range check failed on o.Qty (%v < %v > %v)", o.QtyMinValue(), o.Qty, o.QtyMaxValue()) + } + } + if o.ExecutedQtyInActingVersion(actingVersion) { + if o.ExecutedQty < o.ExecutedQtyMinValue() || o.ExecutedQty > o.ExecutedQtyMaxValue() { + return fmt.Errorf("Range check failed on o.ExecutedQty (%v < %v > %v)", o.ExecutedQtyMinValue(), o.ExecutedQty, o.ExecutedQtyMaxValue()) + } + } + if o.PreventedQtyInActingVersion(actingVersion) { + if o.PreventedQty < o.PreventedQtyMinValue() || o.PreventedQty > o.PreventedQtyMaxValue() { + return fmt.Errorf("Range check failed on o.PreventedQty (%v < %v > %v)", o.PreventedQtyMinValue(), o.PreventedQty, o.PreventedQtyMaxValue()) + } + } + if o.CumulativeQuoteQtyInActingVersion(actingVersion) { + if o.CumulativeQuoteQty < o.CumulativeQuoteQtyMinValue() || o.CumulativeQuoteQty > o.CumulativeQuoteQtyMaxValue() { + return fmt.Errorf("Range check failed on o.CumulativeQuoteQty (%v < %v > %v)", o.CumulativeQuoteQtyMinValue(), o.CumulativeQuoteQty, o.CumulativeQuoteQtyMaxValue()) + } + } + if err := o.Status.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if err := o.TimeInForce.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if err := o.OrderType.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if err := o.Side.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if o.StopPriceInActingVersion(actingVersion) { + if o.StopPrice != o.StopPriceNullValue() && (o.StopPrice < o.StopPriceMinValue() || o.StopPrice > o.StopPriceMaxValue()) { + return fmt.Errorf("Range check failed on o.StopPrice (%v < %v > %v)", o.StopPriceMinValue(), o.StopPrice, o.StopPriceMaxValue()) + } + } + if o.TrailingDeltaInActingVersion(actingVersion) { + if o.TrailingDelta != o.TrailingDeltaNullValue() && (o.TrailingDelta < o.TrailingDeltaMinValue() || o.TrailingDelta > o.TrailingDeltaMaxValue()) { + return fmt.Errorf("Range check failed on o.TrailingDelta (%v < %v > %v)", o.TrailingDeltaMinValue(), o.TrailingDelta, o.TrailingDeltaMaxValue()) + } + } + if o.TrailingTimeInActingVersion(actingVersion) { + if o.TrailingTime != o.TrailingTimeNullValue() && (o.TrailingTime < o.TrailingTimeMinValue() || o.TrailingTime > o.TrailingTimeMaxValue()) { + return fmt.Errorf("Range check failed on o.TrailingTime (%v < %v > %v)", o.TrailingTimeMinValue(), o.TrailingTime, o.TrailingTimeMaxValue()) + } + } + if o.IcebergQtyInActingVersion(actingVersion) { + if o.IcebergQty != o.IcebergQtyNullValue() && (o.IcebergQty < o.IcebergQtyMinValue() || o.IcebergQty > o.IcebergQtyMaxValue()) { + return fmt.Errorf("Range check failed on o.IcebergQty (%v < %v > %v)", o.IcebergQtyMinValue(), o.IcebergQty, o.IcebergQtyMaxValue()) + } + } + if o.WorkingTimeInActingVersion(actingVersion) { + if o.WorkingTime != o.WorkingTimeNullValue() && (o.WorkingTime < o.WorkingTimeMinValue() || o.WorkingTime > o.WorkingTimeMaxValue()) { + return fmt.Errorf("Range check failed on o.WorkingTime (%v < %v > %v)", o.WorkingTimeMinValue(), o.WorkingTime, o.WorkingTimeMaxValue()) + } + } + if o.StrategyIdInActingVersion(actingVersion) { + if o.StrategyId != o.StrategyIdNullValue() && (o.StrategyId < o.StrategyIdMinValue() || o.StrategyId > o.StrategyIdMaxValue()) { + return fmt.Errorf("Range check failed on o.StrategyId (%v < %v > %v)", o.StrategyIdMinValue(), o.StrategyId, o.StrategyIdMaxValue()) + } + } + if o.StrategyTypeInActingVersion(actingVersion) { + if o.StrategyType != o.StrategyTypeNullValue() && (o.StrategyType < o.StrategyTypeMinValue() || o.StrategyType > o.StrategyTypeMaxValue()) { + return fmt.Errorf("Range check failed on o.StrategyType (%v < %v > %v)", o.StrategyTypeMinValue(), o.StrategyType, o.StrategyTypeMaxValue()) + } + } + if err := o.OrderCapacity.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if err := o.WorkingFloor.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if err := o.SelfTradePreventionMode.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if err := o.UsedSor.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if err := o.PegPriceType.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if err := o.PegOffsetType.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if o.PegOffsetValueInActingVersion(actingVersion) { + if o.PegOffsetValue != o.PegOffsetValueNullValue() && (o.PegOffsetValue < o.PegOffsetValueMinValue() || o.PegOffsetValue > o.PegOffsetValueMaxValue()) { + return fmt.Errorf("Range check failed on o.PegOffsetValue (%v < %v > %v)", o.PegOffsetValueMinValue(), o.PegOffsetValue, o.PegOffsetValueMaxValue()) + } + } + if o.PeggedPriceInActingVersion(actingVersion) { + if o.PeggedPrice != o.PeggedPriceNullValue() && (o.PeggedPrice < o.PeggedPriceMinValue() || o.PeggedPrice > o.PeggedPriceMaxValue()) { + return fmt.Errorf("Range check failed on o.PeggedPrice (%v < %v > %v)", o.PeggedPriceMinValue(), o.PeggedPrice, o.PeggedPriceMaxValue()) + } + } + if !utf8.Valid(o.Symbol[:]) { + return errors.New("o.Symbol failed UTF-8 validation") + } + if !utf8.Valid(o.ClientOrderId[:]) { + return errors.New("o.ClientOrderId failed UTF-8 validation") + } + return nil +} + +func OrderAmendKeepPriorityResponseRelatedOrdersInit(o *OrderAmendKeepPriorityResponseRelatedOrders) { + o.OrderListId = math.MinInt64 + o.StopPrice = math.MinInt64 + o.TrailingDelta = math.MinInt64 + o.TrailingTime = math.MinInt64 + o.IcebergQty = math.MinInt64 + o.WorkingTime = math.MinInt64 + o.StrategyId = math.MinInt64 + o.StrategyType = math.MinInt32 + o.PegOffsetValue = math.MaxUint8 + o.PeggedPrice = math.MinInt64 + return +} + +func (*OrderAmendKeepPriorityResponse) SbeBlockLength() (blockLength uint16) { + return 145 +} + +func (*OrderAmendKeepPriorityResponse) SbeTemplateId() (templateId uint16) { + return 317 +} + +func (*OrderAmendKeepPriorityResponse) SbeSchemaId() (schemaId uint16) { + return 3 +} + +func (*OrderAmendKeepPriorityResponse) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} + +func (*OrderAmendKeepPriorityResponse) SbeSemanticType() (semanticType []byte) { + return []byte("") +} + +func (*OrderAmendKeepPriorityResponse) SbeSemanticVersion() (semanticVersion string) { + return "5.2" +} + +func (*OrderAmendKeepPriorityResponse) TransactTimeId() uint16 { + return 1 +} + +func (*OrderAmendKeepPriorityResponse) TransactTimeSinceVersion() uint16 { + return 0 +} + +func (o *OrderAmendKeepPriorityResponse) TransactTimeInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.TransactTimeSinceVersion() +} + +func (*OrderAmendKeepPriorityResponse) TransactTimeDeprecated() uint16 { + return 0 +} + +func (*OrderAmendKeepPriorityResponse) TransactTimeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrderAmendKeepPriorityResponse) TransactTimeMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*OrderAmendKeepPriorityResponse) TransactTimeMaxValue() int64 { + return math.MaxInt64 +} + +func (*OrderAmendKeepPriorityResponse) TransactTimeNullValue() int64 { + return math.MinInt64 +} + +func (*OrderAmendKeepPriorityResponse) ExecutionIdId() uint16 { + return 2 +} + +func (*OrderAmendKeepPriorityResponse) ExecutionIdSinceVersion() uint16 { + return 0 +} + +func (o *OrderAmendKeepPriorityResponse) ExecutionIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.ExecutionIdSinceVersion() +} + +func (*OrderAmendKeepPriorityResponse) ExecutionIdDeprecated() uint16 { + return 0 +} + +func (*OrderAmendKeepPriorityResponse) ExecutionIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrderAmendKeepPriorityResponse) ExecutionIdMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*OrderAmendKeepPriorityResponse) ExecutionIdMaxValue() int64 { + return math.MaxInt64 +} + +func (*OrderAmendKeepPriorityResponse) ExecutionIdNullValue() int64 { + return math.MinInt64 +} + +func (*OrderAmendKeepPriorityResponse) PriceExponentId() uint16 { + return 3 +} + +func (*OrderAmendKeepPriorityResponse) PriceExponentSinceVersion() uint16 { + return 0 +} + +func (o *OrderAmendKeepPriorityResponse) PriceExponentInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.PriceExponentSinceVersion() +} + +func (*OrderAmendKeepPriorityResponse) PriceExponentDeprecated() uint16 { + return 0 +} + +func (*OrderAmendKeepPriorityResponse) PriceExponentMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrderAmendKeepPriorityResponse) PriceExponentMinValue() int8 { + return math.MinInt8 + 1 +} + +func (*OrderAmendKeepPriorityResponse) PriceExponentMaxValue() int8 { + return math.MaxInt8 +} + +func (*OrderAmendKeepPriorityResponse) PriceExponentNullValue() int8 { + return math.MinInt8 +} + +func (*OrderAmendKeepPriorityResponse) QtyExponentId() uint16 { + return 4 +} + +func (*OrderAmendKeepPriorityResponse) QtyExponentSinceVersion() uint16 { + return 0 +} + +func (o *OrderAmendKeepPriorityResponse) QtyExponentInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.QtyExponentSinceVersion() +} + +func (*OrderAmendKeepPriorityResponse) QtyExponentDeprecated() uint16 { + return 0 +} + +func (*OrderAmendKeepPriorityResponse) QtyExponentMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrderAmendKeepPriorityResponse) QtyExponentMinValue() int8 { + return math.MinInt8 + 1 +} + +func (*OrderAmendKeepPriorityResponse) QtyExponentMaxValue() int8 { + return math.MaxInt8 +} + +func (*OrderAmendKeepPriorityResponse) QtyExponentNullValue() int8 { + return math.MinInt8 +} + +func (*OrderAmendKeepPriorityResponse) OrderIdId() uint16 { + return 5 +} + +func (*OrderAmendKeepPriorityResponse) OrderIdSinceVersion() uint16 { + return 0 +} + +func (o *OrderAmendKeepPriorityResponse) OrderIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.OrderIdSinceVersion() +} + +func (*OrderAmendKeepPriorityResponse) OrderIdDeprecated() uint16 { + return 0 +} + +func (*OrderAmendKeepPriorityResponse) OrderIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrderAmendKeepPriorityResponse) OrderIdMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*OrderAmendKeepPriorityResponse) OrderIdMaxValue() int64 { + return math.MaxInt64 +} + +func (*OrderAmendKeepPriorityResponse) OrderIdNullValue() int64 { + return math.MinInt64 +} + +func (*OrderAmendKeepPriorityResponse) OrderListIdId() uint16 { + return 6 +} + +func (*OrderAmendKeepPriorityResponse) OrderListIdSinceVersion() uint16 { + return 0 +} + +func (o *OrderAmendKeepPriorityResponse) OrderListIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.OrderListIdSinceVersion() +} + +func (*OrderAmendKeepPriorityResponse) OrderListIdDeprecated() uint16 { + return 0 +} + +func (*OrderAmendKeepPriorityResponse) OrderListIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*OrderAmendKeepPriorityResponse) OrderListIdMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*OrderAmendKeepPriorityResponse) OrderListIdMaxValue() int64 { + return math.MaxInt64 +} + +func (*OrderAmendKeepPriorityResponse) OrderListIdNullValue() int64 { + return math.MinInt64 +} + +func (*OrderAmendKeepPriorityResponse) PriceId() uint16 { + return 7 +} + +func (*OrderAmendKeepPriorityResponse) PriceSinceVersion() uint16 { + return 0 +} + +func (o *OrderAmendKeepPriorityResponse) PriceInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.PriceSinceVersion() +} + +func (*OrderAmendKeepPriorityResponse) PriceDeprecated() uint16 { + return 0 +} + +func (*OrderAmendKeepPriorityResponse) PriceMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrderAmendKeepPriorityResponse) PriceMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*OrderAmendKeepPriorityResponse) PriceMaxValue() int64 { + return math.MaxInt64 +} + +func (*OrderAmendKeepPriorityResponse) PriceNullValue() int64 { + return math.MinInt64 +} + +func (*OrderAmendKeepPriorityResponse) QtyId() uint16 { + return 8 +} + +func (*OrderAmendKeepPriorityResponse) QtySinceVersion() uint16 { + return 0 +} + +func (o *OrderAmendKeepPriorityResponse) QtyInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.QtySinceVersion() +} + +func (*OrderAmendKeepPriorityResponse) QtyDeprecated() uint16 { + return 0 +} + +func (*OrderAmendKeepPriorityResponse) QtyMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrderAmendKeepPriorityResponse) QtyMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*OrderAmendKeepPriorityResponse) QtyMaxValue() int64 { + return math.MaxInt64 +} + +func (*OrderAmendKeepPriorityResponse) QtyNullValue() int64 { + return math.MinInt64 +} + +func (*OrderAmendKeepPriorityResponse) ExecutedQtyId() uint16 { + return 9 +} + +func (*OrderAmendKeepPriorityResponse) ExecutedQtySinceVersion() uint16 { + return 0 +} + +func (o *OrderAmendKeepPriorityResponse) ExecutedQtyInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.ExecutedQtySinceVersion() +} + +func (*OrderAmendKeepPriorityResponse) ExecutedQtyDeprecated() uint16 { + return 0 +} + +func (*OrderAmendKeepPriorityResponse) ExecutedQtyMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrderAmendKeepPriorityResponse) ExecutedQtyMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*OrderAmendKeepPriorityResponse) ExecutedQtyMaxValue() int64 { + return math.MaxInt64 +} + +func (*OrderAmendKeepPriorityResponse) ExecutedQtyNullValue() int64 { + return math.MinInt64 +} + +func (*OrderAmendKeepPriorityResponse) PreventedQtyId() uint16 { + return 10 +} + +func (*OrderAmendKeepPriorityResponse) PreventedQtySinceVersion() uint16 { + return 0 +} + +func (o *OrderAmendKeepPriorityResponse) PreventedQtyInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.PreventedQtySinceVersion() +} + +func (*OrderAmendKeepPriorityResponse) PreventedQtyDeprecated() uint16 { + return 0 +} + +func (*OrderAmendKeepPriorityResponse) PreventedQtyMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrderAmendKeepPriorityResponse) PreventedQtyMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*OrderAmendKeepPriorityResponse) PreventedQtyMaxValue() int64 { + return math.MaxInt64 +} + +func (*OrderAmendKeepPriorityResponse) PreventedQtyNullValue() int64 { + return math.MinInt64 +} + +func (*OrderAmendKeepPriorityResponse) CumulativeQuoteQtyId() uint16 { + return 11 +} + +func (*OrderAmendKeepPriorityResponse) CumulativeQuoteQtySinceVersion() uint16 { + return 0 +} + +func (o *OrderAmendKeepPriorityResponse) CumulativeQuoteQtyInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.CumulativeQuoteQtySinceVersion() +} + +func (*OrderAmendKeepPriorityResponse) CumulativeQuoteQtyDeprecated() uint16 { + return 0 +} + +func (*OrderAmendKeepPriorityResponse) CumulativeQuoteQtyMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrderAmendKeepPriorityResponse) CumulativeQuoteQtyMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*OrderAmendKeepPriorityResponse) CumulativeQuoteQtyMaxValue() int64 { + return math.MaxInt64 +} + +func (*OrderAmendKeepPriorityResponse) CumulativeQuoteQtyNullValue() int64 { + return math.MinInt64 +} + +func (*OrderAmendKeepPriorityResponse) StatusId() uint16 { + return 12 +} + +func (*OrderAmendKeepPriorityResponse) StatusSinceVersion() uint16 { + return 0 +} + +func (o *OrderAmendKeepPriorityResponse) StatusInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.StatusSinceVersion() +} + +func (*OrderAmendKeepPriorityResponse) StatusDeprecated() uint16 { + return 0 +} + +func (*OrderAmendKeepPriorityResponse) StatusMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrderAmendKeepPriorityResponse) TimeInForceId() uint16 { + return 13 +} + +func (*OrderAmendKeepPriorityResponse) TimeInForceSinceVersion() uint16 { + return 0 +} + +func (o *OrderAmendKeepPriorityResponse) TimeInForceInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.TimeInForceSinceVersion() +} + +func (*OrderAmendKeepPriorityResponse) TimeInForceDeprecated() uint16 { + return 0 +} + +func (*OrderAmendKeepPriorityResponse) TimeInForceMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrderAmendKeepPriorityResponse) OrderTypeId() uint16 { + return 14 +} + +func (*OrderAmendKeepPriorityResponse) OrderTypeSinceVersion() uint16 { + return 0 +} + +func (o *OrderAmendKeepPriorityResponse) OrderTypeInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.OrderTypeSinceVersion() +} + +func (*OrderAmendKeepPriorityResponse) OrderTypeDeprecated() uint16 { + return 0 +} + +func (*OrderAmendKeepPriorityResponse) OrderTypeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrderAmendKeepPriorityResponse) SideId() uint16 { + return 15 +} + +func (*OrderAmendKeepPriorityResponse) SideSinceVersion() uint16 { + return 0 +} + +func (o *OrderAmendKeepPriorityResponse) SideInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.SideSinceVersion() +} + +func (*OrderAmendKeepPriorityResponse) SideDeprecated() uint16 { + return 0 +} + +func (*OrderAmendKeepPriorityResponse) SideMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrderAmendKeepPriorityResponse) StopPriceId() uint16 { + return 16 +} + +func (*OrderAmendKeepPriorityResponse) StopPriceSinceVersion() uint16 { + return 0 +} + +func (o *OrderAmendKeepPriorityResponse) StopPriceInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.StopPriceSinceVersion() +} + +func (*OrderAmendKeepPriorityResponse) StopPriceDeprecated() uint16 { + return 0 +} + +func (*OrderAmendKeepPriorityResponse) StopPriceMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*OrderAmendKeepPriorityResponse) StopPriceMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*OrderAmendKeepPriorityResponse) StopPriceMaxValue() int64 { + return math.MaxInt64 +} + +func (*OrderAmendKeepPriorityResponse) StopPriceNullValue() int64 { + return math.MinInt64 +} + +func (*OrderAmendKeepPriorityResponse) TrailingDeltaId() uint16 { + return 17 +} + +func (*OrderAmendKeepPriorityResponse) TrailingDeltaSinceVersion() uint16 { + return 0 +} + +func (o *OrderAmendKeepPriorityResponse) TrailingDeltaInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.TrailingDeltaSinceVersion() +} + +func (*OrderAmendKeepPriorityResponse) TrailingDeltaDeprecated() uint16 { + return 0 +} + +func (*OrderAmendKeepPriorityResponse) TrailingDeltaMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*OrderAmendKeepPriorityResponse) TrailingDeltaMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*OrderAmendKeepPriorityResponse) TrailingDeltaMaxValue() int64 { + return math.MaxInt64 +} + +func (*OrderAmendKeepPriorityResponse) TrailingDeltaNullValue() int64 { + return math.MinInt64 +} + +func (*OrderAmendKeepPriorityResponse) TrailingTimeId() uint16 { + return 18 +} + +func (*OrderAmendKeepPriorityResponse) TrailingTimeSinceVersion() uint16 { + return 0 +} + +func (o *OrderAmendKeepPriorityResponse) TrailingTimeInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.TrailingTimeSinceVersion() +} + +func (*OrderAmendKeepPriorityResponse) TrailingTimeDeprecated() uint16 { + return 0 +} + +func (*OrderAmendKeepPriorityResponse) TrailingTimeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*OrderAmendKeepPriorityResponse) TrailingTimeMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*OrderAmendKeepPriorityResponse) TrailingTimeMaxValue() int64 { + return math.MaxInt64 +} + +func (*OrderAmendKeepPriorityResponse) TrailingTimeNullValue() int64 { + return math.MinInt64 +} + +func (*OrderAmendKeepPriorityResponse) IcebergQtyId() uint16 { + return 19 +} + +func (*OrderAmendKeepPriorityResponse) IcebergQtySinceVersion() uint16 { + return 0 +} + +func (o *OrderAmendKeepPriorityResponse) IcebergQtyInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.IcebergQtySinceVersion() +} + +func (*OrderAmendKeepPriorityResponse) IcebergQtyDeprecated() uint16 { + return 0 +} + +func (*OrderAmendKeepPriorityResponse) IcebergQtyMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*OrderAmendKeepPriorityResponse) IcebergQtyMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*OrderAmendKeepPriorityResponse) IcebergQtyMaxValue() int64 { + return math.MaxInt64 +} + +func (*OrderAmendKeepPriorityResponse) IcebergQtyNullValue() int64 { + return math.MinInt64 +} + +func (*OrderAmendKeepPriorityResponse) WorkingTimeId() uint16 { + return 20 +} + +func (*OrderAmendKeepPriorityResponse) WorkingTimeSinceVersion() uint16 { + return 0 +} + +func (o *OrderAmendKeepPriorityResponse) WorkingTimeInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.WorkingTimeSinceVersion() +} + +func (*OrderAmendKeepPriorityResponse) WorkingTimeDeprecated() uint16 { + return 0 +} + +func (*OrderAmendKeepPriorityResponse) WorkingTimeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*OrderAmendKeepPriorityResponse) WorkingTimeMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*OrderAmendKeepPriorityResponse) WorkingTimeMaxValue() int64 { + return math.MaxInt64 +} + +func (*OrderAmendKeepPriorityResponse) WorkingTimeNullValue() int64 { + return math.MinInt64 +} + +func (*OrderAmendKeepPriorityResponse) StrategyIdId() uint16 { + return 21 +} + +func (*OrderAmendKeepPriorityResponse) StrategyIdSinceVersion() uint16 { + return 0 +} + +func (o *OrderAmendKeepPriorityResponse) StrategyIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.StrategyIdSinceVersion() +} + +func (*OrderAmendKeepPriorityResponse) StrategyIdDeprecated() uint16 { + return 0 +} + +func (*OrderAmendKeepPriorityResponse) StrategyIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*OrderAmendKeepPriorityResponse) StrategyIdMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*OrderAmendKeepPriorityResponse) StrategyIdMaxValue() int64 { + return math.MaxInt64 +} + +func (*OrderAmendKeepPriorityResponse) StrategyIdNullValue() int64 { + return math.MinInt64 +} + +func (*OrderAmendKeepPriorityResponse) StrategyTypeId() uint16 { + return 22 +} + +func (*OrderAmendKeepPriorityResponse) StrategyTypeSinceVersion() uint16 { + return 0 +} + +func (o *OrderAmendKeepPriorityResponse) StrategyTypeInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.StrategyTypeSinceVersion() +} + +func (*OrderAmendKeepPriorityResponse) StrategyTypeDeprecated() uint16 { + return 0 +} + +func (*OrderAmendKeepPriorityResponse) StrategyTypeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*OrderAmendKeepPriorityResponse) StrategyTypeMinValue() int32 { + return math.MinInt32 + 1 +} + +func (*OrderAmendKeepPriorityResponse) StrategyTypeMaxValue() int32 { + return math.MaxInt32 +} + +func (*OrderAmendKeepPriorityResponse) StrategyTypeNullValue() int32 { + return math.MinInt32 +} + +func (*OrderAmendKeepPriorityResponse) OrderCapacityId() uint16 { + return 23 +} + +func (*OrderAmendKeepPriorityResponse) OrderCapacitySinceVersion() uint16 { + return 0 +} + +func (o *OrderAmendKeepPriorityResponse) OrderCapacityInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.OrderCapacitySinceVersion() +} + +func (*OrderAmendKeepPriorityResponse) OrderCapacityDeprecated() uint16 { + return 0 +} + +func (*OrderAmendKeepPriorityResponse) OrderCapacityMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrderAmendKeepPriorityResponse) WorkingFloorId() uint16 { + return 24 +} + +func (*OrderAmendKeepPriorityResponse) WorkingFloorSinceVersion() uint16 { + return 0 +} + +func (o *OrderAmendKeepPriorityResponse) WorkingFloorInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.WorkingFloorSinceVersion() +} + +func (*OrderAmendKeepPriorityResponse) WorkingFloorDeprecated() uint16 { + return 0 +} + +func (*OrderAmendKeepPriorityResponse) WorkingFloorMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrderAmendKeepPriorityResponse) SelfTradePreventionModeId() uint16 { + return 25 +} + +func (*OrderAmendKeepPriorityResponse) SelfTradePreventionModeSinceVersion() uint16 { + return 0 +} + +func (o *OrderAmendKeepPriorityResponse) SelfTradePreventionModeInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.SelfTradePreventionModeSinceVersion() +} + +func (*OrderAmendKeepPriorityResponse) SelfTradePreventionModeDeprecated() uint16 { + return 0 +} + +func (*OrderAmendKeepPriorityResponse) SelfTradePreventionModeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrderAmendKeepPriorityResponse) UsedSorId() uint16 { + return 26 +} + +func (*OrderAmendKeepPriorityResponse) UsedSorSinceVersion() uint16 { + return 0 +} + +func (o *OrderAmendKeepPriorityResponse) UsedSorInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.UsedSorSinceVersion() +} + +func (*OrderAmendKeepPriorityResponse) UsedSorDeprecated() uint16 { + return 0 +} + +func (*OrderAmendKeepPriorityResponse) UsedSorMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrderAmendKeepPriorityResponse) PegPriceTypeId() uint16 { + return 27 +} + +func (*OrderAmendKeepPriorityResponse) PegPriceTypeSinceVersion() uint16 { + return 1 +} + +func (o *OrderAmendKeepPriorityResponse) PegPriceTypeInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.PegPriceTypeSinceVersion() +} + +func (*OrderAmendKeepPriorityResponse) PegPriceTypeDeprecated() uint16 { + return 0 +} + +func (*OrderAmendKeepPriorityResponse) PegPriceTypeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*OrderAmendKeepPriorityResponse) PegOffsetTypeId() uint16 { + return 28 +} + +func (*OrderAmendKeepPriorityResponse) PegOffsetTypeSinceVersion() uint16 { + return 1 +} + +func (o *OrderAmendKeepPriorityResponse) PegOffsetTypeInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.PegOffsetTypeSinceVersion() +} + +func (*OrderAmendKeepPriorityResponse) PegOffsetTypeDeprecated() uint16 { + return 0 +} + +func (*OrderAmendKeepPriorityResponse) PegOffsetTypeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*OrderAmendKeepPriorityResponse) PegOffsetValueId() uint16 { + return 29 +} + +func (*OrderAmendKeepPriorityResponse) PegOffsetValueSinceVersion() uint16 { + return 1 +} + +func (o *OrderAmendKeepPriorityResponse) PegOffsetValueInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.PegOffsetValueSinceVersion() +} + +func (*OrderAmendKeepPriorityResponse) PegOffsetValueDeprecated() uint16 { + return 0 +} + +func (*OrderAmendKeepPriorityResponse) PegOffsetValueMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*OrderAmendKeepPriorityResponse) PegOffsetValueMinValue() uint8 { + return 0 +} + +func (*OrderAmendKeepPriorityResponse) PegOffsetValueMaxValue() uint8 { + return math.MaxUint8 - 1 +} + +func (*OrderAmendKeepPriorityResponse) PegOffsetValueNullValue() uint8 { + return math.MaxUint8 +} + +func (*OrderAmendKeepPriorityResponse) PeggedPriceId() uint16 { + return 30 +} + +func (*OrderAmendKeepPriorityResponse) PeggedPriceSinceVersion() uint16 { + return 1 +} + +func (o *OrderAmendKeepPriorityResponse) PeggedPriceInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.PeggedPriceSinceVersion() +} + +func (*OrderAmendKeepPriorityResponse) PeggedPriceDeprecated() uint16 { + return 0 +} + +func (*OrderAmendKeepPriorityResponse) PeggedPriceMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*OrderAmendKeepPriorityResponse) PeggedPriceMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*OrderAmendKeepPriorityResponse) PeggedPriceMaxValue() int64 { + return math.MaxInt64 +} + +func (*OrderAmendKeepPriorityResponse) PeggedPriceNullValue() int64 { + return math.MinInt64 +} + +func (*OrderAmendKeepPriorityResponseListStatus) OrderListIdId() uint16 { + return 1 +} + +func (*OrderAmendKeepPriorityResponseListStatus) OrderListIdSinceVersion() uint16 { + return 0 +} + +func (o *OrderAmendKeepPriorityResponseListStatus) OrderListIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.OrderListIdSinceVersion() +} + +func (*OrderAmendKeepPriorityResponseListStatus) OrderListIdDeprecated() uint16 { + return 0 +} + +func (*OrderAmendKeepPriorityResponseListStatus) OrderListIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrderAmendKeepPriorityResponseListStatus) OrderListIdMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*OrderAmendKeepPriorityResponseListStatus) OrderListIdMaxValue() int64 { + return math.MaxInt64 +} + +func (*OrderAmendKeepPriorityResponseListStatus) OrderListIdNullValue() int64 { + return math.MinInt64 +} + +func (*OrderAmendKeepPriorityResponseListStatus) ContingencyTypeId() uint16 { + return 2 +} + +func (*OrderAmendKeepPriorityResponseListStatus) ContingencyTypeSinceVersion() uint16 { + return 0 +} + +func (o *OrderAmendKeepPriorityResponseListStatus) ContingencyTypeInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.ContingencyTypeSinceVersion() +} + +func (*OrderAmendKeepPriorityResponseListStatus) ContingencyTypeDeprecated() uint16 { + return 0 +} + +func (*OrderAmendKeepPriorityResponseListStatus) ContingencyTypeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrderAmendKeepPriorityResponseListStatus) ListOrderStatusId() uint16 { + return 3 +} + +func (*OrderAmendKeepPriorityResponseListStatus) ListOrderStatusSinceVersion() uint16 { + return 0 +} + +func (o *OrderAmendKeepPriorityResponseListStatus) ListOrderStatusInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.ListOrderStatusSinceVersion() +} + +func (*OrderAmendKeepPriorityResponseListStatus) ListOrderStatusDeprecated() uint16 { + return 0 +} + +func (*OrderAmendKeepPriorityResponseListStatus) ListOrderStatusMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrderAmendKeepPriorityResponseListStatusOrders) OrderIdId() uint16 { + return 1 +} + +func (*OrderAmendKeepPriorityResponseListStatusOrders) OrderIdSinceVersion() uint16 { + return 0 +} + +func (o *OrderAmendKeepPriorityResponseListStatusOrders) OrderIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.OrderIdSinceVersion() +} + +func (*OrderAmendKeepPriorityResponseListStatusOrders) OrderIdDeprecated() uint16 { + return 0 +} + +func (*OrderAmendKeepPriorityResponseListStatusOrders) OrderIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrderAmendKeepPriorityResponseListStatusOrders) OrderIdMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*OrderAmendKeepPriorityResponseListStatusOrders) OrderIdMaxValue() int64 { + return math.MaxInt64 +} + +func (*OrderAmendKeepPriorityResponseListStatusOrders) OrderIdNullValue() int64 { + return math.MinInt64 +} + +func (*OrderAmendKeepPriorityResponseListStatusOrders) SymbolMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrderAmendKeepPriorityResponseListStatusOrders) SymbolSinceVersion() uint16 { + return 0 +} + +func (o *OrderAmendKeepPriorityResponseListStatusOrders) SymbolInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.SymbolSinceVersion() +} + +func (*OrderAmendKeepPriorityResponseListStatusOrders) SymbolDeprecated() uint16 { + return 0 +} + +func (OrderAmendKeepPriorityResponseListStatusOrders) SymbolCharacterEncoding() string { + return "UTF-8" +} + +func (OrderAmendKeepPriorityResponseListStatusOrders) SymbolHeaderLength() uint64 { + return 1 +} + +func (*OrderAmendKeepPriorityResponseListStatusOrders) ClientOrderIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrderAmendKeepPriorityResponseListStatusOrders) ClientOrderIdSinceVersion() uint16 { + return 0 +} + +func (o *OrderAmendKeepPriorityResponseListStatusOrders) ClientOrderIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.ClientOrderIdSinceVersion() +} + +func (*OrderAmendKeepPriorityResponseListStatusOrders) ClientOrderIdDeprecated() uint16 { + return 0 +} + +func (OrderAmendKeepPriorityResponseListStatusOrders) ClientOrderIdCharacterEncoding() string { + return "UTF-8" +} + +func (OrderAmendKeepPriorityResponseListStatusOrders) ClientOrderIdHeaderLength() uint64 { + return 1 +} + +func (*OrderAmendKeepPriorityResponseListStatus) ListClientOrderIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrderAmendKeepPriorityResponseListStatus) ListClientOrderIdSinceVersion() uint16 { + return 0 +} + +func (o *OrderAmendKeepPriorityResponseListStatus) ListClientOrderIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.ListClientOrderIdSinceVersion() +} + +func (*OrderAmendKeepPriorityResponseListStatus) ListClientOrderIdDeprecated() uint16 { + return 0 +} + +func (OrderAmendKeepPriorityResponseListStatus) ListClientOrderIdCharacterEncoding() string { + return "UTF-8" +} + +func (OrderAmendKeepPriorityResponseListStatus) ListClientOrderIdHeaderLength() uint64 { + return 1 +} + +func (*OrderAmendKeepPriorityResponseListStatus) SymbolMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrderAmendKeepPriorityResponseListStatus) SymbolSinceVersion() uint16 { + return 0 +} + +func (o *OrderAmendKeepPriorityResponseListStatus) SymbolInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.SymbolSinceVersion() +} + +func (*OrderAmendKeepPriorityResponseListStatus) SymbolDeprecated() uint16 { + return 0 +} + +func (OrderAmendKeepPriorityResponseListStatus) SymbolCharacterEncoding() string { + return "UTF-8" +} + +func (OrderAmendKeepPriorityResponseListStatus) SymbolHeaderLength() uint64 { + return 1 +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) OrderIdId() uint16 { + return 1 +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) OrderIdSinceVersion() uint16 { + return 0 +} + +func (o *OrderAmendKeepPriorityResponseRelatedOrders) OrderIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.OrderIdSinceVersion() +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) OrderIdDeprecated() uint16 { + return 0 +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) OrderIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) OrderIdMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) OrderIdMaxValue() int64 { + return math.MaxInt64 +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) OrderIdNullValue() int64 { + return math.MinInt64 +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) OrderListIdId() uint16 { + return 2 +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) OrderListIdSinceVersion() uint16 { + return 0 +} + +func (o *OrderAmendKeepPriorityResponseRelatedOrders) OrderListIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.OrderListIdSinceVersion() +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) OrderListIdDeprecated() uint16 { + return 0 +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) OrderListIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) OrderListIdMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) OrderListIdMaxValue() int64 { + return math.MaxInt64 +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) OrderListIdNullValue() int64 { + return math.MinInt64 +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) PriceId() uint16 { + return 3 +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) PriceSinceVersion() uint16 { + return 0 +} + +func (o *OrderAmendKeepPriorityResponseRelatedOrders) PriceInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.PriceSinceVersion() +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) PriceDeprecated() uint16 { + return 0 +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) PriceMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) PriceMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) PriceMaxValue() int64 { + return math.MaxInt64 +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) PriceNullValue() int64 { + return math.MinInt64 +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) QtyId() uint16 { + return 4 +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) QtySinceVersion() uint16 { + return 0 +} + +func (o *OrderAmendKeepPriorityResponseRelatedOrders) QtyInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.QtySinceVersion() +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) QtyDeprecated() uint16 { + return 0 +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) QtyMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) QtyMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) QtyMaxValue() int64 { + return math.MaxInt64 +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) QtyNullValue() int64 { + return math.MinInt64 +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) ExecutedQtyId() uint16 { + return 5 +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) ExecutedQtySinceVersion() uint16 { + return 0 +} + +func (o *OrderAmendKeepPriorityResponseRelatedOrders) ExecutedQtyInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.ExecutedQtySinceVersion() +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) ExecutedQtyDeprecated() uint16 { + return 0 +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) ExecutedQtyMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) ExecutedQtyMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) ExecutedQtyMaxValue() int64 { + return math.MaxInt64 +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) ExecutedQtyNullValue() int64 { + return math.MinInt64 +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) PreventedQtyId() uint16 { + return 6 +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) PreventedQtySinceVersion() uint16 { + return 0 +} + +func (o *OrderAmendKeepPriorityResponseRelatedOrders) PreventedQtyInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.PreventedQtySinceVersion() +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) PreventedQtyDeprecated() uint16 { + return 0 +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) PreventedQtyMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) PreventedQtyMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) PreventedQtyMaxValue() int64 { + return math.MaxInt64 +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) PreventedQtyNullValue() int64 { + return math.MinInt64 +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) CumulativeQuoteQtyId() uint16 { + return 7 +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) CumulativeQuoteQtySinceVersion() uint16 { + return 0 +} + +func (o *OrderAmendKeepPriorityResponseRelatedOrders) CumulativeQuoteQtyInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.CumulativeQuoteQtySinceVersion() +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) CumulativeQuoteQtyDeprecated() uint16 { + return 0 +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) CumulativeQuoteQtyMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) CumulativeQuoteQtyMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) CumulativeQuoteQtyMaxValue() int64 { + return math.MaxInt64 +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) CumulativeQuoteQtyNullValue() int64 { + return math.MinInt64 +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) StatusId() uint16 { + return 8 +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) StatusSinceVersion() uint16 { + return 0 +} + +func (o *OrderAmendKeepPriorityResponseRelatedOrders) StatusInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.StatusSinceVersion() +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) StatusDeprecated() uint16 { + return 0 +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) StatusMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) TimeInForceId() uint16 { + return 9 +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) TimeInForceSinceVersion() uint16 { + return 0 +} + +func (o *OrderAmendKeepPriorityResponseRelatedOrders) TimeInForceInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.TimeInForceSinceVersion() +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) TimeInForceDeprecated() uint16 { + return 0 +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) TimeInForceMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) OrderTypeId() uint16 { + return 10 +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) OrderTypeSinceVersion() uint16 { + return 0 +} + +func (o *OrderAmendKeepPriorityResponseRelatedOrders) OrderTypeInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.OrderTypeSinceVersion() +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) OrderTypeDeprecated() uint16 { + return 0 +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) OrderTypeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) SideId() uint16 { + return 11 +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) SideSinceVersion() uint16 { + return 0 +} + +func (o *OrderAmendKeepPriorityResponseRelatedOrders) SideInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.SideSinceVersion() +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) SideDeprecated() uint16 { + return 0 +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) SideMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) StopPriceId() uint16 { + return 12 +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) StopPriceSinceVersion() uint16 { + return 0 +} + +func (o *OrderAmendKeepPriorityResponseRelatedOrders) StopPriceInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.StopPriceSinceVersion() +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) StopPriceDeprecated() uint16 { + return 0 +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) StopPriceMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) StopPriceMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) StopPriceMaxValue() int64 { + return math.MaxInt64 +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) StopPriceNullValue() int64 { + return math.MinInt64 +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) TrailingDeltaId() uint16 { + return 13 +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) TrailingDeltaSinceVersion() uint16 { + return 0 +} + +func (o *OrderAmendKeepPriorityResponseRelatedOrders) TrailingDeltaInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.TrailingDeltaSinceVersion() +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) TrailingDeltaDeprecated() uint16 { + return 0 +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) TrailingDeltaMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) TrailingDeltaMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) TrailingDeltaMaxValue() int64 { + return math.MaxInt64 +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) TrailingDeltaNullValue() int64 { + return math.MinInt64 +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) TrailingTimeId() uint16 { + return 14 +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) TrailingTimeSinceVersion() uint16 { + return 0 +} + +func (o *OrderAmendKeepPriorityResponseRelatedOrders) TrailingTimeInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.TrailingTimeSinceVersion() +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) TrailingTimeDeprecated() uint16 { + return 0 +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) TrailingTimeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) TrailingTimeMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) TrailingTimeMaxValue() int64 { + return math.MaxInt64 +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) TrailingTimeNullValue() int64 { + return math.MinInt64 +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) IcebergQtyId() uint16 { + return 15 +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) IcebergQtySinceVersion() uint16 { + return 0 +} + +func (o *OrderAmendKeepPriorityResponseRelatedOrders) IcebergQtyInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.IcebergQtySinceVersion() +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) IcebergQtyDeprecated() uint16 { + return 0 +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) IcebergQtyMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) IcebergQtyMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) IcebergQtyMaxValue() int64 { + return math.MaxInt64 +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) IcebergQtyNullValue() int64 { + return math.MinInt64 +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) WorkingTimeId() uint16 { + return 16 +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) WorkingTimeSinceVersion() uint16 { + return 0 +} + +func (o *OrderAmendKeepPriorityResponseRelatedOrders) WorkingTimeInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.WorkingTimeSinceVersion() +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) WorkingTimeDeprecated() uint16 { + return 0 +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) WorkingTimeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) WorkingTimeMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) WorkingTimeMaxValue() int64 { + return math.MaxInt64 +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) WorkingTimeNullValue() int64 { + return math.MinInt64 +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) StrategyIdId() uint16 { + return 17 +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) StrategyIdSinceVersion() uint16 { + return 0 +} + +func (o *OrderAmendKeepPriorityResponseRelatedOrders) StrategyIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.StrategyIdSinceVersion() +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) StrategyIdDeprecated() uint16 { + return 0 +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) StrategyIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) StrategyIdMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) StrategyIdMaxValue() int64 { + return math.MaxInt64 +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) StrategyIdNullValue() int64 { + return math.MinInt64 +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) StrategyTypeId() uint16 { + return 18 +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) StrategyTypeSinceVersion() uint16 { + return 0 +} + +func (o *OrderAmendKeepPriorityResponseRelatedOrders) StrategyTypeInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.StrategyTypeSinceVersion() +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) StrategyTypeDeprecated() uint16 { + return 0 +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) StrategyTypeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) StrategyTypeMinValue() int32 { + return math.MinInt32 + 1 +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) StrategyTypeMaxValue() int32 { + return math.MaxInt32 +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) StrategyTypeNullValue() int32 { + return math.MinInt32 +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) OrderCapacityId() uint16 { + return 19 +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) OrderCapacitySinceVersion() uint16 { + return 0 +} + +func (o *OrderAmendKeepPriorityResponseRelatedOrders) OrderCapacityInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.OrderCapacitySinceVersion() +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) OrderCapacityDeprecated() uint16 { + return 0 +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) OrderCapacityMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) WorkingFloorId() uint16 { + return 20 +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) WorkingFloorSinceVersion() uint16 { + return 0 +} + +func (o *OrderAmendKeepPriorityResponseRelatedOrders) WorkingFloorInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.WorkingFloorSinceVersion() +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) WorkingFloorDeprecated() uint16 { + return 0 +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) WorkingFloorMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) SelfTradePreventionModeId() uint16 { + return 21 +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) SelfTradePreventionModeSinceVersion() uint16 { + return 0 +} + +func (o *OrderAmendKeepPriorityResponseRelatedOrders) SelfTradePreventionModeInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.SelfTradePreventionModeSinceVersion() +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) SelfTradePreventionModeDeprecated() uint16 { + return 0 +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) SelfTradePreventionModeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) UsedSorId() uint16 { + return 22 +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) UsedSorSinceVersion() uint16 { + return 0 +} + +func (o *OrderAmendKeepPriorityResponseRelatedOrders) UsedSorInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.UsedSorSinceVersion() +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) UsedSorDeprecated() uint16 { + return 0 +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) UsedSorMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) PegPriceTypeId() uint16 { + return 23 +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) PegPriceTypeSinceVersion() uint16 { + return 1 +} + +func (o *OrderAmendKeepPriorityResponseRelatedOrders) PegPriceTypeInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.PegPriceTypeSinceVersion() +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) PegPriceTypeDeprecated() uint16 { + return 0 +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) PegPriceTypeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) PegOffsetTypeId() uint16 { + return 24 +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) PegOffsetTypeSinceVersion() uint16 { + return 1 +} + +func (o *OrderAmendKeepPriorityResponseRelatedOrders) PegOffsetTypeInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.PegOffsetTypeSinceVersion() +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) PegOffsetTypeDeprecated() uint16 { + return 0 +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) PegOffsetTypeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) PegOffsetValueId() uint16 { + return 25 +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) PegOffsetValueSinceVersion() uint16 { + return 1 +} + +func (o *OrderAmendKeepPriorityResponseRelatedOrders) PegOffsetValueInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.PegOffsetValueSinceVersion() +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) PegOffsetValueDeprecated() uint16 { + return 0 +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) PegOffsetValueMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) PegOffsetValueMinValue() uint8 { + return 0 +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) PegOffsetValueMaxValue() uint8 { + return math.MaxUint8 - 1 +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) PegOffsetValueNullValue() uint8 { + return math.MaxUint8 +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) PeggedPriceId() uint16 { + return 26 +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) PeggedPriceSinceVersion() uint16 { + return 1 +} + +func (o *OrderAmendKeepPriorityResponseRelatedOrders) PeggedPriceInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.PeggedPriceSinceVersion() +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) PeggedPriceDeprecated() uint16 { + return 0 +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) PeggedPriceMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) PeggedPriceMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) PeggedPriceMaxValue() int64 { + return math.MaxInt64 +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) PeggedPriceNullValue() int64 { + return math.MinInt64 +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) SymbolMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) SymbolSinceVersion() uint16 { + return 0 +} + +func (o *OrderAmendKeepPriorityResponseRelatedOrders) SymbolInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.SymbolSinceVersion() +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) SymbolDeprecated() uint16 { + return 0 +} + +func (OrderAmendKeepPriorityResponseRelatedOrders) SymbolCharacterEncoding() string { + return "UTF-8" +} + +func (OrderAmendKeepPriorityResponseRelatedOrders) SymbolHeaderLength() uint64 { + return 1 +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) ClientOrderIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) ClientOrderIdSinceVersion() uint16 { + return 0 +} + +func (o *OrderAmendKeepPriorityResponseRelatedOrders) ClientOrderIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.ClientOrderIdSinceVersion() +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) ClientOrderIdDeprecated() uint16 { + return 0 +} + +func (OrderAmendKeepPriorityResponseRelatedOrders) ClientOrderIdCharacterEncoding() string { + return "UTF-8" +} + +func (OrderAmendKeepPriorityResponseRelatedOrders) ClientOrderIdHeaderLength() uint64 { + return 1 +} + +func (*OrderAmendKeepPriorityResponse) ListStatusId() uint16 { + return 101 +} + +func (*OrderAmendKeepPriorityResponse) ListStatusSinceVersion() uint16 { + return 0 +} + +func (o *OrderAmendKeepPriorityResponse) ListStatusInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.ListStatusSinceVersion() +} + +func (*OrderAmendKeepPriorityResponse) ListStatusDeprecated() uint16 { + return 0 +} + +func (*OrderAmendKeepPriorityResponseListStatus) SbeBlockLength() (blockLength uint) { + return 10 +} + +func (*OrderAmendKeepPriorityResponseListStatus) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} + +func (*OrderAmendKeepPriorityResponseListStatus) OrdersId() uint16 { + return 100 +} + +func (*OrderAmendKeepPriorityResponseListStatus) OrdersSinceVersion() uint16 { + return 0 +} + +func (o *OrderAmendKeepPriorityResponseListStatus) OrdersInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.OrdersSinceVersion() +} + +func (*OrderAmendKeepPriorityResponseListStatus) OrdersDeprecated() uint16 { + return 0 +} + +func (*OrderAmendKeepPriorityResponseListStatusOrders) SbeBlockLength() (blockLength uint) { + return 8 +} + +func (*OrderAmendKeepPriorityResponseListStatusOrders) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} + +func (*OrderAmendKeepPriorityResponse) RelatedOrdersId() uint16 { + return 102 +} + +func (*OrderAmendKeepPriorityResponse) RelatedOrdersSinceVersion() uint16 { + return 0 +} + +func (o *OrderAmendKeepPriorityResponse) RelatedOrdersInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.RelatedOrdersSinceVersion() +} + +func (*OrderAmendKeepPriorityResponse) RelatedOrdersDeprecated() uint16 { + return 0 +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) SbeBlockLength() (blockLength uint) { + return 127 +} + +func (*OrderAmendKeepPriorityResponseRelatedOrders) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} + +func (*OrderAmendKeepPriorityResponse) SymbolMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrderAmendKeepPriorityResponse) SymbolSinceVersion() uint16 { + return 0 +} + +func (o *OrderAmendKeepPriorityResponse) SymbolInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.SymbolSinceVersion() +} + +func (*OrderAmendKeepPriorityResponse) SymbolDeprecated() uint16 { + return 0 +} + +func (OrderAmendKeepPriorityResponse) SymbolCharacterEncoding() string { + return "UTF-8" +} + +func (OrderAmendKeepPriorityResponse) SymbolHeaderLength() uint64 { + return 1 +} + +func (*OrderAmendKeepPriorityResponse) OrigClientOrderIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrderAmendKeepPriorityResponse) OrigClientOrderIdSinceVersion() uint16 { + return 0 +} + +func (o *OrderAmendKeepPriorityResponse) OrigClientOrderIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.OrigClientOrderIdSinceVersion() +} + +func (*OrderAmendKeepPriorityResponse) OrigClientOrderIdDeprecated() uint16 { + return 0 +} + +func (OrderAmendKeepPriorityResponse) OrigClientOrderIdCharacterEncoding() string { + return "UTF-8" +} + +func (OrderAmendKeepPriorityResponse) OrigClientOrderIdHeaderLength() uint64 { + return 1 +} + +func (*OrderAmendKeepPriorityResponse) ClientOrderIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrderAmendKeepPriorityResponse) ClientOrderIdSinceVersion() uint16 { + return 0 +} + +func (o *OrderAmendKeepPriorityResponse) ClientOrderIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.ClientOrderIdSinceVersion() +} + +func (*OrderAmendKeepPriorityResponse) ClientOrderIdDeprecated() uint16 { + return 0 +} + +func (OrderAmendKeepPriorityResponse) ClientOrderIdCharacterEncoding() string { + return "UTF-8" +} + +func (OrderAmendKeepPriorityResponse) ClientOrderIdHeaderLength() uint64 { + return 1 +} diff --git a/v2/sbe/spot_3_1/OrderAmendmentsResponse.go b/v2/sbe/spot_3_1/OrderAmendmentsResponse.go new file mode 100644 index 00000000..54e5f610 --- /dev/null +++ b/v2/sbe/spot_3_1/OrderAmendmentsResponse.go @@ -0,0 +1,674 @@ +// Generated SBE (Simple Binary Encoding) message codec + +package sbe + +import ( + "errors" + "fmt" + "io" + "io/ioutil" + "math" + "unicode/utf8" +) + +type OrderAmendmentsResponse struct { + Amendments []OrderAmendmentsResponseAmendments +} +type OrderAmendmentsResponseAmendments struct { + OrderId int64 + ExecutionId int64 + QtyExponent int8 + OrigQty int64 + NewQty int64 + Time int64 + Symbol []uint8 + OrigClientOrderId []uint8 + NewClientOrderId []uint8 +} + +func (o *OrderAmendmentsResponse) Encode(_m *SbeGoMarshaller, _w io.Writer, doRangeCheck bool) error { + if doRangeCheck { + if err := o.RangeCheck(o.SbeSchemaVersion(), o.SbeSchemaVersion()); err != nil { + return err + } + } + var AmendmentsBlockLength uint16 = 41 + if err := _m.WriteUint16(_w, AmendmentsBlockLength); err != nil { + return err + } + var AmendmentsNumInGroup uint32 = uint32(len(o.Amendments)) + if err := _m.WriteUint32(_w, AmendmentsNumInGroup); err != nil { + return err + } + for i := range o.Amendments { + if err := o.Amendments[i].Encode(_m, _w); err != nil { + return err + } + } + return nil +} + +func (o *OrderAmendmentsResponse) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint16, doRangeCheck bool) error { + if actingVersion > o.SbeSchemaVersion() && blockLength > o.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-o.SbeBlockLength())) + } + + if o.AmendmentsInActingVersion(actingVersion) { + var AmendmentsBlockLength uint16 + if err := _m.ReadUint16(_r, &AmendmentsBlockLength); err != nil { + return err + } + var AmendmentsNumInGroup uint32 + if err := _m.ReadUint32(_r, &AmendmentsNumInGroup); err != nil { + return err + } + if cap(o.Amendments) < int(AmendmentsNumInGroup) { + o.Amendments = make([]OrderAmendmentsResponseAmendments, AmendmentsNumInGroup) + } + o.Amendments = o.Amendments[:AmendmentsNumInGroup] + for i := range o.Amendments { + if err := o.Amendments[i].Decode(_m, _r, actingVersion, uint(AmendmentsBlockLength)); err != nil { + return err + } + } + } + if doRangeCheck { + if err := o.RangeCheck(actingVersion, o.SbeSchemaVersion()); err != nil { + return err + } + } + return nil +} + +func (o *OrderAmendmentsResponse) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + for i := range o.Amendments { + if err := o.Amendments[i].RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + } + return nil +} + +func OrderAmendmentsResponseInit(o *OrderAmendmentsResponse) { + return +} + +func (o *OrderAmendmentsResponseAmendments) Encode(_m *SbeGoMarshaller, _w io.Writer) error { + if err := _m.WriteInt64(_w, o.OrderId); err != nil { + return err + } + if err := _m.WriteInt64(_w, o.ExecutionId); err != nil { + return err + } + if err := _m.WriteInt8(_w, o.QtyExponent); err != nil { + return err + } + if err := _m.WriteInt64(_w, o.OrigQty); err != nil { + return err + } + if err := _m.WriteInt64(_w, o.NewQty); err != nil { + return err + } + if err := _m.WriteInt64(_w, o.Time); err != nil { + return err + } + if err := _m.WriteUint8(_w, uint8(len(o.Symbol))); err != nil { + return err + } + if err := _m.WriteBytes(_w, o.Symbol); err != nil { + return err + } + if err := _m.WriteUint8(_w, uint8(len(o.OrigClientOrderId))); err != nil { + return err + } + if err := _m.WriteBytes(_w, o.OrigClientOrderId); err != nil { + return err + } + if err := _m.WriteUint8(_w, uint8(len(o.NewClientOrderId))); err != nil { + return err + } + if err := _m.WriteBytes(_w, o.NewClientOrderId); err != nil { + return err + } + return nil +} + +func (o *OrderAmendmentsResponseAmendments) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint) error { + if !o.OrderIdInActingVersion(actingVersion) { + o.OrderId = o.OrderIdNullValue() + } else { + if err := _m.ReadInt64(_r, &o.OrderId); err != nil { + return err + } + } + if !o.ExecutionIdInActingVersion(actingVersion) { + o.ExecutionId = o.ExecutionIdNullValue() + } else { + if err := _m.ReadInt64(_r, &o.ExecutionId); err != nil { + return err + } + } + if !o.QtyExponentInActingVersion(actingVersion) { + o.QtyExponent = o.QtyExponentNullValue() + } else { + if err := _m.ReadInt8(_r, &o.QtyExponent); err != nil { + return err + } + } + if !o.OrigQtyInActingVersion(actingVersion) { + o.OrigQty = o.OrigQtyNullValue() + } else { + if err := _m.ReadInt64(_r, &o.OrigQty); err != nil { + return err + } + } + if !o.NewQtyInActingVersion(actingVersion) { + o.NewQty = o.NewQtyNullValue() + } else { + if err := _m.ReadInt64(_r, &o.NewQty); err != nil { + return err + } + } + if !o.TimeInActingVersion(actingVersion) { + o.Time = o.TimeNullValue() + } else { + if err := _m.ReadInt64(_r, &o.Time); err != nil { + return err + } + } + if actingVersion > o.SbeSchemaVersion() && blockLength > o.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-o.SbeBlockLength())) + } + + if o.SymbolInActingVersion(actingVersion) { + var SymbolLength uint8 + if err := _m.ReadUint8(_r, &SymbolLength); err != nil { + return err + } + if cap(o.Symbol) < int(SymbolLength) { + o.Symbol = make([]uint8, SymbolLength) + } + o.Symbol = o.Symbol[:SymbolLength] + if err := _m.ReadBytes(_r, o.Symbol); err != nil { + return err + } + } + + if o.OrigClientOrderIdInActingVersion(actingVersion) { + var OrigClientOrderIdLength uint8 + if err := _m.ReadUint8(_r, &OrigClientOrderIdLength); err != nil { + return err + } + if cap(o.OrigClientOrderId) < int(OrigClientOrderIdLength) { + o.OrigClientOrderId = make([]uint8, OrigClientOrderIdLength) + } + o.OrigClientOrderId = o.OrigClientOrderId[:OrigClientOrderIdLength] + if err := _m.ReadBytes(_r, o.OrigClientOrderId); err != nil { + return err + } + } + + if o.NewClientOrderIdInActingVersion(actingVersion) { + var NewClientOrderIdLength uint8 + if err := _m.ReadUint8(_r, &NewClientOrderIdLength); err != nil { + return err + } + if cap(o.NewClientOrderId) < int(NewClientOrderIdLength) { + o.NewClientOrderId = make([]uint8, NewClientOrderIdLength) + } + o.NewClientOrderId = o.NewClientOrderId[:NewClientOrderIdLength] + if err := _m.ReadBytes(_r, o.NewClientOrderId); err != nil { + return err + } + } + return nil +} + +func (o *OrderAmendmentsResponseAmendments) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if o.OrderIdInActingVersion(actingVersion) { + if o.OrderId < o.OrderIdMinValue() || o.OrderId > o.OrderIdMaxValue() { + return fmt.Errorf("Range check failed on o.OrderId (%v < %v > %v)", o.OrderIdMinValue(), o.OrderId, o.OrderIdMaxValue()) + } + } + if o.ExecutionIdInActingVersion(actingVersion) { + if o.ExecutionId < o.ExecutionIdMinValue() || o.ExecutionId > o.ExecutionIdMaxValue() { + return fmt.Errorf("Range check failed on o.ExecutionId (%v < %v > %v)", o.ExecutionIdMinValue(), o.ExecutionId, o.ExecutionIdMaxValue()) + } + } + if o.QtyExponentInActingVersion(actingVersion) { + if o.QtyExponent < o.QtyExponentMinValue() || o.QtyExponent > o.QtyExponentMaxValue() { + return fmt.Errorf("Range check failed on o.QtyExponent (%v < %v > %v)", o.QtyExponentMinValue(), o.QtyExponent, o.QtyExponentMaxValue()) + } + } + if o.OrigQtyInActingVersion(actingVersion) { + if o.OrigQty < o.OrigQtyMinValue() || o.OrigQty > o.OrigQtyMaxValue() { + return fmt.Errorf("Range check failed on o.OrigQty (%v < %v > %v)", o.OrigQtyMinValue(), o.OrigQty, o.OrigQtyMaxValue()) + } + } + if o.NewQtyInActingVersion(actingVersion) { + if o.NewQty < o.NewQtyMinValue() || o.NewQty > o.NewQtyMaxValue() { + return fmt.Errorf("Range check failed on o.NewQty (%v < %v > %v)", o.NewQtyMinValue(), o.NewQty, o.NewQtyMaxValue()) + } + } + if o.TimeInActingVersion(actingVersion) { + if o.Time < o.TimeMinValue() || o.Time > o.TimeMaxValue() { + return fmt.Errorf("Range check failed on o.Time (%v < %v > %v)", o.TimeMinValue(), o.Time, o.TimeMaxValue()) + } + } + if !utf8.Valid(o.Symbol[:]) { + return errors.New("o.Symbol failed UTF-8 validation") + } + if !utf8.Valid(o.OrigClientOrderId[:]) { + return errors.New("o.OrigClientOrderId failed UTF-8 validation") + } + if !utf8.Valid(o.NewClientOrderId[:]) { + return errors.New("o.NewClientOrderId failed UTF-8 validation") + } + return nil +} + +func OrderAmendmentsResponseAmendmentsInit(o *OrderAmendmentsResponseAmendments) { + return +} + +func (*OrderAmendmentsResponse) SbeBlockLength() (blockLength uint16) { + return 0 +} + +func (*OrderAmendmentsResponse) SbeTemplateId() (templateId uint16) { + return 316 +} + +func (*OrderAmendmentsResponse) SbeSchemaId() (schemaId uint16) { + return 3 +} + +func (*OrderAmendmentsResponse) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} + +func (*OrderAmendmentsResponse) SbeSemanticType() (semanticType []byte) { + return []byte("") +} + +func (*OrderAmendmentsResponse) SbeSemanticVersion() (semanticVersion string) { + return "5.2" +} + +func (*OrderAmendmentsResponseAmendments) OrderIdId() uint16 { + return 1 +} + +func (*OrderAmendmentsResponseAmendments) OrderIdSinceVersion() uint16 { + return 0 +} + +func (o *OrderAmendmentsResponseAmendments) OrderIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.OrderIdSinceVersion() +} + +func (*OrderAmendmentsResponseAmendments) OrderIdDeprecated() uint16 { + return 0 +} + +func (*OrderAmendmentsResponseAmendments) OrderIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrderAmendmentsResponseAmendments) OrderIdMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*OrderAmendmentsResponseAmendments) OrderIdMaxValue() int64 { + return math.MaxInt64 +} + +func (*OrderAmendmentsResponseAmendments) OrderIdNullValue() int64 { + return math.MinInt64 +} + +func (*OrderAmendmentsResponseAmendments) ExecutionIdId() uint16 { + return 2 +} + +func (*OrderAmendmentsResponseAmendments) ExecutionIdSinceVersion() uint16 { + return 0 +} + +func (o *OrderAmendmentsResponseAmendments) ExecutionIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.ExecutionIdSinceVersion() +} + +func (*OrderAmendmentsResponseAmendments) ExecutionIdDeprecated() uint16 { + return 0 +} + +func (*OrderAmendmentsResponseAmendments) ExecutionIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrderAmendmentsResponseAmendments) ExecutionIdMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*OrderAmendmentsResponseAmendments) ExecutionIdMaxValue() int64 { + return math.MaxInt64 +} + +func (*OrderAmendmentsResponseAmendments) ExecutionIdNullValue() int64 { + return math.MinInt64 +} + +func (*OrderAmendmentsResponseAmendments) QtyExponentId() uint16 { + return 3 +} + +func (*OrderAmendmentsResponseAmendments) QtyExponentSinceVersion() uint16 { + return 0 +} + +func (o *OrderAmendmentsResponseAmendments) QtyExponentInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.QtyExponentSinceVersion() +} + +func (*OrderAmendmentsResponseAmendments) QtyExponentDeprecated() uint16 { + return 0 +} + +func (*OrderAmendmentsResponseAmendments) QtyExponentMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrderAmendmentsResponseAmendments) QtyExponentMinValue() int8 { + return math.MinInt8 + 1 +} + +func (*OrderAmendmentsResponseAmendments) QtyExponentMaxValue() int8 { + return math.MaxInt8 +} + +func (*OrderAmendmentsResponseAmendments) QtyExponentNullValue() int8 { + return math.MinInt8 +} + +func (*OrderAmendmentsResponseAmendments) OrigQtyId() uint16 { + return 4 +} + +func (*OrderAmendmentsResponseAmendments) OrigQtySinceVersion() uint16 { + return 0 +} + +func (o *OrderAmendmentsResponseAmendments) OrigQtyInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.OrigQtySinceVersion() +} + +func (*OrderAmendmentsResponseAmendments) OrigQtyDeprecated() uint16 { + return 0 +} + +func (*OrderAmendmentsResponseAmendments) OrigQtyMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrderAmendmentsResponseAmendments) OrigQtyMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*OrderAmendmentsResponseAmendments) OrigQtyMaxValue() int64 { + return math.MaxInt64 +} + +func (*OrderAmendmentsResponseAmendments) OrigQtyNullValue() int64 { + return math.MinInt64 +} + +func (*OrderAmendmentsResponseAmendments) NewQtyId() uint16 { + return 5 +} + +func (*OrderAmendmentsResponseAmendments) NewQtySinceVersion() uint16 { + return 0 +} + +func (o *OrderAmendmentsResponseAmendments) NewQtyInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.NewQtySinceVersion() +} + +func (*OrderAmendmentsResponseAmendments) NewQtyDeprecated() uint16 { + return 0 +} + +func (*OrderAmendmentsResponseAmendments) NewQtyMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrderAmendmentsResponseAmendments) NewQtyMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*OrderAmendmentsResponseAmendments) NewQtyMaxValue() int64 { + return math.MaxInt64 +} + +func (*OrderAmendmentsResponseAmendments) NewQtyNullValue() int64 { + return math.MinInt64 +} + +func (*OrderAmendmentsResponseAmendments) TimeId() uint16 { + return 6 +} + +func (*OrderAmendmentsResponseAmendments) TimeSinceVersion() uint16 { + return 0 +} + +func (o *OrderAmendmentsResponseAmendments) TimeInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.TimeSinceVersion() +} + +func (*OrderAmendmentsResponseAmendments) TimeDeprecated() uint16 { + return 0 +} + +func (*OrderAmendmentsResponseAmendments) TimeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrderAmendmentsResponseAmendments) TimeMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*OrderAmendmentsResponseAmendments) TimeMaxValue() int64 { + return math.MaxInt64 +} + +func (*OrderAmendmentsResponseAmendments) TimeNullValue() int64 { + return math.MinInt64 +} + +func (*OrderAmendmentsResponseAmendments) SymbolMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrderAmendmentsResponseAmendments) SymbolSinceVersion() uint16 { + return 0 +} + +func (o *OrderAmendmentsResponseAmendments) SymbolInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.SymbolSinceVersion() +} + +func (*OrderAmendmentsResponseAmendments) SymbolDeprecated() uint16 { + return 0 +} + +func (OrderAmendmentsResponseAmendments) SymbolCharacterEncoding() string { + return "UTF-8" +} + +func (OrderAmendmentsResponseAmendments) SymbolHeaderLength() uint64 { + return 1 +} + +func (*OrderAmendmentsResponseAmendments) OrigClientOrderIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrderAmendmentsResponseAmendments) OrigClientOrderIdSinceVersion() uint16 { + return 0 +} + +func (o *OrderAmendmentsResponseAmendments) OrigClientOrderIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.OrigClientOrderIdSinceVersion() +} + +func (*OrderAmendmentsResponseAmendments) OrigClientOrderIdDeprecated() uint16 { + return 0 +} + +func (OrderAmendmentsResponseAmendments) OrigClientOrderIdCharacterEncoding() string { + return "UTF-8" +} + +func (OrderAmendmentsResponseAmendments) OrigClientOrderIdHeaderLength() uint64 { + return 1 +} + +func (*OrderAmendmentsResponseAmendments) NewClientOrderIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrderAmendmentsResponseAmendments) NewClientOrderIdSinceVersion() uint16 { + return 0 +} + +func (o *OrderAmendmentsResponseAmendments) NewClientOrderIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.NewClientOrderIdSinceVersion() +} + +func (*OrderAmendmentsResponseAmendments) NewClientOrderIdDeprecated() uint16 { + return 0 +} + +func (OrderAmendmentsResponseAmendments) NewClientOrderIdCharacterEncoding() string { + return "UTF-8" +} + +func (OrderAmendmentsResponseAmendments) NewClientOrderIdHeaderLength() uint64 { + return 1 +} + +func (*OrderAmendmentsResponse) AmendmentsId() uint16 { + return 100 +} + +func (*OrderAmendmentsResponse) AmendmentsSinceVersion() uint16 { + return 0 +} + +func (o *OrderAmendmentsResponse) AmendmentsInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.AmendmentsSinceVersion() +} + +func (*OrderAmendmentsResponse) AmendmentsDeprecated() uint16 { + return 0 +} + +func (*OrderAmendmentsResponseAmendments) SbeBlockLength() (blockLength uint) { + return 41 +} + +func (*OrderAmendmentsResponseAmendments) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} diff --git a/v2/sbe/spot_3_1/OrderCapacity.go b/v2/sbe/spot_3_1/OrderCapacity.go new file mode 100644 index 00000000..7f069fc6 --- /dev/null +++ b/v2/sbe/spot_3_1/OrderCapacity.go @@ -0,0 +1,86 @@ +// Generated SBE (Simple Binary Encoding) message codec + +package sbe + +import ( + "fmt" + "io" + "reflect" +) + +type OrderCapacityEnum uint8 +type OrderCapacityValues struct { + Principal OrderCapacityEnum + Agency OrderCapacityEnum + NonRepresentable OrderCapacityEnum + NullValue OrderCapacityEnum +} + +var OrderCapacity = OrderCapacityValues{1, 2, 254, 255} + +func (o OrderCapacityEnum) Encode(_m *SbeGoMarshaller, _w io.Writer) error { + if err := _m.WriteUint8(_w, uint8(o)); err != nil { + return err + } + return nil +} + +func (o *OrderCapacityEnum) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16) error { + if err := _m.ReadUint8(_r, (*uint8)(o)); err != nil { + return err + } + return nil +} + +func (o OrderCapacityEnum) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if actingVersion > schemaVersion { + return nil + } + value := reflect.ValueOf(OrderCapacity) + for idx := 0; idx < value.NumField(); idx++ { + if o == value.Field(idx).Interface() { + return nil + } + } + return fmt.Errorf("Range check failed on OrderCapacity, unknown enumeration value %d", o) +} + +func (*OrderCapacityEnum) EncodedLength() int64 { + return 1 +} + +func (*OrderCapacityEnum) PrincipalSinceVersion() uint16 { + return 0 +} + +func (o *OrderCapacityEnum) PrincipalInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.PrincipalSinceVersion() +} + +func (*OrderCapacityEnum) PrincipalDeprecated() uint16 { + return 0 +} + +func (*OrderCapacityEnum) AgencySinceVersion() uint16 { + return 0 +} + +func (o *OrderCapacityEnum) AgencyInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.AgencySinceVersion() +} + +func (*OrderCapacityEnum) AgencyDeprecated() uint16 { + return 0 +} + +func (*OrderCapacityEnum) NonRepresentableSinceVersion() uint16 { + return 0 +} + +func (o *OrderCapacityEnum) NonRepresentableInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.NonRepresentableSinceVersion() +} + +func (*OrderCapacityEnum) NonRepresentableDeprecated() uint16 { + return 0 +} diff --git a/v2/sbe/spot_3_1/OrderListResponse.go b/v2/sbe/spot_3_1/OrderListResponse.go new file mode 100644 index 00000000..4a66f0ec --- /dev/null +++ b/v2/sbe/spot_3_1/OrderListResponse.go @@ -0,0 +1,684 @@ +// Generated SBE (Simple Binary Encoding) message codec + +package sbe + +import ( + "errors" + "fmt" + "io" + "io/ioutil" + "math" + "unicode/utf8" +) + +type OrderListResponse struct { + OrderListId int64 + ContingencyType ContingencyTypeEnum + ListStatusType ListStatusTypeEnum + ListOrderStatus ListOrderStatusEnum + TransactionTime int64 + Orders []OrderListResponseOrders + ListClientOrderId []uint8 + Symbol []uint8 +} +type OrderListResponseOrders struct { + OrderId int64 + Symbol []uint8 + ClientOrderId []uint8 +} + +func (o *OrderListResponse) Encode(_m *SbeGoMarshaller, _w io.Writer, doRangeCheck bool) error { + if doRangeCheck { + if err := o.RangeCheck(o.SbeSchemaVersion(), o.SbeSchemaVersion()); err != nil { + return err + } + } + if err := _m.WriteInt64(_w, o.OrderListId); err != nil { + return err + } + if err := o.ContingencyType.Encode(_m, _w); err != nil { + return err + } + if err := o.ListStatusType.Encode(_m, _w); err != nil { + return err + } + if err := o.ListOrderStatus.Encode(_m, _w); err != nil { + return err + } + if err := _m.WriteInt64(_w, o.TransactionTime); err != nil { + return err + } + var OrdersBlockLength uint16 = 8 + if err := _m.WriteUint16(_w, OrdersBlockLength); err != nil { + return err + } + var OrdersNumInGroup uint16 = uint16(len(o.Orders)) + if err := _m.WriteUint16(_w, OrdersNumInGroup); err != nil { + return err + } + for i := range o.Orders { + if err := o.Orders[i].Encode(_m, _w); err != nil { + return err + } + } + if err := _m.WriteUint8(_w, uint8(len(o.ListClientOrderId))); err != nil { + return err + } + if err := _m.WriteBytes(_w, o.ListClientOrderId); err != nil { + return err + } + if err := _m.WriteUint8(_w, uint8(len(o.Symbol))); err != nil { + return err + } + if err := _m.WriteBytes(_w, o.Symbol); err != nil { + return err + } + return nil +} + +func (o *OrderListResponse) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint16, doRangeCheck bool) error { + if !o.OrderListIdInActingVersion(actingVersion) { + o.OrderListId = o.OrderListIdNullValue() + } else { + if err := _m.ReadInt64(_r, &o.OrderListId); err != nil { + return err + } + } + if o.ContingencyTypeInActingVersion(actingVersion) { + if err := o.ContingencyType.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if o.ListStatusTypeInActingVersion(actingVersion) { + if err := o.ListStatusType.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if o.ListOrderStatusInActingVersion(actingVersion) { + if err := o.ListOrderStatus.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if !o.TransactionTimeInActingVersion(actingVersion) { + o.TransactionTime = o.TransactionTimeNullValue() + } else { + if err := _m.ReadInt64(_r, &o.TransactionTime); err != nil { + return err + } + } + if actingVersion > o.SbeSchemaVersion() && blockLength > o.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-o.SbeBlockLength())) + } + + if o.OrdersInActingVersion(actingVersion) { + var OrdersBlockLength uint16 + if err := _m.ReadUint16(_r, &OrdersBlockLength); err != nil { + return err + } + var OrdersNumInGroup uint16 + if err := _m.ReadUint16(_r, &OrdersNumInGroup); err != nil { + return err + } + if cap(o.Orders) < int(OrdersNumInGroup) { + o.Orders = make([]OrderListResponseOrders, OrdersNumInGroup) + } + o.Orders = o.Orders[:OrdersNumInGroup] + for i := range o.Orders { + if err := o.Orders[i].Decode(_m, _r, actingVersion, uint(OrdersBlockLength)); err != nil { + return err + } + } + } + + if o.ListClientOrderIdInActingVersion(actingVersion) { + var ListClientOrderIdLength uint8 + if err := _m.ReadUint8(_r, &ListClientOrderIdLength); err != nil { + return err + } + if cap(o.ListClientOrderId) < int(ListClientOrderIdLength) { + o.ListClientOrderId = make([]uint8, ListClientOrderIdLength) + } + o.ListClientOrderId = o.ListClientOrderId[:ListClientOrderIdLength] + if err := _m.ReadBytes(_r, o.ListClientOrderId); err != nil { + return err + } + } + + if o.SymbolInActingVersion(actingVersion) { + var SymbolLength uint8 + if err := _m.ReadUint8(_r, &SymbolLength); err != nil { + return err + } + if cap(o.Symbol) < int(SymbolLength) { + o.Symbol = make([]uint8, SymbolLength) + } + o.Symbol = o.Symbol[:SymbolLength] + if err := _m.ReadBytes(_r, o.Symbol); err != nil { + return err + } + } + if doRangeCheck { + if err := o.RangeCheck(actingVersion, o.SbeSchemaVersion()); err != nil { + return err + } + } + return nil +} + +func (o *OrderListResponse) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if o.OrderListIdInActingVersion(actingVersion) { + if o.OrderListId < o.OrderListIdMinValue() || o.OrderListId > o.OrderListIdMaxValue() { + return fmt.Errorf("Range check failed on o.OrderListId (%v < %v > %v)", o.OrderListIdMinValue(), o.OrderListId, o.OrderListIdMaxValue()) + } + } + if err := o.ContingencyType.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if err := o.ListStatusType.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if err := o.ListOrderStatus.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if o.TransactionTimeInActingVersion(actingVersion) { + if o.TransactionTime < o.TransactionTimeMinValue() || o.TransactionTime > o.TransactionTimeMaxValue() { + return fmt.Errorf("Range check failed on o.TransactionTime (%v < %v > %v)", o.TransactionTimeMinValue(), o.TransactionTime, o.TransactionTimeMaxValue()) + } + } + for i := range o.Orders { + if err := o.Orders[i].RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + } + if !utf8.Valid(o.ListClientOrderId[:]) { + return errors.New("o.ListClientOrderId failed UTF-8 validation") + } + if !utf8.Valid(o.Symbol[:]) { + return errors.New("o.Symbol failed UTF-8 validation") + } + return nil +} + +func OrderListResponseInit(o *OrderListResponse) { + return +} + +func (o *OrderListResponseOrders) Encode(_m *SbeGoMarshaller, _w io.Writer) error { + if err := _m.WriteInt64(_w, o.OrderId); err != nil { + return err + } + if err := _m.WriteUint8(_w, uint8(len(o.Symbol))); err != nil { + return err + } + if err := _m.WriteBytes(_w, o.Symbol); err != nil { + return err + } + if err := _m.WriteUint8(_w, uint8(len(o.ClientOrderId))); err != nil { + return err + } + if err := _m.WriteBytes(_w, o.ClientOrderId); err != nil { + return err + } + return nil +} + +func (o *OrderListResponseOrders) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint) error { + if !o.OrderIdInActingVersion(actingVersion) { + o.OrderId = o.OrderIdNullValue() + } else { + if err := _m.ReadInt64(_r, &o.OrderId); err != nil { + return err + } + } + if actingVersion > o.SbeSchemaVersion() && blockLength > o.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-o.SbeBlockLength())) + } + + if o.SymbolInActingVersion(actingVersion) { + var SymbolLength uint8 + if err := _m.ReadUint8(_r, &SymbolLength); err != nil { + return err + } + if cap(o.Symbol) < int(SymbolLength) { + o.Symbol = make([]uint8, SymbolLength) + } + o.Symbol = o.Symbol[:SymbolLength] + if err := _m.ReadBytes(_r, o.Symbol); err != nil { + return err + } + } + + if o.ClientOrderIdInActingVersion(actingVersion) { + var ClientOrderIdLength uint8 + if err := _m.ReadUint8(_r, &ClientOrderIdLength); err != nil { + return err + } + if cap(o.ClientOrderId) < int(ClientOrderIdLength) { + o.ClientOrderId = make([]uint8, ClientOrderIdLength) + } + o.ClientOrderId = o.ClientOrderId[:ClientOrderIdLength] + if err := _m.ReadBytes(_r, o.ClientOrderId); err != nil { + return err + } + } + return nil +} + +func (o *OrderListResponseOrders) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if o.OrderIdInActingVersion(actingVersion) { + if o.OrderId < o.OrderIdMinValue() || o.OrderId > o.OrderIdMaxValue() { + return fmt.Errorf("Range check failed on o.OrderId (%v < %v > %v)", o.OrderIdMinValue(), o.OrderId, o.OrderIdMaxValue()) + } + } + if !utf8.Valid(o.Symbol[:]) { + return errors.New("o.Symbol failed UTF-8 validation") + } + if !utf8.Valid(o.ClientOrderId[:]) { + return errors.New("o.ClientOrderId failed UTF-8 validation") + } + return nil +} + +func OrderListResponseOrdersInit(o *OrderListResponseOrders) { + return +} + +func (*OrderListResponse) SbeBlockLength() (blockLength uint16) { + return 19 +} + +func (*OrderListResponse) SbeTemplateId() (templateId uint16) { + return 313 +} + +func (*OrderListResponse) SbeSchemaId() (schemaId uint16) { + return 3 +} + +func (*OrderListResponse) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} + +func (*OrderListResponse) SbeSemanticType() (semanticType []byte) { + return []byte("") +} + +func (*OrderListResponse) SbeSemanticVersion() (semanticVersion string) { + return "5.2" +} + +func (*OrderListResponse) OrderListIdId() uint16 { + return 1 +} + +func (*OrderListResponse) OrderListIdSinceVersion() uint16 { + return 0 +} + +func (o *OrderListResponse) OrderListIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.OrderListIdSinceVersion() +} + +func (*OrderListResponse) OrderListIdDeprecated() uint16 { + return 0 +} + +func (*OrderListResponse) OrderListIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrderListResponse) OrderListIdMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*OrderListResponse) OrderListIdMaxValue() int64 { + return math.MaxInt64 +} + +func (*OrderListResponse) OrderListIdNullValue() int64 { + return math.MinInt64 +} + +func (*OrderListResponse) ContingencyTypeId() uint16 { + return 2 +} + +func (*OrderListResponse) ContingencyTypeSinceVersion() uint16 { + return 0 +} + +func (o *OrderListResponse) ContingencyTypeInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.ContingencyTypeSinceVersion() +} + +func (*OrderListResponse) ContingencyTypeDeprecated() uint16 { + return 0 +} + +func (*OrderListResponse) ContingencyTypeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrderListResponse) ListStatusTypeId() uint16 { + return 3 +} + +func (*OrderListResponse) ListStatusTypeSinceVersion() uint16 { + return 0 +} + +func (o *OrderListResponse) ListStatusTypeInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.ListStatusTypeSinceVersion() +} + +func (*OrderListResponse) ListStatusTypeDeprecated() uint16 { + return 0 +} + +func (*OrderListResponse) ListStatusTypeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrderListResponse) ListOrderStatusId() uint16 { + return 4 +} + +func (*OrderListResponse) ListOrderStatusSinceVersion() uint16 { + return 0 +} + +func (o *OrderListResponse) ListOrderStatusInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.ListOrderStatusSinceVersion() +} + +func (*OrderListResponse) ListOrderStatusDeprecated() uint16 { + return 0 +} + +func (*OrderListResponse) ListOrderStatusMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrderListResponse) TransactionTimeId() uint16 { + return 5 +} + +func (*OrderListResponse) TransactionTimeSinceVersion() uint16 { + return 0 +} + +func (o *OrderListResponse) TransactionTimeInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.TransactionTimeSinceVersion() +} + +func (*OrderListResponse) TransactionTimeDeprecated() uint16 { + return 0 +} + +func (*OrderListResponse) TransactionTimeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrderListResponse) TransactionTimeMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*OrderListResponse) TransactionTimeMaxValue() int64 { + return math.MaxInt64 +} + +func (*OrderListResponse) TransactionTimeNullValue() int64 { + return math.MinInt64 +} + +func (*OrderListResponseOrders) OrderIdId() uint16 { + return 1 +} + +func (*OrderListResponseOrders) OrderIdSinceVersion() uint16 { + return 0 +} + +func (o *OrderListResponseOrders) OrderIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.OrderIdSinceVersion() +} + +func (*OrderListResponseOrders) OrderIdDeprecated() uint16 { + return 0 +} + +func (*OrderListResponseOrders) OrderIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrderListResponseOrders) OrderIdMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*OrderListResponseOrders) OrderIdMaxValue() int64 { + return math.MaxInt64 +} + +func (*OrderListResponseOrders) OrderIdNullValue() int64 { + return math.MinInt64 +} + +func (*OrderListResponseOrders) SymbolMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrderListResponseOrders) SymbolSinceVersion() uint16 { + return 0 +} + +func (o *OrderListResponseOrders) SymbolInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.SymbolSinceVersion() +} + +func (*OrderListResponseOrders) SymbolDeprecated() uint16 { + return 0 +} + +func (OrderListResponseOrders) SymbolCharacterEncoding() string { + return "UTF-8" +} + +func (OrderListResponseOrders) SymbolHeaderLength() uint64 { + return 1 +} + +func (*OrderListResponseOrders) ClientOrderIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrderListResponseOrders) ClientOrderIdSinceVersion() uint16 { + return 0 +} + +func (o *OrderListResponseOrders) ClientOrderIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.ClientOrderIdSinceVersion() +} + +func (*OrderListResponseOrders) ClientOrderIdDeprecated() uint16 { + return 0 +} + +func (OrderListResponseOrders) ClientOrderIdCharacterEncoding() string { + return "UTF-8" +} + +func (OrderListResponseOrders) ClientOrderIdHeaderLength() uint64 { + return 1 +} + +func (*OrderListResponse) OrdersId() uint16 { + return 100 +} + +func (*OrderListResponse) OrdersSinceVersion() uint16 { + return 0 +} + +func (o *OrderListResponse) OrdersInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.OrdersSinceVersion() +} + +func (*OrderListResponse) OrdersDeprecated() uint16 { + return 0 +} + +func (*OrderListResponseOrders) SbeBlockLength() (blockLength uint) { + return 8 +} + +func (*OrderListResponseOrders) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} + +func (*OrderListResponse) ListClientOrderIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrderListResponse) ListClientOrderIdSinceVersion() uint16 { + return 0 +} + +func (o *OrderListResponse) ListClientOrderIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.ListClientOrderIdSinceVersion() +} + +func (*OrderListResponse) ListClientOrderIdDeprecated() uint16 { + return 0 +} + +func (OrderListResponse) ListClientOrderIdCharacterEncoding() string { + return "UTF-8" +} + +func (OrderListResponse) ListClientOrderIdHeaderLength() uint64 { + return 1 +} + +func (*OrderListResponse) SymbolMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrderListResponse) SymbolSinceVersion() uint16 { + return 0 +} + +func (o *OrderListResponse) SymbolInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.SymbolSinceVersion() +} + +func (*OrderListResponse) SymbolDeprecated() uint16 { + return 0 +} + +func (OrderListResponse) SymbolCharacterEncoding() string { + return "UTF-8" +} + +func (OrderListResponse) SymbolHeaderLength() uint64 { + return 1 +} diff --git a/v2/sbe/spot_3_1/OrderListsResponse.go b/v2/sbe/spot_3_1/OrderListsResponse.go new file mode 100644 index 00000000..4c078cca --- /dev/null +++ b/v2/sbe/spot_3_1/OrderListsResponse.go @@ -0,0 +1,768 @@ +// Generated SBE (Simple Binary Encoding) message codec + +package sbe + +import ( + "errors" + "fmt" + "io" + "io/ioutil" + "math" + "unicode/utf8" +) + +type OrderListsResponse struct { + OrderLists []OrderListsResponseOrderLists +} +type OrderListsResponseOrderLists struct { + OrderListId int64 + ContingencyType ContingencyTypeEnum + ListStatusType ListStatusTypeEnum + ListOrderStatus ListOrderStatusEnum + TransactionTime int64 + Orders []OrderListsResponseOrderListsOrders + ListClientOrderId []uint8 + Symbol []uint8 +} +type OrderListsResponseOrderListsOrders struct { + OrderId int64 + Symbol []uint8 + ClientOrderId []uint8 +} + +func (o *OrderListsResponse) Encode(_m *SbeGoMarshaller, _w io.Writer, doRangeCheck bool) error { + if doRangeCheck { + if err := o.RangeCheck(o.SbeSchemaVersion(), o.SbeSchemaVersion()); err != nil { + return err + } + } + var OrderListsBlockLength uint16 = 19 + if err := _m.WriteUint16(_w, OrderListsBlockLength); err != nil { + return err + } + var OrderListsNumInGroup uint32 = uint32(len(o.OrderLists)) + if err := _m.WriteUint32(_w, OrderListsNumInGroup); err != nil { + return err + } + for i := range o.OrderLists { + if err := o.OrderLists[i].Encode(_m, _w); err != nil { + return err + } + } + return nil +} + +func (o *OrderListsResponse) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint16, doRangeCheck bool) error { + if actingVersion > o.SbeSchemaVersion() && blockLength > o.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-o.SbeBlockLength())) + } + + if o.OrderListsInActingVersion(actingVersion) { + var OrderListsBlockLength uint16 + if err := _m.ReadUint16(_r, &OrderListsBlockLength); err != nil { + return err + } + var OrderListsNumInGroup uint32 + if err := _m.ReadUint32(_r, &OrderListsNumInGroup); err != nil { + return err + } + if cap(o.OrderLists) < int(OrderListsNumInGroup) { + o.OrderLists = make([]OrderListsResponseOrderLists, OrderListsNumInGroup) + } + o.OrderLists = o.OrderLists[:OrderListsNumInGroup] + for i := range o.OrderLists { + if err := o.OrderLists[i].Decode(_m, _r, actingVersion, uint(OrderListsBlockLength)); err != nil { + return err + } + } + } + if doRangeCheck { + if err := o.RangeCheck(actingVersion, o.SbeSchemaVersion()); err != nil { + return err + } + } + return nil +} + +func (o *OrderListsResponse) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + for i := range o.OrderLists { + if err := o.OrderLists[i].RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + } + return nil +} + +func OrderListsResponseInit(o *OrderListsResponse) { + return +} + +func (o *OrderListsResponseOrderLists) Encode(_m *SbeGoMarshaller, _w io.Writer) error { + if err := _m.WriteInt64(_w, o.OrderListId); err != nil { + return err + } + if err := o.ContingencyType.Encode(_m, _w); err != nil { + return err + } + if err := o.ListStatusType.Encode(_m, _w); err != nil { + return err + } + if err := o.ListOrderStatus.Encode(_m, _w); err != nil { + return err + } + if err := _m.WriteInt64(_w, o.TransactionTime); err != nil { + return err + } + var OrdersBlockLength uint16 = 8 + if err := _m.WriteUint16(_w, OrdersBlockLength); err != nil { + return err + } + var OrdersNumInGroup uint32 = uint32(len(o.Orders)) + if err := _m.WriteUint32(_w, OrdersNumInGroup); err != nil { + return err + } + for i := range o.Orders { + if err := o.Orders[i].Encode(_m, _w); err != nil { + return err + } + } + if err := _m.WriteUint8(_w, uint8(len(o.ListClientOrderId))); err != nil { + return err + } + if err := _m.WriteBytes(_w, o.ListClientOrderId); err != nil { + return err + } + if err := _m.WriteUint8(_w, uint8(len(o.Symbol))); err != nil { + return err + } + if err := _m.WriteBytes(_w, o.Symbol); err != nil { + return err + } + return nil +} + +func (o *OrderListsResponseOrderLists) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint) error { + if !o.OrderListIdInActingVersion(actingVersion) { + o.OrderListId = o.OrderListIdNullValue() + } else { + if err := _m.ReadInt64(_r, &o.OrderListId); err != nil { + return err + } + } + if o.ContingencyTypeInActingVersion(actingVersion) { + if err := o.ContingencyType.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if o.ListStatusTypeInActingVersion(actingVersion) { + if err := o.ListStatusType.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if o.ListOrderStatusInActingVersion(actingVersion) { + if err := o.ListOrderStatus.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if !o.TransactionTimeInActingVersion(actingVersion) { + o.TransactionTime = o.TransactionTimeNullValue() + } else { + if err := _m.ReadInt64(_r, &o.TransactionTime); err != nil { + return err + } + } + if actingVersion > o.SbeSchemaVersion() && blockLength > o.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-o.SbeBlockLength())) + } + + if o.OrdersInActingVersion(actingVersion) { + var OrdersBlockLength uint16 + if err := _m.ReadUint16(_r, &OrdersBlockLength); err != nil { + return err + } + var OrdersNumInGroup uint32 + if err := _m.ReadUint32(_r, &OrdersNumInGroup); err != nil { + return err + } + if cap(o.Orders) < int(OrdersNumInGroup) { + o.Orders = make([]OrderListsResponseOrderListsOrders, OrdersNumInGroup) + } + o.Orders = o.Orders[:OrdersNumInGroup] + for i := range o.Orders { + if err := o.Orders[i].Decode(_m, _r, actingVersion, uint(OrdersBlockLength)); err != nil { + return err + } + } + } + + if o.ListClientOrderIdInActingVersion(actingVersion) { + var ListClientOrderIdLength uint8 + if err := _m.ReadUint8(_r, &ListClientOrderIdLength); err != nil { + return err + } + if cap(o.ListClientOrderId) < int(ListClientOrderIdLength) { + o.ListClientOrderId = make([]uint8, ListClientOrderIdLength) + } + o.ListClientOrderId = o.ListClientOrderId[:ListClientOrderIdLength] + if err := _m.ReadBytes(_r, o.ListClientOrderId); err != nil { + return err + } + } + + if o.SymbolInActingVersion(actingVersion) { + var SymbolLength uint8 + if err := _m.ReadUint8(_r, &SymbolLength); err != nil { + return err + } + if cap(o.Symbol) < int(SymbolLength) { + o.Symbol = make([]uint8, SymbolLength) + } + o.Symbol = o.Symbol[:SymbolLength] + if err := _m.ReadBytes(_r, o.Symbol); err != nil { + return err + } + } + return nil +} + +func (o *OrderListsResponseOrderLists) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if o.OrderListIdInActingVersion(actingVersion) { + if o.OrderListId < o.OrderListIdMinValue() || o.OrderListId > o.OrderListIdMaxValue() { + return fmt.Errorf("Range check failed on o.OrderListId (%v < %v > %v)", o.OrderListIdMinValue(), o.OrderListId, o.OrderListIdMaxValue()) + } + } + if err := o.ContingencyType.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if err := o.ListStatusType.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if err := o.ListOrderStatus.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if o.TransactionTimeInActingVersion(actingVersion) { + if o.TransactionTime < o.TransactionTimeMinValue() || o.TransactionTime > o.TransactionTimeMaxValue() { + return fmt.Errorf("Range check failed on o.TransactionTime (%v < %v > %v)", o.TransactionTimeMinValue(), o.TransactionTime, o.TransactionTimeMaxValue()) + } + } + for i := range o.Orders { + if err := o.Orders[i].RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + } + if !utf8.Valid(o.ListClientOrderId[:]) { + return errors.New("o.ListClientOrderId failed UTF-8 validation") + } + if !utf8.Valid(o.Symbol[:]) { + return errors.New("o.Symbol failed UTF-8 validation") + } + return nil +} + +func OrderListsResponseOrderListsInit(o *OrderListsResponseOrderLists) { + return +} + +func (o *OrderListsResponseOrderListsOrders) Encode(_m *SbeGoMarshaller, _w io.Writer) error { + if err := _m.WriteInt64(_w, o.OrderId); err != nil { + return err + } + if err := _m.WriteUint8(_w, uint8(len(o.Symbol))); err != nil { + return err + } + if err := _m.WriteBytes(_w, o.Symbol); err != nil { + return err + } + if err := _m.WriteUint8(_w, uint8(len(o.ClientOrderId))); err != nil { + return err + } + if err := _m.WriteBytes(_w, o.ClientOrderId); err != nil { + return err + } + return nil +} + +func (o *OrderListsResponseOrderListsOrders) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint) error { + if !o.OrderIdInActingVersion(actingVersion) { + o.OrderId = o.OrderIdNullValue() + } else { + if err := _m.ReadInt64(_r, &o.OrderId); err != nil { + return err + } + } + if actingVersion > o.SbeSchemaVersion() && blockLength > o.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-o.SbeBlockLength())) + } + + if o.SymbolInActingVersion(actingVersion) { + var SymbolLength uint8 + if err := _m.ReadUint8(_r, &SymbolLength); err != nil { + return err + } + if cap(o.Symbol) < int(SymbolLength) { + o.Symbol = make([]uint8, SymbolLength) + } + o.Symbol = o.Symbol[:SymbolLength] + if err := _m.ReadBytes(_r, o.Symbol); err != nil { + return err + } + } + + if o.ClientOrderIdInActingVersion(actingVersion) { + var ClientOrderIdLength uint8 + if err := _m.ReadUint8(_r, &ClientOrderIdLength); err != nil { + return err + } + if cap(o.ClientOrderId) < int(ClientOrderIdLength) { + o.ClientOrderId = make([]uint8, ClientOrderIdLength) + } + o.ClientOrderId = o.ClientOrderId[:ClientOrderIdLength] + if err := _m.ReadBytes(_r, o.ClientOrderId); err != nil { + return err + } + } + return nil +} + +func (o *OrderListsResponseOrderListsOrders) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if o.OrderIdInActingVersion(actingVersion) { + if o.OrderId < o.OrderIdMinValue() || o.OrderId > o.OrderIdMaxValue() { + return fmt.Errorf("Range check failed on o.OrderId (%v < %v > %v)", o.OrderIdMinValue(), o.OrderId, o.OrderIdMaxValue()) + } + } + if !utf8.Valid(o.Symbol[:]) { + return errors.New("o.Symbol failed UTF-8 validation") + } + if !utf8.Valid(o.ClientOrderId[:]) { + return errors.New("o.ClientOrderId failed UTF-8 validation") + } + return nil +} + +func OrderListsResponseOrderListsOrdersInit(o *OrderListsResponseOrderListsOrders) { + return +} + +func (*OrderListsResponse) SbeBlockLength() (blockLength uint16) { + return 0 +} + +func (*OrderListsResponse) SbeTemplateId() (templateId uint16) { + return 314 +} + +func (*OrderListsResponse) SbeSchemaId() (schemaId uint16) { + return 3 +} + +func (*OrderListsResponse) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} + +func (*OrderListsResponse) SbeSemanticType() (semanticType []byte) { + return []byte("") +} + +func (*OrderListsResponse) SbeSemanticVersion() (semanticVersion string) { + return "5.2" +} + +func (*OrderListsResponseOrderLists) OrderListIdId() uint16 { + return 1 +} + +func (*OrderListsResponseOrderLists) OrderListIdSinceVersion() uint16 { + return 0 +} + +func (o *OrderListsResponseOrderLists) OrderListIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.OrderListIdSinceVersion() +} + +func (*OrderListsResponseOrderLists) OrderListIdDeprecated() uint16 { + return 0 +} + +func (*OrderListsResponseOrderLists) OrderListIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrderListsResponseOrderLists) OrderListIdMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*OrderListsResponseOrderLists) OrderListIdMaxValue() int64 { + return math.MaxInt64 +} + +func (*OrderListsResponseOrderLists) OrderListIdNullValue() int64 { + return math.MinInt64 +} + +func (*OrderListsResponseOrderLists) ContingencyTypeId() uint16 { + return 2 +} + +func (*OrderListsResponseOrderLists) ContingencyTypeSinceVersion() uint16 { + return 0 +} + +func (o *OrderListsResponseOrderLists) ContingencyTypeInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.ContingencyTypeSinceVersion() +} + +func (*OrderListsResponseOrderLists) ContingencyTypeDeprecated() uint16 { + return 0 +} + +func (*OrderListsResponseOrderLists) ContingencyTypeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrderListsResponseOrderLists) ListStatusTypeId() uint16 { + return 3 +} + +func (*OrderListsResponseOrderLists) ListStatusTypeSinceVersion() uint16 { + return 0 +} + +func (o *OrderListsResponseOrderLists) ListStatusTypeInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.ListStatusTypeSinceVersion() +} + +func (*OrderListsResponseOrderLists) ListStatusTypeDeprecated() uint16 { + return 0 +} + +func (*OrderListsResponseOrderLists) ListStatusTypeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrderListsResponseOrderLists) ListOrderStatusId() uint16 { + return 4 +} + +func (*OrderListsResponseOrderLists) ListOrderStatusSinceVersion() uint16 { + return 0 +} + +func (o *OrderListsResponseOrderLists) ListOrderStatusInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.ListOrderStatusSinceVersion() +} + +func (*OrderListsResponseOrderLists) ListOrderStatusDeprecated() uint16 { + return 0 +} + +func (*OrderListsResponseOrderLists) ListOrderStatusMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrderListsResponseOrderLists) TransactionTimeId() uint16 { + return 5 +} + +func (*OrderListsResponseOrderLists) TransactionTimeSinceVersion() uint16 { + return 0 +} + +func (o *OrderListsResponseOrderLists) TransactionTimeInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.TransactionTimeSinceVersion() +} + +func (*OrderListsResponseOrderLists) TransactionTimeDeprecated() uint16 { + return 0 +} + +func (*OrderListsResponseOrderLists) TransactionTimeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrderListsResponseOrderLists) TransactionTimeMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*OrderListsResponseOrderLists) TransactionTimeMaxValue() int64 { + return math.MaxInt64 +} + +func (*OrderListsResponseOrderLists) TransactionTimeNullValue() int64 { + return math.MinInt64 +} + +func (*OrderListsResponseOrderListsOrders) OrderIdId() uint16 { + return 1 +} + +func (*OrderListsResponseOrderListsOrders) OrderIdSinceVersion() uint16 { + return 0 +} + +func (o *OrderListsResponseOrderListsOrders) OrderIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.OrderIdSinceVersion() +} + +func (*OrderListsResponseOrderListsOrders) OrderIdDeprecated() uint16 { + return 0 +} + +func (*OrderListsResponseOrderListsOrders) OrderIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrderListsResponseOrderListsOrders) OrderIdMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*OrderListsResponseOrderListsOrders) OrderIdMaxValue() int64 { + return math.MaxInt64 +} + +func (*OrderListsResponseOrderListsOrders) OrderIdNullValue() int64 { + return math.MinInt64 +} + +func (*OrderListsResponseOrderListsOrders) SymbolMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrderListsResponseOrderListsOrders) SymbolSinceVersion() uint16 { + return 0 +} + +func (o *OrderListsResponseOrderListsOrders) SymbolInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.SymbolSinceVersion() +} + +func (*OrderListsResponseOrderListsOrders) SymbolDeprecated() uint16 { + return 0 +} + +func (OrderListsResponseOrderListsOrders) SymbolCharacterEncoding() string { + return "UTF-8" +} + +func (OrderListsResponseOrderListsOrders) SymbolHeaderLength() uint64 { + return 1 +} + +func (*OrderListsResponseOrderListsOrders) ClientOrderIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrderListsResponseOrderListsOrders) ClientOrderIdSinceVersion() uint16 { + return 0 +} + +func (o *OrderListsResponseOrderListsOrders) ClientOrderIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.ClientOrderIdSinceVersion() +} + +func (*OrderListsResponseOrderListsOrders) ClientOrderIdDeprecated() uint16 { + return 0 +} + +func (OrderListsResponseOrderListsOrders) ClientOrderIdCharacterEncoding() string { + return "UTF-8" +} + +func (OrderListsResponseOrderListsOrders) ClientOrderIdHeaderLength() uint64 { + return 1 +} + +func (*OrderListsResponseOrderLists) ListClientOrderIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrderListsResponseOrderLists) ListClientOrderIdSinceVersion() uint16 { + return 0 +} + +func (o *OrderListsResponseOrderLists) ListClientOrderIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.ListClientOrderIdSinceVersion() +} + +func (*OrderListsResponseOrderLists) ListClientOrderIdDeprecated() uint16 { + return 0 +} + +func (OrderListsResponseOrderLists) ListClientOrderIdCharacterEncoding() string { + return "UTF-8" +} + +func (OrderListsResponseOrderLists) ListClientOrderIdHeaderLength() uint64 { + return 1 +} + +func (*OrderListsResponseOrderLists) SymbolMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrderListsResponseOrderLists) SymbolSinceVersion() uint16 { + return 0 +} + +func (o *OrderListsResponseOrderLists) SymbolInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.SymbolSinceVersion() +} + +func (*OrderListsResponseOrderLists) SymbolDeprecated() uint16 { + return 0 +} + +func (OrderListsResponseOrderLists) SymbolCharacterEncoding() string { + return "UTF-8" +} + +func (OrderListsResponseOrderLists) SymbolHeaderLength() uint64 { + return 1 +} + +func (*OrderListsResponse) OrderListsId() uint16 { + return 100 +} + +func (*OrderListsResponse) OrderListsSinceVersion() uint16 { + return 0 +} + +func (o *OrderListsResponse) OrderListsInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.OrderListsSinceVersion() +} + +func (*OrderListsResponse) OrderListsDeprecated() uint16 { + return 0 +} + +func (*OrderListsResponseOrderLists) SbeBlockLength() (blockLength uint) { + return 19 +} + +func (*OrderListsResponseOrderLists) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} + +func (*OrderListsResponseOrderLists) OrdersId() uint16 { + return 100 +} + +func (*OrderListsResponseOrderLists) OrdersSinceVersion() uint16 { + return 0 +} + +func (o *OrderListsResponseOrderLists) OrdersInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.OrdersSinceVersion() +} + +func (*OrderListsResponseOrderLists) OrdersDeprecated() uint16 { + return 0 +} + +func (*OrderListsResponseOrderListsOrders) SbeBlockLength() (blockLength uint) { + return 8 +} + +func (*OrderListsResponseOrderListsOrders) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} diff --git a/v2/sbe/spot_3_1/OrderResponse.go b/v2/sbe/spot_3_1/OrderResponse.go new file mode 100644 index 00000000..1c7e40b4 --- /dev/null +++ b/v2/sbe/spot_3_1/OrderResponse.go @@ -0,0 +1,1933 @@ +// Generated SBE (Simple Binary Encoding) message codec + +package sbe + +import ( + "errors" + "fmt" + "io" + "io/ioutil" + "math" + "unicode/utf8" +) + +type OrderResponse struct { + PriceExponent int8 + QtyExponent int8 + OrderId int64 + OrderListId int64 + Price int64 + OrigQty int64 + ExecutedQty int64 + CummulativeQuoteQty int64 + Status OrderStatusEnum + TimeInForce TimeInForceEnum + OrderType OrderTypeEnum + Side OrderSideEnum + StopPrice int64 + TrailingDelta int64 + TrailingTime int64 + IcebergQty int64 + Time int64 + UpdateTime int64 + IsWorking BoolEnumEnum + WorkingTime int64 + OrigQuoteOrderQty int64 + StrategyId int64 + StrategyType int32 + OrderCapacity OrderCapacityEnum + WorkingFloor FloorEnum + SelfTradePreventionMode SelfTradePreventionModeEnum + PreventedMatchId int64 + PreventedQuantity int64 + UsedSor BoolEnumEnum + PegPriceType PegPriceTypeEnum + PegOffsetType PegOffsetTypeEnum + PegOffsetValue uint8 + PeggedPrice int64 + Symbol []uint8 + ClientOrderId []uint8 +} + +func (o *OrderResponse) Encode(_m *SbeGoMarshaller, _w io.Writer, doRangeCheck bool) error { + if doRangeCheck { + if err := o.RangeCheck(o.SbeSchemaVersion(), o.SbeSchemaVersion()); err != nil { + return err + } + } + if err := _m.WriteInt8(_w, o.PriceExponent); err != nil { + return err + } + if err := _m.WriteInt8(_w, o.QtyExponent); err != nil { + return err + } + if err := _m.WriteInt64(_w, o.OrderId); err != nil { + return err + } + if err := _m.WriteInt64(_w, o.OrderListId); err != nil { + return err + } + if err := _m.WriteInt64(_w, o.Price); err != nil { + return err + } + if err := _m.WriteInt64(_w, o.OrigQty); err != nil { + return err + } + if err := _m.WriteInt64(_w, o.ExecutedQty); err != nil { + return err + } + if err := _m.WriteInt64(_w, o.CummulativeQuoteQty); err != nil { + return err + } + if err := o.Status.Encode(_m, _w); err != nil { + return err + } + if err := o.TimeInForce.Encode(_m, _w); err != nil { + return err + } + if err := o.OrderType.Encode(_m, _w); err != nil { + return err + } + if err := o.Side.Encode(_m, _w); err != nil { + return err + } + if err := _m.WriteInt64(_w, o.StopPrice); err != nil { + return err + } + if err := _m.WriteInt64(_w, o.TrailingDelta); err != nil { + return err + } + if err := _m.WriteInt64(_w, o.TrailingTime); err != nil { + return err + } + if err := _m.WriteInt64(_w, o.IcebergQty); err != nil { + return err + } + if err := _m.WriteInt64(_w, o.Time); err != nil { + return err + } + if err := _m.WriteInt64(_w, o.UpdateTime); err != nil { + return err + } + if err := o.IsWorking.Encode(_m, _w); err != nil { + return err + } + if err := _m.WriteInt64(_w, o.WorkingTime); err != nil { + return err + } + if err := _m.WriteInt64(_w, o.OrigQuoteOrderQty); err != nil { + return err + } + if err := _m.WriteInt64(_w, o.StrategyId); err != nil { + return err + } + if err := _m.WriteInt32(_w, o.StrategyType); err != nil { + return err + } + if err := o.OrderCapacity.Encode(_m, _w); err != nil { + return err + } + if err := o.WorkingFloor.Encode(_m, _w); err != nil { + return err + } + if err := o.SelfTradePreventionMode.Encode(_m, _w); err != nil { + return err + } + if err := _m.WriteInt64(_w, o.PreventedMatchId); err != nil { + return err + } + if err := _m.WriteInt64(_w, o.PreventedQuantity); err != nil { + return err + } + if err := o.UsedSor.Encode(_m, _w); err != nil { + return err + } + if err := o.PegPriceType.Encode(_m, _w); err != nil { + return err + } + if err := o.PegOffsetType.Encode(_m, _w); err != nil { + return err + } + if err := _m.WriteUint8(_w, o.PegOffsetValue); err != nil { + return err + } + if err := _m.WriteInt64(_w, o.PeggedPrice); err != nil { + return err + } + if err := _m.WriteUint8(_w, uint8(len(o.Symbol))); err != nil { + return err + } + if err := _m.WriteBytes(_w, o.Symbol); err != nil { + return err + } + if err := _m.WriteUint8(_w, uint8(len(o.ClientOrderId))); err != nil { + return err + } + if err := _m.WriteBytes(_w, o.ClientOrderId); err != nil { + return err + } + return nil +} + +func (o *OrderResponse) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint16, doRangeCheck bool) error { + if !o.PriceExponentInActingVersion(actingVersion) { + o.PriceExponent = o.PriceExponentNullValue() + } else { + if err := _m.ReadInt8(_r, &o.PriceExponent); err != nil { + return err + } + } + if !o.QtyExponentInActingVersion(actingVersion) { + o.QtyExponent = o.QtyExponentNullValue() + } else { + if err := _m.ReadInt8(_r, &o.QtyExponent); err != nil { + return err + } + } + if !o.OrderIdInActingVersion(actingVersion) { + o.OrderId = o.OrderIdNullValue() + } else { + if err := _m.ReadInt64(_r, &o.OrderId); err != nil { + return err + } + } + if !o.OrderListIdInActingVersion(actingVersion) { + o.OrderListId = o.OrderListIdNullValue() + } else { + if err := _m.ReadInt64(_r, &o.OrderListId); err != nil { + return err + } + } + if !o.PriceInActingVersion(actingVersion) { + o.Price = o.PriceNullValue() + } else { + if err := _m.ReadInt64(_r, &o.Price); err != nil { + return err + } + } + if !o.OrigQtyInActingVersion(actingVersion) { + o.OrigQty = o.OrigQtyNullValue() + } else { + if err := _m.ReadInt64(_r, &o.OrigQty); err != nil { + return err + } + } + if !o.ExecutedQtyInActingVersion(actingVersion) { + o.ExecutedQty = o.ExecutedQtyNullValue() + } else { + if err := _m.ReadInt64(_r, &o.ExecutedQty); err != nil { + return err + } + } + if !o.CummulativeQuoteQtyInActingVersion(actingVersion) { + o.CummulativeQuoteQty = o.CummulativeQuoteQtyNullValue() + } else { + if err := _m.ReadInt64(_r, &o.CummulativeQuoteQty); err != nil { + return err + } + } + if o.StatusInActingVersion(actingVersion) { + if err := o.Status.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if o.TimeInForceInActingVersion(actingVersion) { + if err := o.TimeInForce.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if o.OrderTypeInActingVersion(actingVersion) { + if err := o.OrderType.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if o.SideInActingVersion(actingVersion) { + if err := o.Side.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if !o.StopPriceInActingVersion(actingVersion) { + o.StopPrice = o.StopPriceNullValue() + } else { + if err := _m.ReadInt64(_r, &o.StopPrice); err != nil { + return err + } + } + if !o.TrailingDeltaInActingVersion(actingVersion) { + o.TrailingDelta = o.TrailingDeltaNullValue() + } else { + if err := _m.ReadInt64(_r, &o.TrailingDelta); err != nil { + return err + } + } + if !o.TrailingTimeInActingVersion(actingVersion) { + o.TrailingTime = o.TrailingTimeNullValue() + } else { + if err := _m.ReadInt64(_r, &o.TrailingTime); err != nil { + return err + } + } + if !o.IcebergQtyInActingVersion(actingVersion) { + o.IcebergQty = o.IcebergQtyNullValue() + } else { + if err := _m.ReadInt64(_r, &o.IcebergQty); err != nil { + return err + } + } + if !o.TimeInActingVersion(actingVersion) { + o.Time = o.TimeNullValue() + } else { + if err := _m.ReadInt64(_r, &o.Time); err != nil { + return err + } + } + if !o.UpdateTimeInActingVersion(actingVersion) { + o.UpdateTime = o.UpdateTimeNullValue() + } else { + if err := _m.ReadInt64(_r, &o.UpdateTime); err != nil { + return err + } + } + if o.IsWorkingInActingVersion(actingVersion) { + if err := o.IsWorking.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if !o.WorkingTimeInActingVersion(actingVersion) { + o.WorkingTime = o.WorkingTimeNullValue() + } else { + if err := _m.ReadInt64(_r, &o.WorkingTime); err != nil { + return err + } + } + if !o.OrigQuoteOrderQtyInActingVersion(actingVersion) { + o.OrigQuoteOrderQty = o.OrigQuoteOrderQtyNullValue() + } else { + if err := _m.ReadInt64(_r, &o.OrigQuoteOrderQty); err != nil { + return err + } + } + if !o.StrategyIdInActingVersion(actingVersion) { + o.StrategyId = o.StrategyIdNullValue() + } else { + if err := _m.ReadInt64(_r, &o.StrategyId); err != nil { + return err + } + } + if !o.StrategyTypeInActingVersion(actingVersion) { + o.StrategyType = o.StrategyTypeNullValue() + } else { + if err := _m.ReadInt32(_r, &o.StrategyType); err != nil { + return err + } + } + if o.OrderCapacityInActingVersion(actingVersion) { + if err := o.OrderCapacity.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if o.WorkingFloorInActingVersion(actingVersion) { + if err := o.WorkingFloor.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if o.SelfTradePreventionModeInActingVersion(actingVersion) { + if err := o.SelfTradePreventionMode.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if !o.PreventedMatchIdInActingVersion(actingVersion) { + o.PreventedMatchId = o.PreventedMatchIdNullValue() + } else { + if err := _m.ReadInt64(_r, &o.PreventedMatchId); err != nil { + return err + } + } + if !o.PreventedQuantityInActingVersion(actingVersion) { + o.PreventedQuantity = o.PreventedQuantityNullValue() + } else { + if err := _m.ReadInt64(_r, &o.PreventedQuantity); err != nil { + return err + } + } + if o.UsedSorInActingVersion(actingVersion) { + if err := o.UsedSor.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if o.PegPriceTypeInActingVersion(actingVersion) { + if err := o.PegPriceType.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if o.PegOffsetTypeInActingVersion(actingVersion) { + if err := o.PegOffsetType.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if !o.PegOffsetValueInActingVersion(actingVersion) { + o.PegOffsetValue = o.PegOffsetValueNullValue() + } else { + if err := _m.ReadUint8(_r, &o.PegOffsetValue); err != nil { + return err + } + } + if !o.PeggedPriceInActingVersion(actingVersion) { + o.PeggedPrice = o.PeggedPriceNullValue() + } else { + if err := _m.ReadInt64(_r, &o.PeggedPrice); err != nil { + return err + } + } + if actingVersion > o.SbeSchemaVersion() && blockLength > o.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-o.SbeBlockLength())) + } + + if o.SymbolInActingVersion(actingVersion) { + var SymbolLength uint8 + if err := _m.ReadUint8(_r, &SymbolLength); err != nil { + return err + } + if cap(o.Symbol) < int(SymbolLength) { + o.Symbol = make([]uint8, SymbolLength) + } + o.Symbol = o.Symbol[:SymbolLength] + if err := _m.ReadBytes(_r, o.Symbol); err != nil { + return err + } + } + + if o.ClientOrderIdInActingVersion(actingVersion) { + var ClientOrderIdLength uint8 + if err := _m.ReadUint8(_r, &ClientOrderIdLength); err != nil { + return err + } + if cap(o.ClientOrderId) < int(ClientOrderIdLength) { + o.ClientOrderId = make([]uint8, ClientOrderIdLength) + } + o.ClientOrderId = o.ClientOrderId[:ClientOrderIdLength] + if err := _m.ReadBytes(_r, o.ClientOrderId); err != nil { + return err + } + } + if doRangeCheck { + if err := o.RangeCheck(actingVersion, o.SbeSchemaVersion()); err != nil { + return err + } + } + return nil +} + +func (o *OrderResponse) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if o.PriceExponentInActingVersion(actingVersion) { + if o.PriceExponent < o.PriceExponentMinValue() || o.PriceExponent > o.PriceExponentMaxValue() { + return fmt.Errorf("Range check failed on o.PriceExponent (%v < %v > %v)", o.PriceExponentMinValue(), o.PriceExponent, o.PriceExponentMaxValue()) + } + } + if o.QtyExponentInActingVersion(actingVersion) { + if o.QtyExponent < o.QtyExponentMinValue() || o.QtyExponent > o.QtyExponentMaxValue() { + return fmt.Errorf("Range check failed on o.QtyExponent (%v < %v > %v)", o.QtyExponentMinValue(), o.QtyExponent, o.QtyExponentMaxValue()) + } + } + if o.OrderIdInActingVersion(actingVersion) { + if o.OrderId < o.OrderIdMinValue() || o.OrderId > o.OrderIdMaxValue() { + return fmt.Errorf("Range check failed on o.OrderId (%v < %v > %v)", o.OrderIdMinValue(), o.OrderId, o.OrderIdMaxValue()) + } + } + if o.OrderListIdInActingVersion(actingVersion) { + if o.OrderListId != o.OrderListIdNullValue() && (o.OrderListId < o.OrderListIdMinValue() || o.OrderListId > o.OrderListIdMaxValue()) { + return fmt.Errorf("Range check failed on o.OrderListId (%v < %v > %v)", o.OrderListIdMinValue(), o.OrderListId, o.OrderListIdMaxValue()) + } + } + if o.PriceInActingVersion(actingVersion) { + if o.Price < o.PriceMinValue() || o.Price > o.PriceMaxValue() { + return fmt.Errorf("Range check failed on o.Price (%v < %v > %v)", o.PriceMinValue(), o.Price, o.PriceMaxValue()) + } + } + if o.OrigQtyInActingVersion(actingVersion) { + if o.OrigQty < o.OrigQtyMinValue() || o.OrigQty > o.OrigQtyMaxValue() { + return fmt.Errorf("Range check failed on o.OrigQty (%v < %v > %v)", o.OrigQtyMinValue(), o.OrigQty, o.OrigQtyMaxValue()) + } + } + if o.ExecutedQtyInActingVersion(actingVersion) { + if o.ExecutedQty < o.ExecutedQtyMinValue() || o.ExecutedQty > o.ExecutedQtyMaxValue() { + return fmt.Errorf("Range check failed on o.ExecutedQty (%v < %v > %v)", o.ExecutedQtyMinValue(), o.ExecutedQty, o.ExecutedQtyMaxValue()) + } + } + if o.CummulativeQuoteQtyInActingVersion(actingVersion) { + if o.CummulativeQuoteQty < o.CummulativeQuoteQtyMinValue() || o.CummulativeQuoteQty > o.CummulativeQuoteQtyMaxValue() { + return fmt.Errorf("Range check failed on o.CummulativeQuoteQty (%v < %v > %v)", o.CummulativeQuoteQtyMinValue(), o.CummulativeQuoteQty, o.CummulativeQuoteQtyMaxValue()) + } + } + if err := o.Status.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if err := o.TimeInForce.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if err := o.OrderType.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if err := o.Side.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if o.StopPriceInActingVersion(actingVersion) { + if o.StopPrice != o.StopPriceNullValue() && (o.StopPrice < o.StopPriceMinValue() || o.StopPrice > o.StopPriceMaxValue()) { + return fmt.Errorf("Range check failed on o.StopPrice (%v < %v > %v)", o.StopPriceMinValue(), o.StopPrice, o.StopPriceMaxValue()) + } + } + if o.TrailingDeltaInActingVersion(actingVersion) { + if o.TrailingDelta != o.TrailingDeltaNullValue() && (o.TrailingDelta < o.TrailingDeltaMinValue() || o.TrailingDelta > o.TrailingDeltaMaxValue()) { + return fmt.Errorf("Range check failed on o.TrailingDelta (%v < %v > %v)", o.TrailingDeltaMinValue(), o.TrailingDelta, o.TrailingDeltaMaxValue()) + } + } + if o.TrailingTimeInActingVersion(actingVersion) { + if o.TrailingTime != o.TrailingTimeNullValue() && (o.TrailingTime < o.TrailingTimeMinValue() || o.TrailingTime > o.TrailingTimeMaxValue()) { + return fmt.Errorf("Range check failed on o.TrailingTime (%v < %v > %v)", o.TrailingTimeMinValue(), o.TrailingTime, o.TrailingTimeMaxValue()) + } + } + if o.IcebergQtyInActingVersion(actingVersion) { + if o.IcebergQty != o.IcebergQtyNullValue() && (o.IcebergQty < o.IcebergQtyMinValue() || o.IcebergQty > o.IcebergQtyMaxValue()) { + return fmt.Errorf("Range check failed on o.IcebergQty (%v < %v > %v)", o.IcebergQtyMinValue(), o.IcebergQty, o.IcebergQtyMaxValue()) + } + } + if o.TimeInActingVersion(actingVersion) { + if o.Time < o.TimeMinValue() || o.Time > o.TimeMaxValue() { + return fmt.Errorf("Range check failed on o.Time (%v < %v > %v)", o.TimeMinValue(), o.Time, o.TimeMaxValue()) + } + } + if o.UpdateTimeInActingVersion(actingVersion) { + if o.UpdateTime < o.UpdateTimeMinValue() || o.UpdateTime > o.UpdateTimeMaxValue() { + return fmt.Errorf("Range check failed on o.UpdateTime (%v < %v > %v)", o.UpdateTimeMinValue(), o.UpdateTime, o.UpdateTimeMaxValue()) + } + } + if err := o.IsWorking.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if o.WorkingTimeInActingVersion(actingVersion) { + if o.WorkingTime != o.WorkingTimeNullValue() && (o.WorkingTime < o.WorkingTimeMinValue() || o.WorkingTime > o.WorkingTimeMaxValue()) { + return fmt.Errorf("Range check failed on o.WorkingTime (%v < %v > %v)", o.WorkingTimeMinValue(), o.WorkingTime, o.WorkingTimeMaxValue()) + } + } + if o.OrigQuoteOrderQtyInActingVersion(actingVersion) { + if o.OrigQuoteOrderQty < o.OrigQuoteOrderQtyMinValue() || o.OrigQuoteOrderQty > o.OrigQuoteOrderQtyMaxValue() { + return fmt.Errorf("Range check failed on o.OrigQuoteOrderQty (%v < %v > %v)", o.OrigQuoteOrderQtyMinValue(), o.OrigQuoteOrderQty, o.OrigQuoteOrderQtyMaxValue()) + } + } + if o.StrategyIdInActingVersion(actingVersion) { + if o.StrategyId != o.StrategyIdNullValue() && (o.StrategyId < o.StrategyIdMinValue() || o.StrategyId > o.StrategyIdMaxValue()) { + return fmt.Errorf("Range check failed on o.StrategyId (%v < %v > %v)", o.StrategyIdMinValue(), o.StrategyId, o.StrategyIdMaxValue()) + } + } + if o.StrategyTypeInActingVersion(actingVersion) { + if o.StrategyType != o.StrategyTypeNullValue() && (o.StrategyType < o.StrategyTypeMinValue() || o.StrategyType > o.StrategyTypeMaxValue()) { + return fmt.Errorf("Range check failed on o.StrategyType (%v < %v > %v)", o.StrategyTypeMinValue(), o.StrategyType, o.StrategyTypeMaxValue()) + } + } + if err := o.OrderCapacity.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if err := o.WorkingFloor.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if err := o.SelfTradePreventionMode.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if o.PreventedMatchIdInActingVersion(actingVersion) { + if o.PreventedMatchId != o.PreventedMatchIdNullValue() && (o.PreventedMatchId < o.PreventedMatchIdMinValue() || o.PreventedMatchId > o.PreventedMatchIdMaxValue()) { + return fmt.Errorf("Range check failed on o.PreventedMatchId (%v < %v > %v)", o.PreventedMatchIdMinValue(), o.PreventedMatchId, o.PreventedMatchIdMaxValue()) + } + } + if o.PreventedQuantityInActingVersion(actingVersion) { + if o.PreventedQuantity < o.PreventedQuantityMinValue() || o.PreventedQuantity > o.PreventedQuantityMaxValue() { + return fmt.Errorf("Range check failed on o.PreventedQuantity (%v < %v > %v)", o.PreventedQuantityMinValue(), o.PreventedQuantity, o.PreventedQuantityMaxValue()) + } + } + if err := o.UsedSor.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if err := o.PegPriceType.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if err := o.PegOffsetType.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if o.PegOffsetValueInActingVersion(actingVersion) { + if o.PegOffsetValue != o.PegOffsetValueNullValue() && (o.PegOffsetValue < o.PegOffsetValueMinValue() || o.PegOffsetValue > o.PegOffsetValueMaxValue()) { + return fmt.Errorf("Range check failed on o.PegOffsetValue (%v < %v > %v)", o.PegOffsetValueMinValue(), o.PegOffsetValue, o.PegOffsetValueMaxValue()) + } + } + if o.PeggedPriceInActingVersion(actingVersion) { + if o.PeggedPrice != o.PeggedPriceNullValue() && (o.PeggedPrice < o.PeggedPriceMinValue() || o.PeggedPrice > o.PeggedPriceMaxValue()) { + return fmt.Errorf("Range check failed on o.PeggedPrice (%v < %v > %v)", o.PeggedPriceMinValue(), o.PeggedPrice, o.PeggedPriceMaxValue()) + } + } + if !utf8.Valid(o.Symbol[:]) { + return errors.New("o.Symbol failed UTF-8 validation") + } + if !utf8.Valid(o.ClientOrderId[:]) { + return errors.New("o.ClientOrderId failed UTF-8 validation") + } + return nil +} + +func OrderResponseInit(o *OrderResponse) { + o.OrderListId = math.MinInt64 + o.StopPrice = math.MinInt64 + o.TrailingDelta = math.MinInt64 + o.TrailingTime = math.MinInt64 + o.IcebergQty = math.MinInt64 + o.WorkingTime = math.MinInt64 + o.StrategyId = math.MinInt64 + o.StrategyType = math.MinInt32 + o.PreventedMatchId = math.MinInt64 + o.PegOffsetValue = math.MaxUint8 + o.PeggedPrice = math.MinInt64 + return +} + +func (*OrderResponse) SbeBlockLength() (blockLength uint16) { + return 162 +} + +func (*OrderResponse) SbeTemplateId() (templateId uint16) { + return 304 +} + +func (*OrderResponse) SbeSchemaId() (schemaId uint16) { + return 3 +} + +func (*OrderResponse) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} + +func (*OrderResponse) SbeSemanticType() (semanticType []byte) { + return []byte("") +} + +func (*OrderResponse) SbeSemanticVersion() (semanticVersion string) { + return "5.2" +} + +func (*OrderResponse) PriceExponentId() uint16 { + return 1 +} + +func (*OrderResponse) PriceExponentSinceVersion() uint16 { + return 0 +} + +func (o *OrderResponse) PriceExponentInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.PriceExponentSinceVersion() +} + +func (*OrderResponse) PriceExponentDeprecated() uint16 { + return 0 +} + +func (*OrderResponse) PriceExponentMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrderResponse) PriceExponentMinValue() int8 { + return math.MinInt8 + 1 +} + +func (*OrderResponse) PriceExponentMaxValue() int8 { + return math.MaxInt8 +} + +func (*OrderResponse) PriceExponentNullValue() int8 { + return math.MinInt8 +} + +func (*OrderResponse) QtyExponentId() uint16 { + return 2 +} + +func (*OrderResponse) QtyExponentSinceVersion() uint16 { + return 0 +} + +func (o *OrderResponse) QtyExponentInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.QtyExponentSinceVersion() +} + +func (*OrderResponse) QtyExponentDeprecated() uint16 { + return 0 +} + +func (*OrderResponse) QtyExponentMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrderResponse) QtyExponentMinValue() int8 { + return math.MinInt8 + 1 +} + +func (*OrderResponse) QtyExponentMaxValue() int8 { + return math.MaxInt8 +} + +func (*OrderResponse) QtyExponentNullValue() int8 { + return math.MinInt8 +} + +func (*OrderResponse) OrderIdId() uint16 { + return 3 +} + +func (*OrderResponse) OrderIdSinceVersion() uint16 { + return 0 +} + +func (o *OrderResponse) OrderIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.OrderIdSinceVersion() +} + +func (*OrderResponse) OrderIdDeprecated() uint16 { + return 0 +} + +func (*OrderResponse) OrderIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrderResponse) OrderIdMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*OrderResponse) OrderIdMaxValue() int64 { + return math.MaxInt64 +} + +func (*OrderResponse) OrderIdNullValue() int64 { + return math.MinInt64 +} + +func (*OrderResponse) OrderListIdId() uint16 { + return 4 +} + +func (*OrderResponse) OrderListIdSinceVersion() uint16 { + return 0 +} + +func (o *OrderResponse) OrderListIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.OrderListIdSinceVersion() +} + +func (*OrderResponse) OrderListIdDeprecated() uint16 { + return 0 +} + +func (*OrderResponse) OrderListIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*OrderResponse) OrderListIdMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*OrderResponse) OrderListIdMaxValue() int64 { + return math.MaxInt64 +} + +func (*OrderResponse) OrderListIdNullValue() int64 { + return math.MinInt64 +} + +func (*OrderResponse) PriceId() uint16 { + return 5 +} + +func (*OrderResponse) PriceSinceVersion() uint16 { + return 0 +} + +func (o *OrderResponse) PriceInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.PriceSinceVersion() +} + +func (*OrderResponse) PriceDeprecated() uint16 { + return 0 +} + +func (*OrderResponse) PriceMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrderResponse) PriceMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*OrderResponse) PriceMaxValue() int64 { + return math.MaxInt64 +} + +func (*OrderResponse) PriceNullValue() int64 { + return math.MinInt64 +} + +func (*OrderResponse) OrigQtyId() uint16 { + return 6 +} + +func (*OrderResponse) OrigQtySinceVersion() uint16 { + return 0 +} + +func (o *OrderResponse) OrigQtyInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.OrigQtySinceVersion() +} + +func (*OrderResponse) OrigQtyDeprecated() uint16 { + return 0 +} + +func (*OrderResponse) OrigQtyMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrderResponse) OrigQtyMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*OrderResponse) OrigQtyMaxValue() int64 { + return math.MaxInt64 +} + +func (*OrderResponse) OrigQtyNullValue() int64 { + return math.MinInt64 +} + +func (*OrderResponse) ExecutedQtyId() uint16 { + return 7 +} + +func (*OrderResponse) ExecutedQtySinceVersion() uint16 { + return 0 +} + +func (o *OrderResponse) ExecutedQtyInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.ExecutedQtySinceVersion() +} + +func (*OrderResponse) ExecutedQtyDeprecated() uint16 { + return 0 +} + +func (*OrderResponse) ExecutedQtyMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrderResponse) ExecutedQtyMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*OrderResponse) ExecutedQtyMaxValue() int64 { + return math.MaxInt64 +} + +func (*OrderResponse) ExecutedQtyNullValue() int64 { + return math.MinInt64 +} + +func (*OrderResponse) CummulativeQuoteQtyId() uint16 { + return 8 +} + +func (*OrderResponse) CummulativeQuoteQtySinceVersion() uint16 { + return 0 +} + +func (o *OrderResponse) CummulativeQuoteQtyInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.CummulativeQuoteQtySinceVersion() +} + +func (*OrderResponse) CummulativeQuoteQtyDeprecated() uint16 { + return 0 +} + +func (*OrderResponse) CummulativeQuoteQtyMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrderResponse) CummulativeQuoteQtyMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*OrderResponse) CummulativeQuoteQtyMaxValue() int64 { + return math.MaxInt64 +} + +func (*OrderResponse) CummulativeQuoteQtyNullValue() int64 { + return math.MinInt64 +} + +func (*OrderResponse) StatusId() uint16 { + return 9 +} + +func (*OrderResponse) StatusSinceVersion() uint16 { + return 0 +} + +func (o *OrderResponse) StatusInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.StatusSinceVersion() +} + +func (*OrderResponse) StatusDeprecated() uint16 { + return 0 +} + +func (*OrderResponse) StatusMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrderResponse) TimeInForceId() uint16 { + return 10 +} + +func (*OrderResponse) TimeInForceSinceVersion() uint16 { + return 0 +} + +func (o *OrderResponse) TimeInForceInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.TimeInForceSinceVersion() +} + +func (*OrderResponse) TimeInForceDeprecated() uint16 { + return 0 +} + +func (*OrderResponse) TimeInForceMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrderResponse) OrderTypeId() uint16 { + return 11 +} + +func (*OrderResponse) OrderTypeSinceVersion() uint16 { + return 0 +} + +func (o *OrderResponse) OrderTypeInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.OrderTypeSinceVersion() +} + +func (*OrderResponse) OrderTypeDeprecated() uint16 { + return 0 +} + +func (*OrderResponse) OrderTypeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrderResponse) SideId() uint16 { + return 12 +} + +func (*OrderResponse) SideSinceVersion() uint16 { + return 0 +} + +func (o *OrderResponse) SideInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.SideSinceVersion() +} + +func (*OrderResponse) SideDeprecated() uint16 { + return 0 +} + +func (*OrderResponse) SideMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrderResponse) StopPriceId() uint16 { + return 13 +} + +func (*OrderResponse) StopPriceSinceVersion() uint16 { + return 0 +} + +func (o *OrderResponse) StopPriceInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.StopPriceSinceVersion() +} + +func (*OrderResponse) StopPriceDeprecated() uint16 { + return 0 +} + +func (*OrderResponse) StopPriceMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*OrderResponse) StopPriceMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*OrderResponse) StopPriceMaxValue() int64 { + return math.MaxInt64 +} + +func (*OrderResponse) StopPriceNullValue() int64 { + return math.MinInt64 +} + +func (*OrderResponse) TrailingDeltaId() uint16 { + return 14 +} + +func (*OrderResponse) TrailingDeltaSinceVersion() uint16 { + return 0 +} + +func (o *OrderResponse) TrailingDeltaInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.TrailingDeltaSinceVersion() +} + +func (*OrderResponse) TrailingDeltaDeprecated() uint16 { + return 0 +} + +func (*OrderResponse) TrailingDeltaMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*OrderResponse) TrailingDeltaMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*OrderResponse) TrailingDeltaMaxValue() int64 { + return math.MaxInt64 +} + +func (*OrderResponse) TrailingDeltaNullValue() int64 { + return math.MinInt64 +} + +func (*OrderResponse) TrailingTimeId() uint16 { + return 15 +} + +func (*OrderResponse) TrailingTimeSinceVersion() uint16 { + return 0 +} + +func (o *OrderResponse) TrailingTimeInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.TrailingTimeSinceVersion() +} + +func (*OrderResponse) TrailingTimeDeprecated() uint16 { + return 0 +} + +func (*OrderResponse) TrailingTimeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*OrderResponse) TrailingTimeMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*OrderResponse) TrailingTimeMaxValue() int64 { + return math.MaxInt64 +} + +func (*OrderResponse) TrailingTimeNullValue() int64 { + return math.MinInt64 +} + +func (*OrderResponse) IcebergQtyId() uint16 { + return 16 +} + +func (*OrderResponse) IcebergQtySinceVersion() uint16 { + return 0 +} + +func (o *OrderResponse) IcebergQtyInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.IcebergQtySinceVersion() +} + +func (*OrderResponse) IcebergQtyDeprecated() uint16 { + return 0 +} + +func (*OrderResponse) IcebergQtyMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*OrderResponse) IcebergQtyMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*OrderResponse) IcebergQtyMaxValue() int64 { + return math.MaxInt64 +} + +func (*OrderResponse) IcebergQtyNullValue() int64 { + return math.MinInt64 +} + +func (*OrderResponse) TimeId() uint16 { + return 17 +} + +func (*OrderResponse) TimeSinceVersion() uint16 { + return 0 +} + +func (o *OrderResponse) TimeInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.TimeSinceVersion() +} + +func (*OrderResponse) TimeDeprecated() uint16 { + return 0 +} + +func (*OrderResponse) TimeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrderResponse) TimeMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*OrderResponse) TimeMaxValue() int64 { + return math.MaxInt64 +} + +func (*OrderResponse) TimeNullValue() int64 { + return math.MinInt64 +} + +func (*OrderResponse) UpdateTimeId() uint16 { + return 18 +} + +func (*OrderResponse) UpdateTimeSinceVersion() uint16 { + return 0 +} + +func (o *OrderResponse) UpdateTimeInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.UpdateTimeSinceVersion() +} + +func (*OrderResponse) UpdateTimeDeprecated() uint16 { + return 0 +} + +func (*OrderResponse) UpdateTimeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrderResponse) UpdateTimeMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*OrderResponse) UpdateTimeMaxValue() int64 { + return math.MaxInt64 +} + +func (*OrderResponse) UpdateTimeNullValue() int64 { + return math.MinInt64 +} + +func (*OrderResponse) IsWorkingId() uint16 { + return 19 +} + +func (*OrderResponse) IsWorkingSinceVersion() uint16 { + return 0 +} + +func (o *OrderResponse) IsWorkingInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.IsWorkingSinceVersion() +} + +func (*OrderResponse) IsWorkingDeprecated() uint16 { + return 0 +} + +func (*OrderResponse) IsWorkingMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrderResponse) WorkingTimeId() uint16 { + return 20 +} + +func (*OrderResponse) WorkingTimeSinceVersion() uint16 { + return 0 +} + +func (o *OrderResponse) WorkingTimeInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.WorkingTimeSinceVersion() +} + +func (*OrderResponse) WorkingTimeDeprecated() uint16 { + return 0 +} + +func (*OrderResponse) WorkingTimeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*OrderResponse) WorkingTimeMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*OrderResponse) WorkingTimeMaxValue() int64 { + return math.MaxInt64 +} + +func (*OrderResponse) WorkingTimeNullValue() int64 { + return math.MinInt64 +} + +func (*OrderResponse) OrigQuoteOrderQtyId() uint16 { + return 21 +} + +func (*OrderResponse) OrigQuoteOrderQtySinceVersion() uint16 { + return 0 +} + +func (o *OrderResponse) OrigQuoteOrderQtyInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.OrigQuoteOrderQtySinceVersion() +} + +func (*OrderResponse) OrigQuoteOrderQtyDeprecated() uint16 { + return 0 +} + +func (*OrderResponse) OrigQuoteOrderQtyMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrderResponse) OrigQuoteOrderQtyMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*OrderResponse) OrigQuoteOrderQtyMaxValue() int64 { + return math.MaxInt64 +} + +func (*OrderResponse) OrigQuoteOrderQtyNullValue() int64 { + return math.MinInt64 +} + +func (*OrderResponse) StrategyIdId() uint16 { + return 22 +} + +func (*OrderResponse) StrategyIdSinceVersion() uint16 { + return 0 +} + +func (o *OrderResponse) StrategyIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.StrategyIdSinceVersion() +} + +func (*OrderResponse) StrategyIdDeprecated() uint16 { + return 0 +} + +func (*OrderResponse) StrategyIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*OrderResponse) StrategyIdMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*OrderResponse) StrategyIdMaxValue() int64 { + return math.MaxInt64 +} + +func (*OrderResponse) StrategyIdNullValue() int64 { + return math.MinInt64 +} + +func (*OrderResponse) StrategyTypeId() uint16 { + return 23 +} + +func (*OrderResponse) StrategyTypeSinceVersion() uint16 { + return 0 +} + +func (o *OrderResponse) StrategyTypeInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.StrategyTypeSinceVersion() +} + +func (*OrderResponse) StrategyTypeDeprecated() uint16 { + return 0 +} + +func (*OrderResponse) StrategyTypeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*OrderResponse) StrategyTypeMinValue() int32 { + return math.MinInt32 + 1 +} + +func (*OrderResponse) StrategyTypeMaxValue() int32 { + return math.MaxInt32 +} + +func (*OrderResponse) StrategyTypeNullValue() int32 { + return math.MinInt32 +} + +func (*OrderResponse) OrderCapacityId() uint16 { + return 24 +} + +func (*OrderResponse) OrderCapacitySinceVersion() uint16 { + return 0 +} + +func (o *OrderResponse) OrderCapacityInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.OrderCapacitySinceVersion() +} + +func (*OrderResponse) OrderCapacityDeprecated() uint16 { + return 0 +} + +func (*OrderResponse) OrderCapacityMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrderResponse) WorkingFloorId() uint16 { + return 25 +} + +func (*OrderResponse) WorkingFloorSinceVersion() uint16 { + return 0 +} + +func (o *OrderResponse) WorkingFloorInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.WorkingFloorSinceVersion() +} + +func (*OrderResponse) WorkingFloorDeprecated() uint16 { + return 0 +} + +func (*OrderResponse) WorkingFloorMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrderResponse) SelfTradePreventionModeId() uint16 { + return 26 +} + +func (*OrderResponse) SelfTradePreventionModeSinceVersion() uint16 { + return 0 +} + +func (o *OrderResponse) SelfTradePreventionModeInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.SelfTradePreventionModeSinceVersion() +} + +func (*OrderResponse) SelfTradePreventionModeDeprecated() uint16 { + return 0 +} + +func (*OrderResponse) SelfTradePreventionModeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrderResponse) PreventedMatchIdId() uint16 { + return 27 +} + +func (*OrderResponse) PreventedMatchIdSinceVersion() uint16 { + return 0 +} + +func (o *OrderResponse) PreventedMatchIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.PreventedMatchIdSinceVersion() +} + +func (*OrderResponse) PreventedMatchIdDeprecated() uint16 { + return 0 +} + +func (*OrderResponse) PreventedMatchIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*OrderResponse) PreventedMatchIdMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*OrderResponse) PreventedMatchIdMaxValue() int64 { + return math.MaxInt64 +} + +func (*OrderResponse) PreventedMatchIdNullValue() int64 { + return math.MinInt64 +} + +func (*OrderResponse) PreventedQuantityId() uint16 { + return 28 +} + +func (*OrderResponse) PreventedQuantitySinceVersion() uint16 { + return 0 +} + +func (o *OrderResponse) PreventedQuantityInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.PreventedQuantitySinceVersion() +} + +func (*OrderResponse) PreventedQuantityDeprecated() uint16 { + return 0 +} + +func (*OrderResponse) PreventedQuantityMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrderResponse) PreventedQuantityMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*OrderResponse) PreventedQuantityMaxValue() int64 { + return math.MaxInt64 +} + +func (*OrderResponse) PreventedQuantityNullValue() int64 { + return math.MinInt64 +} + +func (*OrderResponse) UsedSorId() uint16 { + return 29 +} + +func (*OrderResponse) UsedSorSinceVersion() uint16 { + return 0 +} + +func (o *OrderResponse) UsedSorInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.UsedSorSinceVersion() +} + +func (*OrderResponse) UsedSorDeprecated() uint16 { + return 0 +} + +func (*OrderResponse) UsedSorMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrderResponse) PegPriceTypeId() uint16 { + return 30 +} + +func (*OrderResponse) PegPriceTypeSinceVersion() uint16 { + return 1 +} + +func (o *OrderResponse) PegPriceTypeInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.PegPriceTypeSinceVersion() +} + +func (*OrderResponse) PegPriceTypeDeprecated() uint16 { + return 0 +} + +func (*OrderResponse) PegPriceTypeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*OrderResponse) PegOffsetTypeId() uint16 { + return 31 +} + +func (*OrderResponse) PegOffsetTypeSinceVersion() uint16 { + return 1 +} + +func (o *OrderResponse) PegOffsetTypeInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.PegOffsetTypeSinceVersion() +} + +func (*OrderResponse) PegOffsetTypeDeprecated() uint16 { + return 0 +} + +func (*OrderResponse) PegOffsetTypeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*OrderResponse) PegOffsetValueId() uint16 { + return 32 +} + +func (*OrderResponse) PegOffsetValueSinceVersion() uint16 { + return 1 +} + +func (o *OrderResponse) PegOffsetValueInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.PegOffsetValueSinceVersion() +} + +func (*OrderResponse) PegOffsetValueDeprecated() uint16 { + return 0 +} + +func (*OrderResponse) PegOffsetValueMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*OrderResponse) PegOffsetValueMinValue() uint8 { + return 0 +} + +func (*OrderResponse) PegOffsetValueMaxValue() uint8 { + return math.MaxUint8 - 1 +} + +func (*OrderResponse) PegOffsetValueNullValue() uint8 { + return math.MaxUint8 +} + +func (*OrderResponse) PeggedPriceId() uint16 { + return 33 +} + +func (*OrderResponse) PeggedPriceSinceVersion() uint16 { + return 1 +} + +func (o *OrderResponse) PeggedPriceInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.PeggedPriceSinceVersion() +} + +func (*OrderResponse) PeggedPriceDeprecated() uint16 { + return 0 +} + +func (*OrderResponse) PeggedPriceMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*OrderResponse) PeggedPriceMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*OrderResponse) PeggedPriceMaxValue() int64 { + return math.MaxInt64 +} + +func (*OrderResponse) PeggedPriceNullValue() int64 { + return math.MinInt64 +} + +func (*OrderResponse) SymbolMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrderResponse) SymbolSinceVersion() uint16 { + return 0 +} + +func (o *OrderResponse) SymbolInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.SymbolSinceVersion() +} + +func (*OrderResponse) SymbolDeprecated() uint16 { + return 0 +} + +func (OrderResponse) SymbolCharacterEncoding() string { + return "UTF-8" +} + +func (OrderResponse) SymbolHeaderLength() uint64 { + return 1 +} + +func (*OrderResponse) ClientOrderIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrderResponse) ClientOrderIdSinceVersion() uint16 { + return 0 +} + +func (o *OrderResponse) ClientOrderIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.ClientOrderIdSinceVersion() +} + +func (*OrderResponse) ClientOrderIdDeprecated() uint16 { + return 0 +} + +func (OrderResponse) ClientOrderIdCharacterEncoding() string { + return "UTF-8" +} + +func (OrderResponse) ClientOrderIdHeaderLength() uint64 { + return 1 +} diff --git a/v2/sbe/spot_3_1/OrderSide.go b/v2/sbe/spot_3_1/OrderSide.go new file mode 100644 index 00000000..b1cf1277 --- /dev/null +++ b/v2/sbe/spot_3_1/OrderSide.go @@ -0,0 +1,86 @@ +// Generated SBE (Simple Binary Encoding) message codec + +package sbe + +import ( + "fmt" + "io" + "reflect" +) + +type OrderSideEnum uint8 +type OrderSideValues struct { + Buy OrderSideEnum + Sell OrderSideEnum + NonRepresentable OrderSideEnum + NullValue OrderSideEnum +} + +var OrderSide = OrderSideValues{0, 1, 254, 255} + +func (o OrderSideEnum) Encode(_m *SbeGoMarshaller, _w io.Writer) error { + if err := _m.WriteUint8(_w, uint8(o)); err != nil { + return err + } + return nil +} + +func (o *OrderSideEnum) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16) error { + if err := _m.ReadUint8(_r, (*uint8)(o)); err != nil { + return err + } + return nil +} + +func (o OrderSideEnum) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if actingVersion > schemaVersion { + return nil + } + value := reflect.ValueOf(OrderSide) + for idx := 0; idx < value.NumField(); idx++ { + if o == value.Field(idx).Interface() { + return nil + } + } + return fmt.Errorf("Range check failed on OrderSide, unknown enumeration value %d", o) +} + +func (*OrderSideEnum) EncodedLength() int64 { + return 1 +} + +func (*OrderSideEnum) BuySinceVersion() uint16 { + return 0 +} + +func (o *OrderSideEnum) BuyInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.BuySinceVersion() +} + +func (*OrderSideEnum) BuyDeprecated() uint16 { + return 0 +} + +func (*OrderSideEnum) SellSinceVersion() uint16 { + return 0 +} + +func (o *OrderSideEnum) SellInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.SellSinceVersion() +} + +func (*OrderSideEnum) SellDeprecated() uint16 { + return 0 +} + +func (*OrderSideEnum) NonRepresentableSinceVersion() uint16 { + return 0 +} + +func (o *OrderSideEnum) NonRepresentableInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.NonRepresentableSinceVersion() +} + +func (*OrderSideEnum) NonRepresentableDeprecated() uint16 { + return 0 +} diff --git a/v2/sbe/spot_3_1/OrderStatus.go b/v2/sbe/spot_3_1/OrderStatus.go new file mode 100644 index 00000000..3e44cf55 --- /dev/null +++ b/v2/sbe/spot_3_1/OrderStatus.go @@ -0,0 +1,190 @@ +// Generated SBE (Simple Binary Encoding) message codec + +package sbe + +import ( + "fmt" + "io" + "reflect" +) + +type OrderStatusEnum uint8 +type OrderStatusValues struct { + New OrderStatusEnum + PartiallyFilled OrderStatusEnum + Filled OrderStatusEnum + Canceled OrderStatusEnum + PendingCancel OrderStatusEnum + Rejected OrderStatusEnum + Expired OrderStatusEnum + ExpiredInMatch OrderStatusEnum + PendingNew OrderStatusEnum + Unknown OrderStatusEnum + NonRepresentable OrderStatusEnum + NullValue OrderStatusEnum +} + +var OrderStatus = OrderStatusValues{0, 1, 2, 3, 4, 5, 6, 9, 11, 253, 254, 255} + +func (o OrderStatusEnum) Encode(_m *SbeGoMarshaller, _w io.Writer) error { + if err := _m.WriteUint8(_w, uint8(o)); err != nil { + return err + } + return nil +} + +func (o *OrderStatusEnum) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16) error { + if err := _m.ReadUint8(_r, (*uint8)(o)); err != nil { + return err + } + return nil +} + +func (o OrderStatusEnum) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if actingVersion > schemaVersion { + return nil + } + value := reflect.ValueOf(OrderStatus) + for idx := 0; idx < value.NumField(); idx++ { + if o == value.Field(idx).Interface() { + return nil + } + } + return fmt.Errorf("Range check failed on OrderStatus, unknown enumeration value %d", o) +} + +func (*OrderStatusEnum) EncodedLength() int64 { + return 1 +} + +func (*OrderStatusEnum) NewSinceVersion() uint16 { + return 0 +} + +func (o *OrderStatusEnum) NewInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.NewSinceVersion() +} + +func (*OrderStatusEnum) NewDeprecated() uint16 { + return 0 +} + +func (*OrderStatusEnum) PartiallyFilledSinceVersion() uint16 { + return 0 +} + +func (o *OrderStatusEnum) PartiallyFilledInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.PartiallyFilledSinceVersion() +} + +func (*OrderStatusEnum) PartiallyFilledDeprecated() uint16 { + return 0 +} + +func (*OrderStatusEnum) FilledSinceVersion() uint16 { + return 0 +} + +func (o *OrderStatusEnum) FilledInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.FilledSinceVersion() +} + +func (*OrderStatusEnum) FilledDeprecated() uint16 { + return 0 +} + +func (*OrderStatusEnum) CanceledSinceVersion() uint16 { + return 0 +} + +func (o *OrderStatusEnum) CanceledInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.CanceledSinceVersion() +} + +func (*OrderStatusEnum) CanceledDeprecated() uint16 { + return 0 +} + +func (*OrderStatusEnum) PendingCancelSinceVersion() uint16 { + return 0 +} + +func (o *OrderStatusEnum) PendingCancelInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.PendingCancelSinceVersion() +} + +func (*OrderStatusEnum) PendingCancelDeprecated() uint16 { + return 0 +} + +func (*OrderStatusEnum) RejectedSinceVersion() uint16 { + return 0 +} + +func (o *OrderStatusEnum) RejectedInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.RejectedSinceVersion() +} + +func (*OrderStatusEnum) RejectedDeprecated() uint16 { + return 0 +} + +func (*OrderStatusEnum) ExpiredSinceVersion() uint16 { + return 0 +} + +func (o *OrderStatusEnum) ExpiredInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.ExpiredSinceVersion() +} + +func (*OrderStatusEnum) ExpiredDeprecated() uint16 { + return 0 +} + +func (*OrderStatusEnum) ExpiredInMatchSinceVersion() uint16 { + return 0 +} + +func (o *OrderStatusEnum) ExpiredInMatchInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.ExpiredInMatchSinceVersion() +} + +func (*OrderStatusEnum) ExpiredInMatchDeprecated() uint16 { + return 0 +} + +func (*OrderStatusEnum) PendingNewSinceVersion() uint16 { + return 0 +} + +func (o *OrderStatusEnum) PendingNewInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.PendingNewSinceVersion() +} + +func (*OrderStatusEnum) PendingNewDeprecated() uint16 { + return 0 +} + +func (*OrderStatusEnum) UnknownSinceVersion() uint16 { + return 0 +} + +func (o *OrderStatusEnum) UnknownInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.UnknownSinceVersion() +} + +func (*OrderStatusEnum) UnknownDeprecated() uint16 { + return 0 +} + +func (*OrderStatusEnum) NonRepresentableSinceVersion() uint16 { + return 0 +} + +func (o *OrderStatusEnum) NonRepresentableInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.NonRepresentableSinceVersion() +} + +func (*OrderStatusEnum) NonRepresentableDeprecated() uint16 { + return 0 +} diff --git a/v2/sbe/spot_3_1/OrderTestResponse.go b/v2/sbe/spot_3_1/OrderTestResponse.go new file mode 100644 index 00000000..097200c1 --- /dev/null +++ b/v2/sbe/spot_3_1/OrderTestResponse.go @@ -0,0 +1,64 @@ +// Generated SBE (Simple Binary Encoding) message codec + +package sbe + +import ( + "io" + "io/ioutil" +) + +type OrderTestResponse struct { +} + +func (o *OrderTestResponse) Encode(_m *SbeGoMarshaller, _w io.Writer, doRangeCheck bool) error { + if doRangeCheck { + if err := o.RangeCheck(o.SbeSchemaVersion(), o.SbeSchemaVersion()); err != nil { + return err + } + } + return nil +} + +func (o *OrderTestResponse) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint16, doRangeCheck bool) error { + if actingVersion > o.SbeSchemaVersion() && blockLength > o.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-o.SbeBlockLength())) + } + if doRangeCheck { + if err := o.RangeCheck(actingVersion, o.SbeSchemaVersion()); err != nil { + return err + } + } + return nil +} + +func (o *OrderTestResponse) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + return nil +} + +func OrderTestResponseInit(o *OrderTestResponse) { + return +} + +func (*OrderTestResponse) SbeBlockLength() (blockLength uint16) { + return 0 +} + +func (*OrderTestResponse) SbeTemplateId() (templateId uint16) { + return 303 +} + +func (*OrderTestResponse) SbeSchemaId() (schemaId uint16) { + return 3 +} + +func (*OrderTestResponse) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} + +func (*OrderTestResponse) SbeSemanticType() (semanticType []byte) { + return []byte("") +} + +func (*OrderTestResponse) SbeSemanticVersion() (semanticVersion string) { + return "5.2" +} diff --git a/v2/sbe/spot_3_1/OrderTestWithCommissionsResponse.go b/v2/sbe/spot_3_1/OrderTestWithCommissionsResponse.go new file mode 100644 index 00000000..734f8e5c --- /dev/null +++ b/v2/sbe/spot_3_1/OrderTestWithCommissionsResponse.go @@ -0,0 +1,734 @@ +// Generated SBE (Simple Binary Encoding) message codec + +package sbe + +import ( + "errors" + "fmt" + "io" + "io/ioutil" + "math" + "unicode/utf8" +) + +type OrderTestWithCommissionsResponse struct { + CommissionExponent int8 + DiscountExponent int8 + StandardCommissionForOrderMaker int64 + StandardCommissionForOrderTaker int64 + TaxCommissionForOrderMaker int64 + TaxCommissionForOrderTaker int64 + DiscountEnabledForAccount BoolEnumEnum + DiscountEnabledForSymbol BoolEnumEnum + Discount int64 + SpecialCommissionForOrderMaker int64 + SpecialCommissionForOrderTaker int64 + DiscountAsset []uint8 +} + +func (o *OrderTestWithCommissionsResponse) Encode(_m *SbeGoMarshaller, _w io.Writer, doRangeCheck bool) error { + if doRangeCheck { + if err := o.RangeCheck(o.SbeSchemaVersion(), o.SbeSchemaVersion()); err != nil { + return err + } + } + if err := _m.WriteInt8(_w, o.CommissionExponent); err != nil { + return err + } + if err := _m.WriteInt8(_w, o.DiscountExponent); err != nil { + return err + } + if err := _m.WriteInt64(_w, o.StandardCommissionForOrderMaker); err != nil { + return err + } + if err := _m.WriteInt64(_w, o.StandardCommissionForOrderTaker); err != nil { + return err + } + if err := _m.WriteInt64(_w, o.TaxCommissionForOrderMaker); err != nil { + return err + } + if err := _m.WriteInt64(_w, o.TaxCommissionForOrderTaker); err != nil { + return err + } + if err := o.DiscountEnabledForAccount.Encode(_m, _w); err != nil { + return err + } + if err := o.DiscountEnabledForSymbol.Encode(_m, _w); err != nil { + return err + } + if err := _m.WriteInt64(_w, o.Discount); err != nil { + return err + } + if err := _m.WriteInt64(_w, o.SpecialCommissionForOrderMaker); err != nil { + return err + } + if err := _m.WriteInt64(_w, o.SpecialCommissionForOrderTaker); err != nil { + return err + } + if err := _m.WriteUint8(_w, uint8(len(o.DiscountAsset))); err != nil { + return err + } + if err := _m.WriteBytes(_w, o.DiscountAsset); err != nil { + return err + } + return nil +} + +func (o *OrderTestWithCommissionsResponse) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint16, doRangeCheck bool) error { + if !o.CommissionExponentInActingVersion(actingVersion) { + o.CommissionExponent = o.CommissionExponentNullValue() + } else { + if err := _m.ReadInt8(_r, &o.CommissionExponent); err != nil { + return err + } + } + if !o.DiscountExponentInActingVersion(actingVersion) { + o.DiscountExponent = o.DiscountExponentNullValue() + } else { + if err := _m.ReadInt8(_r, &o.DiscountExponent); err != nil { + return err + } + } + if !o.StandardCommissionForOrderMakerInActingVersion(actingVersion) { + o.StandardCommissionForOrderMaker = o.StandardCommissionForOrderMakerNullValue() + } else { + if err := _m.ReadInt64(_r, &o.StandardCommissionForOrderMaker); err != nil { + return err + } + } + if !o.StandardCommissionForOrderTakerInActingVersion(actingVersion) { + o.StandardCommissionForOrderTaker = o.StandardCommissionForOrderTakerNullValue() + } else { + if err := _m.ReadInt64(_r, &o.StandardCommissionForOrderTaker); err != nil { + return err + } + } + if !o.TaxCommissionForOrderMakerInActingVersion(actingVersion) { + o.TaxCommissionForOrderMaker = o.TaxCommissionForOrderMakerNullValue() + } else { + if err := _m.ReadInt64(_r, &o.TaxCommissionForOrderMaker); err != nil { + return err + } + } + if !o.TaxCommissionForOrderTakerInActingVersion(actingVersion) { + o.TaxCommissionForOrderTaker = o.TaxCommissionForOrderTakerNullValue() + } else { + if err := _m.ReadInt64(_r, &o.TaxCommissionForOrderTaker); err != nil { + return err + } + } + if o.DiscountEnabledForAccountInActingVersion(actingVersion) { + if err := o.DiscountEnabledForAccount.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if o.DiscountEnabledForSymbolInActingVersion(actingVersion) { + if err := o.DiscountEnabledForSymbol.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if !o.DiscountInActingVersion(actingVersion) { + o.Discount = o.DiscountNullValue() + } else { + if err := _m.ReadInt64(_r, &o.Discount); err != nil { + return err + } + } + if !o.SpecialCommissionForOrderMakerInActingVersion(actingVersion) { + o.SpecialCommissionForOrderMaker = o.SpecialCommissionForOrderMakerNullValue() + } else { + if err := _m.ReadInt64(_r, &o.SpecialCommissionForOrderMaker); err != nil { + return err + } + } + if !o.SpecialCommissionForOrderTakerInActingVersion(actingVersion) { + o.SpecialCommissionForOrderTaker = o.SpecialCommissionForOrderTakerNullValue() + } else { + if err := _m.ReadInt64(_r, &o.SpecialCommissionForOrderTaker); err != nil { + return err + } + } + if actingVersion > o.SbeSchemaVersion() && blockLength > o.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-o.SbeBlockLength())) + } + + if o.DiscountAssetInActingVersion(actingVersion) { + var DiscountAssetLength uint8 + if err := _m.ReadUint8(_r, &DiscountAssetLength); err != nil { + return err + } + if cap(o.DiscountAsset) < int(DiscountAssetLength) { + o.DiscountAsset = make([]uint8, DiscountAssetLength) + } + o.DiscountAsset = o.DiscountAsset[:DiscountAssetLength] + if err := _m.ReadBytes(_r, o.DiscountAsset); err != nil { + return err + } + } + if doRangeCheck { + if err := o.RangeCheck(actingVersion, o.SbeSchemaVersion()); err != nil { + return err + } + } + return nil +} + +func (o *OrderTestWithCommissionsResponse) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if o.CommissionExponentInActingVersion(actingVersion) { + if o.CommissionExponent < o.CommissionExponentMinValue() || o.CommissionExponent > o.CommissionExponentMaxValue() { + return fmt.Errorf("Range check failed on o.CommissionExponent (%v < %v > %v)", o.CommissionExponentMinValue(), o.CommissionExponent, o.CommissionExponentMaxValue()) + } + } + if o.DiscountExponentInActingVersion(actingVersion) { + if o.DiscountExponent < o.DiscountExponentMinValue() || o.DiscountExponent > o.DiscountExponentMaxValue() { + return fmt.Errorf("Range check failed on o.DiscountExponent (%v < %v > %v)", o.DiscountExponentMinValue(), o.DiscountExponent, o.DiscountExponentMaxValue()) + } + } + if o.StandardCommissionForOrderMakerInActingVersion(actingVersion) { + if o.StandardCommissionForOrderMaker < o.StandardCommissionForOrderMakerMinValue() || o.StandardCommissionForOrderMaker > o.StandardCommissionForOrderMakerMaxValue() { + return fmt.Errorf("Range check failed on o.StandardCommissionForOrderMaker (%v < %v > %v)", o.StandardCommissionForOrderMakerMinValue(), o.StandardCommissionForOrderMaker, o.StandardCommissionForOrderMakerMaxValue()) + } + } + if o.StandardCommissionForOrderTakerInActingVersion(actingVersion) { + if o.StandardCommissionForOrderTaker < o.StandardCommissionForOrderTakerMinValue() || o.StandardCommissionForOrderTaker > o.StandardCommissionForOrderTakerMaxValue() { + return fmt.Errorf("Range check failed on o.StandardCommissionForOrderTaker (%v < %v > %v)", o.StandardCommissionForOrderTakerMinValue(), o.StandardCommissionForOrderTaker, o.StandardCommissionForOrderTakerMaxValue()) + } + } + if o.TaxCommissionForOrderMakerInActingVersion(actingVersion) { + if o.TaxCommissionForOrderMaker < o.TaxCommissionForOrderMakerMinValue() || o.TaxCommissionForOrderMaker > o.TaxCommissionForOrderMakerMaxValue() { + return fmt.Errorf("Range check failed on o.TaxCommissionForOrderMaker (%v < %v > %v)", o.TaxCommissionForOrderMakerMinValue(), o.TaxCommissionForOrderMaker, o.TaxCommissionForOrderMakerMaxValue()) + } + } + if o.TaxCommissionForOrderTakerInActingVersion(actingVersion) { + if o.TaxCommissionForOrderTaker < o.TaxCommissionForOrderTakerMinValue() || o.TaxCommissionForOrderTaker > o.TaxCommissionForOrderTakerMaxValue() { + return fmt.Errorf("Range check failed on o.TaxCommissionForOrderTaker (%v < %v > %v)", o.TaxCommissionForOrderTakerMinValue(), o.TaxCommissionForOrderTaker, o.TaxCommissionForOrderTakerMaxValue()) + } + } + if err := o.DiscountEnabledForAccount.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if err := o.DiscountEnabledForSymbol.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if o.DiscountInActingVersion(actingVersion) { + if o.Discount < o.DiscountMinValue() || o.Discount > o.DiscountMaxValue() { + return fmt.Errorf("Range check failed on o.Discount (%v < %v > %v)", o.DiscountMinValue(), o.Discount, o.DiscountMaxValue()) + } + } + if o.SpecialCommissionForOrderMakerInActingVersion(actingVersion) { + if o.SpecialCommissionForOrderMaker != o.SpecialCommissionForOrderMakerNullValue() && (o.SpecialCommissionForOrderMaker < o.SpecialCommissionForOrderMakerMinValue() || o.SpecialCommissionForOrderMaker > o.SpecialCommissionForOrderMakerMaxValue()) { + return fmt.Errorf("Range check failed on o.SpecialCommissionForOrderMaker (%v < %v > %v)", o.SpecialCommissionForOrderMakerMinValue(), o.SpecialCommissionForOrderMaker, o.SpecialCommissionForOrderMakerMaxValue()) + } + } + if o.SpecialCommissionForOrderTakerInActingVersion(actingVersion) { + if o.SpecialCommissionForOrderTaker != o.SpecialCommissionForOrderTakerNullValue() && (o.SpecialCommissionForOrderTaker < o.SpecialCommissionForOrderTakerMinValue() || o.SpecialCommissionForOrderTaker > o.SpecialCommissionForOrderTakerMaxValue()) { + return fmt.Errorf("Range check failed on o.SpecialCommissionForOrderTaker (%v < %v > %v)", o.SpecialCommissionForOrderTakerMinValue(), o.SpecialCommissionForOrderTaker, o.SpecialCommissionForOrderTakerMaxValue()) + } + } + if !utf8.Valid(o.DiscountAsset[:]) { + return errors.New("o.DiscountAsset failed UTF-8 validation") + } + return nil +} + +func OrderTestWithCommissionsResponseInit(o *OrderTestWithCommissionsResponse) { + o.SpecialCommissionForOrderMaker = math.MinInt64 + o.SpecialCommissionForOrderTaker = math.MinInt64 + return +} + +func (*OrderTestWithCommissionsResponse) SbeBlockLength() (blockLength uint16) { + return 60 +} + +func (*OrderTestWithCommissionsResponse) SbeTemplateId() (templateId uint16) { + return 315 +} + +func (*OrderTestWithCommissionsResponse) SbeSchemaId() (schemaId uint16) { + return 3 +} + +func (*OrderTestWithCommissionsResponse) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} + +func (*OrderTestWithCommissionsResponse) SbeSemanticType() (semanticType []byte) { + return []byte("") +} + +func (*OrderTestWithCommissionsResponse) SbeSemanticVersion() (semanticVersion string) { + return "5.2" +} + +func (*OrderTestWithCommissionsResponse) CommissionExponentId() uint16 { + return 1 +} + +func (*OrderTestWithCommissionsResponse) CommissionExponentSinceVersion() uint16 { + return 0 +} + +func (o *OrderTestWithCommissionsResponse) CommissionExponentInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.CommissionExponentSinceVersion() +} + +func (*OrderTestWithCommissionsResponse) CommissionExponentDeprecated() uint16 { + return 0 +} + +func (*OrderTestWithCommissionsResponse) CommissionExponentMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrderTestWithCommissionsResponse) CommissionExponentMinValue() int8 { + return math.MinInt8 + 1 +} + +func (*OrderTestWithCommissionsResponse) CommissionExponentMaxValue() int8 { + return math.MaxInt8 +} + +func (*OrderTestWithCommissionsResponse) CommissionExponentNullValue() int8 { + return math.MinInt8 +} + +func (*OrderTestWithCommissionsResponse) DiscountExponentId() uint16 { + return 2 +} + +func (*OrderTestWithCommissionsResponse) DiscountExponentSinceVersion() uint16 { + return 0 +} + +func (o *OrderTestWithCommissionsResponse) DiscountExponentInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.DiscountExponentSinceVersion() +} + +func (*OrderTestWithCommissionsResponse) DiscountExponentDeprecated() uint16 { + return 0 +} + +func (*OrderTestWithCommissionsResponse) DiscountExponentMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrderTestWithCommissionsResponse) DiscountExponentMinValue() int8 { + return math.MinInt8 + 1 +} + +func (*OrderTestWithCommissionsResponse) DiscountExponentMaxValue() int8 { + return math.MaxInt8 +} + +func (*OrderTestWithCommissionsResponse) DiscountExponentNullValue() int8 { + return math.MinInt8 +} + +func (*OrderTestWithCommissionsResponse) StandardCommissionForOrderMakerId() uint16 { + return 3 +} + +func (*OrderTestWithCommissionsResponse) StandardCommissionForOrderMakerSinceVersion() uint16 { + return 0 +} + +func (o *OrderTestWithCommissionsResponse) StandardCommissionForOrderMakerInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.StandardCommissionForOrderMakerSinceVersion() +} + +func (*OrderTestWithCommissionsResponse) StandardCommissionForOrderMakerDeprecated() uint16 { + return 0 +} + +func (*OrderTestWithCommissionsResponse) StandardCommissionForOrderMakerMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrderTestWithCommissionsResponse) StandardCommissionForOrderMakerMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*OrderTestWithCommissionsResponse) StandardCommissionForOrderMakerMaxValue() int64 { + return math.MaxInt64 +} + +func (*OrderTestWithCommissionsResponse) StandardCommissionForOrderMakerNullValue() int64 { + return math.MinInt64 +} + +func (*OrderTestWithCommissionsResponse) StandardCommissionForOrderTakerId() uint16 { + return 4 +} + +func (*OrderTestWithCommissionsResponse) StandardCommissionForOrderTakerSinceVersion() uint16 { + return 0 +} + +func (o *OrderTestWithCommissionsResponse) StandardCommissionForOrderTakerInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.StandardCommissionForOrderTakerSinceVersion() +} + +func (*OrderTestWithCommissionsResponse) StandardCommissionForOrderTakerDeprecated() uint16 { + return 0 +} + +func (*OrderTestWithCommissionsResponse) StandardCommissionForOrderTakerMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrderTestWithCommissionsResponse) StandardCommissionForOrderTakerMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*OrderTestWithCommissionsResponse) StandardCommissionForOrderTakerMaxValue() int64 { + return math.MaxInt64 +} + +func (*OrderTestWithCommissionsResponse) StandardCommissionForOrderTakerNullValue() int64 { + return math.MinInt64 +} + +func (*OrderTestWithCommissionsResponse) TaxCommissionForOrderMakerId() uint16 { + return 5 +} + +func (*OrderTestWithCommissionsResponse) TaxCommissionForOrderMakerSinceVersion() uint16 { + return 0 +} + +func (o *OrderTestWithCommissionsResponse) TaxCommissionForOrderMakerInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.TaxCommissionForOrderMakerSinceVersion() +} + +func (*OrderTestWithCommissionsResponse) TaxCommissionForOrderMakerDeprecated() uint16 { + return 0 +} + +func (*OrderTestWithCommissionsResponse) TaxCommissionForOrderMakerMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrderTestWithCommissionsResponse) TaxCommissionForOrderMakerMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*OrderTestWithCommissionsResponse) TaxCommissionForOrderMakerMaxValue() int64 { + return math.MaxInt64 +} + +func (*OrderTestWithCommissionsResponse) TaxCommissionForOrderMakerNullValue() int64 { + return math.MinInt64 +} + +func (*OrderTestWithCommissionsResponse) TaxCommissionForOrderTakerId() uint16 { + return 6 +} + +func (*OrderTestWithCommissionsResponse) TaxCommissionForOrderTakerSinceVersion() uint16 { + return 0 +} + +func (o *OrderTestWithCommissionsResponse) TaxCommissionForOrderTakerInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.TaxCommissionForOrderTakerSinceVersion() +} + +func (*OrderTestWithCommissionsResponse) TaxCommissionForOrderTakerDeprecated() uint16 { + return 0 +} + +func (*OrderTestWithCommissionsResponse) TaxCommissionForOrderTakerMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrderTestWithCommissionsResponse) TaxCommissionForOrderTakerMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*OrderTestWithCommissionsResponse) TaxCommissionForOrderTakerMaxValue() int64 { + return math.MaxInt64 +} + +func (*OrderTestWithCommissionsResponse) TaxCommissionForOrderTakerNullValue() int64 { + return math.MinInt64 +} + +func (*OrderTestWithCommissionsResponse) DiscountEnabledForAccountId() uint16 { + return 7 +} + +func (*OrderTestWithCommissionsResponse) DiscountEnabledForAccountSinceVersion() uint16 { + return 0 +} + +func (o *OrderTestWithCommissionsResponse) DiscountEnabledForAccountInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.DiscountEnabledForAccountSinceVersion() +} + +func (*OrderTestWithCommissionsResponse) DiscountEnabledForAccountDeprecated() uint16 { + return 0 +} + +func (*OrderTestWithCommissionsResponse) DiscountEnabledForAccountMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrderTestWithCommissionsResponse) DiscountEnabledForSymbolId() uint16 { + return 8 +} + +func (*OrderTestWithCommissionsResponse) DiscountEnabledForSymbolSinceVersion() uint16 { + return 0 +} + +func (o *OrderTestWithCommissionsResponse) DiscountEnabledForSymbolInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.DiscountEnabledForSymbolSinceVersion() +} + +func (*OrderTestWithCommissionsResponse) DiscountEnabledForSymbolDeprecated() uint16 { + return 0 +} + +func (*OrderTestWithCommissionsResponse) DiscountEnabledForSymbolMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrderTestWithCommissionsResponse) DiscountId() uint16 { + return 9 +} + +func (*OrderTestWithCommissionsResponse) DiscountSinceVersion() uint16 { + return 0 +} + +func (o *OrderTestWithCommissionsResponse) DiscountInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.DiscountSinceVersion() +} + +func (*OrderTestWithCommissionsResponse) DiscountDeprecated() uint16 { + return 0 +} + +func (*OrderTestWithCommissionsResponse) DiscountMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrderTestWithCommissionsResponse) DiscountMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*OrderTestWithCommissionsResponse) DiscountMaxValue() int64 { + return math.MaxInt64 +} + +func (*OrderTestWithCommissionsResponse) DiscountNullValue() int64 { + return math.MinInt64 +} + +func (*OrderTestWithCommissionsResponse) SpecialCommissionForOrderMakerId() uint16 { + return 10 +} + +func (*OrderTestWithCommissionsResponse) SpecialCommissionForOrderMakerSinceVersion() uint16 { + return 1 +} + +func (o *OrderTestWithCommissionsResponse) SpecialCommissionForOrderMakerInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.SpecialCommissionForOrderMakerSinceVersion() +} + +func (*OrderTestWithCommissionsResponse) SpecialCommissionForOrderMakerDeprecated() uint16 { + return 0 +} + +func (*OrderTestWithCommissionsResponse) SpecialCommissionForOrderMakerMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*OrderTestWithCommissionsResponse) SpecialCommissionForOrderMakerMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*OrderTestWithCommissionsResponse) SpecialCommissionForOrderMakerMaxValue() int64 { + return math.MaxInt64 +} + +func (*OrderTestWithCommissionsResponse) SpecialCommissionForOrderMakerNullValue() int64 { + return math.MinInt64 +} + +func (*OrderTestWithCommissionsResponse) SpecialCommissionForOrderTakerId() uint16 { + return 11 +} + +func (*OrderTestWithCommissionsResponse) SpecialCommissionForOrderTakerSinceVersion() uint16 { + return 1 +} + +func (o *OrderTestWithCommissionsResponse) SpecialCommissionForOrderTakerInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.SpecialCommissionForOrderTakerSinceVersion() +} + +func (*OrderTestWithCommissionsResponse) SpecialCommissionForOrderTakerDeprecated() uint16 { + return 0 +} + +func (*OrderTestWithCommissionsResponse) SpecialCommissionForOrderTakerMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*OrderTestWithCommissionsResponse) SpecialCommissionForOrderTakerMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*OrderTestWithCommissionsResponse) SpecialCommissionForOrderTakerMaxValue() int64 { + return math.MaxInt64 +} + +func (*OrderTestWithCommissionsResponse) SpecialCommissionForOrderTakerNullValue() int64 { + return math.MinInt64 +} + +func (*OrderTestWithCommissionsResponse) DiscountAssetMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrderTestWithCommissionsResponse) DiscountAssetSinceVersion() uint16 { + return 0 +} + +func (o *OrderTestWithCommissionsResponse) DiscountAssetInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.DiscountAssetSinceVersion() +} + +func (*OrderTestWithCommissionsResponse) DiscountAssetDeprecated() uint16 { + return 0 +} + +func (OrderTestWithCommissionsResponse) DiscountAssetCharacterEncoding() string { + return "UTF-8" +} + +func (OrderTestWithCommissionsResponse) DiscountAssetHeaderLength() uint64 { + return 1 +} diff --git a/v2/sbe/spot_3_1/OrderType.go b/v2/sbe/spot_3_1/OrderType.go new file mode 100644 index 00000000..9649f2da --- /dev/null +++ b/v2/sbe/spot_3_1/OrderType.go @@ -0,0 +1,151 @@ +// Generated SBE (Simple Binary Encoding) message codec + +package sbe + +import ( + "fmt" + "io" + "reflect" +) + +type OrderTypeEnum uint8 +type OrderTypeValues struct { + Market OrderTypeEnum + Limit OrderTypeEnum + StopLoss OrderTypeEnum + StopLossLimit OrderTypeEnum + TakeProfit OrderTypeEnum + TakeProfitLimit OrderTypeEnum + LimitMaker OrderTypeEnum + NonRepresentable OrderTypeEnum + NullValue OrderTypeEnum +} + +var OrderType = OrderTypeValues{0, 1, 2, 3, 4, 5, 6, 254, 255} + +func (o OrderTypeEnum) Encode(_m *SbeGoMarshaller, _w io.Writer) error { + if err := _m.WriteUint8(_w, uint8(o)); err != nil { + return err + } + return nil +} + +func (o *OrderTypeEnum) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16) error { + if err := _m.ReadUint8(_r, (*uint8)(o)); err != nil { + return err + } + return nil +} + +func (o OrderTypeEnum) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if actingVersion > schemaVersion { + return nil + } + value := reflect.ValueOf(OrderType) + for idx := 0; idx < value.NumField(); idx++ { + if o == value.Field(idx).Interface() { + return nil + } + } + return fmt.Errorf("Range check failed on OrderType, unknown enumeration value %d", o) +} + +func (*OrderTypeEnum) EncodedLength() int64 { + return 1 +} + +func (*OrderTypeEnum) MarketSinceVersion() uint16 { + return 0 +} + +func (o *OrderTypeEnum) MarketInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.MarketSinceVersion() +} + +func (*OrderTypeEnum) MarketDeprecated() uint16 { + return 0 +} + +func (*OrderTypeEnum) LimitSinceVersion() uint16 { + return 0 +} + +func (o *OrderTypeEnum) LimitInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.LimitSinceVersion() +} + +func (*OrderTypeEnum) LimitDeprecated() uint16 { + return 0 +} + +func (*OrderTypeEnum) StopLossSinceVersion() uint16 { + return 0 +} + +func (o *OrderTypeEnum) StopLossInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.StopLossSinceVersion() +} + +func (*OrderTypeEnum) StopLossDeprecated() uint16 { + return 0 +} + +func (*OrderTypeEnum) StopLossLimitSinceVersion() uint16 { + return 0 +} + +func (o *OrderTypeEnum) StopLossLimitInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.StopLossLimitSinceVersion() +} + +func (*OrderTypeEnum) StopLossLimitDeprecated() uint16 { + return 0 +} + +func (*OrderTypeEnum) TakeProfitSinceVersion() uint16 { + return 0 +} + +func (o *OrderTypeEnum) TakeProfitInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.TakeProfitSinceVersion() +} + +func (*OrderTypeEnum) TakeProfitDeprecated() uint16 { + return 0 +} + +func (*OrderTypeEnum) TakeProfitLimitSinceVersion() uint16 { + return 0 +} + +func (o *OrderTypeEnum) TakeProfitLimitInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.TakeProfitLimitSinceVersion() +} + +func (*OrderTypeEnum) TakeProfitLimitDeprecated() uint16 { + return 0 +} + +func (*OrderTypeEnum) LimitMakerSinceVersion() uint16 { + return 0 +} + +func (o *OrderTypeEnum) LimitMakerInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.LimitMakerSinceVersion() +} + +func (*OrderTypeEnum) LimitMakerDeprecated() uint16 { + return 0 +} + +func (*OrderTypeEnum) NonRepresentableSinceVersion() uint16 { + return 0 +} + +func (o *OrderTypeEnum) NonRepresentableInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.NonRepresentableSinceVersion() +} + +func (*OrderTypeEnum) NonRepresentableDeprecated() uint16 { + return 0 +} diff --git a/v2/sbe/spot_3_1/OrderTypes.go b/v2/sbe/spot_3_1/OrderTypes.go new file mode 100644 index 00000000..3ef0d7d8 --- /dev/null +++ b/v2/sbe/spot_3_1/OrderTypes.go @@ -0,0 +1,146 @@ +// Generated SBE (Simple Binary Encoding) message codec + +package sbe + +import ( + "io" +) + +type OrderTypes [16]bool +type OrderTypesChoiceValue uint8 +type OrderTypesChoiceValues struct { + Market OrderTypesChoiceValue + Limit OrderTypesChoiceValue + StopLoss OrderTypesChoiceValue + StopLossLimit OrderTypesChoiceValue + TakeProfit OrderTypesChoiceValue + TakeProfitLimit OrderTypesChoiceValue + LimitMaker OrderTypesChoiceValue + NonRepresentable OrderTypesChoiceValue +} + +var OrderTypesChoice = OrderTypesChoiceValues{0, 1, 2, 3, 4, 5, 6, 15} + +func (o *OrderTypes) Encode(_m *SbeGoMarshaller, _w io.Writer) error { + var wireval uint16 = 0 + for k, v := range o { + if v { + wireval |= (1 << uint(k)) + } + } + return _m.WriteUint16(_w, wireval) +} + +func (o *OrderTypes) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16) error { + var wireval uint16 + + if err := _m.ReadUint16(_r, &wireval); err != nil { + return err + } + + var idx uint + for idx = 0; idx < 16; idx++ { + o[idx] = (wireval & (1 << idx)) > 0 + } + return nil +} + +func (OrderTypes) EncodedLength() int64 { + return 2 +} + +func (*OrderTypes) MarketSinceVersion() uint16 { + return 0 +} + +func (o *OrderTypes) MarketInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.MarketSinceVersion() +} + +func (*OrderTypes) MarketDeprecated() uint16 { + return 0 +} + +func (*OrderTypes) LimitSinceVersion() uint16 { + return 0 +} + +func (o *OrderTypes) LimitInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.LimitSinceVersion() +} + +func (*OrderTypes) LimitDeprecated() uint16 { + return 0 +} + +func (*OrderTypes) StopLossSinceVersion() uint16 { + return 0 +} + +func (o *OrderTypes) StopLossInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.StopLossSinceVersion() +} + +func (*OrderTypes) StopLossDeprecated() uint16 { + return 0 +} + +func (*OrderTypes) StopLossLimitSinceVersion() uint16 { + return 0 +} + +func (o *OrderTypes) StopLossLimitInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.StopLossLimitSinceVersion() +} + +func (*OrderTypes) StopLossLimitDeprecated() uint16 { + return 0 +} + +func (*OrderTypes) TakeProfitSinceVersion() uint16 { + return 0 +} + +func (o *OrderTypes) TakeProfitInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.TakeProfitSinceVersion() +} + +func (*OrderTypes) TakeProfitDeprecated() uint16 { + return 0 +} + +func (*OrderTypes) TakeProfitLimitSinceVersion() uint16 { + return 0 +} + +func (o *OrderTypes) TakeProfitLimitInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.TakeProfitLimitSinceVersion() +} + +func (*OrderTypes) TakeProfitLimitDeprecated() uint16 { + return 0 +} + +func (*OrderTypes) LimitMakerSinceVersion() uint16 { + return 0 +} + +func (o *OrderTypes) LimitMakerInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.LimitMakerSinceVersion() +} + +func (*OrderTypes) LimitMakerDeprecated() uint16 { + return 0 +} + +func (*OrderTypes) NonRepresentableSinceVersion() uint16 { + return 0 +} + +func (o *OrderTypes) NonRepresentableInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.NonRepresentableSinceVersion() +} + +func (*OrderTypes) NonRepresentableDeprecated() uint16 { + return 0 +} diff --git a/v2/sbe/spot_3_1/OrdersResponse.go b/v2/sbe/spot_3_1/OrdersResponse.go new file mode 100644 index 00000000..76a45323 --- /dev/null +++ b/v2/sbe/spot_3_1/OrdersResponse.go @@ -0,0 +1,2017 @@ +// Generated SBE (Simple Binary Encoding) message codec + +package sbe + +import ( + "errors" + "fmt" + "io" + "io/ioutil" + "math" + "unicode/utf8" +) + +type OrdersResponse struct { + Orders []OrdersResponseOrders +} +type OrdersResponseOrders struct { + PriceExponent int8 + QtyExponent int8 + OrderId int64 + OrderListId int64 + Price int64 + OrigQty int64 + ExecutedQty int64 + CummulativeQuoteQty int64 + Status OrderStatusEnum + TimeInForce TimeInForceEnum + OrderType OrderTypeEnum + Side OrderSideEnum + StopPrice int64 + TrailingDelta int64 + TrailingTime int64 + IcebergQty int64 + Time int64 + UpdateTime int64 + IsWorking BoolEnumEnum + WorkingTime int64 + OrigQuoteOrderQty int64 + StrategyId int64 + StrategyType int32 + OrderCapacity OrderCapacityEnum + WorkingFloor FloorEnum + SelfTradePreventionMode SelfTradePreventionModeEnum + PreventedMatchId int64 + PreventedQuantity int64 + UsedSor BoolEnumEnum + PegPriceType PegPriceTypeEnum + PegOffsetType PegOffsetTypeEnum + PegOffsetValue uint8 + PeggedPrice int64 + Symbol []uint8 + ClientOrderId []uint8 +} + +func (o *OrdersResponse) Encode(_m *SbeGoMarshaller, _w io.Writer, doRangeCheck bool) error { + if doRangeCheck { + if err := o.RangeCheck(o.SbeSchemaVersion(), o.SbeSchemaVersion()); err != nil { + return err + } + } + var OrdersBlockLength uint16 = 162 + if err := _m.WriteUint16(_w, OrdersBlockLength); err != nil { + return err + } + var OrdersNumInGroup uint32 = uint32(len(o.Orders)) + if err := _m.WriteUint32(_w, OrdersNumInGroup); err != nil { + return err + } + for i := range o.Orders { + if err := o.Orders[i].Encode(_m, _w); err != nil { + return err + } + } + return nil +} + +func (o *OrdersResponse) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint16, doRangeCheck bool) error { + if actingVersion > o.SbeSchemaVersion() && blockLength > o.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-o.SbeBlockLength())) + } + + if o.OrdersInActingVersion(actingVersion) { + var OrdersBlockLength uint16 + if err := _m.ReadUint16(_r, &OrdersBlockLength); err != nil { + return err + } + var OrdersNumInGroup uint32 + if err := _m.ReadUint32(_r, &OrdersNumInGroup); err != nil { + return err + } + if cap(o.Orders) < int(OrdersNumInGroup) { + o.Orders = make([]OrdersResponseOrders, OrdersNumInGroup) + } + o.Orders = o.Orders[:OrdersNumInGroup] + for i := range o.Orders { + if err := o.Orders[i].Decode(_m, _r, actingVersion, uint(OrdersBlockLength)); err != nil { + return err + } + } + } + if doRangeCheck { + if err := o.RangeCheck(actingVersion, o.SbeSchemaVersion()); err != nil { + return err + } + } + return nil +} + +func (o *OrdersResponse) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + for i := range o.Orders { + if err := o.Orders[i].RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + } + return nil +} + +func OrdersResponseInit(o *OrdersResponse) { + return +} + +func (o *OrdersResponseOrders) Encode(_m *SbeGoMarshaller, _w io.Writer) error { + if err := _m.WriteInt8(_w, o.PriceExponent); err != nil { + return err + } + if err := _m.WriteInt8(_w, o.QtyExponent); err != nil { + return err + } + if err := _m.WriteInt64(_w, o.OrderId); err != nil { + return err + } + if err := _m.WriteInt64(_w, o.OrderListId); err != nil { + return err + } + if err := _m.WriteInt64(_w, o.Price); err != nil { + return err + } + if err := _m.WriteInt64(_w, o.OrigQty); err != nil { + return err + } + if err := _m.WriteInt64(_w, o.ExecutedQty); err != nil { + return err + } + if err := _m.WriteInt64(_w, o.CummulativeQuoteQty); err != nil { + return err + } + if err := o.Status.Encode(_m, _w); err != nil { + return err + } + if err := o.TimeInForce.Encode(_m, _w); err != nil { + return err + } + if err := o.OrderType.Encode(_m, _w); err != nil { + return err + } + if err := o.Side.Encode(_m, _w); err != nil { + return err + } + if err := _m.WriteInt64(_w, o.StopPrice); err != nil { + return err + } + if err := _m.WriteInt64(_w, o.TrailingDelta); err != nil { + return err + } + if err := _m.WriteInt64(_w, o.TrailingTime); err != nil { + return err + } + if err := _m.WriteInt64(_w, o.IcebergQty); err != nil { + return err + } + if err := _m.WriteInt64(_w, o.Time); err != nil { + return err + } + if err := _m.WriteInt64(_w, o.UpdateTime); err != nil { + return err + } + if err := o.IsWorking.Encode(_m, _w); err != nil { + return err + } + if err := _m.WriteInt64(_w, o.WorkingTime); err != nil { + return err + } + if err := _m.WriteInt64(_w, o.OrigQuoteOrderQty); err != nil { + return err + } + if err := _m.WriteInt64(_w, o.StrategyId); err != nil { + return err + } + if err := _m.WriteInt32(_w, o.StrategyType); err != nil { + return err + } + if err := o.OrderCapacity.Encode(_m, _w); err != nil { + return err + } + if err := o.WorkingFloor.Encode(_m, _w); err != nil { + return err + } + if err := o.SelfTradePreventionMode.Encode(_m, _w); err != nil { + return err + } + if err := _m.WriteInt64(_w, o.PreventedMatchId); err != nil { + return err + } + if err := _m.WriteInt64(_w, o.PreventedQuantity); err != nil { + return err + } + if err := o.UsedSor.Encode(_m, _w); err != nil { + return err + } + if err := o.PegPriceType.Encode(_m, _w); err != nil { + return err + } + if err := o.PegOffsetType.Encode(_m, _w); err != nil { + return err + } + if err := _m.WriteUint8(_w, o.PegOffsetValue); err != nil { + return err + } + if err := _m.WriteInt64(_w, o.PeggedPrice); err != nil { + return err + } + if err := _m.WriteUint8(_w, uint8(len(o.Symbol))); err != nil { + return err + } + if err := _m.WriteBytes(_w, o.Symbol); err != nil { + return err + } + if err := _m.WriteUint8(_w, uint8(len(o.ClientOrderId))); err != nil { + return err + } + if err := _m.WriteBytes(_w, o.ClientOrderId); err != nil { + return err + } + return nil +} + +func (o *OrdersResponseOrders) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint) error { + if !o.PriceExponentInActingVersion(actingVersion) { + o.PriceExponent = o.PriceExponentNullValue() + } else { + if err := _m.ReadInt8(_r, &o.PriceExponent); err != nil { + return err + } + } + if !o.QtyExponentInActingVersion(actingVersion) { + o.QtyExponent = o.QtyExponentNullValue() + } else { + if err := _m.ReadInt8(_r, &o.QtyExponent); err != nil { + return err + } + } + if !o.OrderIdInActingVersion(actingVersion) { + o.OrderId = o.OrderIdNullValue() + } else { + if err := _m.ReadInt64(_r, &o.OrderId); err != nil { + return err + } + } + if !o.OrderListIdInActingVersion(actingVersion) { + o.OrderListId = o.OrderListIdNullValue() + } else { + if err := _m.ReadInt64(_r, &o.OrderListId); err != nil { + return err + } + } + if !o.PriceInActingVersion(actingVersion) { + o.Price = o.PriceNullValue() + } else { + if err := _m.ReadInt64(_r, &o.Price); err != nil { + return err + } + } + if !o.OrigQtyInActingVersion(actingVersion) { + o.OrigQty = o.OrigQtyNullValue() + } else { + if err := _m.ReadInt64(_r, &o.OrigQty); err != nil { + return err + } + } + if !o.ExecutedQtyInActingVersion(actingVersion) { + o.ExecutedQty = o.ExecutedQtyNullValue() + } else { + if err := _m.ReadInt64(_r, &o.ExecutedQty); err != nil { + return err + } + } + if !o.CummulativeQuoteQtyInActingVersion(actingVersion) { + o.CummulativeQuoteQty = o.CummulativeQuoteQtyNullValue() + } else { + if err := _m.ReadInt64(_r, &o.CummulativeQuoteQty); err != nil { + return err + } + } + if o.StatusInActingVersion(actingVersion) { + if err := o.Status.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if o.TimeInForceInActingVersion(actingVersion) { + if err := o.TimeInForce.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if o.OrderTypeInActingVersion(actingVersion) { + if err := o.OrderType.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if o.SideInActingVersion(actingVersion) { + if err := o.Side.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if !o.StopPriceInActingVersion(actingVersion) { + o.StopPrice = o.StopPriceNullValue() + } else { + if err := _m.ReadInt64(_r, &o.StopPrice); err != nil { + return err + } + } + if !o.TrailingDeltaInActingVersion(actingVersion) { + o.TrailingDelta = o.TrailingDeltaNullValue() + } else { + if err := _m.ReadInt64(_r, &o.TrailingDelta); err != nil { + return err + } + } + if !o.TrailingTimeInActingVersion(actingVersion) { + o.TrailingTime = o.TrailingTimeNullValue() + } else { + if err := _m.ReadInt64(_r, &o.TrailingTime); err != nil { + return err + } + } + if !o.IcebergQtyInActingVersion(actingVersion) { + o.IcebergQty = o.IcebergQtyNullValue() + } else { + if err := _m.ReadInt64(_r, &o.IcebergQty); err != nil { + return err + } + } + if !o.TimeInActingVersion(actingVersion) { + o.Time = o.TimeNullValue() + } else { + if err := _m.ReadInt64(_r, &o.Time); err != nil { + return err + } + } + if !o.UpdateTimeInActingVersion(actingVersion) { + o.UpdateTime = o.UpdateTimeNullValue() + } else { + if err := _m.ReadInt64(_r, &o.UpdateTime); err != nil { + return err + } + } + if o.IsWorkingInActingVersion(actingVersion) { + if err := o.IsWorking.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if !o.WorkingTimeInActingVersion(actingVersion) { + o.WorkingTime = o.WorkingTimeNullValue() + } else { + if err := _m.ReadInt64(_r, &o.WorkingTime); err != nil { + return err + } + } + if !o.OrigQuoteOrderQtyInActingVersion(actingVersion) { + o.OrigQuoteOrderQty = o.OrigQuoteOrderQtyNullValue() + } else { + if err := _m.ReadInt64(_r, &o.OrigQuoteOrderQty); err != nil { + return err + } + } + if !o.StrategyIdInActingVersion(actingVersion) { + o.StrategyId = o.StrategyIdNullValue() + } else { + if err := _m.ReadInt64(_r, &o.StrategyId); err != nil { + return err + } + } + if !o.StrategyTypeInActingVersion(actingVersion) { + o.StrategyType = o.StrategyTypeNullValue() + } else { + if err := _m.ReadInt32(_r, &o.StrategyType); err != nil { + return err + } + } + if o.OrderCapacityInActingVersion(actingVersion) { + if err := o.OrderCapacity.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if o.WorkingFloorInActingVersion(actingVersion) { + if err := o.WorkingFloor.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if o.SelfTradePreventionModeInActingVersion(actingVersion) { + if err := o.SelfTradePreventionMode.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if !o.PreventedMatchIdInActingVersion(actingVersion) { + o.PreventedMatchId = o.PreventedMatchIdNullValue() + } else { + if err := _m.ReadInt64(_r, &o.PreventedMatchId); err != nil { + return err + } + } + if !o.PreventedQuantityInActingVersion(actingVersion) { + o.PreventedQuantity = o.PreventedQuantityNullValue() + } else { + if err := _m.ReadInt64(_r, &o.PreventedQuantity); err != nil { + return err + } + } + if o.UsedSorInActingVersion(actingVersion) { + if err := o.UsedSor.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if o.PegPriceTypeInActingVersion(actingVersion) { + if err := o.PegPriceType.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if o.PegOffsetTypeInActingVersion(actingVersion) { + if err := o.PegOffsetType.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if !o.PegOffsetValueInActingVersion(actingVersion) { + o.PegOffsetValue = o.PegOffsetValueNullValue() + } else { + if err := _m.ReadUint8(_r, &o.PegOffsetValue); err != nil { + return err + } + } + if !o.PeggedPriceInActingVersion(actingVersion) { + o.PeggedPrice = o.PeggedPriceNullValue() + } else { + if err := _m.ReadInt64(_r, &o.PeggedPrice); err != nil { + return err + } + } + if actingVersion > o.SbeSchemaVersion() && blockLength > o.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-o.SbeBlockLength())) + } + + if o.SymbolInActingVersion(actingVersion) { + var SymbolLength uint8 + if err := _m.ReadUint8(_r, &SymbolLength); err != nil { + return err + } + if cap(o.Symbol) < int(SymbolLength) { + o.Symbol = make([]uint8, SymbolLength) + } + o.Symbol = o.Symbol[:SymbolLength] + if err := _m.ReadBytes(_r, o.Symbol); err != nil { + return err + } + } + + if o.ClientOrderIdInActingVersion(actingVersion) { + var ClientOrderIdLength uint8 + if err := _m.ReadUint8(_r, &ClientOrderIdLength); err != nil { + return err + } + if cap(o.ClientOrderId) < int(ClientOrderIdLength) { + o.ClientOrderId = make([]uint8, ClientOrderIdLength) + } + o.ClientOrderId = o.ClientOrderId[:ClientOrderIdLength] + if err := _m.ReadBytes(_r, o.ClientOrderId); err != nil { + return err + } + } + return nil +} + +func (o *OrdersResponseOrders) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if o.PriceExponentInActingVersion(actingVersion) { + if o.PriceExponent < o.PriceExponentMinValue() || o.PriceExponent > o.PriceExponentMaxValue() { + return fmt.Errorf("Range check failed on o.PriceExponent (%v < %v > %v)", o.PriceExponentMinValue(), o.PriceExponent, o.PriceExponentMaxValue()) + } + } + if o.QtyExponentInActingVersion(actingVersion) { + if o.QtyExponent < o.QtyExponentMinValue() || o.QtyExponent > o.QtyExponentMaxValue() { + return fmt.Errorf("Range check failed on o.QtyExponent (%v < %v > %v)", o.QtyExponentMinValue(), o.QtyExponent, o.QtyExponentMaxValue()) + } + } + if o.OrderIdInActingVersion(actingVersion) { + if o.OrderId < o.OrderIdMinValue() || o.OrderId > o.OrderIdMaxValue() { + return fmt.Errorf("Range check failed on o.OrderId (%v < %v > %v)", o.OrderIdMinValue(), o.OrderId, o.OrderIdMaxValue()) + } + } + if o.OrderListIdInActingVersion(actingVersion) { + if o.OrderListId != o.OrderListIdNullValue() && (o.OrderListId < o.OrderListIdMinValue() || o.OrderListId > o.OrderListIdMaxValue()) { + return fmt.Errorf("Range check failed on o.OrderListId (%v < %v > %v)", o.OrderListIdMinValue(), o.OrderListId, o.OrderListIdMaxValue()) + } + } + if o.PriceInActingVersion(actingVersion) { + if o.Price < o.PriceMinValue() || o.Price > o.PriceMaxValue() { + return fmt.Errorf("Range check failed on o.Price (%v < %v > %v)", o.PriceMinValue(), o.Price, o.PriceMaxValue()) + } + } + if o.OrigQtyInActingVersion(actingVersion) { + if o.OrigQty < o.OrigQtyMinValue() || o.OrigQty > o.OrigQtyMaxValue() { + return fmt.Errorf("Range check failed on o.OrigQty (%v < %v > %v)", o.OrigQtyMinValue(), o.OrigQty, o.OrigQtyMaxValue()) + } + } + if o.ExecutedQtyInActingVersion(actingVersion) { + if o.ExecutedQty < o.ExecutedQtyMinValue() || o.ExecutedQty > o.ExecutedQtyMaxValue() { + return fmt.Errorf("Range check failed on o.ExecutedQty (%v < %v > %v)", o.ExecutedQtyMinValue(), o.ExecutedQty, o.ExecutedQtyMaxValue()) + } + } + if o.CummulativeQuoteQtyInActingVersion(actingVersion) { + if o.CummulativeQuoteQty < o.CummulativeQuoteQtyMinValue() || o.CummulativeQuoteQty > o.CummulativeQuoteQtyMaxValue() { + return fmt.Errorf("Range check failed on o.CummulativeQuoteQty (%v < %v > %v)", o.CummulativeQuoteQtyMinValue(), o.CummulativeQuoteQty, o.CummulativeQuoteQtyMaxValue()) + } + } + if err := o.Status.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if err := o.TimeInForce.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if err := o.OrderType.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if err := o.Side.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if o.StopPriceInActingVersion(actingVersion) { + if o.StopPrice != o.StopPriceNullValue() && (o.StopPrice < o.StopPriceMinValue() || o.StopPrice > o.StopPriceMaxValue()) { + return fmt.Errorf("Range check failed on o.StopPrice (%v < %v > %v)", o.StopPriceMinValue(), o.StopPrice, o.StopPriceMaxValue()) + } + } + if o.TrailingDeltaInActingVersion(actingVersion) { + if o.TrailingDelta != o.TrailingDeltaNullValue() && (o.TrailingDelta < o.TrailingDeltaMinValue() || o.TrailingDelta > o.TrailingDeltaMaxValue()) { + return fmt.Errorf("Range check failed on o.TrailingDelta (%v < %v > %v)", o.TrailingDeltaMinValue(), o.TrailingDelta, o.TrailingDeltaMaxValue()) + } + } + if o.TrailingTimeInActingVersion(actingVersion) { + if o.TrailingTime != o.TrailingTimeNullValue() && (o.TrailingTime < o.TrailingTimeMinValue() || o.TrailingTime > o.TrailingTimeMaxValue()) { + return fmt.Errorf("Range check failed on o.TrailingTime (%v < %v > %v)", o.TrailingTimeMinValue(), o.TrailingTime, o.TrailingTimeMaxValue()) + } + } + if o.IcebergQtyInActingVersion(actingVersion) { + if o.IcebergQty != o.IcebergQtyNullValue() && (o.IcebergQty < o.IcebergQtyMinValue() || o.IcebergQty > o.IcebergQtyMaxValue()) { + return fmt.Errorf("Range check failed on o.IcebergQty (%v < %v > %v)", o.IcebergQtyMinValue(), o.IcebergQty, o.IcebergQtyMaxValue()) + } + } + if o.TimeInActingVersion(actingVersion) { + if o.Time < o.TimeMinValue() || o.Time > o.TimeMaxValue() { + return fmt.Errorf("Range check failed on o.Time (%v < %v > %v)", o.TimeMinValue(), o.Time, o.TimeMaxValue()) + } + } + if o.UpdateTimeInActingVersion(actingVersion) { + if o.UpdateTime < o.UpdateTimeMinValue() || o.UpdateTime > o.UpdateTimeMaxValue() { + return fmt.Errorf("Range check failed on o.UpdateTime (%v < %v > %v)", o.UpdateTimeMinValue(), o.UpdateTime, o.UpdateTimeMaxValue()) + } + } + if err := o.IsWorking.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if o.WorkingTimeInActingVersion(actingVersion) { + if o.WorkingTime != o.WorkingTimeNullValue() && (o.WorkingTime < o.WorkingTimeMinValue() || o.WorkingTime > o.WorkingTimeMaxValue()) { + return fmt.Errorf("Range check failed on o.WorkingTime (%v < %v > %v)", o.WorkingTimeMinValue(), o.WorkingTime, o.WorkingTimeMaxValue()) + } + } + if o.OrigQuoteOrderQtyInActingVersion(actingVersion) { + if o.OrigQuoteOrderQty < o.OrigQuoteOrderQtyMinValue() || o.OrigQuoteOrderQty > o.OrigQuoteOrderQtyMaxValue() { + return fmt.Errorf("Range check failed on o.OrigQuoteOrderQty (%v < %v > %v)", o.OrigQuoteOrderQtyMinValue(), o.OrigQuoteOrderQty, o.OrigQuoteOrderQtyMaxValue()) + } + } + if o.StrategyIdInActingVersion(actingVersion) { + if o.StrategyId != o.StrategyIdNullValue() && (o.StrategyId < o.StrategyIdMinValue() || o.StrategyId > o.StrategyIdMaxValue()) { + return fmt.Errorf("Range check failed on o.StrategyId (%v < %v > %v)", o.StrategyIdMinValue(), o.StrategyId, o.StrategyIdMaxValue()) + } + } + if o.StrategyTypeInActingVersion(actingVersion) { + if o.StrategyType != o.StrategyTypeNullValue() && (o.StrategyType < o.StrategyTypeMinValue() || o.StrategyType > o.StrategyTypeMaxValue()) { + return fmt.Errorf("Range check failed on o.StrategyType (%v < %v > %v)", o.StrategyTypeMinValue(), o.StrategyType, o.StrategyTypeMaxValue()) + } + } + if err := o.OrderCapacity.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if err := o.WorkingFloor.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if err := o.SelfTradePreventionMode.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if o.PreventedMatchIdInActingVersion(actingVersion) { + if o.PreventedMatchId != o.PreventedMatchIdNullValue() && (o.PreventedMatchId < o.PreventedMatchIdMinValue() || o.PreventedMatchId > o.PreventedMatchIdMaxValue()) { + return fmt.Errorf("Range check failed on o.PreventedMatchId (%v < %v > %v)", o.PreventedMatchIdMinValue(), o.PreventedMatchId, o.PreventedMatchIdMaxValue()) + } + } + if o.PreventedQuantityInActingVersion(actingVersion) { + if o.PreventedQuantity < o.PreventedQuantityMinValue() || o.PreventedQuantity > o.PreventedQuantityMaxValue() { + return fmt.Errorf("Range check failed on o.PreventedQuantity (%v < %v > %v)", o.PreventedQuantityMinValue(), o.PreventedQuantity, o.PreventedQuantityMaxValue()) + } + } + if err := o.UsedSor.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if err := o.PegPriceType.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if err := o.PegOffsetType.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if o.PegOffsetValueInActingVersion(actingVersion) { + if o.PegOffsetValue != o.PegOffsetValueNullValue() && (o.PegOffsetValue < o.PegOffsetValueMinValue() || o.PegOffsetValue > o.PegOffsetValueMaxValue()) { + return fmt.Errorf("Range check failed on o.PegOffsetValue (%v < %v > %v)", o.PegOffsetValueMinValue(), o.PegOffsetValue, o.PegOffsetValueMaxValue()) + } + } + if o.PeggedPriceInActingVersion(actingVersion) { + if o.PeggedPrice != o.PeggedPriceNullValue() && (o.PeggedPrice < o.PeggedPriceMinValue() || o.PeggedPrice > o.PeggedPriceMaxValue()) { + return fmt.Errorf("Range check failed on o.PeggedPrice (%v < %v > %v)", o.PeggedPriceMinValue(), o.PeggedPrice, o.PeggedPriceMaxValue()) + } + } + if !utf8.Valid(o.Symbol[:]) { + return errors.New("o.Symbol failed UTF-8 validation") + } + if !utf8.Valid(o.ClientOrderId[:]) { + return errors.New("o.ClientOrderId failed UTF-8 validation") + } + return nil +} + +func OrdersResponseOrdersInit(o *OrdersResponseOrders) { + o.OrderListId = math.MinInt64 + o.StopPrice = math.MinInt64 + o.TrailingDelta = math.MinInt64 + o.TrailingTime = math.MinInt64 + o.IcebergQty = math.MinInt64 + o.WorkingTime = math.MinInt64 + o.StrategyId = math.MinInt64 + o.StrategyType = math.MinInt32 + o.PreventedMatchId = math.MinInt64 + o.PegOffsetValue = math.MaxUint8 + o.PeggedPrice = math.MinInt64 + return +} + +func (*OrdersResponse) SbeBlockLength() (blockLength uint16) { + return 0 +} + +func (*OrdersResponse) SbeTemplateId() (templateId uint16) { + return 308 +} + +func (*OrdersResponse) SbeSchemaId() (schemaId uint16) { + return 3 +} + +func (*OrdersResponse) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} + +func (*OrdersResponse) SbeSemanticType() (semanticType []byte) { + return []byte("") +} + +func (*OrdersResponse) SbeSemanticVersion() (semanticVersion string) { + return "5.2" +} + +func (*OrdersResponseOrders) PriceExponentId() uint16 { + return 1 +} + +func (*OrdersResponseOrders) PriceExponentSinceVersion() uint16 { + return 0 +} + +func (o *OrdersResponseOrders) PriceExponentInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.PriceExponentSinceVersion() +} + +func (*OrdersResponseOrders) PriceExponentDeprecated() uint16 { + return 0 +} + +func (*OrdersResponseOrders) PriceExponentMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrdersResponseOrders) PriceExponentMinValue() int8 { + return math.MinInt8 + 1 +} + +func (*OrdersResponseOrders) PriceExponentMaxValue() int8 { + return math.MaxInt8 +} + +func (*OrdersResponseOrders) PriceExponentNullValue() int8 { + return math.MinInt8 +} + +func (*OrdersResponseOrders) QtyExponentId() uint16 { + return 2 +} + +func (*OrdersResponseOrders) QtyExponentSinceVersion() uint16 { + return 0 +} + +func (o *OrdersResponseOrders) QtyExponentInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.QtyExponentSinceVersion() +} + +func (*OrdersResponseOrders) QtyExponentDeprecated() uint16 { + return 0 +} + +func (*OrdersResponseOrders) QtyExponentMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrdersResponseOrders) QtyExponentMinValue() int8 { + return math.MinInt8 + 1 +} + +func (*OrdersResponseOrders) QtyExponentMaxValue() int8 { + return math.MaxInt8 +} + +func (*OrdersResponseOrders) QtyExponentNullValue() int8 { + return math.MinInt8 +} + +func (*OrdersResponseOrders) OrderIdId() uint16 { + return 3 +} + +func (*OrdersResponseOrders) OrderIdSinceVersion() uint16 { + return 0 +} + +func (o *OrdersResponseOrders) OrderIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.OrderIdSinceVersion() +} + +func (*OrdersResponseOrders) OrderIdDeprecated() uint16 { + return 0 +} + +func (*OrdersResponseOrders) OrderIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrdersResponseOrders) OrderIdMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*OrdersResponseOrders) OrderIdMaxValue() int64 { + return math.MaxInt64 +} + +func (*OrdersResponseOrders) OrderIdNullValue() int64 { + return math.MinInt64 +} + +func (*OrdersResponseOrders) OrderListIdId() uint16 { + return 4 +} + +func (*OrdersResponseOrders) OrderListIdSinceVersion() uint16 { + return 0 +} + +func (o *OrdersResponseOrders) OrderListIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.OrderListIdSinceVersion() +} + +func (*OrdersResponseOrders) OrderListIdDeprecated() uint16 { + return 0 +} + +func (*OrdersResponseOrders) OrderListIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*OrdersResponseOrders) OrderListIdMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*OrdersResponseOrders) OrderListIdMaxValue() int64 { + return math.MaxInt64 +} + +func (*OrdersResponseOrders) OrderListIdNullValue() int64 { + return math.MinInt64 +} + +func (*OrdersResponseOrders) PriceId() uint16 { + return 5 +} + +func (*OrdersResponseOrders) PriceSinceVersion() uint16 { + return 0 +} + +func (o *OrdersResponseOrders) PriceInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.PriceSinceVersion() +} + +func (*OrdersResponseOrders) PriceDeprecated() uint16 { + return 0 +} + +func (*OrdersResponseOrders) PriceMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrdersResponseOrders) PriceMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*OrdersResponseOrders) PriceMaxValue() int64 { + return math.MaxInt64 +} + +func (*OrdersResponseOrders) PriceNullValue() int64 { + return math.MinInt64 +} + +func (*OrdersResponseOrders) OrigQtyId() uint16 { + return 6 +} + +func (*OrdersResponseOrders) OrigQtySinceVersion() uint16 { + return 0 +} + +func (o *OrdersResponseOrders) OrigQtyInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.OrigQtySinceVersion() +} + +func (*OrdersResponseOrders) OrigQtyDeprecated() uint16 { + return 0 +} + +func (*OrdersResponseOrders) OrigQtyMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrdersResponseOrders) OrigQtyMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*OrdersResponseOrders) OrigQtyMaxValue() int64 { + return math.MaxInt64 +} + +func (*OrdersResponseOrders) OrigQtyNullValue() int64 { + return math.MinInt64 +} + +func (*OrdersResponseOrders) ExecutedQtyId() uint16 { + return 7 +} + +func (*OrdersResponseOrders) ExecutedQtySinceVersion() uint16 { + return 0 +} + +func (o *OrdersResponseOrders) ExecutedQtyInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.ExecutedQtySinceVersion() +} + +func (*OrdersResponseOrders) ExecutedQtyDeprecated() uint16 { + return 0 +} + +func (*OrdersResponseOrders) ExecutedQtyMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrdersResponseOrders) ExecutedQtyMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*OrdersResponseOrders) ExecutedQtyMaxValue() int64 { + return math.MaxInt64 +} + +func (*OrdersResponseOrders) ExecutedQtyNullValue() int64 { + return math.MinInt64 +} + +func (*OrdersResponseOrders) CummulativeQuoteQtyId() uint16 { + return 8 +} + +func (*OrdersResponseOrders) CummulativeQuoteQtySinceVersion() uint16 { + return 0 +} + +func (o *OrdersResponseOrders) CummulativeQuoteQtyInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.CummulativeQuoteQtySinceVersion() +} + +func (*OrdersResponseOrders) CummulativeQuoteQtyDeprecated() uint16 { + return 0 +} + +func (*OrdersResponseOrders) CummulativeQuoteQtyMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrdersResponseOrders) CummulativeQuoteQtyMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*OrdersResponseOrders) CummulativeQuoteQtyMaxValue() int64 { + return math.MaxInt64 +} + +func (*OrdersResponseOrders) CummulativeQuoteQtyNullValue() int64 { + return math.MinInt64 +} + +func (*OrdersResponseOrders) StatusId() uint16 { + return 9 +} + +func (*OrdersResponseOrders) StatusSinceVersion() uint16 { + return 0 +} + +func (o *OrdersResponseOrders) StatusInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.StatusSinceVersion() +} + +func (*OrdersResponseOrders) StatusDeprecated() uint16 { + return 0 +} + +func (*OrdersResponseOrders) StatusMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrdersResponseOrders) TimeInForceId() uint16 { + return 10 +} + +func (*OrdersResponseOrders) TimeInForceSinceVersion() uint16 { + return 0 +} + +func (o *OrdersResponseOrders) TimeInForceInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.TimeInForceSinceVersion() +} + +func (*OrdersResponseOrders) TimeInForceDeprecated() uint16 { + return 0 +} + +func (*OrdersResponseOrders) TimeInForceMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrdersResponseOrders) OrderTypeId() uint16 { + return 11 +} + +func (*OrdersResponseOrders) OrderTypeSinceVersion() uint16 { + return 0 +} + +func (o *OrdersResponseOrders) OrderTypeInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.OrderTypeSinceVersion() +} + +func (*OrdersResponseOrders) OrderTypeDeprecated() uint16 { + return 0 +} + +func (*OrdersResponseOrders) OrderTypeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrdersResponseOrders) SideId() uint16 { + return 12 +} + +func (*OrdersResponseOrders) SideSinceVersion() uint16 { + return 0 +} + +func (o *OrdersResponseOrders) SideInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.SideSinceVersion() +} + +func (*OrdersResponseOrders) SideDeprecated() uint16 { + return 0 +} + +func (*OrdersResponseOrders) SideMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrdersResponseOrders) StopPriceId() uint16 { + return 13 +} + +func (*OrdersResponseOrders) StopPriceSinceVersion() uint16 { + return 0 +} + +func (o *OrdersResponseOrders) StopPriceInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.StopPriceSinceVersion() +} + +func (*OrdersResponseOrders) StopPriceDeprecated() uint16 { + return 0 +} + +func (*OrdersResponseOrders) StopPriceMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*OrdersResponseOrders) StopPriceMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*OrdersResponseOrders) StopPriceMaxValue() int64 { + return math.MaxInt64 +} + +func (*OrdersResponseOrders) StopPriceNullValue() int64 { + return math.MinInt64 +} + +func (*OrdersResponseOrders) TrailingDeltaId() uint16 { + return 14 +} + +func (*OrdersResponseOrders) TrailingDeltaSinceVersion() uint16 { + return 0 +} + +func (o *OrdersResponseOrders) TrailingDeltaInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.TrailingDeltaSinceVersion() +} + +func (*OrdersResponseOrders) TrailingDeltaDeprecated() uint16 { + return 0 +} + +func (*OrdersResponseOrders) TrailingDeltaMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*OrdersResponseOrders) TrailingDeltaMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*OrdersResponseOrders) TrailingDeltaMaxValue() int64 { + return math.MaxInt64 +} + +func (*OrdersResponseOrders) TrailingDeltaNullValue() int64 { + return math.MinInt64 +} + +func (*OrdersResponseOrders) TrailingTimeId() uint16 { + return 15 +} + +func (*OrdersResponseOrders) TrailingTimeSinceVersion() uint16 { + return 0 +} + +func (o *OrdersResponseOrders) TrailingTimeInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.TrailingTimeSinceVersion() +} + +func (*OrdersResponseOrders) TrailingTimeDeprecated() uint16 { + return 0 +} + +func (*OrdersResponseOrders) TrailingTimeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*OrdersResponseOrders) TrailingTimeMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*OrdersResponseOrders) TrailingTimeMaxValue() int64 { + return math.MaxInt64 +} + +func (*OrdersResponseOrders) TrailingTimeNullValue() int64 { + return math.MinInt64 +} + +func (*OrdersResponseOrders) IcebergQtyId() uint16 { + return 16 +} + +func (*OrdersResponseOrders) IcebergQtySinceVersion() uint16 { + return 0 +} + +func (o *OrdersResponseOrders) IcebergQtyInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.IcebergQtySinceVersion() +} + +func (*OrdersResponseOrders) IcebergQtyDeprecated() uint16 { + return 0 +} + +func (*OrdersResponseOrders) IcebergQtyMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*OrdersResponseOrders) IcebergQtyMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*OrdersResponseOrders) IcebergQtyMaxValue() int64 { + return math.MaxInt64 +} + +func (*OrdersResponseOrders) IcebergQtyNullValue() int64 { + return math.MinInt64 +} + +func (*OrdersResponseOrders) TimeId() uint16 { + return 17 +} + +func (*OrdersResponseOrders) TimeSinceVersion() uint16 { + return 0 +} + +func (o *OrdersResponseOrders) TimeInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.TimeSinceVersion() +} + +func (*OrdersResponseOrders) TimeDeprecated() uint16 { + return 0 +} + +func (*OrdersResponseOrders) TimeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrdersResponseOrders) TimeMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*OrdersResponseOrders) TimeMaxValue() int64 { + return math.MaxInt64 +} + +func (*OrdersResponseOrders) TimeNullValue() int64 { + return math.MinInt64 +} + +func (*OrdersResponseOrders) UpdateTimeId() uint16 { + return 18 +} + +func (*OrdersResponseOrders) UpdateTimeSinceVersion() uint16 { + return 0 +} + +func (o *OrdersResponseOrders) UpdateTimeInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.UpdateTimeSinceVersion() +} + +func (*OrdersResponseOrders) UpdateTimeDeprecated() uint16 { + return 0 +} + +func (*OrdersResponseOrders) UpdateTimeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrdersResponseOrders) UpdateTimeMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*OrdersResponseOrders) UpdateTimeMaxValue() int64 { + return math.MaxInt64 +} + +func (*OrdersResponseOrders) UpdateTimeNullValue() int64 { + return math.MinInt64 +} + +func (*OrdersResponseOrders) IsWorkingId() uint16 { + return 19 +} + +func (*OrdersResponseOrders) IsWorkingSinceVersion() uint16 { + return 0 +} + +func (o *OrdersResponseOrders) IsWorkingInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.IsWorkingSinceVersion() +} + +func (*OrdersResponseOrders) IsWorkingDeprecated() uint16 { + return 0 +} + +func (*OrdersResponseOrders) IsWorkingMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrdersResponseOrders) WorkingTimeId() uint16 { + return 20 +} + +func (*OrdersResponseOrders) WorkingTimeSinceVersion() uint16 { + return 0 +} + +func (o *OrdersResponseOrders) WorkingTimeInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.WorkingTimeSinceVersion() +} + +func (*OrdersResponseOrders) WorkingTimeDeprecated() uint16 { + return 0 +} + +func (*OrdersResponseOrders) WorkingTimeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*OrdersResponseOrders) WorkingTimeMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*OrdersResponseOrders) WorkingTimeMaxValue() int64 { + return math.MaxInt64 +} + +func (*OrdersResponseOrders) WorkingTimeNullValue() int64 { + return math.MinInt64 +} + +func (*OrdersResponseOrders) OrigQuoteOrderQtyId() uint16 { + return 21 +} + +func (*OrdersResponseOrders) OrigQuoteOrderQtySinceVersion() uint16 { + return 0 +} + +func (o *OrdersResponseOrders) OrigQuoteOrderQtyInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.OrigQuoteOrderQtySinceVersion() +} + +func (*OrdersResponseOrders) OrigQuoteOrderQtyDeprecated() uint16 { + return 0 +} + +func (*OrdersResponseOrders) OrigQuoteOrderQtyMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrdersResponseOrders) OrigQuoteOrderQtyMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*OrdersResponseOrders) OrigQuoteOrderQtyMaxValue() int64 { + return math.MaxInt64 +} + +func (*OrdersResponseOrders) OrigQuoteOrderQtyNullValue() int64 { + return math.MinInt64 +} + +func (*OrdersResponseOrders) StrategyIdId() uint16 { + return 22 +} + +func (*OrdersResponseOrders) StrategyIdSinceVersion() uint16 { + return 0 +} + +func (o *OrdersResponseOrders) StrategyIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.StrategyIdSinceVersion() +} + +func (*OrdersResponseOrders) StrategyIdDeprecated() uint16 { + return 0 +} + +func (*OrdersResponseOrders) StrategyIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*OrdersResponseOrders) StrategyIdMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*OrdersResponseOrders) StrategyIdMaxValue() int64 { + return math.MaxInt64 +} + +func (*OrdersResponseOrders) StrategyIdNullValue() int64 { + return math.MinInt64 +} + +func (*OrdersResponseOrders) StrategyTypeId() uint16 { + return 23 +} + +func (*OrdersResponseOrders) StrategyTypeSinceVersion() uint16 { + return 0 +} + +func (o *OrdersResponseOrders) StrategyTypeInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.StrategyTypeSinceVersion() +} + +func (*OrdersResponseOrders) StrategyTypeDeprecated() uint16 { + return 0 +} + +func (*OrdersResponseOrders) StrategyTypeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*OrdersResponseOrders) StrategyTypeMinValue() int32 { + return math.MinInt32 + 1 +} + +func (*OrdersResponseOrders) StrategyTypeMaxValue() int32 { + return math.MaxInt32 +} + +func (*OrdersResponseOrders) StrategyTypeNullValue() int32 { + return math.MinInt32 +} + +func (*OrdersResponseOrders) OrderCapacityId() uint16 { + return 24 +} + +func (*OrdersResponseOrders) OrderCapacitySinceVersion() uint16 { + return 0 +} + +func (o *OrdersResponseOrders) OrderCapacityInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.OrderCapacitySinceVersion() +} + +func (*OrdersResponseOrders) OrderCapacityDeprecated() uint16 { + return 0 +} + +func (*OrdersResponseOrders) OrderCapacityMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrdersResponseOrders) WorkingFloorId() uint16 { + return 25 +} + +func (*OrdersResponseOrders) WorkingFloorSinceVersion() uint16 { + return 0 +} + +func (o *OrdersResponseOrders) WorkingFloorInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.WorkingFloorSinceVersion() +} + +func (*OrdersResponseOrders) WorkingFloorDeprecated() uint16 { + return 0 +} + +func (*OrdersResponseOrders) WorkingFloorMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrdersResponseOrders) SelfTradePreventionModeId() uint16 { + return 26 +} + +func (*OrdersResponseOrders) SelfTradePreventionModeSinceVersion() uint16 { + return 0 +} + +func (o *OrdersResponseOrders) SelfTradePreventionModeInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.SelfTradePreventionModeSinceVersion() +} + +func (*OrdersResponseOrders) SelfTradePreventionModeDeprecated() uint16 { + return 0 +} + +func (*OrdersResponseOrders) SelfTradePreventionModeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrdersResponseOrders) PreventedMatchIdId() uint16 { + return 27 +} + +func (*OrdersResponseOrders) PreventedMatchIdSinceVersion() uint16 { + return 0 +} + +func (o *OrdersResponseOrders) PreventedMatchIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.PreventedMatchIdSinceVersion() +} + +func (*OrdersResponseOrders) PreventedMatchIdDeprecated() uint16 { + return 0 +} + +func (*OrdersResponseOrders) PreventedMatchIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*OrdersResponseOrders) PreventedMatchIdMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*OrdersResponseOrders) PreventedMatchIdMaxValue() int64 { + return math.MaxInt64 +} + +func (*OrdersResponseOrders) PreventedMatchIdNullValue() int64 { + return math.MinInt64 +} + +func (*OrdersResponseOrders) PreventedQuantityId() uint16 { + return 28 +} + +func (*OrdersResponseOrders) PreventedQuantitySinceVersion() uint16 { + return 0 +} + +func (o *OrdersResponseOrders) PreventedQuantityInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.PreventedQuantitySinceVersion() +} + +func (*OrdersResponseOrders) PreventedQuantityDeprecated() uint16 { + return 0 +} + +func (*OrdersResponseOrders) PreventedQuantityMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrdersResponseOrders) PreventedQuantityMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*OrdersResponseOrders) PreventedQuantityMaxValue() int64 { + return math.MaxInt64 +} + +func (*OrdersResponseOrders) PreventedQuantityNullValue() int64 { + return math.MinInt64 +} + +func (*OrdersResponseOrders) UsedSorId() uint16 { + return 29 +} + +func (*OrdersResponseOrders) UsedSorSinceVersion() uint16 { + return 0 +} + +func (o *OrdersResponseOrders) UsedSorInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.UsedSorSinceVersion() +} + +func (*OrdersResponseOrders) UsedSorDeprecated() uint16 { + return 0 +} + +func (*OrdersResponseOrders) UsedSorMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrdersResponseOrders) PegPriceTypeId() uint16 { + return 30 +} + +func (*OrdersResponseOrders) PegPriceTypeSinceVersion() uint16 { + return 1 +} + +func (o *OrdersResponseOrders) PegPriceTypeInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.PegPriceTypeSinceVersion() +} + +func (*OrdersResponseOrders) PegPriceTypeDeprecated() uint16 { + return 0 +} + +func (*OrdersResponseOrders) PegPriceTypeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*OrdersResponseOrders) PegOffsetTypeId() uint16 { + return 31 +} + +func (*OrdersResponseOrders) PegOffsetTypeSinceVersion() uint16 { + return 1 +} + +func (o *OrdersResponseOrders) PegOffsetTypeInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.PegOffsetTypeSinceVersion() +} + +func (*OrdersResponseOrders) PegOffsetTypeDeprecated() uint16 { + return 0 +} + +func (*OrdersResponseOrders) PegOffsetTypeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*OrdersResponseOrders) PegOffsetValueId() uint16 { + return 32 +} + +func (*OrdersResponseOrders) PegOffsetValueSinceVersion() uint16 { + return 1 +} + +func (o *OrdersResponseOrders) PegOffsetValueInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.PegOffsetValueSinceVersion() +} + +func (*OrdersResponseOrders) PegOffsetValueDeprecated() uint16 { + return 0 +} + +func (*OrdersResponseOrders) PegOffsetValueMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*OrdersResponseOrders) PegOffsetValueMinValue() uint8 { + return 0 +} + +func (*OrdersResponseOrders) PegOffsetValueMaxValue() uint8 { + return math.MaxUint8 - 1 +} + +func (*OrdersResponseOrders) PegOffsetValueNullValue() uint8 { + return math.MaxUint8 +} + +func (*OrdersResponseOrders) PeggedPriceId() uint16 { + return 33 +} + +func (*OrdersResponseOrders) PeggedPriceSinceVersion() uint16 { + return 1 +} + +func (o *OrdersResponseOrders) PeggedPriceInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.PeggedPriceSinceVersion() +} + +func (*OrdersResponseOrders) PeggedPriceDeprecated() uint16 { + return 0 +} + +func (*OrdersResponseOrders) PeggedPriceMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*OrdersResponseOrders) PeggedPriceMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*OrdersResponseOrders) PeggedPriceMaxValue() int64 { + return math.MaxInt64 +} + +func (*OrdersResponseOrders) PeggedPriceNullValue() int64 { + return math.MinInt64 +} + +func (*OrdersResponseOrders) SymbolMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrdersResponseOrders) SymbolSinceVersion() uint16 { + return 0 +} + +func (o *OrdersResponseOrders) SymbolInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.SymbolSinceVersion() +} + +func (*OrdersResponseOrders) SymbolDeprecated() uint16 { + return 0 +} + +func (OrdersResponseOrders) SymbolCharacterEncoding() string { + return "UTF-8" +} + +func (OrdersResponseOrders) SymbolHeaderLength() uint64 { + return 1 +} + +func (*OrdersResponseOrders) ClientOrderIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OrdersResponseOrders) ClientOrderIdSinceVersion() uint16 { + return 0 +} + +func (o *OrdersResponseOrders) ClientOrderIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.ClientOrderIdSinceVersion() +} + +func (*OrdersResponseOrders) ClientOrderIdDeprecated() uint16 { + return 0 +} + +func (OrdersResponseOrders) ClientOrderIdCharacterEncoding() string { + return "UTF-8" +} + +func (OrdersResponseOrders) ClientOrderIdHeaderLength() uint64 { + return 1 +} + +func (*OrdersResponse) OrdersId() uint16 { + return 100 +} + +func (*OrdersResponse) OrdersSinceVersion() uint16 { + return 0 +} + +func (o *OrdersResponse) OrdersInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.OrdersSinceVersion() +} + +func (*OrdersResponse) OrdersDeprecated() uint16 { + return 0 +} + +func (*OrdersResponseOrders) SbeBlockLength() (blockLength uint) { + return 162 +} + +func (*OrdersResponseOrders) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} diff --git a/v2/sbe/spot_3_1/OutboundAccountPositionEvent.go b/v2/sbe/spot_3_1/OutboundAccountPositionEvent.go new file mode 100644 index 00000000..18f68e1e --- /dev/null +++ b/v2/sbe/spot_3_1/OutboundAccountPositionEvent.go @@ -0,0 +1,559 @@ +// Generated SBE (Simple Binary Encoding) message codec + +package sbe + +import ( + "errors" + "fmt" + "io" + "io/ioutil" + "math" + "unicode/utf8" +) + +type OutboundAccountPositionEvent struct { + EventTime int64 + UpdateTime int64 + SubscriptionId uint16 + Balances []OutboundAccountPositionEventBalances +} +type OutboundAccountPositionEventBalances struct { + Exponent int8 + Free int64 + Locked int64 + Asset []uint8 +} + +func (o *OutboundAccountPositionEvent) Encode(_m *SbeGoMarshaller, _w io.Writer, doRangeCheck bool) error { + if doRangeCheck { + if err := o.RangeCheck(o.SbeSchemaVersion(), o.SbeSchemaVersion()); err != nil { + return err + } + } + if err := _m.WriteInt64(_w, o.EventTime); err != nil { + return err + } + if err := _m.WriteInt64(_w, o.UpdateTime); err != nil { + return err + } + if err := _m.WriteUint16(_w, o.SubscriptionId); err != nil { + return err + } + var BalancesBlockLength uint16 = 17 + if err := _m.WriteUint16(_w, BalancesBlockLength); err != nil { + return err + } + var BalancesNumInGroup uint32 = uint32(len(o.Balances)) + if err := _m.WriteUint32(_w, BalancesNumInGroup); err != nil { + return err + } + for i := range o.Balances { + if err := o.Balances[i].Encode(_m, _w); err != nil { + return err + } + } + return nil +} + +func (o *OutboundAccountPositionEvent) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint16, doRangeCheck bool) error { + if !o.EventTimeInActingVersion(actingVersion) { + o.EventTime = o.EventTimeNullValue() + } else { + if err := _m.ReadInt64(_r, &o.EventTime); err != nil { + return err + } + } + if !o.UpdateTimeInActingVersion(actingVersion) { + o.UpdateTime = o.UpdateTimeNullValue() + } else { + if err := _m.ReadInt64(_r, &o.UpdateTime); err != nil { + return err + } + } + if !o.SubscriptionIdInActingVersion(actingVersion) { + o.SubscriptionId = o.SubscriptionIdNullValue() + } else { + if err := _m.ReadUint16(_r, &o.SubscriptionId); err != nil { + return err + } + } + if actingVersion > o.SbeSchemaVersion() && blockLength > o.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-o.SbeBlockLength())) + } + + if o.BalancesInActingVersion(actingVersion) { + var BalancesBlockLength uint16 + if err := _m.ReadUint16(_r, &BalancesBlockLength); err != nil { + return err + } + var BalancesNumInGroup uint32 + if err := _m.ReadUint32(_r, &BalancesNumInGroup); err != nil { + return err + } + if cap(o.Balances) < int(BalancesNumInGroup) { + o.Balances = make([]OutboundAccountPositionEventBalances, BalancesNumInGroup) + } + o.Balances = o.Balances[:BalancesNumInGroup] + for i := range o.Balances { + if err := o.Balances[i].Decode(_m, _r, actingVersion, uint(BalancesBlockLength)); err != nil { + return err + } + } + } + if doRangeCheck { + if err := o.RangeCheck(actingVersion, o.SbeSchemaVersion()); err != nil { + return err + } + } + return nil +} + +func (o *OutboundAccountPositionEvent) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if o.EventTimeInActingVersion(actingVersion) { + if o.EventTime < o.EventTimeMinValue() || o.EventTime > o.EventTimeMaxValue() { + return fmt.Errorf("Range check failed on o.EventTime (%v < %v > %v)", o.EventTimeMinValue(), o.EventTime, o.EventTimeMaxValue()) + } + } + if o.UpdateTimeInActingVersion(actingVersion) { + if o.UpdateTime < o.UpdateTimeMinValue() || o.UpdateTime > o.UpdateTimeMaxValue() { + return fmt.Errorf("Range check failed on o.UpdateTime (%v < %v > %v)", o.UpdateTimeMinValue(), o.UpdateTime, o.UpdateTimeMaxValue()) + } + } + if o.SubscriptionIdInActingVersion(actingVersion) { + if o.SubscriptionId != o.SubscriptionIdNullValue() && (o.SubscriptionId < o.SubscriptionIdMinValue() || o.SubscriptionId > o.SubscriptionIdMaxValue()) { + return fmt.Errorf("Range check failed on o.SubscriptionId (%v < %v > %v)", o.SubscriptionIdMinValue(), o.SubscriptionId, o.SubscriptionIdMaxValue()) + } + } + for i := range o.Balances { + if err := o.Balances[i].RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + } + return nil +} + +func OutboundAccountPositionEventInit(o *OutboundAccountPositionEvent) { + o.SubscriptionId = math.MaxUint16 + return +} + +func (o *OutboundAccountPositionEventBalances) Encode(_m *SbeGoMarshaller, _w io.Writer) error { + if err := _m.WriteInt8(_w, o.Exponent); err != nil { + return err + } + if err := _m.WriteInt64(_w, o.Free); err != nil { + return err + } + if err := _m.WriteInt64(_w, o.Locked); err != nil { + return err + } + if err := _m.WriteUint8(_w, uint8(len(o.Asset))); err != nil { + return err + } + if err := _m.WriteBytes(_w, o.Asset); err != nil { + return err + } + return nil +} + +func (o *OutboundAccountPositionEventBalances) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint) error { + if !o.ExponentInActingVersion(actingVersion) { + o.Exponent = o.ExponentNullValue() + } else { + if err := _m.ReadInt8(_r, &o.Exponent); err != nil { + return err + } + } + if !o.FreeInActingVersion(actingVersion) { + o.Free = o.FreeNullValue() + } else { + if err := _m.ReadInt64(_r, &o.Free); err != nil { + return err + } + } + if !o.LockedInActingVersion(actingVersion) { + o.Locked = o.LockedNullValue() + } else { + if err := _m.ReadInt64(_r, &o.Locked); err != nil { + return err + } + } + if actingVersion > o.SbeSchemaVersion() && blockLength > o.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-o.SbeBlockLength())) + } + + if o.AssetInActingVersion(actingVersion) { + var AssetLength uint8 + if err := _m.ReadUint8(_r, &AssetLength); err != nil { + return err + } + if cap(o.Asset) < int(AssetLength) { + o.Asset = make([]uint8, AssetLength) + } + o.Asset = o.Asset[:AssetLength] + if err := _m.ReadBytes(_r, o.Asset); err != nil { + return err + } + } + return nil +} + +func (o *OutboundAccountPositionEventBalances) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if o.ExponentInActingVersion(actingVersion) { + if o.Exponent < o.ExponentMinValue() || o.Exponent > o.ExponentMaxValue() { + return fmt.Errorf("Range check failed on o.Exponent (%v < %v > %v)", o.ExponentMinValue(), o.Exponent, o.ExponentMaxValue()) + } + } + if o.FreeInActingVersion(actingVersion) { + if o.Free < o.FreeMinValue() || o.Free > o.FreeMaxValue() { + return fmt.Errorf("Range check failed on o.Free (%v < %v > %v)", o.FreeMinValue(), o.Free, o.FreeMaxValue()) + } + } + if o.LockedInActingVersion(actingVersion) { + if o.Locked < o.LockedMinValue() || o.Locked > o.LockedMaxValue() { + return fmt.Errorf("Range check failed on o.Locked (%v < %v > %v)", o.LockedMinValue(), o.Locked, o.LockedMaxValue()) + } + } + if !utf8.Valid(o.Asset[:]) { + return errors.New("o.Asset failed UTF-8 validation") + } + return nil +} + +func OutboundAccountPositionEventBalancesInit(o *OutboundAccountPositionEventBalances) { + return +} + +func (*OutboundAccountPositionEvent) SbeBlockLength() (blockLength uint16) { + return 18 +} + +func (*OutboundAccountPositionEvent) SbeTemplateId() (templateId uint16) { + return 607 +} + +func (*OutboundAccountPositionEvent) SbeSchemaId() (schemaId uint16) { + return 3 +} + +func (*OutboundAccountPositionEvent) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} + +func (*OutboundAccountPositionEvent) SbeSemanticType() (semanticType []byte) { + return []byte("") +} + +func (*OutboundAccountPositionEvent) SbeSemanticVersion() (semanticVersion string) { + return "5.2" +} + +func (*OutboundAccountPositionEvent) EventTimeId() uint16 { + return 1 +} + +func (*OutboundAccountPositionEvent) EventTimeSinceVersion() uint16 { + return 0 +} + +func (o *OutboundAccountPositionEvent) EventTimeInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.EventTimeSinceVersion() +} + +func (*OutboundAccountPositionEvent) EventTimeDeprecated() uint16 { + return 0 +} + +func (*OutboundAccountPositionEvent) EventTimeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OutboundAccountPositionEvent) EventTimeMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*OutboundAccountPositionEvent) EventTimeMaxValue() int64 { + return math.MaxInt64 +} + +func (*OutboundAccountPositionEvent) EventTimeNullValue() int64 { + return math.MinInt64 +} + +func (*OutboundAccountPositionEvent) UpdateTimeId() uint16 { + return 2 +} + +func (*OutboundAccountPositionEvent) UpdateTimeSinceVersion() uint16 { + return 0 +} + +func (o *OutboundAccountPositionEvent) UpdateTimeInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.UpdateTimeSinceVersion() +} + +func (*OutboundAccountPositionEvent) UpdateTimeDeprecated() uint16 { + return 0 +} + +func (*OutboundAccountPositionEvent) UpdateTimeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OutboundAccountPositionEvent) UpdateTimeMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*OutboundAccountPositionEvent) UpdateTimeMaxValue() int64 { + return math.MaxInt64 +} + +func (*OutboundAccountPositionEvent) UpdateTimeNullValue() int64 { + return math.MinInt64 +} + +func (*OutboundAccountPositionEvent) SubscriptionIdId() uint16 { + return 3 +} + +func (*OutboundAccountPositionEvent) SubscriptionIdSinceVersion() uint16 { + return 1 +} + +func (o *OutboundAccountPositionEvent) SubscriptionIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.SubscriptionIdSinceVersion() +} + +func (*OutboundAccountPositionEvent) SubscriptionIdDeprecated() uint16 { + return 0 +} + +func (*OutboundAccountPositionEvent) SubscriptionIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*OutboundAccountPositionEvent) SubscriptionIdMinValue() uint16 { + return 0 +} + +func (*OutboundAccountPositionEvent) SubscriptionIdMaxValue() uint16 { + return math.MaxUint16 - 1 +} + +func (*OutboundAccountPositionEvent) SubscriptionIdNullValue() uint16 { + return math.MaxUint16 +} + +func (*OutboundAccountPositionEventBalances) ExponentId() uint16 { + return 1 +} + +func (*OutboundAccountPositionEventBalances) ExponentSinceVersion() uint16 { + return 0 +} + +func (o *OutboundAccountPositionEventBalances) ExponentInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.ExponentSinceVersion() +} + +func (*OutboundAccountPositionEventBalances) ExponentDeprecated() uint16 { + return 0 +} + +func (*OutboundAccountPositionEventBalances) ExponentMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OutboundAccountPositionEventBalances) ExponentMinValue() int8 { + return math.MinInt8 + 1 +} + +func (*OutboundAccountPositionEventBalances) ExponentMaxValue() int8 { + return math.MaxInt8 +} + +func (*OutboundAccountPositionEventBalances) ExponentNullValue() int8 { + return math.MinInt8 +} + +func (*OutboundAccountPositionEventBalances) FreeId() uint16 { + return 2 +} + +func (*OutboundAccountPositionEventBalances) FreeSinceVersion() uint16 { + return 0 +} + +func (o *OutboundAccountPositionEventBalances) FreeInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.FreeSinceVersion() +} + +func (*OutboundAccountPositionEventBalances) FreeDeprecated() uint16 { + return 0 +} + +func (*OutboundAccountPositionEventBalances) FreeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OutboundAccountPositionEventBalances) FreeMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*OutboundAccountPositionEventBalances) FreeMaxValue() int64 { + return math.MaxInt64 +} + +func (*OutboundAccountPositionEventBalances) FreeNullValue() int64 { + return math.MinInt64 +} + +func (*OutboundAccountPositionEventBalances) LockedId() uint16 { + return 3 +} + +func (*OutboundAccountPositionEventBalances) LockedSinceVersion() uint16 { + return 0 +} + +func (o *OutboundAccountPositionEventBalances) LockedInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.LockedSinceVersion() +} + +func (*OutboundAccountPositionEventBalances) LockedDeprecated() uint16 { + return 0 +} + +func (*OutboundAccountPositionEventBalances) LockedMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OutboundAccountPositionEventBalances) LockedMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*OutboundAccountPositionEventBalances) LockedMaxValue() int64 { + return math.MaxInt64 +} + +func (*OutboundAccountPositionEventBalances) LockedNullValue() int64 { + return math.MinInt64 +} + +func (*OutboundAccountPositionEventBalances) AssetMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*OutboundAccountPositionEventBalances) AssetSinceVersion() uint16 { + return 0 +} + +func (o *OutboundAccountPositionEventBalances) AssetInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.AssetSinceVersion() +} + +func (*OutboundAccountPositionEventBalances) AssetDeprecated() uint16 { + return 0 +} + +func (OutboundAccountPositionEventBalances) AssetCharacterEncoding() string { + return "UTF-8" +} + +func (OutboundAccountPositionEventBalances) AssetHeaderLength() uint64 { + return 1 +} + +func (*OutboundAccountPositionEvent) BalancesId() uint16 { + return 100 +} + +func (*OutboundAccountPositionEvent) BalancesSinceVersion() uint16 { + return 0 +} + +func (o *OutboundAccountPositionEvent) BalancesInActingVersion(actingVersion uint16) bool { + return actingVersion >= o.BalancesSinceVersion() +} + +func (*OutboundAccountPositionEvent) BalancesDeprecated() uint16 { + return 0 +} + +func (*OutboundAccountPositionEventBalances) SbeBlockLength() (blockLength uint) { + return 17 +} + +func (*OutboundAccountPositionEventBalances) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} diff --git a/v2/sbe/spot_3_1/PegOffsetType.go b/v2/sbe/spot_3_1/PegOffsetType.go new file mode 100644 index 00000000..652ba3c1 --- /dev/null +++ b/v2/sbe/spot_3_1/PegOffsetType.go @@ -0,0 +1,73 @@ +// Generated SBE (Simple Binary Encoding) message codec + +package sbe + +import ( + "fmt" + "io" + "reflect" +) + +type PegOffsetTypeEnum uint8 +type PegOffsetTypeValues struct { + PriceLevel PegOffsetTypeEnum + NonRepresentable PegOffsetTypeEnum + NullValue PegOffsetTypeEnum +} + +var PegOffsetType = PegOffsetTypeValues{1, 254, 255} + +func (p PegOffsetTypeEnum) Encode(_m *SbeGoMarshaller, _w io.Writer) error { + if err := _m.WriteUint8(_w, uint8(p)); err != nil { + return err + } + return nil +} + +func (p *PegOffsetTypeEnum) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16) error { + if err := _m.ReadUint8(_r, (*uint8)(p)); err != nil { + return err + } + return nil +} + +func (p PegOffsetTypeEnum) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if actingVersion > schemaVersion { + return nil + } + value := reflect.ValueOf(PegOffsetType) + for idx := 0; idx < value.NumField(); idx++ { + if p == value.Field(idx).Interface() { + return nil + } + } + return fmt.Errorf("Range check failed on PegOffsetType, unknown enumeration value %d", p) +} + +func (*PegOffsetTypeEnum) EncodedLength() int64 { + return 1 +} + +func (*PegOffsetTypeEnum) PriceLevelSinceVersion() uint16 { + return 0 +} + +func (p *PegOffsetTypeEnum) PriceLevelInActingVersion(actingVersion uint16) bool { + return actingVersion >= p.PriceLevelSinceVersion() +} + +func (*PegOffsetTypeEnum) PriceLevelDeprecated() uint16 { + return 0 +} + +func (*PegOffsetTypeEnum) NonRepresentableSinceVersion() uint16 { + return 0 +} + +func (p *PegOffsetTypeEnum) NonRepresentableInActingVersion(actingVersion uint16) bool { + return actingVersion >= p.NonRepresentableSinceVersion() +} + +func (*PegOffsetTypeEnum) NonRepresentableDeprecated() uint16 { + return 0 +} diff --git a/v2/sbe/spot_3_1/PegPriceType.go b/v2/sbe/spot_3_1/PegPriceType.go new file mode 100644 index 00000000..cb81d984 --- /dev/null +++ b/v2/sbe/spot_3_1/PegPriceType.go @@ -0,0 +1,86 @@ +// Generated SBE (Simple Binary Encoding) message codec + +package sbe + +import ( + "fmt" + "io" + "reflect" +) + +type PegPriceTypeEnum uint8 +type PegPriceTypeValues struct { + PrimaryPeg PegPriceTypeEnum + MarketPeg PegPriceTypeEnum + NonRepresentable PegPriceTypeEnum + NullValue PegPriceTypeEnum +} + +var PegPriceType = PegPriceTypeValues{1, 2, 254, 255} + +func (p PegPriceTypeEnum) Encode(_m *SbeGoMarshaller, _w io.Writer) error { + if err := _m.WriteUint8(_w, uint8(p)); err != nil { + return err + } + return nil +} + +func (p *PegPriceTypeEnum) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16) error { + if err := _m.ReadUint8(_r, (*uint8)(p)); err != nil { + return err + } + return nil +} + +func (p PegPriceTypeEnum) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if actingVersion > schemaVersion { + return nil + } + value := reflect.ValueOf(PegPriceType) + for idx := 0; idx < value.NumField(); idx++ { + if p == value.Field(idx).Interface() { + return nil + } + } + return fmt.Errorf("Range check failed on PegPriceType, unknown enumeration value %d", p) +} + +func (*PegPriceTypeEnum) EncodedLength() int64 { + return 1 +} + +func (*PegPriceTypeEnum) PrimaryPegSinceVersion() uint16 { + return 0 +} + +func (p *PegPriceTypeEnum) PrimaryPegInActingVersion(actingVersion uint16) bool { + return actingVersion >= p.PrimaryPegSinceVersion() +} + +func (*PegPriceTypeEnum) PrimaryPegDeprecated() uint16 { + return 0 +} + +func (*PegPriceTypeEnum) MarketPegSinceVersion() uint16 { + return 0 +} + +func (p *PegPriceTypeEnum) MarketPegInActingVersion(actingVersion uint16) bool { + return actingVersion >= p.MarketPegSinceVersion() +} + +func (*PegPriceTypeEnum) MarketPegDeprecated() uint16 { + return 0 +} + +func (*PegPriceTypeEnum) NonRepresentableSinceVersion() uint16 { + return 0 +} + +func (p *PegPriceTypeEnum) NonRepresentableInActingVersion(actingVersion uint16) bool { + return actingVersion >= p.NonRepresentableSinceVersion() +} + +func (*PegPriceTypeEnum) NonRepresentableDeprecated() uint16 { + return 0 +} diff --git a/v2/sbe/spot_3_1/PercentPriceBySideFilter.go b/v2/sbe/spot_3_1/PercentPriceBySideFilter.go new file mode 100644 index 00000000..3733c540 --- /dev/null +++ b/v2/sbe/spot_3_1/PercentPriceBySideFilter.go @@ -0,0 +1,450 @@ +// Generated SBE (Simple Binary Encoding) message codec + +package sbe + +import ( + "fmt" + "io" + "io/ioutil" + "math" +) + +type PercentPriceBySideFilter struct { + FilterType FilterTypeEnum + MultiplierExponent int8 + BidMultiplierUp int64 + BidMultiplierDown int64 + AskMultiplierUp int64 + AskMultiplierDown int64 + AvgPriceMins int32 +} + +func (p *PercentPriceBySideFilter) Encode(_m *SbeGoMarshaller, _w io.Writer, doRangeCheck bool) error { + if doRangeCheck { + if err := p.RangeCheck(p.SbeSchemaVersion(), p.SbeSchemaVersion()); err != nil { + return err + } + } + if err := _m.WriteInt8(_w, p.MultiplierExponent); err != nil { + return err + } + if err := _m.WriteInt64(_w, p.BidMultiplierUp); err != nil { + return err + } + if err := _m.WriteInt64(_w, p.BidMultiplierDown); err != nil { + return err + } + if err := _m.WriteInt64(_w, p.AskMultiplierUp); err != nil { + return err + } + if err := _m.WriteInt64(_w, p.AskMultiplierDown); err != nil { + return err + } + if err := _m.WriteInt32(_w, p.AvgPriceMins); err != nil { + return err + } + return nil +} + +func (p *PercentPriceBySideFilter) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint16, doRangeCheck bool) error { + p.FilterType = FilterType.PercentPriceBySide + if !p.MultiplierExponentInActingVersion(actingVersion) { + p.MultiplierExponent = p.MultiplierExponentNullValue() + } else { + if err := _m.ReadInt8(_r, &p.MultiplierExponent); err != nil { + return err + } + } + if !p.BidMultiplierUpInActingVersion(actingVersion) { + p.BidMultiplierUp = p.BidMultiplierUpNullValue() + } else { + if err := _m.ReadInt64(_r, &p.BidMultiplierUp); err != nil { + return err + } + } + if !p.BidMultiplierDownInActingVersion(actingVersion) { + p.BidMultiplierDown = p.BidMultiplierDownNullValue() + } else { + if err := _m.ReadInt64(_r, &p.BidMultiplierDown); err != nil { + return err + } + } + if !p.AskMultiplierUpInActingVersion(actingVersion) { + p.AskMultiplierUp = p.AskMultiplierUpNullValue() + } else { + if err := _m.ReadInt64(_r, &p.AskMultiplierUp); err != nil { + return err + } + } + if !p.AskMultiplierDownInActingVersion(actingVersion) { + p.AskMultiplierDown = p.AskMultiplierDownNullValue() + } else { + if err := _m.ReadInt64(_r, &p.AskMultiplierDown); err != nil { + return err + } + } + if !p.AvgPriceMinsInActingVersion(actingVersion) { + p.AvgPriceMins = p.AvgPriceMinsNullValue() + } else { + if err := _m.ReadInt32(_r, &p.AvgPriceMins); err != nil { + return err + } + } + if actingVersion > p.SbeSchemaVersion() && blockLength > p.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-p.SbeBlockLength())) + } + if doRangeCheck { + if err := p.RangeCheck(actingVersion, p.SbeSchemaVersion()); err != nil { + return err + } + } + return nil +} + +func (p *PercentPriceBySideFilter) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if err := p.FilterType.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if p.MultiplierExponentInActingVersion(actingVersion) { + if p.MultiplierExponent < p.MultiplierExponentMinValue() || p.MultiplierExponent > p.MultiplierExponentMaxValue() { + return fmt.Errorf("Range check failed on p.MultiplierExponent (%v < %v > %v)", p.MultiplierExponentMinValue(), p.MultiplierExponent, p.MultiplierExponentMaxValue()) + } + } + if p.BidMultiplierUpInActingVersion(actingVersion) { + if p.BidMultiplierUp < p.BidMultiplierUpMinValue() || p.BidMultiplierUp > p.BidMultiplierUpMaxValue() { + return fmt.Errorf("Range check failed on p.BidMultiplierUp (%v < %v > %v)", p.BidMultiplierUpMinValue(), p.BidMultiplierUp, p.BidMultiplierUpMaxValue()) + } + } + if p.BidMultiplierDownInActingVersion(actingVersion) { + if p.BidMultiplierDown < p.BidMultiplierDownMinValue() || p.BidMultiplierDown > p.BidMultiplierDownMaxValue() { + return fmt.Errorf("Range check failed on p.BidMultiplierDown (%v < %v > %v)", p.BidMultiplierDownMinValue(), p.BidMultiplierDown, p.BidMultiplierDownMaxValue()) + } + } + if p.AskMultiplierUpInActingVersion(actingVersion) { + if p.AskMultiplierUp < p.AskMultiplierUpMinValue() || p.AskMultiplierUp > p.AskMultiplierUpMaxValue() { + return fmt.Errorf("Range check failed on p.AskMultiplierUp (%v < %v > %v)", p.AskMultiplierUpMinValue(), p.AskMultiplierUp, p.AskMultiplierUpMaxValue()) + } + } + if p.AskMultiplierDownInActingVersion(actingVersion) { + if p.AskMultiplierDown < p.AskMultiplierDownMinValue() || p.AskMultiplierDown > p.AskMultiplierDownMaxValue() { + return fmt.Errorf("Range check failed on p.AskMultiplierDown (%v < %v > %v)", p.AskMultiplierDownMinValue(), p.AskMultiplierDown, p.AskMultiplierDownMaxValue()) + } + } + if p.AvgPriceMinsInActingVersion(actingVersion) { + if p.AvgPriceMins < p.AvgPriceMinsMinValue() || p.AvgPriceMins > p.AvgPriceMinsMaxValue() { + return fmt.Errorf("Range check failed on p.AvgPriceMins (%v < %v > %v)", p.AvgPriceMinsMinValue(), p.AvgPriceMins, p.AvgPriceMinsMaxValue()) + } + } + return nil +} + +func PercentPriceBySideFilterInit(p *PercentPriceBySideFilter) { + p.FilterType = FilterType.PercentPriceBySide + return +} + +func (*PercentPriceBySideFilter) SbeBlockLength() (blockLength uint16) { + return 37 +} + +func (*PercentPriceBySideFilter) SbeTemplateId() (templateId uint16) { + return 3 +} + +func (*PercentPriceBySideFilter) SbeSchemaId() (schemaId uint16) { + return 3 +} + +func (*PercentPriceBySideFilter) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} + +func (*PercentPriceBySideFilter) SbeSemanticType() (semanticType []byte) { + return []byte("") +} + +func (*PercentPriceBySideFilter) SbeSemanticVersion() (semanticVersion string) { + return "5.2" +} + +func (*PercentPriceBySideFilter) FilterTypeId() uint16 { + return 1 +} + +func (*PercentPriceBySideFilter) FilterTypeSinceVersion() uint16 { + return 0 +} + +func (p *PercentPriceBySideFilter) FilterTypeInActingVersion(actingVersion uint16) bool { + return actingVersion >= p.FilterTypeSinceVersion() +} + +func (*PercentPriceBySideFilter) FilterTypeDeprecated() uint16 { + return 0 +} + +func (*PercentPriceBySideFilter) FilterTypeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "constant" + } + return "" +} + +func (*PercentPriceBySideFilter) MultiplierExponentId() uint16 { + return 2 +} + +func (*PercentPriceBySideFilter) MultiplierExponentSinceVersion() uint16 { + return 0 +} + +func (p *PercentPriceBySideFilter) MultiplierExponentInActingVersion(actingVersion uint16) bool { + return actingVersion >= p.MultiplierExponentSinceVersion() +} + +func (*PercentPriceBySideFilter) MultiplierExponentDeprecated() uint16 { + return 0 +} + +func (*PercentPriceBySideFilter) MultiplierExponentMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*PercentPriceBySideFilter) MultiplierExponentMinValue() int8 { + return math.MinInt8 + 1 +} + +func (*PercentPriceBySideFilter) MultiplierExponentMaxValue() int8 { + return math.MaxInt8 +} + +func (*PercentPriceBySideFilter) MultiplierExponentNullValue() int8 { + return math.MinInt8 +} + +func (*PercentPriceBySideFilter) BidMultiplierUpId() uint16 { + return 3 +} + +func (*PercentPriceBySideFilter) BidMultiplierUpSinceVersion() uint16 { + return 0 +} + +func (p *PercentPriceBySideFilter) BidMultiplierUpInActingVersion(actingVersion uint16) bool { + return actingVersion >= p.BidMultiplierUpSinceVersion() +} + +func (*PercentPriceBySideFilter) BidMultiplierUpDeprecated() uint16 { + return 0 +} + +func (*PercentPriceBySideFilter) BidMultiplierUpMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*PercentPriceBySideFilter) BidMultiplierUpMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*PercentPriceBySideFilter) BidMultiplierUpMaxValue() int64 { + return math.MaxInt64 +} + +func (*PercentPriceBySideFilter) BidMultiplierUpNullValue() int64 { + return math.MinInt64 +} + +func (*PercentPriceBySideFilter) BidMultiplierDownId() uint16 { + return 4 +} + +func (*PercentPriceBySideFilter) BidMultiplierDownSinceVersion() uint16 { + return 0 +} + +func (p *PercentPriceBySideFilter) BidMultiplierDownInActingVersion(actingVersion uint16) bool { + return actingVersion >= p.BidMultiplierDownSinceVersion() +} + +func (*PercentPriceBySideFilter) BidMultiplierDownDeprecated() uint16 { + return 0 +} + +func (*PercentPriceBySideFilter) BidMultiplierDownMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*PercentPriceBySideFilter) BidMultiplierDownMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*PercentPriceBySideFilter) BidMultiplierDownMaxValue() int64 { + return math.MaxInt64 +} + +func (*PercentPriceBySideFilter) BidMultiplierDownNullValue() int64 { + return math.MinInt64 +} + +func (*PercentPriceBySideFilter) AskMultiplierUpId() uint16 { + return 5 +} + +func (*PercentPriceBySideFilter) AskMultiplierUpSinceVersion() uint16 { + return 0 +} + +func (p *PercentPriceBySideFilter) AskMultiplierUpInActingVersion(actingVersion uint16) bool { + return actingVersion >= p.AskMultiplierUpSinceVersion() +} + +func (*PercentPriceBySideFilter) AskMultiplierUpDeprecated() uint16 { + return 0 +} + +func (*PercentPriceBySideFilter) AskMultiplierUpMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*PercentPriceBySideFilter) AskMultiplierUpMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*PercentPriceBySideFilter) AskMultiplierUpMaxValue() int64 { + return math.MaxInt64 +} + +func (*PercentPriceBySideFilter) AskMultiplierUpNullValue() int64 { + return math.MinInt64 +} + +func (*PercentPriceBySideFilter) AskMultiplierDownId() uint16 { + return 6 +} + +func (*PercentPriceBySideFilter) AskMultiplierDownSinceVersion() uint16 { + return 0 +} + +func (p *PercentPriceBySideFilter) AskMultiplierDownInActingVersion(actingVersion uint16) bool { + return actingVersion >= p.AskMultiplierDownSinceVersion() +} + +func (*PercentPriceBySideFilter) AskMultiplierDownDeprecated() uint16 { + return 0 +} + +func (*PercentPriceBySideFilter) AskMultiplierDownMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*PercentPriceBySideFilter) AskMultiplierDownMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*PercentPriceBySideFilter) AskMultiplierDownMaxValue() int64 { + return math.MaxInt64 +} + +func (*PercentPriceBySideFilter) AskMultiplierDownNullValue() int64 { + return math.MinInt64 +} + +func (*PercentPriceBySideFilter) AvgPriceMinsId() uint16 { + return 7 +} + +func (*PercentPriceBySideFilter) AvgPriceMinsSinceVersion() uint16 { + return 0 +} + +func (p *PercentPriceBySideFilter) AvgPriceMinsInActingVersion(actingVersion uint16) bool { + return actingVersion >= p.AvgPriceMinsSinceVersion() +} + +func (*PercentPriceBySideFilter) AvgPriceMinsDeprecated() uint16 { + return 0 +} + +func (*PercentPriceBySideFilter) AvgPriceMinsMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*PercentPriceBySideFilter) AvgPriceMinsMinValue() int32 { + return math.MinInt32 + 1 +} + +func (*PercentPriceBySideFilter) AvgPriceMinsMaxValue() int32 { + return math.MaxInt32 +} + +func (*PercentPriceBySideFilter) AvgPriceMinsNullValue() int32 { + return math.MinInt32 +} diff --git a/v2/sbe/spot_3_1/PercentPriceFilter.go b/v2/sbe/spot_3_1/PercentPriceFilter.go new file mode 100644 index 00000000..13884d93 --- /dev/null +++ b/v2/sbe/spot_3_1/PercentPriceFilter.go @@ -0,0 +1,334 @@ +// Generated SBE (Simple Binary Encoding) message codec + +package sbe + +import ( + "fmt" + "io" + "io/ioutil" + "math" +) + +type PercentPriceFilter struct { + FilterType FilterTypeEnum + MultiplierExponent int8 + MultiplierUp int64 + MultiplierDown int64 + AvgPriceMins int32 +} + +func (p *PercentPriceFilter) Encode(_m *SbeGoMarshaller, _w io.Writer, doRangeCheck bool) error { + if doRangeCheck { + if err := p.RangeCheck(p.SbeSchemaVersion(), p.SbeSchemaVersion()); err != nil { + return err + } + } + if err := _m.WriteInt8(_w, p.MultiplierExponent); err != nil { + return err + } + if err := _m.WriteInt64(_w, p.MultiplierUp); err != nil { + return err + } + if err := _m.WriteInt64(_w, p.MultiplierDown); err != nil { + return err + } + if err := _m.WriteInt32(_w, p.AvgPriceMins); err != nil { + return err + } + return nil +} + +func (p *PercentPriceFilter) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint16, doRangeCheck bool) error { + p.FilterType = FilterType.PercentPrice + if !p.MultiplierExponentInActingVersion(actingVersion) { + p.MultiplierExponent = p.MultiplierExponentNullValue() + } else { + if err := _m.ReadInt8(_r, &p.MultiplierExponent); err != nil { + return err + } + } + if !p.MultiplierUpInActingVersion(actingVersion) { + p.MultiplierUp = p.MultiplierUpNullValue() + } else { + if err := _m.ReadInt64(_r, &p.MultiplierUp); err != nil { + return err + } + } + if !p.MultiplierDownInActingVersion(actingVersion) { + p.MultiplierDown = p.MultiplierDownNullValue() + } else { + if err := _m.ReadInt64(_r, &p.MultiplierDown); err != nil { + return err + } + } + if !p.AvgPriceMinsInActingVersion(actingVersion) { + p.AvgPriceMins = p.AvgPriceMinsNullValue() + } else { + if err := _m.ReadInt32(_r, &p.AvgPriceMins); err != nil { + return err + } + } + if actingVersion > p.SbeSchemaVersion() && blockLength > p.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-p.SbeBlockLength())) + } + if doRangeCheck { + if err := p.RangeCheck(actingVersion, p.SbeSchemaVersion()); err != nil { + return err + } + } + return nil +} + +func (p *PercentPriceFilter) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if err := p.FilterType.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if p.MultiplierExponentInActingVersion(actingVersion) { + if p.MultiplierExponent < p.MultiplierExponentMinValue() || p.MultiplierExponent > p.MultiplierExponentMaxValue() { + return fmt.Errorf("Range check failed on p.MultiplierExponent (%v < %v > %v)", p.MultiplierExponentMinValue(), p.MultiplierExponent, p.MultiplierExponentMaxValue()) + } + } + if p.MultiplierUpInActingVersion(actingVersion) { + if p.MultiplierUp < p.MultiplierUpMinValue() || p.MultiplierUp > p.MultiplierUpMaxValue() { + return fmt.Errorf("Range check failed on p.MultiplierUp (%v < %v > %v)", p.MultiplierUpMinValue(), p.MultiplierUp, p.MultiplierUpMaxValue()) + } + } + if p.MultiplierDownInActingVersion(actingVersion) { + if p.MultiplierDown < p.MultiplierDownMinValue() || p.MultiplierDown > p.MultiplierDownMaxValue() { + return fmt.Errorf("Range check failed on p.MultiplierDown (%v < %v > %v)", p.MultiplierDownMinValue(), p.MultiplierDown, p.MultiplierDownMaxValue()) + } + } + if p.AvgPriceMinsInActingVersion(actingVersion) { + if p.AvgPriceMins < p.AvgPriceMinsMinValue() || p.AvgPriceMins > p.AvgPriceMinsMaxValue() { + return fmt.Errorf("Range check failed on p.AvgPriceMins (%v < %v > %v)", p.AvgPriceMinsMinValue(), p.AvgPriceMins, p.AvgPriceMinsMaxValue()) + } + } + return nil +} + +func PercentPriceFilterInit(p *PercentPriceFilter) { + p.FilterType = FilterType.PercentPrice + return +} + +func (*PercentPriceFilter) SbeBlockLength() (blockLength uint16) { + return 21 +} + +func (*PercentPriceFilter) SbeTemplateId() (templateId uint16) { + return 2 +} + +func (*PercentPriceFilter) SbeSchemaId() (schemaId uint16) { + return 3 +} + +func (*PercentPriceFilter) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} + +func (*PercentPriceFilter) SbeSemanticType() (semanticType []byte) { + return []byte("") +} + +func (*PercentPriceFilter) SbeSemanticVersion() (semanticVersion string) { + return "5.2" +} + +func (*PercentPriceFilter) FilterTypeId() uint16 { + return 1 +} + +func (*PercentPriceFilter) FilterTypeSinceVersion() uint16 { + return 0 +} + +func (p *PercentPriceFilter) FilterTypeInActingVersion(actingVersion uint16) bool { + return actingVersion >= p.FilterTypeSinceVersion() +} + +func (*PercentPriceFilter) FilterTypeDeprecated() uint16 { + return 0 +} + +func (*PercentPriceFilter) FilterTypeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "constant" + } + return "" +} + +func (*PercentPriceFilter) MultiplierExponentId() uint16 { + return 2 +} + +func (*PercentPriceFilter) MultiplierExponentSinceVersion() uint16 { + return 0 +} + +func (p *PercentPriceFilter) MultiplierExponentInActingVersion(actingVersion uint16) bool { + return actingVersion >= p.MultiplierExponentSinceVersion() +} + +func (*PercentPriceFilter) MultiplierExponentDeprecated() uint16 { + return 0 +} + +func (*PercentPriceFilter) MultiplierExponentMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*PercentPriceFilter) MultiplierExponentMinValue() int8 { + return math.MinInt8 + 1 +} + +func (*PercentPriceFilter) MultiplierExponentMaxValue() int8 { + return math.MaxInt8 +} + +func (*PercentPriceFilter) MultiplierExponentNullValue() int8 { + return math.MinInt8 +} + +func (*PercentPriceFilter) MultiplierUpId() uint16 { + return 3 +} + +func (*PercentPriceFilter) MultiplierUpSinceVersion() uint16 { + return 0 +} + +func (p *PercentPriceFilter) MultiplierUpInActingVersion(actingVersion uint16) bool { + return actingVersion >= p.MultiplierUpSinceVersion() +} + +func (*PercentPriceFilter) MultiplierUpDeprecated() uint16 { + return 0 +} + +func (*PercentPriceFilter) MultiplierUpMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*PercentPriceFilter) MultiplierUpMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*PercentPriceFilter) MultiplierUpMaxValue() int64 { + return math.MaxInt64 +} + +func (*PercentPriceFilter) MultiplierUpNullValue() int64 { + return math.MinInt64 +} + +func (*PercentPriceFilter) MultiplierDownId() uint16 { + return 4 +} + +func (*PercentPriceFilter) MultiplierDownSinceVersion() uint16 { + return 0 +} + +func (p *PercentPriceFilter) MultiplierDownInActingVersion(actingVersion uint16) bool { + return actingVersion >= p.MultiplierDownSinceVersion() +} + +func (*PercentPriceFilter) MultiplierDownDeprecated() uint16 { + return 0 +} + +func (*PercentPriceFilter) MultiplierDownMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*PercentPriceFilter) MultiplierDownMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*PercentPriceFilter) MultiplierDownMaxValue() int64 { + return math.MaxInt64 +} + +func (*PercentPriceFilter) MultiplierDownNullValue() int64 { + return math.MinInt64 +} + +func (*PercentPriceFilter) AvgPriceMinsId() uint16 { + return 5 +} + +func (*PercentPriceFilter) AvgPriceMinsSinceVersion() uint16 { + return 0 +} + +func (p *PercentPriceFilter) AvgPriceMinsInActingVersion(actingVersion uint16) bool { + return actingVersion >= p.AvgPriceMinsSinceVersion() +} + +func (*PercentPriceFilter) AvgPriceMinsDeprecated() uint16 { + return 0 +} + +func (*PercentPriceFilter) AvgPriceMinsMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*PercentPriceFilter) AvgPriceMinsMinValue() int32 { + return math.MinInt32 + 1 +} + +func (*PercentPriceFilter) AvgPriceMinsMaxValue() int32 { + return math.MaxInt32 +} + +func (*PercentPriceFilter) AvgPriceMinsNullValue() int32 { + return math.MinInt32 +} diff --git a/v2/sbe/spot_3_1/PingResponse.go b/v2/sbe/spot_3_1/PingResponse.go new file mode 100644 index 00000000..96dc7bea --- /dev/null +++ b/v2/sbe/spot_3_1/PingResponse.go @@ -0,0 +1,64 @@ +// Generated SBE (Simple Binary Encoding) message codec + +package sbe + +import ( + "io" + "io/ioutil" +) + +type PingResponse struct { +} + +func (p *PingResponse) Encode(_m *SbeGoMarshaller, _w io.Writer, doRangeCheck bool) error { + if doRangeCheck { + if err := p.RangeCheck(p.SbeSchemaVersion(), p.SbeSchemaVersion()); err != nil { + return err + } + } + return nil +} + +func (p *PingResponse) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint16, doRangeCheck bool) error { + if actingVersion > p.SbeSchemaVersion() && blockLength > p.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-p.SbeBlockLength())) + } + if doRangeCheck { + if err := p.RangeCheck(actingVersion, p.SbeSchemaVersion()); err != nil { + return err + } + } + return nil +} + +func (p *PingResponse) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + return nil +} + +func PingResponseInit(p *PingResponse) { + return +} + +func (*PingResponse) SbeBlockLength() (blockLength uint16) { + return 0 +} + +func (*PingResponse) SbeTemplateId() (templateId uint16) { + return 101 +} + +func (*PingResponse) SbeSchemaId() (schemaId uint16) { + return 3 +} + +func (*PingResponse) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} + +func (*PingResponse) SbeSemanticType() (semanticType []byte) { + return []byte("") +} + +func (*PingResponse) SbeSemanticVersion() (semanticVersion string) { + return "5.2" +} diff --git a/v2/sbe/spot_3_1/PriceFilter.go b/v2/sbe/spot_3_1/PriceFilter.go new file mode 100644 index 00000000..fb94c60a --- /dev/null +++ b/v2/sbe/spot_3_1/PriceFilter.go @@ -0,0 +1,334 @@ +// Generated SBE (Simple Binary Encoding) message codec + +package sbe + +import ( + "fmt" + "io" + "io/ioutil" + "math" +) + +type PriceFilter struct { + FilterType FilterTypeEnum + PriceExponent int8 + MinPrice int64 + MaxPrice int64 + TickSize int64 +} + +func (p *PriceFilter) Encode(_m *SbeGoMarshaller, _w io.Writer, doRangeCheck bool) error { + if doRangeCheck { + if err := p.RangeCheck(p.SbeSchemaVersion(), p.SbeSchemaVersion()); err != nil { + return err + } + } + if err := _m.WriteInt8(_w, p.PriceExponent); err != nil { + return err + } + if err := _m.WriteInt64(_w, p.MinPrice); err != nil { + return err + } + if err := _m.WriteInt64(_w, p.MaxPrice); err != nil { + return err + } + if err := _m.WriteInt64(_w, p.TickSize); err != nil { + return err + } + return nil +} + +func (p *PriceFilter) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint16, doRangeCheck bool) error { + p.FilterType = FilterType.PriceFilter + if !p.PriceExponentInActingVersion(actingVersion) { + p.PriceExponent = p.PriceExponentNullValue() + } else { + if err := _m.ReadInt8(_r, &p.PriceExponent); err != nil { + return err + } + } + if !p.MinPriceInActingVersion(actingVersion) { + p.MinPrice = p.MinPriceNullValue() + } else { + if err := _m.ReadInt64(_r, &p.MinPrice); err != nil { + return err + } + } + if !p.MaxPriceInActingVersion(actingVersion) { + p.MaxPrice = p.MaxPriceNullValue() + } else { + if err := _m.ReadInt64(_r, &p.MaxPrice); err != nil { + return err + } + } + if !p.TickSizeInActingVersion(actingVersion) { + p.TickSize = p.TickSizeNullValue() + } else { + if err := _m.ReadInt64(_r, &p.TickSize); err != nil { + return err + } + } + if actingVersion > p.SbeSchemaVersion() && blockLength > p.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-p.SbeBlockLength())) + } + if doRangeCheck { + if err := p.RangeCheck(actingVersion, p.SbeSchemaVersion()); err != nil { + return err + } + } + return nil +} + +func (p *PriceFilter) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if err := p.FilterType.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if p.PriceExponentInActingVersion(actingVersion) { + if p.PriceExponent < p.PriceExponentMinValue() || p.PriceExponent > p.PriceExponentMaxValue() { + return fmt.Errorf("Range check failed on p.PriceExponent (%v < %v > %v)", p.PriceExponentMinValue(), p.PriceExponent, p.PriceExponentMaxValue()) + } + } + if p.MinPriceInActingVersion(actingVersion) { + if p.MinPrice < p.MinPriceMinValue() || p.MinPrice > p.MinPriceMaxValue() { + return fmt.Errorf("Range check failed on p.MinPrice (%v < %v > %v)", p.MinPriceMinValue(), p.MinPrice, p.MinPriceMaxValue()) + } + } + if p.MaxPriceInActingVersion(actingVersion) { + if p.MaxPrice < p.MaxPriceMinValue() || p.MaxPrice > p.MaxPriceMaxValue() { + return fmt.Errorf("Range check failed on p.MaxPrice (%v < %v > %v)", p.MaxPriceMinValue(), p.MaxPrice, p.MaxPriceMaxValue()) + } + } + if p.TickSizeInActingVersion(actingVersion) { + if p.TickSize < p.TickSizeMinValue() || p.TickSize > p.TickSizeMaxValue() { + return fmt.Errorf("Range check failed on p.TickSize (%v < %v > %v)", p.TickSizeMinValue(), p.TickSize, p.TickSizeMaxValue()) + } + } + return nil +} + +func PriceFilterInit(p *PriceFilter) { + p.FilterType = FilterType.PriceFilter + return +} + +func (*PriceFilter) SbeBlockLength() (blockLength uint16) { + return 25 +} + +func (*PriceFilter) SbeTemplateId() (templateId uint16) { + return 1 +} + +func (*PriceFilter) SbeSchemaId() (schemaId uint16) { + return 3 +} + +func (*PriceFilter) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} + +func (*PriceFilter) SbeSemanticType() (semanticType []byte) { + return []byte("") +} + +func (*PriceFilter) SbeSemanticVersion() (semanticVersion string) { + return "5.2" +} + +func (*PriceFilter) FilterTypeId() uint16 { + return 1 +} + +func (*PriceFilter) FilterTypeSinceVersion() uint16 { + return 0 +} + +func (p *PriceFilter) FilterTypeInActingVersion(actingVersion uint16) bool { + return actingVersion >= p.FilterTypeSinceVersion() +} + +func (*PriceFilter) FilterTypeDeprecated() uint16 { + return 0 +} + +func (*PriceFilter) FilterTypeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "constant" + } + return "" +} + +func (*PriceFilter) PriceExponentId() uint16 { + return 2 +} + +func (*PriceFilter) PriceExponentSinceVersion() uint16 { + return 0 +} + +func (p *PriceFilter) PriceExponentInActingVersion(actingVersion uint16) bool { + return actingVersion >= p.PriceExponentSinceVersion() +} + +func (*PriceFilter) PriceExponentDeprecated() uint16 { + return 0 +} + +func (*PriceFilter) PriceExponentMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*PriceFilter) PriceExponentMinValue() int8 { + return math.MinInt8 + 1 +} + +func (*PriceFilter) PriceExponentMaxValue() int8 { + return math.MaxInt8 +} + +func (*PriceFilter) PriceExponentNullValue() int8 { + return math.MinInt8 +} + +func (*PriceFilter) MinPriceId() uint16 { + return 3 +} + +func (*PriceFilter) MinPriceSinceVersion() uint16 { + return 0 +} + +func (p *PriceFilter) MinPriceInActingVersion(actingVersion uint16) bool { + return actingVersion >= p.MinPriceSinceVersion() +} + +func (*PriceFilter) MinPriceDeprecated() uint16 { + return 0 +} + +func (*PriceFilter) MinPriceMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*PriceFilter) MinPriceMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*PriceFilter) MinPriceMaxValue() int64 { + return math.MaxInt64 +} + +func (*PriceFilter) MinPriceNullValue() int64 { + return math.MinInt64 +} + +func (*PriceFilter) MaxPriceId() uint16 { + return 4 +} + +func (*PriceFilter) MaxPriceSinceVersion() uint16 { + return 0 +} + +func (p *PriceFilter) MaxPriceInActingVersion(actingVersion uint16) bool { + return actingVersion >= p.MaxPriceSinceVersion() +} + +func (*PriceFilter) MaxPriceDeprecated() uint16 { + return 0 +} + +func (*PriceFilter) MaxPriceMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*PriceFilter) MaxPriceMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*PriceFilter) MaxPriceMaxValue() int64 { + return math.MaxInt64 +} + +func (*PriceFilter) MaxPriceNullValue() int64 { + return math.MinInt64 +} + +func (*PriceFilter) TickSizeId() uint16 { + return 5 +} + +func (*PriceFilter) TickSizeSinceVersion() uint16 { + return 0 +} + +func (p *PriceFilter) TickSizeInActingVersion(actingVersion uint16) bool { + return actingVersion >= p.TickSizeSinceVersion() +} + +func (*PriceFilter) TickSizeDeprecated() uint16 { + return 0 +} + +func (*PriceFilter) TickSizeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*PriceFilter) TickSizeMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*PriceFilter) TickSizeMaxValue() int64 { + return math.MaxInt64 +} + +func (*PriceFilter) TickSizeNullValue() int64 { + return math.MinInt64 +} diff --git a/v2/sbe/spot_3_1/PriceTickerResponse.go b/v2/sbe/spot_3_1/PriceTickerResponse.go new file mode 100644 index 00000000..caae1b47 --- /dev/null +++ b/v2/sbe/spot_3_1/PriceTickerResponse.go @@ -0,0 +1,327 @@ +// Generated SBE (Simple Binary Encoding) message codec + +package sbe + +import ( + "errors" + "fmt" + "io" + "io/ioutil" + "math" + "unicode/utf8" +) + +type PriceTickerResponse struct { + Tickers []PriceTickerResponseTickers +} +type PriceTickerResponseTickers struct { + PriceExponent int8 + Price int64 + Symbol []uint8 +} + +func (p *PriceTickerResponse) Encode(_m *SbeGoMarshaller, _w io.Writer, doRangeCheck bool) error { + if doRangeCheck { + if err := p.RangeCheck(p.SbeSchemaVersion(), p.SbeSchemaVersion()); err != nil { + return err + } + } + var TickersBlockLength uint16 = 9 + if err := _m.WriteUint16(_w, TickersBlockLength); err != nil { + return err + } + var TickersNumInGroup uint32 = uint32(len(p.Tickers)) + if err := _m.WriteUint32(_w, TickersNumInGroup); err != nil { + return err + } + for i := range p.Tickers { + if err := p.Tickers[i].Encode(_m, _w); err != nil { + return err + } + } + return nil +} + +func (p *PriceTickerResponse) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint16, doRangeCheck bool) error { + if actingVersion > p.SbeSchemaVersion() && blockLength > p.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-p.SbeBlockLength())) + } + + if p.TickersInActingVersion(actingVersion) { + var TickersBlockLength uint16 + if err := _m.ReadUint16(_r, &TickersBlockLength); err != nil { + return err + } + var TickersNumInGroup uint32 + if err := _m.ReadUint32(_r, &TickersNumInGroup); err != nil { + return err + } + if cap(p.Tickers) < int(TickersNumInGroup) { + p.Tickers = make([]PriceTickerResponseTickers, TickersNumInGroup) + } + p.Tickers = p.Tickers[:TickersNumInGroup] + for i := range p.Tickers { + if err := p.Tickers[i].Decode(_m, _r, actingVersion, uint(TickersBlockLength)); err != nil { + return err + } + } + } + if doRangeCheck { + if err := p.RangeCheck(actingVersion, p.SbeSchemaVersion()); err != nil { + return err + } + } + return nil +} + +func (p *PriceTickerResponse) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + for i := range p.Tickers { + if err := p.Tickers[i].RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + } + return nil +} + +func PriceTickerResponseInit(p *PriceTickerResponse) { + return +} + +func (p *PriceTickerResponseTickers) Encode(_m *SbeGoMarshaller, _w io.Writer) error { + if err := _m.WriteInt8(_w, p.PriceExponent); err != nil { + return err + } + if err := _m.WriteInt64(_w, p.Price); err != nil { + return err + } + if err := _m.WriteUint8(_w, uint8(len(p.Symbol))); err != nil { + return err + } + if err := _m.WriteBytes(_w, p.Symbol); err != nil { + return err + } + return nil +} + +func (p *PriceTickerResponseTickers) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint) error { + if !p.PriceExponentInActingVersion(actingVersion) { + p.PriceExponent = p.PriceExponentNullValue() + } else { + if err := _m.ReadInt8(_r, &p.PriceExponent); err != nil { + return err + } + } + if !p.PriceInActingVersion(actingVersion) { + p.Price = p.PriceNullValue() + } else { + if err := _m.ReadInt64(_r, &p.Price); err != nil { + return err + } + } + if actingVersion > p.SbeSchemaVersion() && blockLength > p.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-p.SbeBlockLength())) + } + + if p.SymbolInActingVersion(actingVersion) { + var SymbolLength uint8 + if err := _m.ReadUint8(_r, &SymbolLength); err != nil { + return err + } + if cap(p.Symbol) < int(SymbolLength) { + p.Symbol = make([]uint8, SymbolLength) + } + p.Symbol = p.Symbol[:SymbolLength] + if err := _m.ReadBytes(_r, p.Symbol); err != nil { + return err + } + } + return nil +} + +func (p *PriceTickerResponseTickers) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if p.PriceExponentInActingVersion(actingVersion) { + if p.PriceExponent < p.PriceExponentMinValue() || p.PriceExponent > p.PriceExponentMaxValue() { + return fmt.Errorf("Range check failed on p.PriceExponent (%v < %v > %v)", p.PriceExponentMinValue(), p.PriceExponent, p.PriceExponentMaxValue()) + } + } + if p.PriceInActingVersion(actingVersion) { + if p.Price != p.PriceNullValue() && (p.Price < p.PriceMinValue() || p.Price > p.PriceMaxValue()) { + return fmt.Errorf("Range check failed on p.Price (%v < %v > %v)", p.PriceMinValue(), p.Price, p.PriceMaxValue()) + } + } + if !utf8.Valid(p.Symbol[:]) { + return errors.New("p.Symbol failed UTF-8 validation") + } + return nil +} + +func PriceTickerResponseTickersInit(p *PriceTickerResponseTickers) { + p.Price = math.MinInt64 + return +} + +func (*PriceTickerResponse) SbeBlockLength() (blockLength uint16) { + return 0 +} + +func (*PriceTickerResponse) SbeTemplateId() (templateId uint16) { + return 210 +} + +func (*PriceTickerResponse) SbeSchemaId() (schemaId uint16) { + return 3 +} + +func (*PriceTickerResponse) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} + +func (*PriceTickerResponse) SbeSemanticType() (semanticType []byte) { + return []byte("") +} + +func (*PriceTickerResponse) SbeSemanticVersion() (semanticVersion string) { + return "5.2" +} + +func (*PriceTickerResponseTickers) PriceExponentId() uint16 { + return 1 +} + +func (*PriceTickerResponseTickers) PriceExponentSinceVersion() uint16 { + return 0 +} + +func (p *PriceTickerResponseTickers) PriceExponentInActingVersion(actingVersion uint16) bool { + return actingVersion >= p.PriceExponentSinceVersion() +} + +func (*PriceTickerResponseTickers) PriceExponentDeprecated() uint16 { + return 0 +} + +func (*PriceTickerResponseTickers) PriceExponentMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*PriceTickerResponseTickers) PriceExponentMinValue() int8 { + return math.MinInt8 + 1 +} + +func (*PriceTickerResponseTickers) PriceExponentMaxValue() int8 { + return math.MaxInt8 +} + +func (*PriceTickerResponseTickers) PriceExponentNullValue() int8 { + return math.MinInt8 +} + +func (*PriceTickerResponseTickers) PriceId() uint16 { + return 2 +} + +func (*PriceTickerResponseTickers) PriceSinceVersion() uint16 { + return 0 +} + +func (p *PriceTickerResponseTickers) PriceInActingVersion(actingVersion uint16) bool { + return actingVersion >= p.PriceSinceVersion() +} + +func (*PriceTickerResponseTickers) PriceDeprecated() uint16 { + return 0 +} + +func (*PriceTickerResponseTickers) PriceMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*PriceTickerResponseTickers) PriceMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*PriceTickerResponseTickers) PriceMaxValue() int64 { + return math.MaxInt64 +} + +func (*PriceTickerResponseTickers) PriceNullValue() int64 { + return math.MinInt64 +} + +func (*PriceTickerResponseTickers) SymbolMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*PriceTickerResponseTickers) SymbolSinceVersion() uint16 { + return 0 +} + +func (p *PriceTickerResponseTickers) SymbolInActingVersion(actingVersion uint16) bool { + return actingVersion >= p.SymbolSinceVersion() +} + +func (*PriceTickerResponseTickers) SymbolDeprecated() uint16 { + return 0 +} + +func (PriceTickerResponseTickers) SymbolCharacterEncoding() string { + return "UTF-8" +} + +func (PriceTickerResponseTickers) SymbolHeaderLength() uint64 { + return 1 +} + +func (*PriceTickerResponse) TickersId() uint16 { + return 100 +} + +func (*PriceTickerResponse) TickersSinceVersion() uint16 { + return 0 +} + +func (p *PriceTickerResponse) TickersInActingVersion(actingVersion uint16) bool { + return actingVersion >= p.TickersSinceVersion() +} + +func (*PriceTickerResponse) TickersDeprecated() uint16 { + return 0 +} + +func (*PriceTickerResponseTickers) SbeBlockLength() (blockLength uint) { + return 9 +} + +func (*PriceTickerResponseTickers) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} diff --git a/v2/sbe/spot_3_1/PriceTickerSymbolResponse.go b/v2/sbe/spot_3_1/PriceTickerSymbolResponse.go new file mode 100644 index 00000000..58794fbe --- /dev/null +++ b/v2/sbe/spot_3_1/PriceTickerSymbolResponse.go @@ -0,0 +1,243 @@ +// Generated SBE (Simple Binary Encoding) message codec + +package sbe + +import ( + "errors" + "fmt" + "io" + "io/ioutil" + "math" + "unicode/utf8" +) + +type PriceTickerSymbolResponse struct { + PriceExponent int8 + Price int64 + Symbol []uint8 +} + +func (p *PriceTickerSymbolResponse) Encode(_m *SbeGoMarshaller, _w io.Writer, doRangeCheck bool) error { + if doRangeCheck { + if err := p.RangeCheck(p.SbeSchemaVersion(), p.SbeSchemaVersion()); err != nil { + return err + } + } + if err := _m.WriteInt8(_w, p.PriceExponent); err != nil { + return err + } + if err := _m.WriteInt64(_w, p.Price); err != nil { + return err + } + if err := _m.WriteUint8(_w, uint8(len(p.Symbol))); err != nil { + return err + } + if err := _m.WriteBytes(_w, p.Symbol); err != nil { + return err + } + return nil +} + +func (p *PriceTickerSymbolResponse) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint16, doRangeCheck bool) error { + if !p.PriceExponentInActingVersion(actingVersion) { + p.PriceExponent = p.PriceExponentNullValue() + } else { + if err := _m.ReadInt8(_r, &p.PriceExponent); err != nil { + return err + } + } + if !p.PriceInActingVersion(actingVersion) { + p.Price = p.PriceNullValue() + } else { + if err := _m.ReadInt64(_r, &p.Price); err != nil { + return err + } + } + if actingVersion > p.SbeSchemaVersion() && blockLength > p.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-p.SbeBlockLength())) + } + + if p.SymbolInActingVersion(actingVersion) { + var SymbolLength uint8 + if err := _m.ReadUint8(_r, &SymbolLength); err != nil { + return err + } + if cap(p.Symbol) < int(SymbolLength) { + p.Symbol = make([]uint8, SymbolLength) + } + p.Symbol = p.Symbol[:SymbolLength] + if err := _m.ReadBytes(_r, p.Symbol); err != nil { + return err + } + } + if doRangeCheck { + if err := p.RangeCheck(actingVersion, p.SbeSchemaVersion()); err != nil { + return err + } + } + return nil +} + +func (p *PriceTickerSymbolResponse) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if p.PriceExponentInActingVersion(actingVersion) { + if p.PriceExponent < p.PriceExponentMinValue() || p.PriceExponent > p.PriceExponentMaxValue() { + return fmt.Errorf("Range check failed on p.PriceExponent (%v < %v > %v)", p.PriceExponentMinValue(), p.PriceExponent, p.PriceExponentMaxValue()) + } + } + if p.PriceInActingVersion(actingVersion) { + if p.Price != p.PriceNullValue() && (p.Price < p.PriceMinValue() || p.Price > p.PriceMaxValue()) { + return fmt.Errorf("Range check failed on p.Price (%v < %v > %v)", p.PriceMinValue(), p.Price, p.PriceMaxValue()) + } + } + if !utf8.Valid(p.Symbol[:]) { + return errors.New("p.Symbol failed UTF-8 validation") + } + return nil +} + +func PriceTickerSymbolResponseInit(p *PriceTickerSymbolResponse) { + p.Price = math.MinInt64 + return +} + +func (*PriceTickerSymbolResponse) SbeBlockLength() (blockLength uint16) { + return 9 +} + +func (*PriceTickerSymbolResponse) SbeTemplateId() (templateId uint16) { + return 209 +} + +func (*PriceTickerSymbolResponse) SbeSchemaId() (schemaId uint16) { + return 3 +} + +func (*PriceTickerSymbolResponse) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} + +func (*PriceTickerSymbolResponse) SbeSemanticType() (semanticType []byte) { + return []byte("") +} + +func (*PriceTickerSymbolResponse) SbeSemanticVersion() (semanticVersion string) { + return "5.2" +} + +func (*PriceTickerSymbolResponse) PriceExponentId() uint16 { + return 1 +} + +func (*PriceTickerSymbolResponse) PriceExponentSinceVersion() uint16 { + return 0 +} + +func (p *PriceTickerSymbolResponse) PriceExponentInActingVersion(actingVersion uint16) bool { + return actingVersion >= p.PriceExponentSinceVersion() +} + +func (*PriceTickerSymbolResponse) PriceExponentDeprecated() uint16 { + return 0 +} + +func (*PriceTickerSymbolResponse) PriceExponentMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*PriceTickerSymbolResponse) PriceExponentMinValue() int8 { + return math.MinInt8 + 1 +} + +func (*PriceTickerSymbolResponse) PriceExponentMaxValue() int8 { + return math.MaxInt8 +} + +func (*PriceTickerSymbolResponse) PriceExponentNullValue() int8 { + return math.MinInt8 +} + +func (*PriceTickerSymbolResponse) PriceId() uint16 { + return 2 +} + +func (*PriceTickerSymbolResponse) PriceSinceVersion() uint16 { + return 0 +} + +func (p *PriceTickerSymbolResponse) PriceInActingVersion(actingVersion uint16) bool { + return actingVersion >= p.PriceSinceVersion() +} + +func (*PriceTickerSymbolResponse) PriceDeprecated() uint16 { + return 0 +} + +func (*PriceTickerSymbolResponse) PriceMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*PriceTickerSymbolResponse) PriceMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*PriceTickerSymbolResponse) PriceMaxValue() int64 { + return math.MaxInt64 +} + +func (*PriceTickerSymbolResponse) PriceNullValue() int64 { + return math.MinInt64 +} + +func (*PriceTickerSymbolResponse) SymbolMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*PriceTickerSymbolResponse) SymbolSinceVersion() uint16 { + return 0 +} + +func (p *PriceTickerSymbolResponse) SymbolInActingVersion(actingVersion uint16) bool { + return actingVersion >= p.SymbolSinceVersion() +} + +func (*PriceTickerSymbolResponse) SymbolDeprecated() uint16 { + return 0 +} + +func (PriceTickerSymbolResponse) SymbolCharacterEncoding() string { + return "UTF-8" +} + +func (PriceTickerSymbolResponse) SymbolHeaderLength() uint64 { + return 1 +} diff --git a/v2/sbe/spot_3_1/RateLimitInterval.go b/v2/sbe/spot_3_1/RateLimitInterval.go new file mode 100644 index 00000000..bff2d805 --- /dev/null +++ b/v2/sbe/spot_3_1/RateLimitInterval.go @@ -0,0 +1,112 @@ +// Generated SBE (Simple Binary Encoding) message codec + +package sbe + +import ( + "fmt" + "io" + "reflect" +) + +type RateLimitIntervalEnum uint8 +type RateLimitIntervalValues struct { + Second RateLimitIntervalEnum + Minute RateLimitIntervalEnum + Hour RateLimitIntervalEnum + Day RateLimitIntervalEnum + NonRepresentable RateLimitIntervalEnum + NullValue RateLimitIntervalEnum +} + +var RateLimitInterval = RateLimitIntervalValues{0, 1, 2, 3, 254, 255} + +func (r RateLimitIntervalEnum) Encode(_m *SbeGoMarshaller, _w io.Writer) error { + if err := _m.WriteUint8(_w, uint8(r)); err != nil { + return err + } + return nil +} + +func (r *RateLimitIntervalEnum) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16) error { + if err := _m.ReadUint8(_r, (*uint8)(r)); err != nil { + return err + } + return nil +} + +func (r RateLimitIntervalEnum) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if actingVersion > schemaVersion { + return nil + } + value := reflect.ValueOf(RateLimitInterval) + for idx := 0; idx < value.NumField(); idx++ { + if r == value.Field(idx).Interface() { + return nil + } + } + return fmt.Errorf("Range check failed on RateLimitInterval, unknown enumeration value %d", r) +} + +func (*RateLimitIntervalEnum) EncodedLength() int64 { + return 1 +} + +func (*RateLimitIntervalEnum) SecondSinceVersion() uint16 { + return 0 +} + +func (r *RateLimitIntervalEnum) SecondInActingVersion(actingVersion uint16) bool { + return actingVersion >= r.SecondSinceVersion() +} + +func (*RateLimitIntervalEnum) SecondDeprecated() uint16 { + return 0 +} + +func (*RateLimitIntervalEnum) MinuteSinceVersion() uint16 { + return 0 +} + +func (r *RateLimitIntervalEnum) MinuteInActingVersion(actingVersion uint16) bool { + return actingVersion >= r.MinuteSinceVersion() +} + +func (*RateLimitIntervalEnum) MinuteDeprecated() uint16 { + return 0 +} + +func (*RateLimitIntervalEnum) HourSinceVersion() uint16 { + return 0 +} + +func (r *RateLimitIntervalEnum) HourInActingVersion(actingVersion uint16) bool { + return actingVersion >= r.HourSinceVersion() +} + +func (*RateLimitIntervalEnum) HourDeprecated() uint16 { + return 0 +} + +func (*RateLimitIntervalEnum) DaySinceVersion() uint16 { + return 0 +} + +func (r *RateLimitIntervalEnum) DayInActingVersion(actingVersion uint16) bool { + return actingVersion >= r.DaySinceVersion() +} + +func (*RateLimitIntervalEnum) DayDeprecated() uint16 { + return 0 +} + +func (*RateLimitIntervalEnum) NonRepresentableSinceVersion() uint16 { + return 0 +} + +func (r *RateLimitIntervalEnum) NonRepresentableInActingVersion(actingVersion uint16) bool { + return actingVersion >= r.NonRepresentableSinceVersion() +} + +func (*RateLimitIntervalEnum) NonRepresentableDeprecated() uint16 { + return 0 +} diff --git a/v2/sbe/spot_3_1/RateLimitType.go b/v2/sbe/spot_3_1/RateLimitType.go new file mode 100644 index 00000000..3658cb0e --- /dev/null +++ b/v2/sbe/spot_3_1/RateLimitType.go @@ -0,0 +1,112 @@ +// Generated SBE (Simple Binary Encoding) message codec + +package sbe + +import ( + "fmt" + "io" + "reflect" +) + +type RateLimitTypeEnum uint8 +type RateLimitTypeValues struct { + RawRequests RateLimitTypeEnum + Connections RateLimitTypeEnum + RequestWeight RateLimitTypeEnum + Orders RateLimitTypeEnum + NonRepresentable RateLimitTypeEnum + NullValue RateLimitTypeEnum +} + +var RateLimitType = RateLimitTypeValues{0, 1, 2, 3, 254, 255} + +func (r RateLimitTypeEnum) Encode(_m *SbeGoMarshaller, _w io.Writer) error { + if err := _m.WriteUint8(_w, uint8(r)); err != nil { + return err + } + return nil +} + +func (r *RateLimitTypeEnum) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16) error { + if err := _m.ReadUint8(_r, (*uint8)(r)); err != nil { + return err + } + return nil +} + +func (r RateLimitTypeEnum) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if actingVersion > schemaVersion { + return nil + } + value := reflect.ValueOf(RateLimitType) + for idx := 0; idx < value.NumField(); idx++ { + if r == value.Field(idx).Interface() { + return nil + } + } + return fmt.Errorf("Range check failed on RateLimitType, unknown enumeration value %d", r) +} + +func (*RateLimitTypeEnum) EncodedLength() int64 { + return 1 +} + +func (*RateLimitTypeEnum) RawRequestsSinceVersion() uint16 { + return 0 +} + +func (r *RateLimitTypeEnum) RawRequestsInActingVersion(actingVersion uint16) bool { + return actingVersion >= r.RawRequestsSinceVersion() +} + +func (*RateLimitTypeEnum) RawRequestsDeprecated() uint16 { + return 0 +} + +func (*RateLimitTypeEnum) ConnectionsSinceVersion() uint16 { + return 0 +} + +func (r *RateLimitTypeEnum) ConnectionsInActingVersion(actingVersion uint16) bool { + return actingVersion >= r.ConnectionsSinceVersion() +} + +func (*RateLimitTypeEnum) ConnectionsDeprecated() uint16 { + return 0 +} + +func (*RateLimitTypeEnum) RequestWeightSinceVersion() uint16 { + return 0 +} + +func (r *RateLimitTypeEnum) RequestWeightInActingVersion(actingVersion uint16) bool { + return actingVersion >= r.RequestWeightSinceVersion() +} + +func (*RateLimitTypeEnum) RequestWeightDeprecated() uint16 { + return 0 +} + +func (*RateLimitTypeEnum) OrdersSinceVersion() uint16 { + return 0 +} + +func (r *RateLimitTypeEnum) OrdersInActingVersion(actingVersion uint16) bool { + return actingVersion >= r.OrdersSinceVersion() +} + +func (*RateLimitTypeEnum) OrdersDeprecated() uint16 { + return 0 +} + +func (*RateLimitTypeEnum) NonRepresentableSinceVersion() uint16 { + return 0 +} + +func (r *RateLimitTypeEnum) NonRepresentableInActingVersion(actingVersion uint16) bool { + return actingVersion >= r.NonRepresentableSinceVersion() +} + +func (*RateLimitTypeEnum) NonRepresentableDeprecated() uint16 { + return 0 +} diff --git a/v2/sbe/spot_3_1/SbeMarshalling.go b/v2/sbe/spot_3_1/SbeMarshalling.go new file mode 100644 index 00000000..8773ae13 --- /dev/null +++ b/v2/sbe/spot_3_1/SbeMarshalling.go @@ -0,0 +1,283 @@ +// Copyright (C) 2017 MarketFactory, Inc +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at: +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// This file provides a simple bespoke marshalling layer for the +// standard binary encoding golang backend and is part of: +// +// https://github.com/real-logic/simple-binary-encoding + +package sbe + +import ( + "io" + "math" +) + +// Allocate via NewSbeGoMarshaller to initialize +type SbeGoMarshaller struct { + b8 []byte // statically allocated tmp space to avoid alloc + b1 []byte // previously created slice into b to save time + b2 []byte // previously created slice into b to save time + b4 []byte // previously created slice into b to save time +} + +func NewSbeGoMarshaller() *SbeGoMarshaller { + var m SbeGoMarshaller + m.b8 = make([]byte, 8) + m.b1 = m.b8[:1] + m.b2 = m.b8[:2] + m.b4 = m.b8[:4] + return &m +} + +// The "standard" MessageHeader. +// +// Most applications will use this as it's the default and optimized +// although it's possible to change it by: +// a) using a different sized BlockLength, or +// b) adding arbitrary fields +// +// If the MessageHeader is not "standard" then you can use the +// generated MessageHeader type in MessageHeader.go otherwise we +// recommend this one. +type SbeGoMessageHeader struct { + BlockLength uint16 + TemplateId uint16 + SchemaId uint16 + Version uint16 +} + +func (m SbeGoMessageHeader) Encode(_m *SbeGoMarshaller, _w io.Writer) error { + _m.b8[0] = byte(m.BlockLength) + _m.b8[1] = byte(m.BlockLength >> 8) + _m.b8[2] = byte(m.TemplateId) + _m.b8[3] = byte(m.TemplateId >> 8) + _m.b8[4] = byte(m.SchemaId) + _m.b8[5] = byte(m.SchemaId >> 8) + _m.b8[6] = byte(m.Version) + _m.b8[7] = byte(m.Version >> 8) + if _, err := _w.Write(_m.b8); err != nil { + return err + } + return nil +} + +func (m *SbeGoMessageHeader) Decode(_m *SbeGoMarshaller, _r io.Reader) error { + if _, err := io.ReadFull(_r, _m.b8); err != nil { + return err + } + m.BlockLength = uint16(_m.b8[0]) | uint16(_m.b8[1])<<8 + m.TemplateId = uint16(_m.b8[2]) | uint16(_m.b8[3])<<8 + m.SchemaId = uint16(_m.b8[4]) | uint16(_m.b8[5])<<8 + m.Version = uint16(_m.b8[6]) | uint16(_m.b8[7])<<8 + return nil +} + +func (m *SbeGoMarshaller) WriteUint8(w io.Writer, v uint8) error { + m.b1[0] = byte(v) + _, err := w.Write(m.b1) + return err +} + +func (m *SbeGoMarshaller) WriteUint16(w io.Writer, v uint16) error { + m.b2[0] = byte(v) + m.b2[1] = byte(v >> 8) + _, err := w.Write(m.b2) + return err +} + +func (m *SbeGoMarshaller) WriteUint32(w io.Writer, v uint32) error { + m.b4[0] = byte(v) + m.b4[1] = byte(v >> 8) + m.b4[2] = byte(v >> 16) + m.b4[3] = byte(v >> 24) + _, err := w.Write(m.b4) + return err +} + +func (m *SbeGoMarshaller) WriteUint64(w io.Writer, v uint64) error { + m.b8[0] = byte(v) + m.b8[1] = byte(v >> 8) + m.b8[2] = byte(v >> 16) + m.b8[3] = byte(v >> 24) + m.b8[4] = byte(v >> 32) + m.b8[5] = byte(v >> 40) + m.b8[6] = byte(v >> 48) + m.b8[7] = byte(v >> 56) + _, err := w.Write(m.b8) + return err +} + +func (m *SbeGoMarshaller) WriteInt8(w io.Writer, v int8) error { + m.b1[0] = byte(v) + _, err := w.Write(m.b1) + return err +} + +func (m *SbeGoMarshaller) WriteInt16(w io.Writer, v int16) error { + m.b2[0] = byte(v) + m.b2[1] = byte(v >> 8) + _, err := w.Write(m.b2) + return err +} + +func (m *SbeGoMarshaller) WriteInt32(w io.Writer, v int32) error { + m.b4[0] = byte(v) + m.b4[1] = byte(v >> 8) + m.b4[2] = byte(v >> 16) + m.b4[3] = byte(v >> 24) + _, err := w.Write(m.b4) + return err +} + +func (m *SbeGoMarshaller) WriteInt64(w io.Writer, v int64) error { + m.b8[0] = byte(v) + m.b8[1] = byte(v >> 8) + m.b8[2] = byte(v >> 16) + m.b8[3] = byte(v >> 24) + m.b8[4] = byte(v >> 32) + m.b8[5] = byte(v >> 40) + m.b8[6] = byte(v >> 48) + m.b8[7] = byte(v >> 56) + _, err := w.Write(m.b8) + return err +} + +func (m *SbeGoMarshaller) WriteFloat32(w io.Writer, v float32) error { + u32 := math.Float32bits(v) + m.b4[0] = byte(u32) + m.b4[1] = byte(u32 >> 8) + m.b4[2] = byte(u32 >> 16) + m.b4[3] = byte(u32 >> 24) + _, err := w.Write(m.b4) + return err +} + +func (m *SbeGoMarshaller) WriteFloat64(w io.Writer, v float64) error { + u64 := math.Float64bits(v) + m.b8[0] = byte(u64) + m.b8[1] = byte(u64 >> 8) + m.b8[2] = byte(u64 >> 16) + m.b8[3] = byte(u64 >> 24) + m.b8[4] = byte(u64 >> 32) + m.b8[5] = byte(u64 >> 40) + m.b8[6] = byte(u64 >> 48) + m.b8[7] = byte(u64 >> 56) + _, err := w.Write(m.b8) + return err +} + +func (m *SbeGoMarshaller) WriteBytes(w io.Writer, v []byte) error { + _, err := w.Write(v) + return err +} + +func (m *SbeGoMarshaller) ReadUint8(r io.Reader, v *uint8) error { + if _, err := io.ReadFull(r, m.b1); err != nil { + return err + } + *v = uint8(m.b1[0]) + return nil +} + +func (m *SbeGoMarshaller) ReadUint16(r io.Reader, v *uint16) error { + if _, err := io.ReadFull(r, m.b2); err != nil { + return err + } + *v = (uint16(m.b2[0]) | uint16(m.b2[1])<<8) + return nil +} + +func (m *SbeGoMarshaller) ReadUint32(r io.Reader, v *uint32) error { + if _, err := io.ReadFull(r, m.b4); err != nil { + return err + } + *v = (uint32(m.b4[0]) | uint32(m.b4[1])<<8 | + uint32(m.b4[2])<<16 | uint32(m.b4[3])<<24) + return nil +} + +func (m *SbeGoMarshaller) ReadUint64(r io.Reader, v *uint64) error { + if _, err := io.ReadFull(r, m.b8); err != nil { + return err + } + *v = (uint64(m.b8[0]) | uint64(m.b8[1])<<8 | + uint64(m.b8[2])<<16 | uint64(m.b8[3])<<24 | + uint64(m.b8[4])<<32 | uint64(m.b8[5])<<40 | + uint64(m.b8[6])<<48 | uint64(m.b8[7])<<56) + return nil +} + +func (m *SbeGoMarshaller) ReadInt8(r io.Reader, v *int8) error { + if _, err := io.ReadFull(r, m.b1); err != nil { + return err + } + *v = int8(m.b1[0]) + return nil +} + +func (m *SbeGoMarshaller) ReadInt16(r io.Reader, v *int16) error { + if _, err := io.ReadFull(r, m.b2); err != nil { + return err + } + *v = (int16(m.b2[0]) | int16(m.b2[1])<<8) + return nil +} + +func (m *SbeGoMarshaller) ReadInt32(r io.Reader, v *int32) error { + if _, err := io.ReadFull(r, m.b4); err != nil { + return err + } + *v = (int32(m.b4[0]) | int32(m.b4[1])<<8 | + int32(m.b4[2])<<16 | int32(m.b4[3])<<24) + return nil +} + +func (m *SbeGoMarshaller) ReadInt64(r io.Reader, v *int64) error { + if _, err := io.ReadFull(r, m.b8); err != nil { + return err + } + *v = (int64(m.b8[0]) | int64(m.b8[1])<<8 | + int64(m.b8[2])<<16 | int64(m.b8[3])<<24 | + int64(m.b8[4])<<32 | int64(m.b8[5])<<40 | + int64(m.b8[6])<<48 | int64(m.b8[7])<<56) + return nil +} + +func (m *SbeGoMarshaller) ReadFloat32(r io.Reader, v *float32) error { + if _, err := io.ReadFull(r, m.b4); err != nil { + return err + } + *v = math.Float32frombits(uint32(m.b4[0]) | uint32(m.b4[1])<<8 | + uint32(m.b4[2])<<16 | uint32(m.b4[3])<<24) + return nil +} + +func (m *SbeGoMarshaller) ReadFloat64(r io.Reader, v *float64) error { + if _, err := io.ReadFull(r, m.b8); err != nil { + return err + } + *v = math.Float64frombits(uint64(m.b8[0]) | uint64(m.b8[1])<<8 | + uint64(m.b8[2])<<16 | uint64(m.b8[3])<<24 | + uint64(m.b8[4])<<32 | uint64(m.b8[5])<<40 | + uint64(m.b8[6])<<48 | uint64(m.b8[7])<<56) + return nil +} + +func (m *SbeGoMarshaller) ReadBytes(r io.Reader, b []byte) error { + if _, err := io.ReadFull(r, b); err != nil { + return err + } + return nil +} diff --git a/v2/sbe/spot_3_1/SelfTradePreventionMode.go b/v2/sbe/spot_3_1/SelfTradePreventionMode.go new file mode 100644 index 00000000..89d403d3 --- /dev/null +++ b/v2/sbe/spot_3_1/SelfTradePreventionMode.go @@ -0,0 +1,125 @@ +// Generated SBE (Simple Binary Encoding) message codec + +package sbe + +import ( + "fmt" + "io" + "reflect" +) + +type SelfTradePreventionModeEnum uint8 +type SelfTradePreventionModeValues struct { + None SelfTradePreventionModeEnum + ExpireTaker SelfTradePreventionModeEnum + ExpireMaker SelfTradePreventionModeEnum + ExpireBoth SelfTradePreventionModeEnum + Decrement SelfTradePreventionModeEnum + NonRepresentable SelfTradePreventionModeEnum + NullValue SelfTradePreventionModeEnum +} + +var SelfTradePreventionMode = SelfTradePreventionModeValues{1, 2, 3, 4, 5, 254, 255} + +func (s SelfTradePreventionModeEnum) Encode(_m *SbeGoMarshaller, _w io.Writer) error { + if err := _m.WriteUint8(_w, uint8(s)); err != nil { + return err + } + return nil +} + +func (s *SelfTradePreventionModeEnum) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16) error { + if err := _m.ReadUint8(_r, (*uint8)(s)); err != nil { + return err + } + return nil +} + +func (s SelfTradePreventionModeEnum) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if actingVersion > schemaVersion { + return nil + } + value := reflect.ValueOf(SelfTradePreventionMode) + for idx := 0; idx < value.NumField(); idx++ { + if s == value.Field(idx).Interface() { + return nil + } + } + return fmt.Errorf("Range check failed on SelfTradePreventionMode, unknown enumeration value %d", s) +} + +func (*SelfTradePreventionModeEnum) EncodedLength() int64 { + return 1 +} + +func (*SelfTradePreventionModeEnum) NoneSinceVersion() uint16 { + return 0 +} + +func (s *SelfTradePreventionModeEnum) NoneInActingVersion(actingVersion uint16) bool { + return actingVersion >= s.NoneSinceVersion() +} + +func (*SelfTradePreventionModeEnum) NoneDeprecated() uint16 { + return 0 +} + +func (*SelfTradePreventionModeEnum) ExpireTakerSinceVersion() uint16 { + return 0 +} + +func (s *SelfTradePreventionModeEnum) ExpireTakerInActingVersion(actingVersion uint16) bool { + return actingVersion >= s.ExpireTakerSinceVersion() +} + +func (*SelfTradePreventionModeEnum) ExpireTakerDeprecated() uint16 { + return 0 +} + +func (*SelfTradePreventionModeEnum) ExpireMakerSinceVersion() uint16 { + return 0 +} + +func (s *SelfTradePreventionModeEnum) ExpireMakerInActingVersion(actingVersion uint16) bool { + return actingVersion >= s.ExpireMakerSinceVersion() +} + +func (*SelfTradePreventionModeEnum) ExpireMakerDeprecated() uint16 { + return 0 +} + +func (*SelfTradePreventionModeEnum) ExpireBothSinceVersion() uint16 { + return 0 +} + +func (s *SelfTradePreventionModeEnum) ExpireBothInActingVersion(actingVersion uint16) bool { + return actingVersion >= s.ExpireBothSinceVersion() +} + +func (*SelfTradePreventionModeEnum) ExpireBothDeprecated() uint16 { + return 0 +} + +func (*SelfTradePreventionModeEnum) DecrementSinceVersion() uint16 { + return 0 +} + +func (s *SelfTradePreventionModeEnum) DecrementInActingVersion(actingVersion uint16) bool { + return actingVersion >= s.DecrementSinceVersion() +} + +func (*SelfTradePreventionModeEnum) DecrementDeprecated() uint16 { + return 0 +} + +func (*SelfTradePreventionModeEnum) NonRepresentableSinceVersion() uint16 { + return 0 +} + +func (s *SelfTradePreventionModeEnum) NonRepresentableInActingVersion(actingVersion uint16) bool { + return actingVersion >= s.NonRepresentableSinceVersion() +} + +func (*SelfTradePreventionModeEnum) NonRepresentableDeprecated() uint16 { + return 0 +} diff --git a/v2/sbe/spot_3_1/ServerTimeResponse.go b/v2/sbe/spot_3_1/ServerTimeResponse.go new file mode 100644 index 00000000..6adf4725 --- /dev/null +++ b/v2/sbe/spot_3_1/ServerTimeResponse.go @@ -0,0 +1,124 @@ +// Generated SBE (Simple Binary Encoding) message codec + +package sbe + +import ( + "fmt" + "io" + "io/ioutil" + "math" +) + +type ServerTimeResponse struct { + ServerTime int64 +} + +func (s *ServerTimeResponse) Encode(_m *SbeGoMarshaller, _w io.Writer, doRangeCheck bool) error { + if doRangeCheck { + if err := s.RangeCheck(s.SbeSchemaVersion(), s.SbeSchemaVersion()); err != nil { + return err + } + } + if err := _m.WriteInt64(_w, s.ServerTime); err != nil { + return err + } + return nil +} + +func (s *ServerTimeResponse) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint16, doRangeCheck bool) error { + if !s.ServerTimeInActingVersion(actingVersion) { + s.ServerTime = s.ServerTimeNullValue() + } else { + if err := _m.ReadInt64(_r, &s.ServerTime); err != nil { + return err + } + } + if actingVersion > s.SbeSchemaVersion() && blockLength > s.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-s.SbeBlockLength())) + } + if doRangeCheck { + if err := s.RangeCheck(actingVersion, s.SbeSchemaVersion()); err != nil { + return err + } + } + return nil +} + +func (s *ServerTimeResponse) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if s.ServerTimeInActingVersion(actingVersion) { + if s.ServerTime < s.ServerTimeMinValue() || s.ServerTime > s.ServerTimeMaxValue() { + return fmt.Errorf("Range check failed on s.ServerTime (%v < %v > %v)", s.ServerTimeMinValue(), s.ServerTime, s.ServerTimeMaxValue()) + } + } + return nil +} + +func ServerTimeResponseInit(s *ServerTimeResponse) { + return +} + +func (*ServerTimeResponse) SbeBlockLength() (blockLength uint16) { + return 8 +} + +func (*ServerTimeResponse) SbeTemplateId() (templateId uint16) { + return 102 +} + +func (*ServerTimeResponse) SbeSchemaId() (schemaId uint16) { + return 3 +} + +func (*ServerTimeResponse) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} + +func (*ServerTimeResponse) SbeSemanticType() (semanticType []byte) { + return []byte("") +} + +func (*ServerTimeResponse) SbeSemanticVersion() (semanticVersion string) { + return "5.2" +} + +func (*ServerTimeResponse) ServerTimeId() uint16 { + return 1 +} + +func (*ServerTimeResponse) ServerTimeSinceVersion() uint16 { + return 0 +} + +func (s *ServerTimeResponse) ServerTimeInActingVersion(actingVersion uint16) bool { + return actingVersion >= s.ServerTimeSinceVersion() +} + +func (*ServerTimeResponse) ServerTimeDeprecated() uint16 { + return 0 +} + +func (*ServerTimeResponse) ServerTimeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*ServerTimeResponse) ServerTimeMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*ServerTimeResponse) ServerTimeMaxValue() int64 { + return math.MaxInt64 +} + +func (*ServerTimeResponse) ServerTimeNullValue() int64 { + return math.MinInt64 +} diff --git a/v2/sbe/spot_3_1/SymbolStatus.go b/v2/sbe/spot_3_1/SymbolStatus.go new file mode 100644 index 00000000..f67c8bf8 --- /dev/null +++ b/v2/sbe/spot_3_1/SymbolStatus.go @@ -0,0 +1,112 @@ +// Generated SBE (Simple Binary Encoding) message codec + +package sbe + +import ( + "fmt" + "io" + "reflect" +) + +type SymbolStatusEnum uint8 +type SymbolStatusValues struct { + Trading SymbolStatusEnum + EndOfDay SymbolStatusEnum + Halt SymbolStatusEnum + Break SymbolStatusEnum + NonRepresentable SymbolStatusEnum + NullValue SymbolStatusEnum +} + +var SymbolStatus = SymbolStatusValues{0, 1, 2, 3, 254, 255} + +func (s SymbolStatusEnum) Encode(_m *SbeGoMarshaller, _w io.Writer) error { + if err := _m.WriteUint8(_w, uint8(s)); err != nil { + return err + } + return nil +} + +func (s *SymbolStatusEnum) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16) error { + if err := _m.ReadUint8(_r, (*uint8)(s)); err != nil { + return err + } + return nil +} + +func (s SymbolStatusEnum) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if actingVersion > schemaVersion { + return nil + } + value := reflect.ValueOf(SymbolStatus) + for idx := 0; idx < value.NumField(); idx++ { + if s == value.Field(idx).Interface() { + return nil + } + } + return fmt.Errorf("Range check failed on SymbolStatus, unknown enumeration value %d", s) +} + +func (*SymbolStatusEnum) EncodedLength() int64 { + return 1 +} + +func (*SymbolStatusEnum) TradingSinceVersion() uint16 { + return 0 +} + +func (s *SymbolStatusEnum) TradingInActingVersion(actingVersion uint16) bool { + return actingVersion >= s.TradingSinceVersion() +} + +func (*SymbolStatusEnum) TradingDeprecated() uint16 { + return 0 +} + +func (*SymbolStatusEnum) EndOfDaySinceVersion() uint16 { + return 0 +} + +func (s *SymbolStatusEnum) EndOfDayInActingVersion(actingVersion uint16) bool { + return actingVersion >= s.EndOfDaySinceVersion() +} + +func (*SymbolStatusEnum) EndOfDayDeprecated() uint16 { + return 0 +} + +func (*SymbolStatusEnum) HaltSinceVersion() uint16 { + return 0 +} + +func (s *SymbolStatusEnum) HaltInActingVersion(actingVersion uint16) bool { + return actingVersion >= s.HaltSinceVersion() +} + +func (*SymbolStatusEnum) HaltDeprecated() uint16 { + return 0 +} + +func (*SymbolStatusEnum) BreakSinceVersion() uint16 { + return 0 +} + +func (s *SymbolStatusEnum) BreakInActingVersion(actingVersion uint16) bool { + return actingVersion >= s.BreakSinceVersion() +} + +func (*SymbolStatusEnum) BreakDeprecated() uint16 { + return 0 +} + +func (*SymbolStatusEnum) NonRepresentableSinceVersion() uint16 { + return 0 +} + +func (s *SymbolStatusEnum) NonRepresentableInActingVersion(actingVersion uint16) bool { + return actingVersion >= s.NonRepresentableSinceVersion() +} + +func (*SymbolStatusEnum) NonRepresentableDeprecated() uint16 { + return 0 +} diff --git a/v2/sbe/spot_3_1/TPlusSellFilter.go b/v2/sbe/spot_3_1/TPlusSellFilter.go new file mode 100644 index 00000000..183d8262 --- /dev/null +++ b/v2/sbe/spot_3_1/TPlusSellFilter.go @@ -0,0 +1,161 @@ +// Generated SBE (Simple Binary Encoding) message codec + +package sbe + +import ( + "fmt" + "io" + "io/ioutil" + "math" +) + +type TPlusSellFilter struct { + FilterType FilterTypeEnum + EndTime int64 +} + +func (t *TPlusSellFilter) Encode(_m *SbeGoMarshaller, _w io.Writer, doRangeCheck bool) error { + if doRangeCheck { + if err := t.RangeCheck(t.SbeSchemaVersion(), t.SbeSchemaVersion()); err != nil { + return err + } + } + if err := _m.WriteInt64(_w, t.EndTime); err != nil { + return err + } + return nil +} + +func (t *TPlusSellFilter) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint16, doRangeCheck bool) error { + t.FilterType = FilterType.TPlusSell + if !t.EndTimeInActingVersion(actingVersion) { + t.EndTime = t.EndTimeNullValue() + } else { + if err := _m.ReadInt64(_r, &t.EndTime); err != nil { + return err + } + } + if actingVersion > t.SbeSchemaVersion() && blockLength > t.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-t.SbeBlockLength())) + } + if doRangeCheck { + if err := t.RangeCheck(actingVersion, t.SbeSchemaVersion()); err != nil { + return err + } + } + return nil +} + +func (t *TPlusSellFilter) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if err := t.FilterType.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if t.EndTimeInActingVersion(actingVersion) { + if t.EndTime != t.EndTimeNullValue() && (t.EndTime < t.EndTimeMinValue() || t.EndTime > t.EndTimeMaxValue()) { + return fmt.Errorf("Range check failed on t.EndTime (%v < %v > %v)", t.EndTimeMinValue(), t.EndTime, t.EndTimeMaxValue()) + } + } + return nil +} + +func TPlusSellFilterInit(t *TPlusSellFilter) { + t.FilterType = FilterType.TPlusSell + t.EndTime = math.MinInt64 + return +} + +func (*TPlusSellFilter) SbeBlockLength() (blockLength uint16) { + return 8 +} + +func (*TPlusSellFilter) SbeTemplateId() (templateId uint16) { + return 14 +} + +func (*TPlusSellFilter) SbeSchemaId() (schemaId uint16) { + return 3 +} + +func (*TPlusSellFilter) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} + +func (*TPlusSellFilter) SbeSemanticType() (semanticType []byte) { + return []byte("") +} + +func (*TPlusSellFilter) SbeSemanticVersion() (semanticVersion string) { + return "5.2" +} + +func (*TPlusSellFilter) FilterTypeId() uint16 { + return 1 +} + +func (*TPlusSellFilter) FilterTypeSinceVersion() uint16 { + return 0 +} + +func (t *TPlusSellFilter) FilterTypeInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.FilterTypeSinceVersion() +} + +func (*TPlusSellFilter) FilterTypeDeprecated() uint16 { + return 0 +} + +func (*TPlusSellFilter) FilterTypeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "constant" + } + return "" +} + +func (*TPlusSellFilter) EndTimeId() uint16 { + return 2 +} + +func (*TPlusSellFilter) EndTimeSinceVersion() uint16 { + return 0 +} + +func (t *TPlusSellFilter) EndTimeInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.EndTimeSinceVersion() +} + +func (*TPlusSellFilter) EndTimeDeprecated() uint16 { + return 0 +} + +func (*TPlusSellFilter) EndTimeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*TPlusSellFilter) EndTimeMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*TPlusSellFilter) EndTimeMaxValue() int64 { + return math.MaxInt64 +} + +func (*TPlusSellFilter) EndTimeNullValue() int64 { + return math.MinInt64 +} diff --git a/v2/sbe/spot_3_1/Ticker24hFullResponse.go b/v2/sbe/spot_3_1/Ticker24hFullResponse.go new file mode 100644 index 00000000..12fa3938 --- /dev/null +++ b/v2/sbe/spot_3_1/Ticker24hFullResponse.go @@ -0,0 +1,1510 @@ +// Generated SBE (Simple Binary Encoding) message codec + +package sbe + +import ( + "errors" + "fmt" + "io" + "io/ioutil" + "math" + "unicode/utf8" +) + +type Ticker24hFullResponse struct { + Tickers []Ticker24hFullResponseTickers +} +type Ticker24hFullResponseTickers struct { + PriceExponent int8 + QtyExponent int8 + PriceChange int64 + PriceChangePercent float32 + WeightedAvgPrice int64 + PrevClosePrice int64 + LastPrice int64 + LastQty [16]uint8 + BidPrice int64 + BidQty int64 + AskPrice int64 + AskQty int64 + OpenPrice int64 + HighPrice int64 + LowPrice int64 + Volume [16]uint8 + QuoteVolume [16]uint8 + OpenTime int64 + CloseTime int64 + FirstId int64 + LastId int64 + NumTrades int64 + Symbol []uint8 +} + +func (t *Ticker24hFullResponse) Encode(_m *SbeGoMarshaller, _w io.Writer, doRangeCheck bool) error { + if doRangeCheck { + if err := t.RangeCheck(t.SbeSchemaVersion(), t.SbeSchemaVersion()); err != nil { + return err + } + } + var TickersBlockLength uint16 = 182 + if err := _m.WriteUint16(_w, TickersBlockLength); err != nil { + return err + } + var TickersNumInGroup uint32 = uint32(len(t.Tickers)) + if err := _m.WriteUint32(_w, TickersNumInGroup); err != nil { + return err + } + for i := range t.Tickers { + if err := t.Tickers[i].Encode(_m, _w); err != nil { + return err + } + } + return nil +} + +func (t *Ticker24hFullResponse) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint16, doRangeCheck bool) error { + if actingVersion > t.SbeSchemaVersion() && blockLength > t.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-t.SbeBlockLength())) + } + + if t.TickersInActingVersion(actingVersion) { + var TickersBlockLength uint16 + if err := _m.ReadUint16(_r, &TickersBlockLength); err != nil { + return err + } + var TickersNumInGroup uint32 + if err := _m.ReadUint32(_r, &TickersNumInGroup); err != nil { + return err + } + if cap(t.Tickers) < int(TickersNumInGroup) { + t.Tickers = make([]Ticker24hFullResponseTickers, TickersNumInGroup) + } + t.Tickers = t.Tickers[:TickersNumInGroup] + for i := range t.Tickers { + if err := t.Tickers[i].Decode(_m, _r, actingVersion, uint(TickersBlockLength)); err != nil { + return err + } + } + } + if doRangeCheck { + if err := t.RangeCheck(actingVersion, t.SbeSchemaVersion()); err != nil { + return err + } + } + return nil +} + +func (t *Ticker24hFullResponse) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + for i := range t.Tickers { + if err := t.Tickers[i].RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + } + return nil +} + +func Ticker24hFullResponseInit(t *Ticker24hFullResponse) { + return +} + +func (t *Ticker24hFullResponseTickers) Encode(_m *SbeGoMarshaller, _w io.Writer) error { + if err := _m.WriteInt8(_w, t.PriceExponent); err != nil { + return err + } + if err := _m.WriteInt8(_w, t.QtyExponent); err != nil { + return err + } + if err := _m.WriteInt64(_w, t.PriceChange); err != nil { + return err + } + if err := _m.WriteFloat32(_w, t.PriceChangePercent); err != nil { + return err + } + if err := _m.WriteInt64(_w, t.WeightedAvgPrice); err != nil { + return err + } + if err := _m.WriteInt64(_w, t.PrevClosePrice); err != nil { + return err + } + if err := _m.WriteInt64(_w, t.LastPrice); err != nil { + return err + } + if err := _m.WriteBytes(_w, t.LastQty[:]); err != nil { + return err + } + if err := _m.WriteInt64(_w, t.BidPrice); err != nil { + return err + } + if err := _m.WriteInt64(_w, t.BidQty); err != nil { + return err + } + if err := _m.WriteInt64(_w, t.AskPrice); err != nil { + return err + } + if err := _m.WriteInt64(_w, t.AskQty); err != nil { + return err + } + if err := _m.WriteInt64(_w, t.OpenPrice); err != nil { + return err + } + if err := _m.WriteInt64(_w, t.HighPrice); err != nil { + return err + } + if err := _m.WriteInt64(_w, t.LowPrice); err != nil { + return err + } + if err := _m.WriteBytes(_w, t.Volume[:]); err != nil { + return err + } + if err := _m.WriteBytes(_w, t.QuoteVolume[:]); err != nil { + return err + } + if err := _m.WriteInt64(_w, t.OpenTime); err != nil { + return err + } + if err := _m.WriteInt64(_w, t.CloseTime); err != nil { + return err + } + if err := _m.WriteInt64(_w, t.FirstId); err != nil { + return err + } + if err := _m.WriteInt64(_w, t.LastId); err != nil { + return err + } + if err := _m.WriteInt64(_w, t.NumTrades); err != nil { + return err + } + if err := _m.WriteUint8(_w, uint8(len(t.Symbol))); err != nil { + return err + } + if err := _m.WriteBytes(_w, t.Symbol); err != nil { + return err + } + return nil +} + +func (t *Ticker24hFullResponseTickers) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint) error { + if !t.PriceExponentInActingVersion(actingVersion) { + t.PriceExponent = t.PriceExponentNullValue() + } else { + if err := _m.ReadInt8(_r, &t.PriceExponent); err != nil { + return err + } + } + if !t.QtyExponentInActingVersion(actingVersion) { + t.QtyExponent = t.QtyExponentNullValue() + } else { + if err := _m.ReadInt8(_r, &t.QtyExponent); err != nil { + return err + } + } + if !t.PriceChangeInActingVersion(actingVersion) { + t.PriceChange = t.PriceChangeNullValue() + } else { + if err := _m.ReadInt64(_r, &t.PriceChange); err != nil { + return err + } + } + if !t.PriceChangePercentInActingVersion(actingVersion) { + t.PriceChangePercent = t.PriceChangePercentNullValue() + } else { + if err := _m.ReadFloat32(_r, &t.PriceChangePercent); err != nil { + return err + } + } + if !t.WeightedAvgPriceInActingVersion(actingVersion) { + t.WeightedAvgPrice = t.WeightedAvgPriceNullValue() + } else { + if err := _m.ReadInt64(_r, &t.WeightedAvgPrice); err != nil { + return err + } + } + if !t.PrevClosePriceInActingVersion(actingVersion) { + t.PrevClosePrice = t.PrevClosePriceNullValue() + } else { + if err := _m.ReadInt64(_r, &t.PrevClosePrice); err != nil { + return err + } + } + if !t.LastPriceInActingVersion(actingVersion) { + t.LastPrice = t.LastPriceNullValue() + } else { + if err := _m.ReadInt64(_r, &t.LastPrice); err != nil { + return err + } + } + if !t.LastQtyInActingVersion(actingVersion) { + for idx := 0; idx < 16; idx++ { + t.LastQty[idx] = t.LastQtyNullValue() + } + } else { + if err := _m.ReadBytes(_r, t.LastQty[:]); err != nil { + return err + } + } + if !t.BidPriceInActingVersion(actingVersion) { + t.BidPrice = t.BidPriceNullValue() + } else { + if err := _m.ReadInt64(_r, &t.BidPrice); err != nil { + return err + } + } + if !t.BidQtyInActingVersion(actingVersion) { + t.BidQty = t.BidQtyNullValue() + } else { + if err := _m.ReadInt64(_r, &t.BidQty); err != nil { + return err + } + } + if !t.AskPriceInActingVersion(actingVersion) { + t.AskPrice = t.AskPriceNullValue() + } else { + if err := _m.ReadInt64(_r, &t.AskPrice); err != nil { + return err + } + } + if !t.AskQtyInActingVersion(actingVersion) { + t.AskQty = t.AskQtyNullValue() + } else { + if err := _m.ReadInt64(_r, &t.AskQty); err != nil { + return err + } + } + if !t.OpenPriceInActingVersion(actingVersion) { + t.OpenPrice = t.OpenPriceNullValue() + } else { + if err := _m.ReadInt64(_r, &t.OpenPrice); err != nil { + return err + } + } + if !t.HighPriceInActingVersion(actingVersion) { + t.HighPrice = t.HighPriceNullValue() + } else { + if err := _m.ReadInt64(_r, &t.HighPrice); err != nil { + return err + } + } + if !t.LowPriceInActingVersion(actingVersion) { + t.LowPrice = t.LowPriceNullValue() + } else { + if err := _m.ReadInt64(_r, &t.LowPrice); err != nil { + return err + } + } + if !t.VolumeInActingVersion(actingVersion) { + for idx := 0; idx < 16; idx++ { + t.Volume[idx] = t.VolumeNullValue() + } + } else { + if err := _m.ReadBytes(_r, t.Volume[:]); err != nil { + return err + } + } + if !t.QuoteVolumeInActingVersion(actingVersion) { + for idx := 0; idx < 16; idx++ { + t.QuoteVolume[idx] = t.QuoteVolumeNullValue() + } + } else { + if err := _m.ReadBytes(_r, t.QuoteVolume[:]); err != nil { + return err + } + } + if !t.OpenTimeInActingVersion(actingVersion) { + t.OpenTime = t.OpenTimeNullValue() + } else { + if err := _m.ReadInt64(_r, &t.OpenTime); err != nil { + return err + } + } + if !t.CloseTimeInActingVersion(actingVersion) { + t.CloseTime = t.CloseTimeNullValue() + } else { + if err := _m.ReadInt64(_r, &t.CloseTime); err != nil { + return err + } + } + if !t.FirstIdInActingVersion(actingVersion) { + t.FirstId = t.FirstIdNullValue() + } else { + if err := _m.ReadInt64(_r, &t.FirstId); err != nil { + return err + } + } + if !t.LastIdInActingVersion(actingVersion) { + t.LastId = t.LastIdNullValue() + } else { + if err := _m.ReadInt64(_r, &t.LastId); err != nil { + return err + } + } + if !t.NumTradesInActingVersion(actingVersion) { + t.NumTrades = t.NumTradesNullValue() + } else { + if err := _m.ReadInt64(_r, &t.NumTrades); err != nil { + return err + } + } + if actingVersion > t.SbeSchemaVersion() && blockLength > t.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-t.SbeBlockLength())) + } + + if t.SymbolInActingVersion(actingVersion) { + var SymbolLength uint8 + if err := _m.ReadUint8(_r, &SymbolLength); err != nil { + return err + } + if cap(t.Symbol) < int(SymbolLength) { + t.Symbol = make([]uint8, SymbolLength) + } + t.Symbol = t.Symbol[:SymbolLength] + if err := _m.ReadBytes(_r, t.Symbol); err != nil { + return err + } + } + return nil +} + +func (t *Ticker24hFullResponseTickers) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if t.PriceExponentInActingVersion(actingVersion) { + if t.PriceExponent < t.PriceExponentMinValue() || t.PriceExponent > t.PriceExponentMaxValue() { + return fmt.Errorf("Range check failed on t.PriceExponent (%v < %v > %v)", t.PriceExponentMinValue(), t.PriceExponent, t.PriceExponentMaxValue()) + } + } + if t.QtyExponentInActingVersion(actingVersion) { + if t.QtyExponent < t.QtyExponentMinValue() || t.QtyExponent > t.QtyExponentMaxValue() { + return fmt.Errorf("Range check failed on t.QtyExponent (%v < %v > %v)", t.QtyExponentMinValue(), t.QtyExponent, t.QtyExponentMaxValue()) + } + } + if t.PriceChangeInActingVersion(actingVersion) { + if t.PriceChange != t.PriceChangeNullValue() && (t.PriceChange < t.PriceChangeMinValue() || t.PriceChange > t.PriceChangeMaxValue()) { + return fmt.Errorf("Range check failed on t.PriceChange (%v < %v > %v)", t.PriceChangeMinValue(), t.PriceChange, t.PriceChangeMaxValue()) + } + } + if t.PriceChangePercentInActingVersion(actingVersion) { + if t.PriceChangePercent != t.PriceChangePercentNullValue() && (t.PriceChangePercent < t.PriceChangePercentMinValue() || t.PriceChangePercent > t.PriceChangePercentMaxValue()) { + return fmt.Errorf("Range check failed on t.PriceChangePercent (%v < %v > %v)", t.PriceChangePercentMinValue(), t.PriceChangePercent, t.PriceChangePercentMaxValue()) + } + } + if t.WeightedAvgPriceInActingVersion(actingVersion) { + if t.WeightedAvgPrice != t.WeightedAvgPriceNullValue() && (t.WeightedAvgPrice < t.WeightedAvgPriceMinValue() || t.WeightedAvgPrice > t.WeightedAvgPriceMaxValue()) { + return fmt.Errorf("Range check failed on t.WeightedAvgPrice (%v < %v > %v)", t.WeightedAvgPriceMinValue(), t.WeightedAvgPrice, t.WeightedAvgPriceMaxValue()) + } + } + if t.PrevClosePriceInActingVersion(actingVersion) { + if t.PrevClosePrice != t.PrevClosePriceNullValue() && (t.PrevClosePrice < t.PrevClosePriceMinValue() || t.PrevClosePrice > t.PrevClosePriceMaxValue()) { + return fmt.Errorf("Range check failed on t.PrevClosePrice (%v < %v > %v)", t.PrevClosePriceMinValue(), t.PrevClosePrice, t.PrevClosePriceMaxValue()) + } + } + if t.LastPriceInActingVersion(actingVersion) { + if t.LastPrice != t.LastPriceNullValue() && (t.LastPrice < t.LastPriceMinValue() || t.LastPrice > t.LastPriceMaxValue()) { + return fmt.Errorf("Range check failed on t.LastPrice (%v < %v > %v)", t.LastPriceMinValue(), t.LastPrice, t.LastPriceMaxValue()) + } + } + if t.LastQtyInActingVersion(actingVersion) { + for idx := 0; idx < 16; idx++ { + if t.LastQty[idx] < t.LastQtyMinValue() || t.LastQty[idx] > t.LastQtyMaxValue() { + return fmt.Errorf("Range check failed on t.LastQty[%d] (%v < %v > %v)", idx, t.LastQtyMinValue(), t.LastQty[idx], t.LastQtyMaxValue()) + } + } + } + if t.BidPriceInActingVersion(actingVersion) { + if t.BidPrice != t.BidPriceNullValue() && (t.BidPrice < t.BidPriceMinValue() || t.BidPrice > t.BidPriceMaxValue()) { + return fmt.Errorf("Range check failed on t.BidPrice (%v < %v > %v)", t.BidPriceMinValue(), t.BidPrice, t.BidPriceMaxValue()) + } + } + if t.BidQtyInActingVersion(actingVersion) { + if t.BidQty < t.BidQtyMinValue() || t.BidQty > t.BidQtyMaxValue() { + return fmt.Errorf("Range check failed on t.BidQty (%v < %v > %v)", t.BidQtyMinValue(), t.BidQty, t.BidQtyMaxValue()) + } + } + if t.AskPriceInActingVersion(actingVersion) { + if t.AskPrice != t.AskPriceNullValue() && (t.AskPrice < t.AskPriceMinValue() || t.AskPrice > t.AskPriceMaxValue()) { + return fmt.Errorf("Range check failed on t.AskPrice (%v < %v > %v)", t.AskPriceMinValue(), t.AskPrice, t.AskPriceMaxValue()) + } + } + if t.AskQtyInActingVersion(actingVersion) { + if t.AskQty < t.AskQtyMinValue() || t.AskQty > t.AskQtyMaxValue() { + return fmt.Errorf("Range check failed on t.AskQty (%v < %v > %v)", t.AskQtyMinValue(), t.AskQty, t.AskQtyMaxValue()) + } + } + if t.OpenPriceInActingVersion(actingVersion) { + if t.OpenPrice != t.OpenPriceNullValue() && (t.OpenPrice < t.OpenPriceMinValue() || t.OpenPrice > t.OpenPriceMaxValue()) { + return fmt.Errorf("Range check failed on t.OpenPrice (%v < %v > %v)", t.OpenPriceMinValue(), t.OpenPrice, t.OpenPriceMaxValue()) + } + } + if t.HighPriceInActingVersion(actingVersion) { + if t.HighPrice != t.HighPriceNullValue() && (t.HighPrice < t.HighPriceMinValue() || t.HighPrice > t.HighPriceMaxValue()) { + return fmt.Errorf("Range check failed on t.HighPrice (%v < %v > %v)", t.HighPriceMinValue(), t.HighPrice, t.HighPriceMaxValue()) + } + } + if t.LowPriceInActingVersion(actingVersion) { + if t.LowPrice != t.LowPriceNullValue() && (t.LowPrice < t.LowPriceMinValue() || t.LowPrice > t.LowPriceMaxValue()) { + return fmt.Errorf("Range check failed on t.LowPrice (%v < %v > %v)", t.LowPriceMinValue(), t.LowPrice, t.LowPriceMaxValue()) + } + } + if t.VolumeInActingVersion(actingVersion) { + for idx := 0; idx < 16; idx++ { + if t.Volume[idx] < t.VolumeMinValue() || t.Volume[idx] > t.VolumeMaxValue() { + return fmt.Errorf("Range check failed on t.Volume[%d] (%v < %v > %v)", idx, t.VolumeMinValue(), t.Volume[idx], t.VolumeMaxValue()) + } + } + } + if t.QuoteVolumeInActingVersion(actingVersion) { + for idx := 0; idx < 16; idx++ { + if t.QuoteVolume[idx] < t.QuoteVolumeMinValue() || t.QuoteVolume[idx] > t.QuoteVolumeMaxValue() { + return fmt.Errorf("Range check failed on t.QuoteVolume[%d] (%v < %v > %v)", idx, t.QuoteVolumeMinValue(), t.QuoteVolume[idx], t.QuoteVolumeMaxValue()) + } + } + } + if t.OpenTimeInActingVersion(actingVersion) { + if t.OpenTime < t.OpenTimeMinValue() || t.OpenTime > t.OpenTimeMaxValue() { + return fmt.Errorf("Range check failed on t.OpenTime (%v < %v > %v)", t.OpenTimeMinValue(), t.OpenTime, t.OpenTimeMaxValue()) + } + } + if t.CloseTimeInActingVersion(actingVersion) { + if t.CloseTime < t.CloseTimeMinValue() || t.CloseTime > t.CloseTimeMaxValue() { + return fmt.Errorf("Range check failed on t.CloseTime (%v < %v > %v)", t.CloseTimeMinValue(), t.CloseTime, t.CloseTimeMaxValue()) + } + } + if t.FirstIdInActingVersion(actingVersion) { + if t.FirstId != t.FirstIdNullValue() && (t.FirstId < t.FirstIdMinValue() || t.FirstId > t.FirstIdMaxValue()) { + return fmt.Errorf("Range check failed on t.FirstId (%v < %v > %v)", t.FirstIdMinValue(), t.FirstId, t.FirstIdMaxValue()) + } + } + if t.LastIdInActingVersion(actingVersion) { + if t.LastId != t.LastIdNullValue() && (t.LastId < t.LastIdMinValue() || t.LastId > t.LastIdMaxValue()) { + return fmt.Errorf("Range check failed on t.LastId (%v < %v > %v)", t.LastIdMinValue(), t.LastId, t.LastIdMaxValue()) + } + } + if t.NumTradesInActingVersion(actingVersion) { + if t.NumTrades < t.NumTradesMinValue() || t.NumTrades > t.NumTradesMaxValue() { + return fmt.Errorf("Range check failed on t.NumTrades (%v < %v > %v)", t.NumTradesMinValue(), t.NumTrades, t.NumTradesMaxValue()) + } + } + if !utf8.Valid(t.Symbol[:]) { + return errors.New("t.Symbol failed UTF-8 validation") + } + return nil +} + +func Ticker24hFullResponseTickersInit(t *Ticker24hFullResponseTickers) { + t.PriceChange = math.MinInt64 + t.PriceChangePercent = float32(math.NaN()) + t.WeightedAvgPrice = math.MinInt64 + t.PrevClosePrice = math.MinInt64 + t.LastPrice = math.MinInt64 + t.BidPrice = math.MinInt64 + t.AskPrice = math.MinInt64 + t.OpenPrice = math.MinInt64 + t.HighPrice = math.MinInt64 + t.LowPrice = math.MinInt64 + t.FirstId = math.MinInt64 + t.LastId = math.MinInt64 + return +} + +func (*Ticker24hFullResponse) SbeBlockLength() (blockLength uint16) { + return 0 +} + +func (*Ticker24hFullResponse) SbeTemplateId() (templateId uint16) { + return 206 +} + +func (*Ticker24hFullResponse) SbeSchemaId() (schemaId uint16) { + return 3 +} + +func (*Ticker24hFullResponse) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} + +func (*Ticker24hFullResponse) SbeSemanticType() (semanticType []byte) { + return []byte("") +} + +func (*Ticker24hFullResponse) SbeSemanticVersion() (semanticVersion string) { + return "5.2" +} + +func (*Ticker24hFullResponseTickers) PriceExponentId() uint16 { + return 1 +} + +func (*Ticker24hFullResponseTickers) PriceExponentSinceVersion() uint16 { + return 0 +} + +func (t *Ticker24hFullResponseTickers) PriceExponentInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.PriceExponentSinceVersion() +} + +func (*Ticker24hFullResponseTickers) PriceExponentDeprecated() uint16 { + return 0 +} + +func (*Ticker24hFullResponseTickers) PriceExponentMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*Ticker24hFullResponseTickers) PriceExponentMinValue() int8 { + return math.MinInt8 + 1 +} + +func (*Ticker24hFullResponseTickers) PriceExponentMaxValue() int8 { + return math.MaxInt8 +} + +func (*Ticker24hFullResponseTickers) PriceExponentNullValue() int8 { + return math.MinInt8 +} + +func (*Ticker24hFullResponseTickers) QtyExponentId() uint16 { + return 2 +} + +func (*Ticker24hFullResponseTickers) QtyExponentSinceVersion() uint16 { + return 0 +} + +func (t *Ticker24hFullResponseTickers) QtyExponentInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.QtyExponentSinceVersion() +} + +func (*Ticker24hFullResponseTickers) QtyExponentDeprecated() uint16 { + return 0 +} + +func (*Ticker24hFullResponseTickers) QtyExponentMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*Ticker24hFullResponseTickers) QtyExponentMinValue() int8 { + return math.MinInt8 + 1 +} + +func (*Ticker24hFullResponseTickers) QtyExponentMaxValue() int8 { + return math.MaxInt8 +} + +func (*Ticker24hFullResponseTickers) QtyExponentNullValue() int8 { + return math.MinInt8 +} + +func (*Ticker24hFullResponseTickers) PriceChangeId() uint16 { + return 3 +} + +func (*Ticker24hFullResponseTickers) PriceChangeSinceVersion() uint16 { + return 0 +} + +func (t *Ticker24hFullResponseTickers) PriceChangeInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.PriceChangeSinceVersion() +} + +func (*Ticker24hFullResponseTickers) PriceChangeDeprecated() uint16 { + return 0 +} + +func (*Ticker24hFullResponseTickers) PriceChangeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*Ticker24hFullResponseTickers) PriceChangeMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*Ticker24hFullResponseTickers) PriceChangeMaxValue() int64 { + return math.MaxInt64 +} + +func (*Ticker24hFullResponseTickers) PriceChangeNullValue() int64 { + return math.MinInt64 +} + +func (*Ticker24hFullResponseTickers) PriceChangePercentId() uint16 { + return 4 +} + +func (*Ticker24hFullResponseTickers) PriceChangePercentSinceVersion() uint16 { + return 0 +} + +func (t *Ticker24hFullResponseTickers) PriceChangePercentInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.PriceChangePercentSinceVersion() +} + +func (*Ticker24hFullResponseTickers) PriceChangePercentDeprecated() uint16 { + return 0 +} + +func (*Ticker24hFullResponseTickers) PriceChangePercentMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*Ticker24hFullResponseTickers) PriceChangePercentMinValue() float32 { + return -math.MaxFloat32 +} + +func (*Ticker24hFullResponseTickers) PriceChangePercentMaxValue() float32 { + return math.MaxFloat32 +} + +func (*Ticker24hFullResponseTickers) PriceChangePercentNullValue() float32 { + return float32(math.NaN()) +} + +func (*Ticker24hFullResponseTickers) WeightedAvgPriceId() uint16 { + return 5 +} + +func (*Ticker24hFullResponseTickers) WeightedAvgPriceSinceVersion() uint16 { + return 0 +} + +func (t *Ticker24hFullResponseTickers) WeightedAvgPriceInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.WeightedAvgPriceSinceVersion() +} + +func (*Ticker24hFullResponseTickers) WeightedAvgPriceDeprecated() uint16 { + return 0 +} + +func (*Ticker24hFullResponseTickers) WeightedAvgPriceMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*Ticker24hFullResponseTickers) WeightedAvgPriceMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*Ticker24hFullResponseTickers) WeightedAvgPriceMaxValue() int64 { + return math.MaxInt64 +} + +func (*Ticker24hFullResponseTickers) WeightedAvgPriceNullValue() int64 { + return math.MinInt64 +} + +func (*Ticker24hFullResponseTickers) PrevClosePriceId() uint16 { + return 6 +} + +func (*Ticker24hFullResponseTickers) PrevClosePriceSinceVersion() uint16 { + return 0 +} + +func (t *Ticker24hFullResponseTickers) PrevClosePriceInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.PrevClosePriceSinceVersion() +} + +func (*Ticker24hFullResponseTickers) PrevClosePriceDeprecated() uint16 { + return 0 +} + +func (*Ticker24hFullResponseTickers) PrevClosePriceMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*Ticker24hFullResponseTickers) PrevClosePriceMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*Ticker24hFullResponseTickers) PrevClosePriceMaxValue() int64 { + return math.MaxInt64 +} + +func (*Ticker24hFullResponseTickers) PrevClosePriceNullValue() int64 { + return math.MinInt64 +} + +func (*Ticker24hFullResponseTickers) LastPriceId() uint16 { + return 7 +} + +func (*Ticker24hFullResponseTickers) LastPriceSinceVersion() uint16 { + return 0 +} + +func (t *Ticker24hFullResponseTickers) LastPriceInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.LastPriceSinceVersion() +} + +func (*Ticker24hFullResponseTickers) LastPriceDeprecated() uint16 { + return 0 +} + +func (*Ticker24hFullResponseTickers) LastPriceMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*Ticker24hFullResponseTickers) LastPriceMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*Ticker24hFullResponseTickers) LastPriceMaxValue() int64 { + return math.MaxInt64 +} + +func (*Ticker24hFullResponseTickers) LastPriceNullValue() int64 { + return math.MinInt64 +} + +func (*Ticker24hFullResponseTickers) LastQtyId() uint16 { + return 8 +} + +func (*Ticker24hFullResponseTickers) LastQtySinceVersion() uint16 { + return 0 +} + +func (t *Ticker24hFullResponseTickers) LastQtyInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.LastQtySinceVersion() +} + +func (*Ticker24hFullResponseTickers) LastQtyDeprecated() uint16 { + return 0 +} + +func (*Ticker24hFullResponseTickers) LastQtyMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*Ticker24hFullResponseTickers) LastQtyMinValue() uint8 { + return 0 +} + +func (*Ticker24hFullResponseTickers) LastQtyMaxValue() uint8 { + return math.MaxUint8 - 1 +} + +func (*Ticker24hFullResponseTickers) LastQtyNullValue() uint8 { + return math.MaxUint8 +} + +func (*Ticker24hFullResponseTickers) BidPriceId() uint16 { + return 9 +} + +func (*Ticker24hFullResponseTickers) BidPriceSinceVersion() uint16 { + return 0 +} + +func (t *Ticker24hFullResponseTickers) BidPriceInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.BidPriceSinceVersion() +} + +func (*Ticker24hFullResponseTickers) BidPriceDeprecated() uint16 { + return 0 +} + +func (*Ticker24hFullResponseTickers) BidPriceMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*Ticker24hFullResponseTickers) BidPriceMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*Ticker24hFullResponseTickers) BidPriceMaxValue() int64 { + return math.MaxInt64 +} + +func (*Ticker24hFullResponseTickers) BidPriceNullValue() int64 { + return math.MinInt64 +} + +func (*Ticker24hFullResponseTickers) BidQtyId() uint16 { + return 10 +} + +func (*Ticker24hFullResponseTickers) BidQtySinceVersion() uint16 { + return 0 +} + +func (t *Ticker24hFullResponseTickers) BidQtyInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.BidQtySinceVersion() +} + +func (*Ticker24hFullResponseTickers) BidQtyDeprecated() uint16 { + return 0 +} + +func (*Ticker24hFullResponseTickers) BidQtyMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*Ticker24hFullResponseTickers) BidQtyMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*Ticker24hFullResponseTickers) BidQtyMaxValue() int64 { + return math.MaxInt64 +} + +func (*Ticker24hFullResponseTickers) BidQtyNullValue() int64 { + return math.MinInt64 +} + +func (*Ticker24hFullResponseTickers) AskPriceId() uint16 { + return 11 +} + +func (*Ticker24hFullResponseTickers) AskPriceSinceVersion() uint16 { + return 0 +} + +func (t *Ticker24hFullResponseTickers) AskPriceInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.AskPriceSinceVersion() +} + +func (*Ticker24hFullResponseTickers) AskPriceDeprecated() uint16 { + return 0 +} + +func (*Ticker24hFullResponseTickers) AskPriceMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*Ticker24hFullResponseTickers) AskPriceMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*Ticker24hFullResponseTickers) AskPriceMaxValue() int64 { + return math.MaxInt64 +} + +func (*Ticker24hFullResponseTickers) AskPriceNullValue() int64 { + return math.MinInt64 +} + +func (*Ticker24hFullResponseTickers) AskQtyId() uint16 { + return 12 +} + +func (*Ticker24hFullResponseTickers) AskQtySinceVersion() uint16 { + return 0 +} + +func (t *Ticker24hFullResponseTickers) AskQtyInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.AskQtySinceVersion() +} + +func (*Ticker24hFullResponseTickers) AskQtyDeprecated() uint16 { + return 0 +} + +func (*Ticker24hFullResponseTickers) AskQtyMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*Ticker24hFullResponseTickers) AskQtyMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*Ticker24hFullResponseTickers) AskQtyMaxValue() int64 { + return math.MaxInt64 +} + +func (*Ticker24hFullResponseTickers) AskQtyNullValue() int64 { + return math.MinInt64 +} + +func (*Ticker24hFullResponseTickers) OpenPriceId() uint16 { + return 13 +} + +func (*Ticker24hFullResponseTickers) OpenPriceSinceVersion() uint16 { + return 0 +} + +func (t *Ticker24hFullResponseTickers) OpenPriceInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.OpenPriceSinceVersion() +} + +func (*Ticker24hFullResponseTickers) OpenPriceDeprecated() uint16 { + return 0 +} + +func (*Ticker24hFullResponseTickers) OpenPriceMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*Ticker24hFullResponseTickers) OpenPriceMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*Ticker24hFullResponseTickers) OpenPriceMaxValue() int64 { + return math.MaxInt64 +} + +func (*Ticker24hFullResponseTickers) OpenPriceNullValue() int64 { + return math.MinInt64 +} + +func (*Ticker24hFullResponseTickers) HighPriceId() uint16 { + return 14 +} + +func (*Ticker24hFullResponseTickers) HighPriceSinceVersion() uint16 { + return 0 +} + +func (t *Ticker24hFullResponseTickers) HighPriceInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.HighPriceSinceVersion() +} + +func (*Ticker24hFullResponseTickers) HighPriceDeprecated() uint16 { + return 0 +} + +func (*Ticker24hFullResponseTickers) HighPriceMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*Ticker24hFullResponseTickers) HighPriceMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*Ticker24hFullResponseTickers) HighPriceMaxValue() int64 { + return math.MaxInt64 +} + +func (*Ticker24hFullResponseTickers) HighPriceNullValue() int64 { + return math.MinInt64 +} + +func (*Ticker24hFullResponseTickers) LowPriceId() uint16 { + return 15 +} + +func (*Ticker24hFullResponseTickers) LowPriceSinceVersion() uint16 { + return 0 +} + +func (t *Ticker24hFullResponseTickers) LowPriceInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.LowPriceSinceVersion() +} + +func (*Ticker24hFullResponseTickers) LowPriceDeprecated() uint16 { + return 0 +} + +func (*Ticker24hFullResponseTickers) LowPriceMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*Ticker24hFullResponseTickers) LowPriceMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*Ticker24hFullResponseTickers) LowPriceMaxValue() int64 { + return math.MaxInt64 +} + +func (*Ticker24hFullResponseTickers) LowPriceNullValue() int64 { + return math.MinInt64 +} + +func (*Ticker24hFullResponseTickers) VolumeId() uint16 { + return 16 +} + +func (*Ticker24hFullResponseTickers) VolumeSinceVersion() uint16 { + return 0 +} + +func (t *Ticker24hFullResponseTickers) VolumeInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.VolumeSinceVersion() +} + +func (*Ticker24hFullResponseTickers) VolumeDeprecated() uint16 { + return 0 +} + +func (*Ticker24hFullResponseTickers) VolumeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*Ticker24hFullResponseTickers) VolumeMinValue() uint8 { + return 0 +} + +func (*Ticker24hFullResponseTickers) VolumeMaxValue() uint8 { + return math.MaxUint8 - 1 +} + +func (*Ticker24hFullResponseTickers) VolumeNullValue() uint8 { + return math.MaxUint8 +} + +func (*Ticker24hFullResponseTickers) QuoteVolumeId() uint16 { + return 17 +} + +func (*Ticker24hFullResponseTickers) QuoteVolumeSinceVersion() uint16 { + return 0 +} + +func (t *Ticker24hFullResponseTickers) QuoteVolumeInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.QuoteVolumeSinceVersion() +} + +func (*Ticker24hFullResponseTickers) QuoteVolumeDeprecated() uint16 { + return 0 +} + +func (*Ticker24hFullResponseTickers) QuoteVolumeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*Ticker24hFullResponseTickers) QuoteVolumeMinValue() uint8 { + return 0 +} + +func (*Ticker24hFullResponseTickers) QuoteVolumeMaxValue() uint8 { + return math.MaxUint8 - 1 +} + +func (*Ticker24hFullResponseTickers) QuoteVolumeNullValue() uint8 { + return math.MaxUint8 +} + +func (*Ticker24hFullResponseTickers) OpenTimeId() uint16 { + return 18 +} + +func (*Ticker24hFullResponseTickers) OpenTimeSinceVersion() uint16 { + return 0 +} + +func (t *Ticker24hFullResponseTickers) OpenTimeInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.OpenTimeSinceVersion() +} + +func (*Ticker24hFullResponseTickers) OpenTimeDeprecated() uint16 { + return 0 +} + +func (*Ticker24hFullResponseTickers) OpenTimeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*Ticker24hFullResponseTickers) OpenTimeMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*Ticker24hFullResponseTickers) OpenTimeMaxValue() int64 { + return math.MaxInt64 +} + +func (*Ticker24hFullResponseTickers) OpenTimeNullValue() int64 { + return math.MinInt64 +} + +func (*Ticker24hFullResponseTickers) CloseTimeId() uint16 { + return 19 +} + +func (*Ticker24hFullResponseTickers) CloseTimeSinceVersion() uint16 { + return 0 +} + +func (t *Ticker24hFullResponseTickers) CloseTimeInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.CloseTimeSinceVersion() +} + +func (*Ticker24hFullResponseTickers) CloseTimeDeprecated() uint16 { + return 0 +} + +func (*Ticker24hFullResponseTickers) CloseTimeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*Ticker24hFullResponseTickers) CloseTimeMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*Ticker24hFullResponseTickers) CloseTimeMaxValue() int64 { + return math.MaxInt64 +} + +func (*Ticker24hFullResponseTickers) CloseTimeNullValue() int64 { + return math.MinInt64 +} + +func (*Ticker24hFullResponseTickers) FirstIdId() uint16 { + return 20 +} + +func (*Ticker24hFullResponseTickers) FirstIdSinceVersion() uint16 { + return 0 +} + +func (t *Ticker24hFullResponseTickers) FirstIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.FirstIdSinceVersion() +} + +func (*Ticker24hFullResponseTickers) FirstIdDeprecated() uint16 { + return 0 +} + +func (*Ticker24hFullResponseTickers) FirstIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*Ticker24hFullResponseTickers) FirstIdMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*Ticker24hFullResponseTickers) FirstIdMaxValue() int64 { + return math.MaxInt64 +} + +func (*Ticker24hFullResponseTickers) FirstIdNullValue() int64 { + return math.MinInt64 +} + +func (*Ticker24hFullResponseTickers) LastIdId() uint16 { + return 21 +} + +func (*Ticker24hFullResponseTickers) LastIdSinceVersion() uint16 { + return 0 +} + +func (t *Ticker24hFullResponseTickers) LastIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.LastIdSinceVersion() +} + +func (*Ticker24hFullResponseTickers) LastIdDeprecated() uint16 { + return 0 +} + +func (*Ticker24hFullResponseTickers) LastIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*Ticker24hFullResponseTickers) LastIdMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*Ticker24hFullResponseTickers) LastIdMaxValue() int64 { + return math.MaxInt64 +} + +func (*Ticker24hFullResponseTickers) LastIdNullValue() int64 { + return math.MinInt64 +} + +func (*Ticker24hFullResponseTickers) NumTradesId() uint16 { + return 22 +} + +func (*Ticker24hFullResponseTickers) NumTradesSinceVersion() uint16 { + return 0 +} + +func (t *Ticker24hFullResponseTickers) NumTradesInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.NumTradesSinceVersion() +} + +func (*Ticker24hFullResponseTickers) NumTradesDeprecated() uint16 { + return 0 +} + +func (*Ticker24hFullResponseTickers) NumTradesMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*Ticker24hFullResponseTickers) NumTradesMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*Ticker24hFullResponseTickers) NumTradesMaxValue() int64 { + return math.MaxInt64 +} + +func (*Ticker24hFullResponseTickers) NumTradesNullValue() int64 { + return math.MinInt64 +} + +func (*Ticker24hFullResponseTickers) SymbolMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*Ticker24hFullResponseTickers) SymbolSinceVersion() uint16 { + return 0 +} + +func (t *Ticker24hFullResponseTickers) SymbolInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.SymbolSinceVersion() +} + +func (*Ticker24hFullResponseTickers) SymbolDeprecated() uint16 { + return 0 +} + +func (Ticker24hFullResponseTickers) SymbolCharacterEncoding() string { + return "UTF-8" +} + +func (Ticker24hFullResponseTickers) SymbolHeaderLength() uint64 { + return 1 +} + +func (*Ticker24hFullResponse) TickersId() uint16 { + return 100 +} + +func (*Ticker24hFullResponse) TickersSinceVersion() uint16 { + return 0 +} + +func (t *Ticker24hFullResponse) TickersInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.TickersSinceVersion() +} + +func (*Ticker24hFullResponse) TickersDeprecated() uint16 { + return 0 +} + +func (*Ticker24hFullResponseTickers) SbeBlockLength() (blockLength uint) { + return 182 +} + +func (*Ticker24hFullResponseTickers) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} diff --git a/v2/sbe/spot_3_1/Ticker24hMiniResponse.go b/v2/sbe/spot_3_1/Ticker24hMiniResponse.go new file mode 100644 index 00000000..cc629807 --- /dev/null +++ b/v2/sbe/spot_3_1/Ticker24hMiniResponse.go @@ -0,0 +1,978 @@ +// Generated SBE (Simple Binary Encoding) message codec + +package sbe + +import ( + "errors" + "fmt" + "io" + "io/ioutil" + "math" + "unicode/utf8" +) + +type Ticker24hMiniResponse struct { + Tickers []Ticker24hMiniResponseTickers +} +type Ticker24hMiniResponseTickers struct { + PriceExponent int8 + QtyExponent int8 + OpenPrice int64 + HighPrice int64 + LowPrice int64 + LastPrice int64 + Volume [16]uint8 + QuoteVolume [16]uint8 + OpenTime int64 + CloseTime int64 + FirstId int64 + LastId int64 + NumTrades int64 + Symbol []uint8 +} + +func (t *Ticker24hMiniResponse) Encode(_m *SbeGoMarshaller, _w io.Writer, doRangeCheck bool) error { + if doRangeCheck { + if err := t.RangeCheck(t.SbeSchemaVersion(), t.SbeSchemaVersion()); err != nil { + return err + } + } + var TickersBlockLength uint16 = 106 + if err := _m.WriteUint16(_w, TickersBlockLength); err != nil { + return err + } + var TickersNumInGroup uint32 = uint32(len(t.Tickers)) + if err := _m.WriteUint32(_w, TickersNumInGroup); err != nil { + return err + } + for i := range t.Tickers { + if err := t.Tickers[i].Encode(_m, _w); err != nil { + return err + } + } + return nil +} + +func (t *Ticker24hMiniResponse) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint16, doRangeCheck bool) error { + if actingVersion > t.SbeSchemaVersion() && blockLength > t.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-t.SbeBlockLength())) + } + + if t.TickersInActingVersion(actingVersion) { + var TickersBlockLength uint16 + if err := _m.ReadUint16(_r, &TickersBlockLength); err != nil { + return err + } + var TickersNumInGroup uint32 + if err := _m.ReadUint32(_r, &TickersNumInGroup); err != nil { + return err + } + if cap(t.Tickers) < int(TickersNumInGroup) { + t.Tickers = make([]Ticker24hMiniResponseTickers, TickersNumInGroup) + } + t.Tickers = t.Tickers[:TickersNumInGroup] + for i := range t.Tickers { + if err := t.Tickers[i].Decode(_m, _r, actingVersion, uint(TickersBlockLength)); err != nil { + return err + } + } + } + if doRangeCheck { + if err := t.RangeCheck(actingVersion, t.SbeSchemaVersion()); err != nil { + return err + } + } + return nil +} + +func (t *Ticker24hMiniResponse) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + for i := range t.Tickers { + if err := t.Tickers[i].RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + } + return nil +} + +func Ticker24hMiniResponseInit(t *Ticker24hMiniResponse) { + return +} + +func (t *Ticker24hMiniResponseTickers) Encode(_m *SbeGoMarshaller, _w io.Writer) error { + if err := _m.WriteInt8(_w, t.PriceExponent); err != nil { + return err + } + if err := _m.WriteInt8(_w, t.QtyExponent); err != nil { + return err + } + if err := _m.WriteInt64(_w, t.OpenPrice); err != nil { + return err + } + if err := _m.WriteInt64(_w, t.HighPrice); err != nil { + return err + } + if err := _m.WriteInt64(_w, t.LowPrice); err != nil { + return err + } + if err := _m.WriteInt64(_w, t.LastPrice); err != nil { + return err + } + if err := _m.WriteBytes(_w, t.Volume[:]); err != nil { + return err + } + if err := _m.WriteBytes(_w, t.QuoteVolume[:]); err != nil { + return err + } + if err := _m.WriteInt64(_w, t.OpenTime); err != nil { + return err + } + if err := _m.WriteInt64(_w, t.CloseTime); err != nil { + return err + } + if err := _m.WriteInt64(_w, t.FirstId); err != nil { + return err + } + if err := _m.WriteInt64(_w, t.LastId); err != nil { + return err + } + if err := _m.WriteInt64(_w, t.NumTrades); err != nil { + return err + } + if err := _m.WriteUint8(_w, uint8(len(t.Symbol))); err != nil { + return err + } + if err := _m.WriteBytes(_w, t.Symbol); err != nil { + return err + } + return nil +} + +func (t *Ticker24hMiniResponseTickers) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint) error { + if !t.PriceExponentInActingVersion(actingVersion) { + t.PriceExponent = t.PriceExponentNullValue() + } else { + if err := _m.ReadInt8(_r, &t.PriceExponent); err != nil { + return err + } + } + if !t.QtyExponentInActingVersion(actingVersion) { + t.QtyExponent = t.QtyExponentNullValue() + } else { + if err := _m.ReadInt8(_r, &t.QtyExponent); err != nil { + return err + } + } + if !t.OpenPriceInActingVersion(actingVersion) { + t.OpenPrice = t.OpenPriceNullValue() + } else { + if err := _m.ReadInt64(_r, &t.OpenPrice); err != nil { + return err + } + } + if !t.HighPriceInActingVersion(actingVersion) { + t.HighPrice = t.HighPriceNullValue() + } else { + if err := _m.ReadInt64(_r, &t.HighPrice); err != nil { + return err + } + } + if !t.LowPriceInActingVersion(actingVersion) { + t.LowPrice = t.LowPriceNullValue() + } else { + if err := _m.ReadInt64(_r, &t.LowPrice); err != nil { + return err + } + } + if !t.LastPriceInActingVersion(actingVersion) { + t.LastPrice = t.LastPriceNullValue() + } else { + if err := _m.ReadInt64(_r, &t.LastPrice); err != nil { + return err + } + } + if !t.VolumeInActingVersion(actingVersion) { + for idx := 0; idx < 16; idx++ { + t.Volume[idx] = t.VolumeNullValue() + } + } else { + if err := _m.ReadBytes(_r, t.Volume[:]); err != nil { + return err + } + } + if !t.QuoteVolumeInActingVersion(actingVersion) { + for idx := 0; idx < 16; idx++ { + t.QuoteVolume[idx] = t.QuoteVolumeNullValue() + } + } else { + if err := _m.ReadBytes(_r, t.QuoteVolume[:]); err != nil { + return err + } + } + if !t.OpenTimeInActingVersion(actingVersion) { + t.OpenTime = t.OpenTimeNullValue() + } else { + if err := _m.ReadInt64(_r, &t.OpenTime); err != nil { + return err + } + } + if !t.CloseTimeInActingVersion(actingVersion) { + t.CloseTime = t.CloseTimeNullValue() + } else { + if err := _m.ReadInt64(_r, &t.CloseTime); err != nil { + return err + } + } + if !t.FirstIdInActingVersion(actingVersion) { + t.FirstId = t.FirstIdNullValue() + } else { + if err := _m.ReadInt64(_r, &t.FirstId); err != nil { + return err + } + } + if !t.LastIdInActingVersion(actingVersion) { + t.LastId = t.LastIdNullValue() + } else { + if err := _m.ReadInt64(_r, &t.LastId); err != nil { + return err + } + } + if !t.NumTradesInActingVersion(actingVersion) { + t.NumTrades = t.NumTradesNullValue() + } else { + if err := _m.ReadInt64(_r, &t.NumTrades); err != nil { + return err + } + } + if actingVersion > t.SbeSchemaVersion() && blockLength > t.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-t.SbeBlockLength())) + } + + if t.SymbolInActingVersion(actingVersion) { + var SymbolLength uint8 + if err := _m.ReadUint8(_r, &SymbolLength); err != nil { + return err + } + if cap(t.Symbol) < int(SymbolLength) { + t.Symbol = make([]uint8, SymbolLength) + } + t.Symbol = t.Symbol[:SymbolLength] + if err := _m.ReadBytes(_r, t.Symbol); err != nil { + return err + } + } + return nil +} + +func (t *Ticker24hMiniResponseTickers) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if t.PriceExponentInActingVersion(actingVersion) { + if t.PriceExponent < t.PriceExponentMinValue() || t.PriceExponent > t.PriceExponentMaxValue() { + return fmt.Errorf("Range check failed on t.PriceExponent (%v < %v > %v)", t.PriceExponentMinValue(), t.PriceExponent, t.PriceExponentMaxValue()) + } + } + if t.QtyExponentInActingVersion(actingVersion) { + if t.QtyExponent < t.QtyExponentMinValue() || t.QtyExponent > t.QtyExponentMaxValue() { + return fmt.Errorf("Range check failed on t.QtyExponent (%v < %v > %v)", t.QtyExponentMinValue(), t.QtyExponent, t.QtyExponentMaxValue()) + } + } + if t.OpenPriceInActingVersion(actingVersion) { + if t.OpenPrice != t.OpenPriceNullValue() && (t.OpenPrice < t.OpenPriceMinValue() || t.OpenPrice > t.OpenPriceMaxValue()) { + return fmt.Errorf("Range check failed on t.OpenPrice (%v < %v > %v)", t.OpenPriceMinValue(), t.OpenPrice, t.OpenPriceMaxValue()) + } + } + if t.HighPriceInActingVersion(actingVersion) { + if t.HighPrice != t.HighPriceNullValue() && (t.HighPrice < t.HighPriceMinValue() || t.HighPrice > t.HighPriceMaxValue()) { + return fmt.Errorf("Range check failed on t.HighPrice (%v < %v > %v)", t.HighPriceMinValue(), t.HighPrice, t.HighPriceMaxValue()) + } + } + if t.LowPriceInActingVersion(actingVersion) { + if t.LowPrice != t.LowPriceNullValue() && (t.LowPrice < t.LowPriceMinValue() || t.LowPrice > t.LowPriceMaxValue()) { + return fmt.Errorf("Range check failed on t.LowPrice (%v < %v > %v)", t.LowPriceMinValue(), t.LowPrice, t.LowPriceMaxValue()) + } + } + if t.LastPriceInActingVersion(actingVersion) { + if t.LastPrice != t.LastPriceNullValue() && (t.LastPrice < t.LastPriceMinValue() || t.LastPrice > t.LastPriceMaxValue()) { + return fmt.Errorf("Range check failed on t.LastPrice (%v < %v > %v)", t.LastPriceMinValue(), t.LastPrice, t.LastPriceMaxValue()) + } + } + if t.VolumeInActingVersion(actingVersion) { + for idx := 0; idx < 16; idx++ { + if t.Volume[idx] < t.VolumeMinValue() || t.Volume[idx] > t.VolumeMaxValue() { + return fmt.Errorf("Range check failed on t.Volume[%d] (%v < %v > %v)", idx, t.VolumeMinValue(), t.Volume[idx], t.VolumeMaxValue()) + } + } + } + if t.QuoteVolumeInActingVersion(actingVersion) { + for idx := 0; idx < 16; idx++ { + if t.QuoteVolume[idx] < t.QuoteVolumeMinValue() || t.QuoteVolume[idx] > t.QuoteVolumeMaxValue() { + return fmt.Errorf("Range check failed on t.QuoteVolume[%d] (%v < %v > %v)", idx, t.QuoteVolumeMinValue(), t.QuoteVolume[idx], t.QuoteVolumeMaxValue()) + } + } + } + if t.OpenTimeInActingVersion(actingVersion) { + if t.OpenTime < t.OpenTimeMinValue() || t.OpenTime > t.OpenTimeMaxValue() { + return fmt.Errorf("Range check failed on t.OpenTime (%v < %v > %v)", t.OpenTimeMinValue(), t.OpenTime, t.OpenTimeMaxValue()) + } + } + if t.CloseTimeInActingVersion(actingVersion) { + if t.CloseTime < t.CloseTimeMinValue() || t.CloseTime > t.CloseTimeMaxValue() { + return fmt.Errorf("Range check failed on t.CloseTime (%v < %v > %v)", t.CloseTimeMinValue(), t.CloseTime, t.CloseTimeMaxValue()) + } + } + if t.FirstIdInActingVersion(actingVersion) { + if t.FirstId != t.FirstIdNullValue() && (t.FirstId < t.FirstIdMinValue() || t.FirstId > t.FirstIdMaxValue()) { + return fmt.Errorf("Range check failed on t.FirstId (%v < %v > %v)", t.FirstIdMinValue(), t.FirstId, t.FirstIdMaxValue()) + } + } + if t.LastIdInActingVersion(actingVersion) { + if t.LastId != t.LastIdNullValue() && (t.LastId < t.LastIdMinValue() || t.LastId > t.LastIdMaxValue()) { + return fmt.Errorf("Range check failed on t.LastId (%v < %v > %v)", t.LastIdMinValue(), t.LastId, t.LastIdMaxValue()) + } + } + if t.NumTradesInActingVersion(actingVersion) { + if t.NumTrades < t.NumTradesMinValue() || t.NumTrades > t.NumTradesMaxValue() { + return fmt.Errorf("Range check failed on t.NumTrades (%v < %v > %v)", t.NumTradesMinValue(), t.NumTrades, t.NumTradesMaxValue()) + } + } + if !utf8.Valid(t.Symbol[:]) { + return errors.New("t.Symbol failed UTF-8 validation") + } + return nil +} + +func Ticker24hMiniResponseTickersInit(t *Ticker24hMiniResponseTickers) { + t.OpenPrice = math.MinInt64 + t.HighPrice = math.MinInt64 + t.LowPrice = math.MinInt64 + t.LastPrice = math.MinInt64 + t.FirstId = math.MinInt64 + t.LastId = math.MinInt64 + return +} + +func (*Ticker24hMiniResponse) SbeBlockLength() (blockLength uint16) { + return 0 +} + +func (*Ticker24hMiniResponse) SbeTemplateId() (templateId uint16) { + return 208 +} + +func (*Ticker24hMiniResponse) SbeSchemaId() (schemaId uint16) { + return 3 +} + +func (*Ticker24hMiniResponse) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} + +func (*Ticker24hMiniResponse) SbeSemanticType() (semanticType []byte) { + return []byte("") +} + +func (*Ticker24hMiniResponse) SbeSemanticVersion() (semanticVersion string) { + return "5.2" +} + +func (*Ticker24hMiniResponseTickers) PriceExponentId() uint16 { + return 1 +} + +func (*Ticker24hMiniResponseTickers) PriceExponentSinceVersion() uint16 { + return 0 +} + +func (t *Ticker24hMiniResponseTickers) PriceExponentInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.PriceExponentSinceVersion() +} + +func (*Ticker24hMiniResponseTickers) PriceExponentDeprecated() uint16 { + return 0 +} + +func (*Ticker24hMiniResponseTickers) PriceExponentMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*Ticker24hMiniResponseTickers) PriceExponentMinValue() int8 { + return math.MinInt8 + 1 +} + +func (*Ticker24hMiniResponseTickers) PriceExponentMaxValue() int8 { + return math.MaxInt8 +} + +func (*Ticker24hMiniResponseTickers) PriceExponentNullValue() int8 { + return math.MinInt8 +} + +func (*Ticker24hMiniResponseTickers) QtyExponentId() uint16 { + return 2 +} + +func (*Ticker24hMiniResponseTickers) QtyExponentSinceVersion() uint16 { + return 0 +} + +func (t *Ticker24hMiniResponseTickers) QtyExponentInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.QtyExponentSinceVersion() +} + +func (*Ticker24hMiniResponseTickers) QtyExponentDeprecated() uint16 { + return 0 +} + +func (*Ticker24hMiniResponseTickers) QtyExponentMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*Ticker24hMiniResponseTickers) QtyExponentMinValue() int8 { + return math.MinInt8 + 1 +} + +func (*Ticker24hMiniResponseTickers) QtyExponentMaxValue() int8 { + return math.MaxInt8 +} + +func (*Ticker24hMiniResponseTickers) QtyExponentNullValue() int8 { + return math.MinInt8 +} + +func (*Ticker24hMiniResponseTickers) OpenPriceId() uint16 { + return 3 +} + +func (*Ticker24hMiniResponseTickers) OpenPriceSinceVersion() uint16 { + return 0 +} + +func (t *Ticker24hMiniResponseTickers) OpenPriceInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.OpenPriceSinceVersion() +} + +func (*Ticker24hMiniResponseTickers) OpenPriceDeprecated() uint16 { + return 0 +} + +func (*Ticker24hMiniResponseTickers) OpenPriceMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*Ticker24hMiniResponseTickers) OpenPriceMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*Ticker24hMiniResponseTickers) OpenPriceMaxValue() int64 { + return math.MaxInt64 +} + +func (*Ticker24hMiniResponseTickers) OpenPriceNullValue() int64 { + return math.MinInt64 +} + +func (*Ticker24hMiniResponseTickers) HighPriceId() uint16 { + return 4 +} + +func (*Ticker24hMiniResponseTickers) HighPriceSinceVersion() uint16 { + return 0 +} + +func (t *Ticker24hMiniResponseTickers) HighPriceInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.HighPriceSinceVersion() +} + +func (*Ticker24hMiniResponseTickers) HighPriceDeprecated() uint16 { + return 0 +} + +func (*Ticker24hMiniResponseTickers) HighPriceMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*Ticker24hMiniResponseTickers) HighPriceMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*Ticker24hMiniResponseTickers) HighPriceMaxValue() int64 { + return math.MaxInt64 +} + +func (*Ticker24hMiniResponseTickers) HighPriceNullValue() int64 { + return math.MinInt64 +} + +func (*Ticker24hMiniResponseTickers) LowPriceId() uint16 { + return 5 +} + +func (*Ticker24hMiniResponseTickers) LowPriceSinceVersion() uint16 { + return 0 +} + +func (t *Ticker24hMiniResponseTickers) LowPriceInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.LowPriceSinceVersion() +} + +func (*Ticker24hMiniResponseTickers) LowPriceDeprecated() uint16 { + return 0 +} + +func (*Ticker24hMiniResponseTickers) LowPriceMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*Ticker24hMiniResponseTickers) LowPriceMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*Ticker24hMiniResponseTickers) LowPriceMaxValue() int64 { + return math.MaxInt64 +} + +func (*Ticker24hMiniResponseTickers) LowPriceNullValue() int64 { + return math.MinInt64 +} + +func (*Ticker24hMiniResponseTickers) LastPriceId() uint16 { + return 6 +} + +func (*Ticker24hMiniResponseTickers) LastPriceSinceVersion() uint16 { + return 0 +} + +func (t *Ticker24hMiniResponseTickers) LastPriceInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.LastPriceSinceVersion() +} + +func (*Ticker24hMiniResponseTickers) LastPriceDeprecated() uint16 { + return 0 +} + +func (*Ticker24hMiniResponseTickers) LastPriceMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*Ticker24hMiniResponseTickers) LastPriceMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*Ticker24hMiniResponseTickers) LastPriceMaxValue() int64 { + return math.MaxInt64 +} + +func (*Ticker24hMiniResponseTickers) LastPriceNullValue() int64 { + return math.MinInt64 +} + +func (*Ticker24hMiniResponseTickers) VolumeId() uint16 { + return 7 +} + +func (*Ticker24hMiniResponseTickers) VolumeSinceVersion() uint16 { + return 0 +} + +func (t *Ticker24hMiniResponseTickers) VolumeInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.VolumeSinceVersion() +} + +func (*Ticker24hMiniResponseTickers) VolumeDeprecated() uint16 { + return 0 +} + +func (*Ticker24hMiniResponseTickers) VolumeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*Ticker24hMiniResponseTickers) VolumeMinValue() uint8 { + return 0 +} + +func (*Ticker24hMiniResponseTickers) VolumeMaxValue() uint8 { + return math.MaxUint8 - 1 +} + +func (*Ticker24hMiniResponseTickers) VolumeNullValue() uint8 { + return math.MaxUint8 +} + +func (*Ticker24hMiniResponseTickers) QuoteVolumeId() uint16 { + return 8 +} + +func (*Ticker24hMiniResponseTickers) QuoteVolumeSinceVersion() uint16 { + return 0 +} + +func (t *Ticker24hMiniResponseTickers) QuoteVolumeInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.QuoteVolumeSinceVersion() +} + +func (*Ticker24hMiniResponseTickers) QuoteVolumeDeprecated() uint16 { + return 0 +} + +func (*Ticker24hMiniResponseTickers) QuoteVolumeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*Ticker24hMiniResponseTickers) QuoteVolumeMinValue() uint8 { + return 0 +} + +func (*Ticker24hMiniResponseTickers) QuoteVolumeMaxValue() uint8 { + return math.MaxUint8 - 1 +} + +func (*Ticker24hMiniResponseTickers) QuoteVolumeNullValue() uint8 { + return math.MaxUint8 +} + +func (*Ticker24hMiniResponseTickers) OpenTimeId() uint16 { + return 9 +} + +func (*Ticker24hMiniResponseTickers) OpenTimeSinceVersion() uint16 { + return 0 +} + +func (t *Ticker24hMiniResponseTickers) OpenTimeInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.OpenTimeSinceVersion() +} + +func (*Ticker24hMiniResponseTickers) OpenTimeDeprecated() uint16 { + return 0 +} + +func (*Ticker24hMiniResponseTickers) OpenTimeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*Ticker24hMiniResponseTickers) OpenTimeMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*Ticker24hMiniResponseTickers) OpenTimeMaxValue() int64 { + return math.MaxInt64 +} + +func (*Ticker24hMiniResponseTickers) OpenTimeNullValue() int64 { + return math.MinInt64 +} + +func (*Ticker24hMiniResponseTickers) CloseTimeId() uint16 { + return 10 +} + +func (*Ticker24hMiniResponseTickers) CloseTimeSinceVersion() uint16 { + return 0 +} + +func (t *Ticker24hMiniResponseTickers) CloseTimeInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.CloseTimeSinceVersion() +} + +func (*Ticker24hMiniResponseTickers) CloseTimeDeprecated() uint16 { + return 0 +} + +func (*Ticker24hMiniResponseTickers) CloseTimeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*Ticker24hMiniResponseTickers) CloseTimeMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*Ticker24hMiniResponseTickers) CloseTimeMaxValue() int64 { + return math.MaxInt64 +} + +func (*Ticker24hMiniResponseTickers) CloseTimeNullValue() int64 { + return math.MinInt64 +} + +func (*Ticker24hMiniResponseTickers) FirstIdId() uint16 { + return 11 +} + +func (*Ticker24hMiniResponseTickers) FirstIdSinceVersion() uint16 { + return 0 +} + +func (t *Ticker24hMiniResponseTickers) FirstIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.FirstIdSinceVersion() +} + +func (*Ticker24hMiniResponseTickers) FirstIdDeprecated() uint16 { + return 0 +} + +func (*Ticker24hMiniResponseTickers) FirstIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*Ticker24hMiniResponseTickers) FirstIdMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*Ticker24hMiniResponseTickers) FirstIdMaxValue() int64 { + return math.MaxInt64 +} + +func (*Ticker24hMiniResponseTickers) FirstIdNullValue() int64 { + return math.MinInt64 +} + +func (*Ticker24hMiniResponseTickers) LastIdId() uint16 { + return 12 +} + +func (*Ticker24hMiniResponseTickers) LastIdSinceVersion() uint16 { + return 0 +} + +func (t *Ticker24hMiniResponseTickers) LastIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.LastIdSinceVersion() +} + +func (*Ticker24hMiniResponseTickers) LastIdDeprecated() uint16 { + return 0 +} + +func (*Ticker24hMiniResponseTickers) LastIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*Ticker24hMiniResponseTickers) LastIdMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*Ticker24hMiniResponseTickers) LastIdMaxValue() int64 { + return math.MaxInt64 +} + +func (*Ticker24hMiniResponseTickers) LastIdNullValue() int64 { + return math.MinInt64 +} + +func (*Ticker24hMiniResponseTickers) NumTradesId() uint16 { + return 13 +} + +func (*Ticker24hMiniResponseTickers) NumTradesSinceVersion() uint16 { + return 0 +} + +func (t *Ticker24hMiniResponseTickers) NumTradesInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.NumTradesSinceVersion() +} + +func (*Ticker24hMiniResponseTickers) NumTradesDeprecated() uint16 { + return 0 +} + +func (*Ticker24hMiniResponseTickers) NumTradesMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*Ticker24hMiniResponseTickers) NumTradesMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*Ticker24hMiniResponseTickers) NumTradesMaxValue() int64 { + return math.MaxInt64 +} + +func (*Ticker24hMiniResponseTickers) NumTradesNullValue() int64 { + return math.MinInt64 +} + +func (*Ticker24hMiniResponseTickers) SymbolMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*Ticker24hMiniResponseTickers) SymbolSinceVersion() uint16 { + return 0 +} + +func (t *Ticker24hMiniResponseTickers) SymbolInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.SymbolSinceVersion() +} + +func (*Ticker24hMiniResponseTickers) SymbolDeprecated() uint16 { + return 0 +} + +func (Ticker24hMiniResponseTickers) SymbolCharacterEncoding() string { + return "UTF-8" +} + +func (Ticker24hMiniResponseTickers) SymbolHeaderLength() uint64 { + return 1 +} + +func (*Ticker24hMiniResponse) TickersId() uint16 { + return 100 +} + +func (*Ticker24hMiniResponse) TickersSinceVersion() uint16 { + return 0 +} + +func (t *Ticker24hMiniResponse) TickersInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.TickersSinceVersion() +} + +func (*Ticker24hMiniResponse) TickersDeprecated() uint16 { + return 0 +} + +func (*Ticker24hMiniResponseTickers) SbeBlockLength() (blockLength uint) { + return 106 +} + +func (*Ticker24hMiniResponseTickers) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} diff --git a/v2/sbe/spot_3_1/Ticker24hSymbolFullResponse.go b/v2/sbe/spot_3_1/Ticker24hSymbolFullResponse.go new file mode 100644 index 00000000..39b94e5f --- /dev/null +++ b/v2/sbe/spot_3_1/Ticker24hSymbolFullResponse.go @@ -0,0 +1,1426 @@ +// Generated SBE (Simple Binary Encoding) message codec + +package sbe + +import ( + "errors" + "fmt" + "io" + "io/ioutil" + "math" + "unicode/utf8" +) + +type Ticker24hSymbolFullResponse struct { + PriceExponent int8 + QtyExponent int8 + PriceChange int64 + PriceChangePercent float32 + WeightedAvgPrice int64 + PrevClosePrice int64 + LastPrice int64 + LastQty [16]uint8 + BidPrice int64 + BidQty int64 + AskPrice int64 + AskQty int64 + OpenPrice int64 + HighPrice int64 + LowPrice int64 + Volume [16]uint8 + QuoteVolume [16]uint8 + OpenTime int64 + CloseTime int64 + FirstId int64 + LastId int64 + NumTrades int64 + Symbol []uint8 +} + +func (t *Ticker24hSymbolFullResponse) Encode(_m *SbeGoMarshaller, _w io.Writer, doRangeCheck bool) error { + if doRangeCheck { + if err := t.RangeCheck(t.SbeSchemaVersion(), t.SbeSchemaVersion()); err != nil { + return err + } + } + if err := _m.WriteInt8(_w, t.PriceExponent); err != nil { + return err + } + if err := _m.WriteInt8(_w, t.QtyExponent); err != nil { + return err + } + if err := _m.WriteInt64(_w, t.PriceChange); err != nil { + return err + } + if err := _m.WriteFloat32(_w, t.PriceChangePercent); err != nil { + return err + } + if err := _m.WriteInt64(_w, t.WeightedAvgPrice); err != nil { + return err + } + if err := _m.WriteInt64(_w, t.PrevClosePrice); err != nil { + return err + } + if err := _m.WriteInt64(_w, t.LastPrice); err != nil { + return err + } + if err := _m.WriteBytes(_w, t.LastQty[:]); err != nil { + return err + } + if err := _m.WriteInt64(_w, t.BidPrice); err != nil { + return err + } + if err := _m.WriteInt64(_w, t.BidQty); err != nil { + return err + } + if err := _m.WriteInt64(_w, t.AskPrice); err != nil { + return err + } + if err := _m.WriteInt64(_w, t.AskQty); err != nil { + return err + } + if err := _m.WriteInt64(_w, t.OpenPrice); err != nil { + return err + } + if err := _m.WriteInt64(_w, t.HighPrice); err != nil { + return err + } + if err := _m.WriteInt64(_w, t.LowPrice); err != nil { + return err + } + if err := _m.WriteBytes(_w, t.Volume[:]); err != nil { + return err + } + if err := _m.WriteBytes(_w, t.QuoteVolume[:]); err != nil { + return err + } + if err := _m.WriteInt64(_w, t.OpenTime); err != nil { + return err + } + if err := _m.WriteInt64(_w, t.CloseTime); err != nil { + return err + } + if err := _m.WriteInt64(_w, t.FirstId); err != nil { + return err + } + if err := _m.WriteInt64(_w, t.LastId); err != nil { + return err + } + if err := _m.WriteInt64(_w, t.NumTrades); err != nil { + return err + } + if err := _m.WriteUint8(_w, uint8(len(t.Symbol))); err != nil { + return err + } + if err := _m.WriteBytes(_w, t.Symbol); err != nil { + return err + } + return nil +} + +func (t *Ticker24hSymbolFullResponse) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint16, doRangeCheck bool) error { + if !t.PriceExponentInActingVersion(actingVersion) { + t.PriceExponent = t.PriceExponentNullValue() + } else { + if err := _m.ReadInt8(_r, &t.PriceExponent); err != nil { + return err + } + } + if !t.QtyExponentInActingVersion(actingVersion) { + t.QtyExponent = t.QtyExponentNullValue() + } else { + if err := _m.ReadInt8(_r, &t.QtyExponent); err != nil { + return err + } + } + if !t.PriceChangeInActingVersion(actingVersion) { + t.PriceChange = t.PriceChangeNullValue() + } else { + if err := _m.ReadInt64(_r, &t.PriceChange); err != nil { + return err + } + } + if !t.PriceChangePercentInActingVersion(actingVersion) { + t.PriceChangePercent = t.PriceChangePercentNullValue() + } else { + if err := _m.ReadFloat32(_r, &t.PriceChangePercent); err != nil { + return err + } + } + if !t.WeightedAvgPriceInActingVersion(actingVersion) { + t.WeightedAvgPrice = t.WeightedAvgPriceNullValue() + } else { + if err := _m.ReadInt64(_r, &t.WeightedAvgPrice); err != nil { + return err + } + } + if !t.PrevClosePriceInActingVersion(actingVersion) { + t.PrevClosePrice = t.PrevClosePriceNullValue() + } else { + if err := _m.ReadInt64(_r, &t.PrevClosePrice); err != nil { + return err + } + } + if !t.LastPriceInActingVersion(actingVersion) { + t.LastPrice = t.LastPriceNullValue() + } else { + if err := _m.ReadInt64(_r, &t.LastPrice); err != nil { + return err + } + } + if !t.LastQtyInActingVersion(actingVersion) { + for idx := 0; idx < 16; idx++ { + t.LastQty[idx] = t.LastQtyNullValue() + } + } else { + if err := _m.ReadBytes(_r, t.LastQty[:]); err != nil { + return err + } + } + if !t.BidPriceInActingVersion(actingVersion) { + t.BidPrice = t.BidPriceNullValue() + } else { + if err := _m.ReadInt64(_r, &t.BidPrice); err != nil { + return err + } + } + if !t.BidQtyInActingVersion(actingVersion) { + t.BidQty = t.BidQtyNullValue() + } else { + if err := _m.ReadInt64(_r, &t.BidQty); err != nil { + return err + } + } + if !t.AskPriceInActingVersion(actingVersion) { + t.AskPrice = t.AskPriceNullValue() + } else { + if err := _m.ReadInt64(_r, &t.AskPrice); err != nil { + return err + } + } + if !t.AskQtyInActingVersion(actingVersion) { + t.AskQty = t.AskQtyNullValue() + } else { + if err := _m.ReadInt64(_r, &t.AskQty); err != nil { + return err + } + } + if !t.OpenPriceInActingVersion(actingVersion) { + t.OpenPrice = t.OpenPriceNullValue() + } else { + if err := _m.ReadInt64(_r, &t.OpenPrice); err != nil { + return err + } + } + if !t.HighPriceInActingVersion(actingVersion) { + t.HighPrice = t.HighPriceNullValue() + } else { + if err := _m.ReadInt64(_r, &t.HighPrice); err != nil { + return err + } + } + if !t.LowPriceInActingVersion(actingVersion) { + t.LowPrice = t.LowPriceNullValue() + } else { + if err := _m.ReadInt64(_r, &t.LowPrice); err != nil { + return err + } + } + if !t.VolumeInActingVersion(actingVersion) { + for idx := 0; idx < 16; idx++ { + t.Volume[idx] = t.VolumeNullValue() + } + } else { + if err := _m.ReadBytes(_r, t.Volume[:]); err != nil { + return err + } + } + if !t.QuoteVolumeInActingVersion(actingVersion) { + for idx := 0; idx < 16; idx++ { + t.QuoteVolume[idx] = t.QuoteVolumeNullValue() + } + } else { + if err := _m.ReadBytes(_r, t.QuoteVolume[:]); err != nil { + return err + } + } + if !t.OpenTimeInActingVersion(actingVersion) { + t.OpenTime = t.OpenTimeNullValue() + } else { + if err := _m.ReadInt64(_r, &t.OpenTime); err != nil { + return err + } + } + if !t.CloseTimeInActingVersion(actingVersion) { + t.CloseTime = t.CloseTimeNullValue() + } else { + if err := _m.ReadInt64(_r, &t.CloseTime); err != nil { + return err + } + } + if !t.FirstIdInActingVersion(actingVersion) { + t.FirstId = t.FirstIdNullValue() + } else { + if err := _m.ReadInt64(_r, &t.FirstId); err != nil { + return err + } + } + if !t.LastIdInActingVersion(actingVersion) { + t.LastId = t.LastIdNullValue() + } else { + if err := _m.ReadInt64(_r, &t.LastId); err != nil { + return err + } + } + if !t.NumTradesInActingVersion(actingVersion) { + t.NumTrades = t.NumTradesNullValue() + } else { + if err := _m.ReadInt64(_r, &t.NumTrades); err != nil { + return err + } + } + if actingVersion > t.SbeSchemaVersion() && blockLength > t.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-t.SbeBlockLength())) + } + + if t.SymbolInActingVersion(actingVersion) { + var SymbolLength uint8 + if err := _m.ReadUint8(_r, &SymbolLength); err != nil { + return err + } + if cap(t.Symbol) < int(SymbolLength) { + t.Symbol = make([]uint8, SymbolLength) + } + t.Symbol = t.Symbol[:SymbolLength] + if err := _m.ReadBytes(_r, t.Symbol); err != nil { + return err + } + } + if doRangeCheck { + if err := t.RangeCheck(actingVersion, t.SbeSchemaVersion()); err != nil { + return err + } + } + return nil +} + +func (t *Ticker24hSymbolFullResponse) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if t.PriceExponentInActingVersion(actingVersion) { + if t.PriceExponent < t.PriceExponentMinValue() || t.PriceExponent > t.PriceExponentMaxValue() { + return fmt.Errorf("Range check failed on t.PriceExponent (%v < %v > %v)", t.PriceExponentMinValue(), t.PriceExponent, t.PriceExponentMaxValue()) + } + } + if t.QtyExponentInActingVersion(actingVersion) { + if t.QtyExponent < t.QtyExponentMinValue() || t.QtyExponent > t.QtyExponentMaxValue() { + return fmt.Errorf("Range check failed on t.QtyExponent (%v < %v > %v)", t.QtyExponentMinValue(), t.QtyExponent, t.QtyExponentMaxValue()) + } + } + if t.PriceChangeInActingVersion(actingVersion) { + if t.PriceChange != t.PriceChangeNullValue() && (t.PriceChange < t.PriceChangeMinValue() || t.PriceChange > t.PriceChangeMaxValue()) { + return fmt.Errorf("Range check failed on t.PriceChange (%v < %v > %v)", t.PriceChangeMinValue(), t.PriceChange, t.PriceChangeMaxValue()) + } + } + if t.PriceChangePercentInActingVersion(actingVersion) { + if t.PriceChangePercent != t.PriceChangePercentNullValue() && (t.PriceChangePercent < t.PriceChangePercentMinValue() || t.PriceChangePercent > t.PriceChangePercentMaxValue()) { + return fmt.Errorf("Range check failed on t.PriceChangePercent (%v < %v > %v)", t.PriceChangePercentMinValue(), t.PriceChangePercent, t.PriceChangePercentMaxValue()) + } + } + if t.WeightedAvgPriceInActingVersion(actingVersion) { + if t.WeightedAvgPrice != t.WeightedAvgPriceNullValue() && (t.WeightedAvgPrice < t.WeightedAvgPriceMinValue() || t.WeightedAvgPrice > t.WeightedAvgPriceMaxValue()) { + return fmt.Errorf("Range check failed on t.WeightedAvgPrice (%v < %v > %v)", t.WeightedAvgPriceMinValue(), t.WeightedAvgPrice, t.WeightedAvgPriceMaxValue()) + } + } + if t.PrevClosePriceInActingVersion(actingVersion) { + if t.PrevClosePrice != t.PrevClosePriceNullValue() && (t.PrevClosePrice < t.PrevClosePriceMinValue() || t.PrevClosePrice > t.PrevClosePriceMaxValue()) { + return fmt.Errorf("Range check failed on t.PrevClosePrice (%v < %v > %v)", t.PrevClosePriceMinValue(), t.PrevClosePrice, t.PrevClosePriceMaxValue()) + } + } + if t.LastPriceInActingVersion(actingVersion) { + if t.LastPrice != t.LastPriceNullValue() && (t.LastPrice < t.LastPriceMinValue() || t.LastPrice > t.LastPriceMaxValue()) { + return fmt.Errorf("Range check failed on t.LastPrice (%v < %v > %v)", t.LastPriceMinValue(), t.LastPrice, t.LastPriceMaxValue()) + } + } + if t.LastQtyInActingVersion(actingVersion) { + for idx := 0; idx < 16; idx++ { + if t.LastQty[idx] < t.LastQtyMinValue() || t.LastQty[idx] > t.LastQtyMaxValue() { + return fmt.Errorf("Range check failed on t.LastQty[%d] (%v < %v > %v)", idx, t.LastQtyMinValue(), t.LastQty[idx], t.LastQtyMaxValue()) + } + } + } + if t.BidPriceInActingVersion(actingVersion) { + if t.BidPrice != t.BidPriceNullValue() && (t.BidPrice < t.BidPriceMinValue() || t.BidPrice > t.BidPriceMaxValue()) { + return fmt.Errorf("Range check failed on t.BidPrice (%v < %v > %v)", t.BidPriceMinValue(), t.BidPrice, t.BidPriceMaxValue()) + } + } + if t.BidQtyInActingVersion(actingVersion) { + if t.BidQty < t.BidQtyMinValue() || t.BidQty > t.BidQtyMaxValue() { + return fmt.Errorf("Range check failed on t.BidQty (%v < %v > %v)", t.BidQtyMinValue(), t.BidQty, t.BidQtyMaxValue()) + } + } + if t.AskPriceInActingVersion(actingVersion) { + if t.AskPrice != t.AskPriceNullValue() && (t.AskPrice < t.AskPriceMinValue() || t.AskPrice > t.AskPriceMaxValue()) { + return fmt.Errorf("Range check failed on t.AskPrice (%v < %v > %v)", t.AskPriceMinValue(), t.AskPrice, t.AskPriceMaxValue()) + } + } + if t.AskQtyInActingVersion(actingVersion) { + if t.AskQty < t.AskQtyMinValue() || t.AskQty > t.AskQtyMaxValue() { + return fmt.Errorf("Range check failed on t.AskQty (%v < %v > %v)", t.AskQtyMinValue(), t.AskQty, t.AskQtyMaxValue()) + } + } + if t.OpenPriceInActingVersion(actingVersion) { + if t.OpenPrice != t.OpenPriceNullValue() && (t.OpenPrice < t.OpenPriceMinValue() || t.OpenPrice > t.OpenPriceMaxValue()) { + return fmt.Errorf("Range check failed on t.OpenPrice (%v < %v > %v)", t.OpenPriceMinValue(), t.OpenPrice, t.OpenPriceMaxValue()) + } + } + if t.HighPriceInActingVersion(actingVersion) { + if t.HighPrice != t.HighPriceNullValue() && (t.HighPrice < t.HighPriceMinValue() || t.HighPrice > t.HighPriceMaxValue()) { + return fmt.Errorf("Range check failed on t.HighPrice (%v < %v > %v)", t.HighPriceMinValue(), t.HighPrice, t.HighPriceMaxValue()) + } + } + if t.LowPriceInActingVersion(actingVersion) { + if t.LowPrice != t.LowPriceNullValue() && (t.LowPrice < t.LowPriceMinValue() || t.LowPrice > t.LowPriceMaxValue()) { + return fmt.Errorf("Range check failed on t.LowPrice (%v < %v > %v)", t.LowPriceMinValue(), t.LowPrice, t.LowPriceMaxValue()) + } + } + if t.VolumeInActingVersion(actingVersion) { + for idx := 0; idx < 16; idx++ { + if t.Volume[idx] < t.VolumeMinValue() || t.Volume[idx] > t.VolumeMaxValue() { + return fmt.Errorf("Range check failed on t.Volume[%d] (%v < %v > %v)", idx, t.VolumeMinValue(), t.Volume[idx], t.VolumeMaxValue()) + } + } + } + if t.QuoteVolumeInActingVersion(actingVersion) { + for idx := 0; idx < 16; idx++ { + if t.QuoteVolume[idx] < t.QuoteVolumeMinValue() || t.QuoteVolume[idx] > t.QuoteVolumeMaxValue() { + return fmt.Errorf("Range check failed on t.QuoteVolume[%d] (%v < %v > %v)", idx, t.QuoteVolumeMinValue(), t.QuoteVolume[idx], t.QuoteVolumeMaxValue()) + } + } + } + if t.OpenTimeInActingVersion(actingVersion) { + if t.OpenTime < t.OpenTimeMinValue() || t.OpenTime > t.OpenTimeMaxValue() { + return fmt.Errorf("Range check failed on t.OpenTime (%v < %v > %v)", t.OpenTimeMinValue(), t.OpenTime, t.OpenTimeMaxValue()) + } + } + if t.CloseTimeInActingVersion(actingVersion) { + if t.CloseTime < t.CloseTimeMinValue() || t.CloseTime > t.CloseTimeMaxValue() { + return fmt.Errorf("Range check failed on t.CloseTime (%v < %v > %v)", t.CloseTimeMinValue(), t.CloseTime, t.CloseTimeMaxValue()) + } + } + if t.FirstIdInActingVersion(actingVersion) { + if t.FirstId != t.FirstIdNullValue() && (t.FirstId < t.FirstIdMinValue() || t.FirstId > t.FirstIdMaxValue()) { + return fmt.Errorf("Range check failed on t.FirstId (%v < %v > %v)", t.FirstIdMinValue(), t.FirstId, t.FirstIdMaxValue()) + } + } + if t.LastIdInActingVersion(actingVersion) { + if t.LastId != t.LastIdNullValue() && (t.LastId < t.LastIdMinValue() || t.LastId > t.LastIdMaxValue()) { + return fmt.Errorf("Range check failed on t.LastId (%v < %v > %v)", t.LastIdMinValue(), t.LastId, t.LastIdMaxValue()) + } + } + if t.NumTradesInActingVersion(actingVersion) { + if t.NumTrades < t.NumTradesMinValue() || t.NumTrades > t.NumTradesMaxValue() { + return fmt.Errorf("Range check failed on t.NumTrades (%v < %v > %v)", t.NumTradesMinValue(), t.NumTrades, t.NumTradesMaxValue()) + } + } + if !utf8.Valid(t.Symbol[:]) { + return errors.New("t.Symbol failed UTF-8 validation") + } + return nil +} + +func Ticker24hSymbolFullResponseInit(t *Ticker24hSymbolFullResponse) { + t.PriceChange = math.MinInt64 + t.PriceChangePercent = float32(math.NaN()) + t.WeightedAvgPrice = math.MinInt64 + t.PrevClosePrice = math.MinInt64 + t.LastPrice = math.MinInt64 + t.BidPrice = math.MinInt64 + t.AskPrice = math.MinInt64 + t.OpenPrice = math.MinInt64 + t.HighPrice = math.MinInt64 + t.LowPrice = math.MinInt64 + t.FirstId = math.MinInt64 + t.LastId = math.MinInt64 + return +} + +func (*Ticker24hSymbolFullResponse) SbeBlockLength() (blockLength uint16) { + return 182 +} + +func (*Ticker24hSymbolFullResponse) SbeTemplateId() (templateId uint16) { + return 205 +} + +func (*Ticker24hSymbolFullResponse) SbeSchemaId() (schemaId uint16) { + return 3 +} + +func (*Ticker24hSymbolFullResponse) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} + +func (*Ticker24hSymbolFullResponse) SbeSemanticType() (semanticType []byte) { + return []byte("") +} + +func (*Ticker24hSymbolFullResponse) SbeSemanticVersion() (semanticVersion string) { + return "5.2" +} + +func (*Ticker24hSymbolFullResponse) PriceExponentId() uint16 { + return 1 +} + +func (*Ticker24hSymbolFullResponse) PriceExponentSinceVersion() uint16 { + return 0 +} + +func (t *Ticker24hSymbolFullResponse) PriceExponentInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.PriceExponentSinceVersion() +} + +func (*Ticker24hSymbolFullResponse) PriceExponentDeprecated() uint16 { + return 0 +} + +func (*Ticker24hSymbolFullResponse) PriceExponentMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*Ticker24hSymbolFullResponse) PriceExponentMinValue() int8 { + return math.MinInt8 + 1 +} + +func (*Ticker24hSymbolFullResponse) PriceExponentMaxValue() int8 { + return math.MaxInt8 +} + +func (*Ticker24hSymbolFullResponse) PriceExponentNullValue() int8 { + return math.MinInt8 +} + +func (*Ticker24hSymbolFullResponse) QtyExponentId() uint16 { + return 2 +} + +func (*Ticker24hSymbolFullResponse) QtyExponentSinceVersion() uint16 { + return 0 +} + +func (t *Ticker24hSymbolFullResponse) QtyExponentInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.QtyExponentSinceVersion() +} + +func (*Ticker24hSymbolFullResponse) QtyExponentDeprecated() uint16 { + return 0 +} + +func (*Ticker24hSymbolFullResponse) QtyExponentMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*Ticker24hSymbolFullResponse) QtyExponentMinValue() int8 { + return math.MinInt8 + 1 +} + +func (*Ticker24hSymbolFullResponse) QtyExponentMaxValue() int8 { + return math.MaxInt8 +} + +func (*Ticker24hSymbolFullResponse) QtyExponentNullValue() int8 { + return math.MinInt8 +} + +func (*Ticker24hSymbolFullResponse) PriceChangeId() uint16 { + return 3 +} + +func (*Ticker24hSymbolFullResponse) PriceChangeSinceVersion() uint16 { + return 0 +} + +func (t *Ticker24hSymbolFullResponse) PriceChangeInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.PriceChangeSinceVersion() +} + +func (*Ticker24hSymbolFullResponse) PriceChangeDeprecated() uint16 { + return 0 +} + +func (*Ticker24hSymbolFullResponse) PriceChangeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*Ticker24hSymbolFullResponse) PriceChangeMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*Ticker24hSymbolFullResponse) PriceChangeMaxValue() int64 { + return math.MaxInt64 +} + +func (*Ticker24hSymbolFullResponse) PriceChangeNullValue() int64 { + return math.MinInt64 +} + +func (*Ticker24hSymbolFullResponse) PriceChangePercentId() uint16 { + return 4 +} + +func (*Ticker24hSymbolFullResponse) PriceChangePercentSinceVersion() uint16 { + return 0 +} + +func (t *Ticker24hSymbolFullResponse) PriceChangePercentInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.PriceChangePercentSinceVersion() +} + +func (*Ticker24hSymbolFullResponse) PriceChangePercentDeprecated() uint16 { + return 0 +} + +func (*Ticker24hSymbolFullResponse) PriceChangePercentMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*Ticker24hSymbolFullResponse) PriceChangePercentMinValue() float32 { + return -math.MaxFloat32 +} + +func (*Ticker24hSymbolFullResponse) PriceChangePercentMaxValue() float32 { + return math.MaxFloat32 +} + +func (*Ticker24hSymbolFullResponse) PriceChangePercentNullValue() float32 { + return float32(math.NaN()) +} + +func (*Ticker24hSymbolFullResponse) WeightedAvgPriceId() uint16 { + return 5 +} + +func (*Ticker24hSymbolFullResponse) WeightedAvgPriceSinceVersion() uint16 { + return 0 +} + +func (t *Ticker24hSymbolFullResponse) WeightedAvgPriceInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.WeightedAvgPriceSinceVersion() +} + +func (*Ticker24hSymbolFullResponse) WeightedAvgPriceDeprecated() uint16 { + return 0 +} + +func (*Ticker24hSymbolFullResponse) WeightedAvgPriceMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*Ticker24hSymbolFullResponse) WeightedAvgPriceMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*Ticker24hSymbolFullResponse) WeightedAvgPriceMaxValue() int64 { + return math.MaxInt64 +} + +func (*Ticker24hSymbolFullResponse) WeightedAvgPriceNullValue() int64 { + return math.MinInt64 +} + +func (*Ticker24hSymbolFullResponse) PrevClosePriceId() uint16 { + return 6 +} + +func (*Ticker24hSymbolFullResponse) PrevClosePriceSinceVersion() uint16 { + return 0 +} + +func (t *Ticker24hSymbolFullResponse) PrevClosePriceInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.PrevClosePriceSinceVersion() +} + +func (*Ticker24hSymbolFullResponse) PrevClosePriceDeprecated() uint16 { + return 0 +} + +func (*Ticker24hSymbolFullResponse) PrevClosePriceMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*Ticker24hSymbolFullResponse) PrevClosePriceMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*Ticker24hSymbolFullResponse) PrevClosePriceMaxValue() int64 { + return math.MaxInt64 +} + +func (*Ticker24hSymbolFullResponse) PrevClosePriceNullValue() int64 { + return math.MinInt64 +} + +func (*Ticker24hSymbolFullResponse) LastPriceId() uint16 { + return 7 +} + +func (*Ticker24hSymbolFullResponse) LastPriceSinceVersion() uint16 { + return 0 +} + +func (t *Ticker24hSymbolFullResponse) LastPriceInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.LastPriceSinceVersion() +} + +func (*Ticker24hSymbolFullResponse) LastPriceDeprecated() uint16 { + return 0 +} + +func (*Ticker24hSymbolFullResponse) LastPriceMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*Ticker24hSymbolFullResponse) LastPriceMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*Ticker24hSymbolFullResponse) LastPriceMaxValue() int64 { + return math.MaxInt64 +} + +func (*Ticker24hSymbolFullResponse) LastPriceNullValue() int64 { + return math.MinInt64 +} + +func (*Ticker24hSymbolFullResponse) LastQtyId() uint16 { + return 8 +} + +func (*Ticker24hSymbolFullResponse) LastQtySinceVersion() uint16 { + return 0 +} + +func (t *Ticker24hSymbolFullResponse) LastQtyInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.LastQtySinceVersion() +} + +func (*Ticker24hSymbolFullResponse) LastQtyDeprecated() uint16 { + return 0 +} + +func (*Ticker24hSymbolFullResponse) LastQtyMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*Ticker24hSymbolFullResponse) LastQtyMinValue() uint8 { + return 0 +} + +func (*Ticker24hSymbolFullResponse) LastQtyMaxValue() uint8 { + return math.MaxUint8 - 1 +} + +func (*Ticker24hSymbolFullResponse) LastQtyNullValue() uint8 { + return math.MaxUint8 +} + +func (*Ticker24hSymbolFullResponse) BidPriceId() uint16 { + return 9 +} + +func (*Ticker24hSymbolFullResponse) BidPriceSinceVersion() uint16 { + return 0 +} + +func (t *Ticker24hSymbolFullResponse) BidPriceInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.BidPriceSinceVersion() +} + +func (*Ticker24hSymbolFullResponse) BidPriceDeprecated() uint16 { + return 0 +} + +func (*Ticker24hSymbolFullResponse) BidPriceMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*Ticker24hSymbolFullResponse) BidPriceMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*Ticker24hSymbolFullResponse) BidPriceMaxValue() int64 { + return math.MaxInt64 +} + +func (*Ticker24hSymbolFullResponse) BidPriceNullValue() int64 { + return math.MinInt64 +} + +func (*Ticker24hSymbolFullResponse) BidQtyId() uint16 { + return 10 +} + +func (*Ticker24hSymbolFullResponse) BidQtySinceVersion() uint16 { + return 0 +} + +func (t *Ticker24hSymbolFullResponse) BidQtyInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.BidQtySinceVersion() +} + +func (*Ticker24hSymbolFullResponse) BidQtyDeprecated() uint16 { + return 0 +} + +func (*Ticker24hSymbolFullResponse) BidQtyMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*Ticker24hSymbolFullResponse) BidQtyMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*Ticker24hSymbolFullResponse) BidQtyMaxValue() int64 { + return math.MaxInt64 +} + +func (*Ticker24hSymbolFullResponse) BidQtyNullValue() int64 { + return math.MinInt64 +} + +func (*Ticker24hSymbolFullResponse) AskPriceId() uint16 { + return 11 +} + +func (*Ticker24hSymbolFullResponse) AskPriceSinceVersion() uint16 { + return 0 +} + +func (t *Ticker24hSymbolFullResponse) AskPriceInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.AskPriceSinceVersion() +} + +func (*Ticker24hSymbolFullResponse) AskPriceDeprecated() uint16 { + return 0 +} + +func (*Ticker24hSymbolFullResponse) AskPriceMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*Ticker24hSymbolFullResponse) AskPriceMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*Ticker24hSymbolFullResponse) AskPriceMaxValue() int64 { + return math.MaxInt64 +} + +func (*Ticker24hSymbolFullResponse) AskPriceNullValue() int64 { + return math.MinInt64 +} + +func (*Ticker24hSymbolFullResponse) AskQtyId() uint16 { + return 12 +} + +func (*Ticker24hSymbolFullResponse) AskQtySinceVersion() uint16 { + return 0 +} + +func (t *Ticker24hSymbolFullResponse) AskQtyInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.AskQtySinceVersion() +} + +func (*Ticker24hSymbolFullResponse) AskQtyDeprecated() uint16 { + return 0 +} + +func (*Ticker24hSymbolFullResponse) AskQtyMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*Ticker24hSymbolFullResponse) AskQtyMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*Ticker24hSymbolFullResponse) AskQtyMaxValue() int64 { + return math.MaxInt64 +} + +func (*Ticker24hSymbolFullResponse) AskQtyNullValue() int64 { + return math.MinInt64 +} + +func (*Ticker24hSymbolFullResponse) OpenPriceId() uint16 { + return 13 +} + +func (*Ticker24hSymbolFullResponse) OpenPriceSinceVersion() uint16 { + return 0 +} + +func (t *Ticker24hSymbolFullResponse) OpenPriceInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.OpenPriceSinceVersion() +} + +func (*Ticker24hSymbolFullResponse) OpenPriceDeprecated() uint16 { + return 0 +} + +func (*Ticker24hSymbolFullResponse) OpenPriceMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*Ticker24hSymbolFullResponse) OpenPriceMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*Ticker24hSymbolFullResponse) OpenPriceMaxValue() int64 { + return math.MaxInt64 +} + +func (*Ticker24hSymbolFullResponse) OpenPriceNullValue() int64 { + return math.MinInt64 +} + +func (*Ticker24hSymbolFullResponse) HighPriceId() uint16 { + return 14 +} + +func (*Ticker24hSymbolFullResponse) HighPriceSinceVersion() uint16 { + return 0 +} + +func (t *Ticker24hSymbolFullResponse) HighPriceInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.HighPriceSinceVersion() +} + +func (*Ticker24hSymbolFullResponse) HighPriceDeprecated() uint16 { + return 0 +} + +func (*Ticker24hSymbolFullResponse) HighPriceMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*Ticker24hSymbolFullResponse) HighPriceMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*Ticker24hSymbolFullResponse) HighPriceMaxValue() int64 { + return math.MaxInt64 +} + +func (*Ticker24hSymbolFullResponse) HighPriceNullValue() int64 { + return math.MinInt64 +} + +func (*Ticker24hSymbolFullResponse) LowPriceId() uint16 { + return 15 +} + +func (*Ticker24hSymbolFullResponse) LowPriceSinceVersion() uint16 { + return 0 +} + +func (t *Ticker24hSymbolFullResponse) LowPriceInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.LowPriceSinceVersion() +} + +func (*Ticker24hSymbolFullResponse) LowPriceDeprecated() uint16 { + return 0 +} + +func (*Ticker24hSymbolFullResponse) LowPriceMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*Ticker24hSymbolFullResponse) LowPriceMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*Ticker24hSymbolFullResponse) LowPriceMaxValue() int64 { + return math.MaxInt64 +} + +func (*Ticker24hSymbolFullResponse) LowPriceNullValue() int64 { + return math.MinInt64 +} + +func (*Ticker24hSymbolFullResponse) VolumeId() uint16 { + return 16 +} + +func (*Ticker24hSymbolFullResponse) VolumeSinceVersion() uint16 { + return 0 +} + +func (t *Ticker24hSymbolFullResponse) VolumeInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.VolumeSinceVersion() +} + +func (*Ticker24hSymbolFullResponse) VolumeDeprecated() uint16 { + return 0 +} + +func (*Ticker24hSymbolFullResponse) VolumeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*Ticker24hSymbolFullResponse) VolumeMinValue() uint8 { + return 0 +} + +func (*Ticker24hSymbolFullResponse) VolumeMaxValue() uint8 { + return math.MaxUint8 - 1 +} + +func (*Ticker24hSymbolFullResponse) VolumeNullValue() uint8 { + return math.MaxUint8 +} + +func (*Ticker24hSymbolFullResponse) QuoteVolumeId() uint16 { + return 17 +} + +func (*Ticker24hSymbolFullResponse) QuoteVolumeSinceVersion() uint16 { + return 0 +} + +func (t *Ticker24hSymbolFullResponse) QuoteVolumeInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.QuoteVolumeSinceVersion() +} + +func (*Ticker24hSymbolFullResponse) QuoteVolumeDeprecated() uint16 { + return 0 +} + +func (*Ticker24hSymbolFullResponse) QuoteVolumeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*Ticker24hSymbolFullResponse) QuoteVolumeMinValue() uint8 { + return 0 +} + +func (*Ticker24hSymbolFullResponse) QuoteVolumeMaxValue() uint8 { + return math.MaxUint8 - 1 +} + +func (*Ticker24hSymbolFullResponse) QuoteVolumeNullValue() uint8 { + return math.MaxUint8 +} + +func (*Ticker24hSymbolFullResponse) OpenTimeId() uint16 { + return 18 +} + +func (*Ticker24hSymbolFullResponse) OpenTimeSinceVersion() uint16 { + return 0 +} + +func (t *Ticker24hSymbolFullResponse) OpenTimeInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.OpenTimeSinceVersion() +} + +func (*Ticker24hSymbolFullResponse) OpenTimeDeprecated() uint16 { + return 0 +} + +func (*Ticker24hSymbolFullResponse) OpenTimeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*Ticker24hSymbolFullResponse) OpenTimeMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*Ticker24hSymbolFullResponse) OpenTimeMaxValue() int64 { + return math.MaxInt64 +} + +func (*Ticker24hSymbolFullResponse) OpenTimeNullValue() int64 { + return math.MinInt64 +} + +func (*Ticker24hSymbolFullResponse) CloseTimeId() uint16 { + return 19 +} + +func (*Ticker24hSymbolFullResponse) CloseTimeSinceVersion() uint16 { + return 0 +} + +func (t *Ticker24hSymbolFullResponse) CloseTimeInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.CloseTimeSinceVersion() +} + +func (*Ticker24hSymbolFullResponse) CloseTimeDeprecated() uint16 { + return 0 +} + +func (*Ticker24hSymbolFullResponse) CloseTimeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*Ticker24hSymbolFullResponse) CloseTimeMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*Ticker24hSymbolFullResponse) CloseTimeMaxValue() int64 { + return math.MaxInt64 +} + +func (*Ticker24hSymbolFullResponse) CloseTimeNullValue() int64 { + return math.MinInt64 +} + +func (*Ticker24hSymbolFullResponse) FirstIdId() uint16 { + return 20 +} + +func (*Ticker24hSymbolFullResponse) FirstIdSinceVersion() uint16 { + return 0 +} + +func (t *Ticker24hSymbolFullResponse) FirstIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.FirstIdSinceVersion() +} + +func (*Ticker24hSymbolFullResponse) FirstIdDeprecated() uint16 { + return 0 +} + +func (*Ticker24hSymbolFullResponse) FirstIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*Ticker24hSymbolFullResponse) FirstIdMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*Ticker24hSymbolFullResponse) FirstIdMaxValue() int64 { + return math.MaxInt64 +} + +func (*Ticker24hSymbolFullResponse) FirstIdNullValue() int64 { + return math.MinInt64 +} + +func (*Ticker24hSymbolFullResponse) LastIdId() uint16 { + return 21 +} + +func (*Ticker24hSymbolFullResponse) LastIdSinceVersion() uint16 { + return 0 +} + +func (t *Ticker24hSymbolFullResponse) LastIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.LastIdSinceVersion() +} + +func (*Ticker24hSymbolFullResponse) LastIdDeprecated() uint16 { + return 0 +} + +func (*Ticker24hSymbolFullResponse) LastIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*Ticker24hSymbolFullResponse) LastIdMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*Ticker24hSymbolFullResponse) LastIdMaxValue() int64 { + return math.MaxInt64 +} + +func (*Ticker24hSymbolFullResponse) LastIdNullValue() int64 { + return math.MinInt64 +} + +func (*Ticker24hSymbolFullResponse) NumTradesId() uint16 { + return 22 +} + +func (*Ticker24hSymbolFullResponse) NumTradesSinceVersion() uint16 { + return 0 +} + +func (t *Ticker24hSymbolFullResponse) NumTradesInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.NumTradesSinceVersion() +} + +func (*Ticker24hSymbolFullResponse) NumTradesDeprecated() uint16 { + return 0 +} + +func (*Ticker24hSymbolFullResponse) NumTradesMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*Ticker24hSymbolFullResponse) NumTradesMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*Ticker24hSymbolFullResponse) NumTradesMaxValue() int64 { + return math.MaxInt64 +} + +func (*Ticker24hSymbolFullResponse) NumTradesNullValue() int64 { + return math.MinInt64 +} + +func (*Ticker24hSymbolFullResponse) SymbolMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*Ticker24hSymbolFullResponse) SymbolSinceVersion() uint16 { + return 0 +} + +func (t *Ticker24hSymbolFullResponse) SymbolInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.SymbolSinceVersion() +} + +func (*Ticker24hSymbolFullResponse) SymbolDeprecated() uint16 { + return 0 +} + +func (Ticker24hSymbolFullResponse) SymbolCharacterEncoding() string { + return "UTF-8" +} + +func (Ticker24hSymbolFullResponse) SymbolHeaderLength() uint64 { + return 1 +} diff --git a/v2/sbe/spot_3_1/Ticker24hSymbolMiniResponse.go b/v2/sbe/spot_3_1/Ticker24hSymbolMiniResponse.go new file mode 100644 index 00000000..4e2ec863 --- /dev/null +++ b/v2/sbe/spot_3_1/Ticker24hSymbolMiniResponse.go @@ -0,0 +1,894 @@ +// Generated SBE (Simple Binary Encoding) message codec + +package sbe + +import ( + "errors" + "fmt" + "io" + "io/ioutil" + "math" + "unicode/utf8" +) + +type Ticker24hSymbolMiniResponse struct { + PriceExponent int8 + QtyExponent int8 + OpenPrice int64 + HighPrice int64 + LowPrice int64 + LastPrice int64 + Volume [16]uint8 + QuoteVolume [16]uint8 + OpenTime int64 + CloseTime int64 + FirstId int64 + LastId int64 + NumTrades int64 + Symbol []uint8 +} + +func (t *Ticker24hSymbolMiniResponse) Encode(_m *SbeGoMarshaller, _w io.Writer, doRangeCheck bool) error { + if doRangeCheck { + if err := t.RangeCheck(t.SbeSchemaVersion(), t.SbeSchemaVersion()); err != nil { + return err + } + } + if err := _m.WriteInt8(_w, t.PriceExponent); err != nil { + return err + } + if err := _m.WriteInt8(_w, t.QtyExponent); err != nil { + return err + } + if err := _m.WriteInt64(_w, t.OpenPrice); err != nil { + return err + } + if err := _m.WriteInt64(_w, t.HighPrice); err != nil { + return err + } + if err := _m.WriteInt64(_w, t.LowPrice); err != nil { + return err + } + if err := _m.WriteInt64(_w, t.LastPrice); err != nil { + return err + } + if err := _m.WriteBytes(_w, t.Volume[:]); err != nil { + return err + } + if err := _m.WriteBytes(_w, t.QuoteVolume[:]); err != nil { + return err + } + if err := _m.WriteInt64(_w, t.OpenTime); err != nil { + return err + } + if err := _m.WriteInt64(_w, t.CloseTime); err != nil { + return err + } + if err := _m.WriteInt64(_w, t.FirstId); err != nil { + return err + } + if err := _m.WriteInt64(_w, t.LastId); err != nil { + return err + } + if err := _m.WriteInt64(_w, t.NumTrades); err != nil { + return err + } + if err := _m.WriteUint8(_w, uint8(len(t.Symbol))); err != nil { + return err + } + if err := _m.WriteBytes(_w, t.Symbol); err != nil { + return err + } + return nil +} + +func (t *Ticker24hSymbolMiniResponse) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint16, doRangeCheck bool) error { + if !t.PriceExponentInActingVersion(actingVersion) { + t.PriceExponent = t.PriceExponentNullValue() + } else { + if err := _m.ReadInt8(_r, &t.PriceExponent); err != nil { + return err + } + } + if !t.QtyExponentInActingVersion(actingVersion) { + t.QtyExponent = t.QtyExponentNullValue() + } else { + if err := _m.ReadInt8(_r, &t.QtyExponent); err != nil { + return err + } + } + if !t.OpenPriceInActingVersion(actingVersion) { + t.OpenPrice = t.OpenPriceNullValue() + } else { + if err := _m.ReadInt64(_r, &t.OpenPrice); err != nil { + return err + } + } + if !t.HighPriceInActingVersion(actingVersion) { + t.HighPrice = t.HighPriceNullValue() + } else { + if err := _m.ReadInt64(_r, &t.HighPrice); err != nil { + return err + } + } + if !t.LowPriceInActingVersion(actingVersion) { + t.LowPrice = t.LowPriceNullValue() + } else { + if err := _m.ReadInt64(_r, &t.LowPrice); err != nil { + return err + } + } + if !t.LastPriceInActingVersion(actingVersion) { + t.LastPrice = t.LastPriceNullValue() + } else { + if err := _m.ReadInt64(_r, &t.LastPrice); err != nil { + return err + } + } + if !t.VolumeInActingVersion(actingVersion) { + for idx := 0; idx < 16; idx++ { + t.Volume[idx] = t.VolumeNullValue() + } + } else { + if err := _m.ReadBytes(_r, t.Volume[:]); err != nil { + return err + } + } + if !t.QuoteVolumeInActingVersion(actingVersion) { + for idx := 0; idx < 16; idx++ { + t.QuoteVolume[idx] = t.QuoteVolumeNullValue() + } + } else { + if err := _m.ReadBytes(_r, t.QuoteVolume[:]); err != nil { + return err + } + } + if !t.OpenTimeInActingVersion(actingVersion) { + t.OpenTime = t.OpenTimeNullValue() + } else { + if err := _m.ReadInt64(_r, &t.OpenTime); err != nil { + return err + } + } + if !t.CloseTimeInActingVersion(actingVersion) { + t.CloseTime = t.CloseTimeNullValue() + } else { + if err := _m.ReadInt64(_r, &t.CloseTime); err != nil { + return err + } + } + if !t.FirstIdInActingVersion(actingVersion) { + t.FirstId = t.FirstIdNullValue() + } else { + if err := _m.ReadInt64(_r, &t.FirstId); err != nil { + return err + } + } + if !t.LastIdInActingVersion(actingVersion) { + t.LastId = t.LastIdNullValue() + } else { + if err := _m.ReadInt64(_r, &t.LastId); err != nil { + return err + } + } + if !t.NumTradesInActingVersion(actingVersion) { + t.NumTrades = t.NumTradesNullValue() + } else { + if err := _m.ReadInt64(_r, &t.NumTrades); err != nil { + return err + } + } + if actingVersion > t.SbeSchemaVersion() && blockLength > t.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-t.SbeBlockLength())) + } + + if t.SymbolInActingVersion(actingVersion) { + var SymbolLength uint8 + if err := _m.ReadUint8(_r, &SymbolLength); err != nil { + return err + } + if cap(t.Symbol) < int(SymbolLength) { + t.Symbol = make([]uint8, SymbolLength) + } + t.Symbol = t.Symbol[:SymbolLength] + if err := _m.ReadBytes(_r, t.Symbol); err != nil { + return err + } + } + if doRangeCheck { + if err := t.RangeCheck(actingVersion, t.SbeSchemaVersion()); err != nil { + return err + } + } + return nil +} + +func (t *Ticker24hSymbolMiniResponse) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if t.PriceExponentInActingVersion(actingVersion) { + if t.PriceExponent < t.PriceExponentMinValue() || t.PriceExponent > t.PriceExponentMaxValue() { + return fmt.Errorf("Range check failed on t.PriceExponent (%v < %v > %v)", t.PriceExponentMinValue(), t.PriceExponent, t.PriceExponentMaxValue()) + } + } + if t.QtyExponentInActingVersion(actingVersion) { + if t.QtyExponent < t.QtyExponentMinValue() || t.QtyExponent > t.QtyExponentMaxValue() { + return fmt.Errorf("Range check failed on t.QtyExponent (%v < %v > %v)", t.QtyExponentMinValue(), t.QtyExponent, t.QtyExponentMaxValue()) + } + } + if t.OpenPriceInActingVersion(actingVersion) { + if t.OpenPrice != t.OpenPriceNullValue() && (t.OpenPrice < t.OpenPriceMinValue() || t.OpenPrice > t.OpenPriceMaxValue()) { + return fmt.Errorf("Range check failed on t.OpenPrice (%v < %v > %v)", t.OpenPriceMinValue(), t.OpenPrice, t.OpenPriceMaxValue()) + } + } + if t.HighPriceInActingVersion(actingVersion) { + if t.HighPrice != t.HighPriceNullValue() && (t.HighPrice < t.HighPriceMinValue() || t.HighPrice > t.HighPriceMaxValue()) { + return fmt.Errorf("Range check failed on t.HighPrice (%v < %v > %v)", t.HighPriceMinValue(), t.HighPrice, t.HighPriceMaxValue()) + } + } + if t.LowPriceInActingVersion(actingVersion) { + if t.LowPrice != t.LowPriceNullValue() && (t.LowPrice < t.LowPriceMinValue() || t.LowPrice > t.LowPriceMaxValue()) { + return fmt.Errorf("Range check failed on t.LowPrice (%v < %v > %v)", t.LowPriceMinValue(), t.LowPrice, t.LowPriceMaxValue()) + } + } + if t.LastPriceInActingVersion(actingVersion) { + if t.LastPrice != t.LastPriceNullValue() && (t.LastPrice < t.LastPriceMinValue() || t.LastPrice > t.LastPriceMaxValue()) { + return fmt.Errorf("Range check failed on t.LastPrice (%v < %v > %v)", t.LastPriceMinValue(), t.LastPrice, t.LastPriceMaxValue()) + } + } + if t.VolumeInActingVersion(actingVersion) { + for idx := 0; idx < 16; idx++ { + if t.Volume[idx] < t.VolumeMinValue() || t.Volume[idx] > t.VolumeMaxValue() { + return fmt.Errorf("Range check failed on t.Volume[%d] (%v < %v > %v)", idx, t.VolumeMinValue(), t.Volume[idx], t.VolumeMaxValue()) + } + } + } + if t.QuoteVolumeInActingVersion(actingVersion) { + for idx := 0; idx < 16; idx++ { + if t.QuoteVolume[idx] < t.QuoteVolumeMinValue() || t.QuoteVolume[idx] > t.QuoteVolumeMaxValue() { + return fmt.Errorf("Range check failed on t.QuoteVolume[%d] (%v < %v > %v)", idx, t.QuoteVolumeMinValue(), t.QuoteVolume[idx], t.QuoteVolumeMaxValue()) + } + } + } + if t.OpenTimeInActingVersion(actingVersion) { + if t.OpenTime < t.OpenTimeMinValue() || t.OpenTime > t.OpenTimeMaxValue() { + return fmt.Errorf("Range check failed on t.OpenTime (%v < %v > %v)", t.OpenTimeMinValue(), t.OpenTime, t.OpenTimeMaxValue()) + } + } + if t.CloseTimeInActingVersion(actingVersion) { + if t.CloseTime < t.CloseTimeMinValue() || t.CloseTime > t.CloseTimeMaxValue() { + return fmt.Errorf("Range check failed on t.CloseTime (%v < %v > %v)", t.CloseTimeMinValue(), t.CloseTime, t.CloseTimeMaxValue()) + } + } + if t.FirstIdInActingVersion(actingVersion) { + if t.FirstId != t.FirstIdNullValue() && (t.FirstId < t.FirstIdMinValue() || t.FirstId > t.FirstIdMaxValue()) { + return fmt.Errorf("Range check failed on t.FirstId (%v < %v > %v)", t.FirstIdMinValue(), t.FirstId, t.FirstIdMaxValue()) + } + } + if t.LastIdInActingVersion(actingVersion) { + if t.LastId != t.LastIdNullValue() && (t.LastId < t.LastIdMinValue() || t.LastId > t.LastIdMaxValue()) { + return fmt.Errorf("Range check failed on t.LastId (%v < %v > %v)", t.LastIdMinValue(), t.LastId, t.LastIdMaxValue()) + } + } + if t.NumTradesInActingVersion(actingVersion) { + if t.NumTrades < t.NumTradesMinValue() || t.NumTrades > t.NumTradesMaxValue() { + return fmt.Errorf("Range check failed on t.NumTrades (%v < %v > %v)", t.NumTradesMinValue(), t.NumTrades, t.NumTradesMaxValue()) + } + } + if !utf8.Valid(t.Symbol[:]) { + return errors.New("t.Symbol failed UTF-8 validation") + } + return nil +} + +func Ticker24hSymbolMiniResponseInit(t *Ticker24hSymbolMiniResponse) { + t.OpenPrice = math.MinInt64 + t.HighPrice = math.MinInt64 + t.LowPrice = math.MinInt64 + t.LastPrice = math.MinInt64 + t.FirstId = math.MinInt64 + t.LastId = math.MinInt64 + return +} + +func (*Ticker24hSymbolMiniResponse) SbeBlockLength() (blockLength uint16) { + return 106 +} + +func (*Ticker24hSymbolMiniResponse) SbeTemplateId() (templateId uint16) { + return 207 +} + +func (*Ticker24hSymbolMiniResponse) SbeSchemaId() (schemaId uint16) { + return 3 +} + +func (*Ticker24hSymbolMiniResponse) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} + +func (*Ticker24hSymbolMiniResponse) SbeSemanticType() (semanticType []byte) { + return []byte("") +} + +func (*Ticker24hSymbolMiniResponse) SbeSemanticVersion() (semanticVersion string) { + return "5.2" +} + +func (*Ticker24hSymbolMiniResponse) PriceExponentId() uint16 { + return 1 +} + +func (*Ticker24hSymbolMiniResponse) PriceExponentSinceVersion() uint16 { + return 0 +} + +func (t *Ticker24hSymbolMiniResponse) PriceExponentInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.PriceExponentSinceVersion() +} + +func (*Ticker24hSymbolMiniResponse) PriceExponentDeprecated() uint16 { + return 0 +} + +func (*Ticker24hSymbolMiniResponse) PriceExponentMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*Ticker24hSymbolMiniResponse) PriceExponentMinValue() int8 { + return math.MinInt8 + 1 +} + +func (*Ticker24hSymbolMiniResponse) PriceExponentMaxValue() int8 { + return math.MaxInt8 +} + +func (*Ticker24hSymbolMiniResponse) PriceExponentNullValue() int8 { + return math.MinInt8 +} + +func (*Ticker24hSymbolMiniResponse) QtyExponentId() uint16 { + return 2 +} + +func (*Ticker24hSymbolMiniResponse) QtyExponentSinceVersion() uint16 { + return 0 +} + +func (t *Ticker24hSymbolMiniResponse) QtyExponentInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.QtyExponentSinceVersion() +} + +func (*Ticker24hSymbolMiniResponse) QtyExponentDeprecated() uint16 { + return 0 +} + +func (*Ticker24hSymbolMiniResponse) QtyExponentMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*Ticker24hSymbolMiniResponse) QtyExponentMinValue() int8 { + return math.MinInt8 + 1 +} + +func (*Ticker24hSymbolMiniResponse) QtyExponentMaxValue() int8 { + return math.MaxInt8 +} + +func (*Ticker24hSymbolMiniResponse) QtyExponentNullValue() int8 { + return math.MinInt8 +} + +func (*Ticker24hSymbolMiniResponse) OpenPriceId() uint16 { + return 3 +} + +func (*Ticker24hSymbolMiniResponse) OpenPriceSinceVersion() uint16 { + return 0 +} + +func (t *Ticker24hSymbolMiniResponse) OpenPriceInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.OpenPriceSinceVersion() +} + +func (*Ticker24hSymbolMiniResponse) OpenPriceDeprecated() uint16 { + return 0 +} + +func (*Ticker24hSymbolMiniResponse) OpenPriceMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*Ticker24hSymbolMiniResponse) OpenPriceMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*Ticker24hSymbolMiniResponse) OpenPriceMaxValue() int64 { + return math.MaxInt64 +} + +func (*Ticker24hSymbolMiniResponse) OpenPriceNullValue() int64 { + return math.MinInt64 +} + +func (*Ticker24hSymbolMiniResponse) HighPriceId() uint16 { + return 4 +} + +func (*Ticker24hSymbolMiniResponse) HighPriceSinceVersion() uint16 { + return 0 +} + +func (t *Ticker24hSymbolMiniResponse) HighPriceInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.HighPriceSinceVersion() +} + +func (*Ticker24hSymbolMiniResponse) HighPriceDeprecated() uint16 { + return 0 +} + +func (*Ticker24hSymbolMiniResponse) HighPriceMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*Ticker24hSymbolMiniResponse) HighPriceMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*Ticker24hSymbolMiniResponse) HighPriceMaxValue() int64 { + return math.MaxInt64 +} + +func (*Ticker24hSymbolMiniResponse) HighPriceNullValue() int64 { + return math.MinInt64 +} + +func (*Ticker24hSymbolMiniResponse) LowPriceId() uint16 { + return 5 +} + +func (*Ticker24hSymbolMiniResponse) LowPriceSinceVersion() uint16 { + return 0 +} + +func (t *Ticker24hSymbolMiniResponse) LowPriceInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.LowPriceSinceVersion() +} + +func (*Ticker24hSymbolMiniResponse) LowPriceDeprecated() uint16 { + return 0 +} + +func (*Ticker24hSymbolMiniResponse) LowPriceMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*Ticker24hSymbolMiniResponse) LowPriceMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*Ticker24hSymbolMiniResponse) LowPriceMaxValue() int64 { + return math.MaxInt64 +} + +func (*Ticker24hSymbolMiniResponse) LowPriceNullValue() int64 { + return math.MinInt64 +} + +func (*Ticker24hSymbolMiniResponse) LastPriceId() uint16 { + return 6 +} + +func (*Ticker24hSymbolMiniResponse) LastPriceSinceVersion() uint16 { + return 0 +} + +func (t *Ticker24hSymbolMiniResponse) LastPriceInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.LastPriceSinceVersion() +} + +func (*Ticker24hSymbolMiniResponse) LastPriceDeprecated() uint16 { + return 0 +} + +func (*Ticker24hSymbolMiniResponse) LastPriceMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*Ticker24hSymbolMiniResponse) LastPriceMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*Ticker24hSymbolMiniResponse) LastPriceMaxValue() int64 { + return math.MaxInt64 +} + +func (*Ticker24hSymbolMiniResponse) LastPriceNullValue() int64 { + return math.MinInt64 +} + +func (*Ticker24hSymbolMiniResponse) VolumeId() uint16 { + return 7 +} + +func (*Ticker24hSymbolMiniResponse) VolumeSinceVersion() uint16 { + return 0 +} + +func (t *Ticker24hSymbolMiniResponse) VolumeInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.VolumeSinceVersion() +} + +func (*Ticker24hSymbolMiniResponse) VolumeDeprecated() uint16 { + return 0 +} + +func (*Ticker24hSymbolMiniResponse) VolumeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*Ticker24hSymbolMiniResponse) VolumeMinValue() uint8 { + return 0 +} + +func (*Ticker24hSymbolMiniResponse) VolumeMaxValue() uint8 { + return math.MaxUint8 - 1 +} + +func (*Ticker24hSymbolMiniResponse) VolumeNullValue() uint8 { + return math.MaxUint8 +} + +func (*Ticker24hSymbolMiniResponse) QuoteVolumeId() uint16 { + return 8 +} + +func (*Ticker24hSymbolMiniResponse) QuoteVolumeSinceVersion() uint16 { + return 0 +} + +func (t *Ticker24hSymbolMiniResponse) QuoteVolumeInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.QuoteVolumeSinceVersion() +} + +func (*Ticker24hSymbolMiniResponse) QuoteVolumeDeprecated() uint16 { + return 0 +} + +func (*Ticker24hSymbolMiniResponse) QuoteVolumeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*Ticker24hSymbolMiniResponse) QuoteVolumeMinValue() uint8 { + return 0 +} + +func (*Ticker24hSymbolMiniResponse) QuoteVolumeMaxValue() uint8 { + return math.MaxUint8 - 1 +} + +func (*Ticker24hSymbolMiniResponse) QuoteVolumeNullValue() uint8 { + return math.MaxUint8 +} + +func (*Ticker24hSymbolMiniResponse) OpenTimeId() uint16 { + return 9 +} + +func (*Ticker24hSymbolMiniResponse) OpenTimeSinceVersion() uint16 { + return 0 +} + +func (t *Ticker24hSymbolMiniResponse) OpenTimeInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.OpenTimeSinceVersion() +} + +func (*Ticker24hSymbolMiniResponse) OpenTimeDeprecated() uint16 { + return 0 +} + +func (*Ticker24hSymbolMiniResponse) OpenTimeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*Ticker24hSymbolMiniResponse) OpenTimeMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*Ticker24hSymbolMiniResponse) OpenTimeMaxValue() int64 { + return math.MaxInt64 +} + +func (*Ticker24hSymbolMiniResponse) OpenTimeNullValue() int64 { + return math.MinInt64 +} + +func (*Ticker24hSymbolMiniResponse) CloseTimeId() uint16 { + return 10 +} + +func (*Ticker24hSymbolMiniResponse) CloseTimeSinceVersion() uint16 { + return 0 +} + +func (t *Ticker24hSymbolMiniResponse) CloseTimeInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.CloseTimeSinceVersion() +} + +func (*Ticker24hSymbolMiniResponse) CloseTimeDeprecated() uint16 { + return 0 +} + +func (*Ticker24hSymbolMiniResponse) CloseTimeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*Ticker24hSymbolMiniResponse) CloseTimeMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*Ticker24hSymbolMiniResponse) CloseTimeMaxValue() int64 { + return math.MaxInt64 +} + +func (*Ticker24hSymbolMiniResponse) CloseTimeNullValue() int64 { + return math.MinInt64 +} + +func (*Ticker24hSymbolMiniResponse) FirstIdId() uint16 { + return 11 +} + +func (*Ticker24hSymbolMiniResponse) FirstIdSinceVersion() uint16 { + return 0 +} + +func (t *Ticker24hSymbolMiniResponse) FirstIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.FirstIdSinceVersion() +} + +func (*Ticker24hSymbolMiniResponse) FirstIdDeprecated() uint16 { + return 0 +} + +func (*Ticker24hSymbolMiniResponse) FirstIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*Ticker24hSymbolMiniResponse) FirstIdMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*Ticker24hSymbolMiniResponse) FirstIdMaxValue() int64 { + return math.MaxInt64 +} + +func (*Ticker24hSymbolMiniResponse) FirstIdNullValue() int64 { + return math.MinInt64 +} + +func (*Ticker24hSymbolMiniResponse) LastIdId() uint16 { + return 12 +} + +func (*Ticker24hSymbolMiniResponse) LastIdSinceVersion() uint16 { + return 0 +} + +func (t *Ticker24hSymbolMiniResponse) LastIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.LastIdSinceVersion() +} + +func (*Ticker24hSymbolMiniResponse) LastIdDeprecated() uint16 { + return 0 +} + +func (*Ticker24hSymbolMiniResponse) LastIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*Ticker24hSymbolMiniResponse) LastIdMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*Ticker24hSymbolMiniResponse) LastIdMaxValue() int64 { + return math.MaxInt64 +} + +func (*Ticker24hSymbolMiniResponse) LastIdNullValue() int64 { + return math.MinInt64 +} + +func (*Ticker24hSymbolMiniResponse) NumTradesId() uint16 { + return 13 +} + +func (*Ticker24hSymbolMiniResponse) NumTradesSinceVersion() uint16 { + return 0 +} + +func (t *Ticker24hSymbolMiniResponse) NumTradesInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.NumTradesSinceVersion() +} + +func (*Ticker24hSymbolMiniResponse) NumTradesDeprecated() uint16 { + return 0 +} + +func (*Ticker24hSymbolMiniResponse) NumTradesMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*Ticker24hSymbolMiniResponse) NumTradesMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*Ticker24hSymbolMiniResponse) NumTradesMaxValue() int64 { + return math.MaxInt64 +} + +func (*Ticker24hSymbolMiniResponse) NumTradesNullValue() int64 { + return math.MinInt64 +} + +func (*Ticker24hSymbolMiniResponse) SymbolMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*Ticker24hSymbolMiniResponse) SymbolSinceVersion() uint16 { + return 0 +} + +func (t *Ticker24hSymbolMiniResponse) SymbolInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.SymbolSinceVersion() +} + +func (*Ticker24hSymbolMiniResponse) SymbolDeprecated() uint16 { + return 0 +} + +func (Ticker24hSymbolMiniResponse) SymbolCharacterEncoding() string { + return "UTF-8" +} + +func (Ticker24hSymbolMiniResponse) SymbolHeaderLength() uint64 { + return 1 +} diff --git a/v2/sbe/spot_3_1/TickerFullResponse.go b/v2/sbe/spot_3_1/TickerFullResponse.go new file mode 100644 index 00000000..7296e912 --- /dev/null +++ b/v2/sbe/spot_3_1/TickerFullResponse.go @@ -0,0 +1,1155 @@ +// Generated SBE (Simple Binary Encoding) message codec + +package sbe + +import ( + "errors" + "fmt" + "io" + "io/ioutil" + "math" + "unicode/utf8" +) + +type TickerFullResponse struct { + Tickers []TickerFullResponseTickers +} +type TickerFullResponseTickers struct { + PriceExponent int8 + QtyExponent int8 + PriceChange int64 + PriceChangePercent float32 + WeightedAvgPrice int64 + OpenPrice int64 + HighPrice int64 + LowPrice int64 + LastPrice int64 + Volume [16]uint8 + QuoteVolume [16]uint8 + OpenTime int64 + CloseTime int64 + FirstId int64 + LastId int64 + NumTrades int64 + Symbol []uint8 +} + +func (t *TickerFullResponse) Encode(_m *SbeGoMarshaller, _w io.Writer, doRangeCheck bool) error { + if doRangeCheck { + if err := t.RangeCheck(t.SbeSchemaVersion(), t.SbeSchemaVersion()); err != nil { + return err + } + } + var TickersBlockLength uint16 = 126 + if err := _m.WriteUint16(_w, TickersBlockLength); err != nil { + return err + } + var TickersNumInGroup uint32 = uint32(len(t.Tickers)) + if err := _m.WriteUint32(_w, TickersNumInGroup); err != nil { + return err + } + for i := range t.Tickers { + if err := t.Tickers[i].Encode(_m, _w); err != nil { + return err + } + } + return nil +} + +func (t *TickerFullResponse) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint16, doRangeCheck bool) error { + if actingVersion > t.SbeSchemaVersion() && blockLength > t.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-t.SbeBlockLength())) + } + + if t.TickersInActingVersion(actingVersion) { + var TickersBlockLength uint16 + if err := _m.ReadUint16(_r, &TickersBlockLength); err != nil { + return err + } + var TickersNumInGroup uint32 + if err := _m.ReadUint32(_r, &TickersNumInGroup); err != nil { + return err + } + if cap(t.Tickers) < int(TickersNumInGroup) { + t.Tickers = make([]TickerFullResponseTickers, TickersNumInGroup) + } + t.Tickers = t.Tickers[:TickersNumInGroup] + for i := range t.Tickers { + if err := t.Tickers[i].Decode(_m, _r, actingVersion, uint(TickersBlockLength)); err != nil { + return err + } + } + } + if doRangeCheck { + if err := t.RangeCheck(actingVersion, t.SbeSchemaVersion()); err != nil { + return err + } + } + return nil +} + +func (t *TickerFullResponse) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + for i := range t.Tickers { + if err := t.Tickers[i].RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + } + return nil +} + +func TickerFullResponseInit(t *TickerFullResponse) { + return +} + +func (t *TickerFullResponseTickers) Encode(_m *SbeGoMarshaller, _w io.Writer) error { + if err := _m.WriteInt8(_w, t.PriceExponent); err != nil { + return err + } + if err := _m.WriteInt8(_w, t.QtyExponent); err != nil { + return err + } + if err := _m.WriteInt64(_w, t.PriceChange); err != nil { + return err + } + if err := _m.WriteFloat32(_w, t.PriceChangePercent); err != nil { + return err + } + if err := _m.WriteInt64(_w, t.WeightedAvgPrice); err != nil { + return err + } + if err := _m.WriteInt64(_w, t.OpenPrice); err != nil { + return err + } + if err := _m.WriteInt64(_w, t.HighPrice); err != nil { + return err + } + if err := _m.WriteInt64(_w, t.LowPrice); err != nil { + return err + } + if err := _m.WriteInt64(_w, t.LastPrice); err != nil { + return err + } + if err := _m.WriteBytes(_w, t.Volume[:]); err != nil { + return err + } + if err := _m.WriteBytes(_w, t.QuoteVolume[:]); err != nil { + return err + } + if err := _m.WriteInt64(_w, t.OpenTime); err != nil { + return err + } + if err := _m.WriteInt64(_w, t.CloseTime); err != nil { + return err + } + if err := _m.WriteInt64(_w, t.FirstId); err != nil { + return err + } + if err := _m.WriteInt64(_w, t.LastId); err != nil { + return err + } + if err := _m.WriteInt64(_w, t.NumTrades); err != nil { + return err + } + if err := _m.WriteUint8(_w, uint8(len(t.Symbol))); err != nil { + return err + } + if err := _m.WriteBytes(_w, t.Symbol); err != nil { + return err + } + return nil +} + +func (t *TickerFullResponseTickers) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint) error { + if !t.PriceExponentInActingVersion(actingVersion) { + t.PriceExponent = t.PriceExponentNullValue() + } else { + if err := _m.ReadInt8(_r, &t.PriceExponent); err != nil { + return err + } + } + if !t.QtyExponentInActingVersion(actingVersion) { + t.QtyExponent = t.QtyExponentNullValue() + } else { + if err := _m.ReadInt8(_r, &t.QtyExponent); err != nil { + return err + } + } + if !t.PriceChangeInActingVersion(actingVersion) { + t.PriceChange = t.PriceChangeNullValue() + } else { + if err := _m.ReadInt64(_r, &t.PriceChange); err != nil { + return err + } + } + if !t.PriceChangePercentInActingVersion(actingVersion) { + t.PriceChangePercent = t.PriceChangePercentNullValue() + } else { + if err := _m.ReadFloat32(_r, &t.PriceChangePercent); err != nil { + return err + } + } + if !t.WeightedAvgPriceInActingVersion(actingVersion) { + t.WeightedAvgPrice = t.WeightedAvgPriceNullValue() + } else { + if err := _m.ReadInt64(_r, &t.WeightedAvgPrice); err != nil { + return err + } + } + if !t.OpenPriceInActingVersion(actingVersion) { + t.OpenPrice = t.OpenPriceNullValue() + } else { + if err := _m.ReadInt64(_r, &t.OpenPrice); err != nil { + return err + } + } + if !t.HighPriceInActingVersion(actingVersion) { + t.HighPrice = t.HighPriceNullValue() + } else { + if err := _m.ReadInt64(_r, &t.HighPrice); err != nil { + return err + } + } + if !t.LowPriceInActingVersion(actingVersion) { + t.LowPrice = t.LowPriceNullValue() + } else { + if err := _m.ReadInt64(_r, &t.LowPrice); err != nil { + return err + } + } + if !t.LastPriceInActingVersion(actingVersion) { + t.LastPrice = t.LastPriceNullValue() + } else { + if err := _m.ReadInt64(_r, &t.LastPrice); err != nil { + return err + } + } + if !t.VolumeInActingVersion(actingVersion) { + for idx := 0; idx < 16; idx++ { + t.Volume[idx] = t.VolumeNullValue() + } + } else { + if err := _m.ReadBytes(_r, t.Volume[:]); err != nil { + return err + } + } + if !t.QuoteVolumeInActingVersion(actingVersion) { + for idx := 0; idx < 16; idx++ { + t.QuoteVolume[idx] = t.QuoteVolumeNullValue() + } + } else { + if err := _m.ReadBytes(_r, t.QuoteVolume[:]); err != nil { + return err + } + } + if !t.OpenTimeInActingVersion(actingVersion) { + t.OpenTime = t.OpenTimeNullValue() + } else { + if err := _m.ReadInt64(_r, &t.OpenTime); err != nil { + return err + } + } + if !t.CloseTimeInActingVersion(actingVersion) { + t.CloseTime = t.CloseTimeNullValue() + } else { + if err := _m.ReadInt64(_r, &t.CloseTime); err != nil { + return err + } + } + if !t.FirstIdInActingVersion(actingVersion) { + t.FirstId = t.FirstIdNullValue() + } else { + if err := _m.ReadInt64(_r, &t.FirstId); err != nil { + return err + } + } + if !t.LastIdInActingVersion(actingVersion) { + t.LastId = t.LastIdNullValue() + } else { + if err := _m.ReadInt64(_r, &t.LastId); err != nil { + return err + } + } + if !t.NumTradesInActingVersion(actingVersion) { + t.NumTrades = t.NumTradesNullValue() + } else { + if err := _m.ReadInt64(_r, &t.NumTrades); err != nil { + return err + } + } + if actingVersion > t.SbeSchemaVersion() && blockLength > t.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-t.SbeBlockLength())) + } + + if t.SymbolInActingVersion(actingVersion) { + var SymbolLength uint8 + if err := _m.ReadUint8(_r, &SymbolLength); err != nil { + return err + } + if cap(t.Symbol) < int(SymbolLength) { + t.Symbol = make([]uint8, SymbolLength) + } + t.Symbol = t.Symbol[:SymbolLength] + if err := _m.ReadBytes(_r, t.Symbol); err != nil { + return err + } + } + return nil +} + +func (t *TickerFullResponseTickers) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if t.PriceExponentInActingVersion(actingVersion) { + if t.PriceExponent < t.PriceExponentMinValue() || t.PriceExponent > t.PriceExponentMaxValue() { + return fmt.Errorf("Range check failed on t.PriceExponent (%v < %v > %v)", t.PriceExponentMinValue(), t.PriceExponent, t.PriceExponentMaxValue()) + } + } + if t.QtyExponentInActingVersion(actingVersion) { + if t.QtyExponent < t.QtyExponentMinValue() || t.QtyExponent > t.QtyExponentMaxValue() { + return fmt.Errorf("Range check failed on t.QtyExponent (%v < %v > %v)", t.QtyExponentMinValue(), t.QtyExponent, t.QtyExponentMaxValue()) + } + } + if t.PriceChangeInActingVersion(actingVersion) { + if t.PriceChange != t.PriceChangeNullValue() && (t.PriceChange < t.PriceChangeMinValue() || t.PriceChange > t.PriceChangeMaxValue()) { + return fmt.Errorf("Range check failed on t.PriceChange (%v < %v > %v)", t.PriceChangeMinValue(), t.PriceChange, t.PriceChangeMaxValue()) + } + } + if t.PriceChangePercentInActingVersion(actingVersion) { + if t.PriceChangePercent != t.PriceChangePercentNullValue() && (t.PriceChangePercent < t.PriceChangePercentMinValue() || t.PriceChangePercent > t.PriceChangePercentMaxValue()) { + return fmt.Errorf("Range check failed on t.PriceChangePercent (%v < %v > %v)", t.PriceChangePercentMinValue(), t.PriceChangePercent, t.PriceChangePercentMaxValue()) + } + } + if t.WeightedAvgPriceInActingVersion(actingVersion) { + if t.WeightedAvgPrice != t.WeightedAvgPriceNullValue() && (t.WeightedAvgPrice < t.WeightedAvgPriceMinValue() || t.WeightedAvgPrice > t.WeightedAvgPriceMaxValue()) { + return fmt.Errorf("Range check failed on t.WeightedAvgPrice (%v < %v > %v)", t.WeightedAvgPriceMinValue(), t.WeightedAvgPrice, t.WeightedAvgPriceMaxValue()) + } + } + if t.OpenPriceInActingVersion(actingVersion) { + if t.OpenPrice != t.OpenPriceNullValue() && (t.OpenPrice < t.OpenPriceMinValue() || t.OpenPrice > t.OpenPriceMaxValue()) { + return fmt.Errorf("Range check failed on t.OpenPrice (%v < %v > %v)", t.OpenPriceMinValue(), t.OpenPrice, t.OpenPriceMaxValue()) + } + } + if t.HighPriceInActingVersion(actingVersion) { + if t.HighPrice != t.HighPriceNullValue() && (t.HighPrice < t.HighPriceMinValue() || t.HighPrice > t.HighPriceMaxValue()) { + return fmt.Errorf("Range check failed on t.HighPrice (%v < %v > %v)", t.HighPriceMinValue(), t.HighPrice, t.HighPriceMaxValue()) + } + } + if t.LowPriceInActingVersion(actingVersion) { + if t.LowPrice != t.LowPriceNullValue() && (t.LowPrice < t.LowPriceMinValue() || t.LowPrice > t.LowPriceMaxValue()) { + return fmt.Errorf("Range check failed on t.LowPrice (%v < %v > %v)", t.LowPriceMinValue(), t.LowPrice, t.LowPriceMaxValue()) + } + } + if t.LastPriceInActingVersion(actingVersion) { + if t.LastPrice != t.LastPriceNullValue() && (t.LastPrice < t.LastPriceMinValue() || t.LastPrice > t.LastPriceMaxValue()) { + return fmt.Errorf("Range check failed on t.LastPrice (%v < %v > %v)", t.LastPriceMinValue(), t.LastPrice, t.LastPriceMaxValue()) + } + } + if t.VolumeInActingVersion(actingVersion) { + for idx := 0; idx < 16; idx++ { + if t.Volume[idx] < t.VolumeMinValue() || t.Volume[idx] > t.VolumeMaxValue() { + return fmt.Errorf("Range check failed on t.Volume[%d] (%v < %v > %v)", idx, t.VolumeMinValue(), t.Volume[idx], t.VolumeMaxValue()) + } + } + } + if t.QuoteVolumeInActingVersion(actingVersion) { + for idx := 0; idx < 16; idx++ { + if t.QuoteVolume[idx] < t.QuoteVolumeMinValue() || t.QuoteVolume[idx] > t.QuoteVolumeMaxValue() { + return fmt.Errorf("Range check failed on t.QuoteVolume[%d] (%v < %v > %v)", idx, t.QuoteVolumeMinValue(), t.QuoteVolume[idx], t.QuoteVolumeMaxValue()) + } + } + } + if t.OpenTimeInActingVersion(actingVersion) { + if t.OpenTime < t.OpenTimeMinValue() || t.OpenTime > t.OpenTimeMaxValue() { + return fmt.Errorf("Range check failed on t.OpenTime (%v < %v > %v)", t.OpenTimeMinValue(), t.OpenTime, t.OpenTimeMaxValue()) + } + } + if t.CloseTimeInActingVersion(actingVersion) { + if t.CloseTime < t.CloseTimeMinValue() || t.CloseTime > t.CloseTimeMaxValue() { + return fmt.Errorf("Range check failed on t.CloseTime (%v < %v > %v)", t.CloseTimeMinValue(), t.CloseTime, t.CloseTimeMaxValue()) + } + } + if t.FirstIdInActingVersion(actingVersion) { + if t.FirstId != t.FirstIdNullValue() && (t.FirstId < t.FirstIdMinValue() || t.FirstId > t.FirstIdMaxValue()) { + return fmt.Errorf("Range check failed on t.FirstId (%v < %v > %v)", t.FirstIdMinValue(), t.FirstId, t.FirstIdMaxValue()) + } + } + if t.LastIdInActingVersion(actingVersion) { + if t.LastId != t.LastIdNullValue() && (t.LastId < t.LastIdMinValue() || t.LastId > t.LastIdMaxValue()) { + return fmt.Errorf("Range check failed on t.LastId (%v < %v > %v)", t.LastIdMinValue(), t.LastId, t.LastIdMaxValue()) + } + } + if t.NumTradesInActingVersion(actingVersion) { + if t.NumTrades < t.NumTradesMinValue() || t.NumTrades > t.NumTradesMaxValue() { + return fmt.Errorf("Range check failed on t.NumTrades (%v < %v > %v)", t.NumTradesMinValue(), t.NumTrades, t.NumTradesMaxValue()) + } + } + if !utf8.Valid(t.Symbol[:]) { + return errors.New("t.Symbol failed UTF-8 validation") + } + return nil +} + +func TickerFullResponseTickersInit(t *TickerFullResponseTickers) { + t.PriceChange = math.MinInt64 + t.PriceChangePercent = float32(math.NaN()) + t.WeightedAvgPrice = math.MinInt64 + t.OpenPrice = math.MinInt64 + t.HighPrice = math.MinInt64 + t.LowPrice = math.MinInt64 + t.LastPrice = math.MinInt64 + t.FirstId = math.MinInt64 + t.LastId = math.MinInt64 + return +} + +func (*TickerFullResponse) SbeBlockLength() (blockLength uint16) { + return 0 +} + +func (*TickerFullResponse) SbeTemplateId() (templateId uint16) { + return 214 +} + +func (*TickerFullResponse) SbeSchemaId() (schemaId uint16) { + return 3 +} + +func (*TickerFullResponse) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} + +func (*TickerFullResponse) SbeSemanticType() (semanticType []byte) { + return []byte("") +} + +func (*TickerFullResponse) SbeSemanticVersion() (semanticVersion string) { + return "5.2" +} + +func (*TickerFullResponseTickers) PriceExponentId() uint16 { + return 1 +} + +func (*TickerFullResponseTickers) PriceExponentSinceVersion() uint16 { + return 0 +} + +func (t *TickerFullResponseTickers) PriceExponentInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.PriceExponentSinceVersion() +} + +func (*TickerFullResponseTickers) PriceExponentDeprecated() uint16 { + return 0 +} + +func (*TickerFullResponseTickers) PriceExponentMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*TickerFullResponseTickers) PriceExponentMinValue() int8 { + return math.MinInt8 + 1 +} + +func (*TickerFullResponseTickers) PriceExponentMaxValue() int8 { + return math.MaxInt8 +} + +func (*TickerFullResponseTickers) PriceExponentNullValue() int8 { + return math.MinInt8 +} + +func (*TickerFullResponseTickers) QtyExponentId() uint16 { + return 2 +} + +func (*TickerFullResponseTickers) QtyExponentSinceVersion() uint16 { + return 0 +} + +func (t *TickerFullResponseTickers) QtyExponentInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.QtyExponentSinceVersion() +} + +func (*TickerFullResponseTickers) QtyExponentDeprecated() uint16 { + return 0 +} + +func (*TickerFullResponseTickers) QtyExponentMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*TickerFullResponseTickers) QtyExponentMinValue() int8 { + return math.MinInt8 + 1 +} + +func (*TickerFullResponseTickers) QtyExponentMaxValue() int8 { + return math.MaxInt8 +} + +func (*TickerFullResponseTickers) QtyExponentNullValue() int8 { + return math.MinInt8 +} + +func (*TickerFullResponseTickers) PriceChangeId() uint16 { + return 3 +} + +func (*TickerFullResponseTickers) PriceChangeSinceVersion() uint16 { + return 0 +} + +func (t *TickerFullResponseTickers) PriceChangeInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.PriceChangeSinceVersion() +} + +func (*TickerFullResponseTickers) PriceChangeDeprecated() uint16 { + return 0 +} + +func (*TickerFullResponseTickers) PriceChangeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*TickerFullResponseTickers) PriceChangeMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*TickerFullResponseTickers) PriceChangeMaxValue() int64 { + return math.MaxInt64 +} + +func (*TickerFullResponseTickers) PriceChangeNullValue() int64 { + return math.MinInt64 +} + +func (*TickerFullResponseTickers) PriceChangePercentId() uint16 { + return 4 +} + +func (*TickerFullResponseTickers) PriceChangePercentSinceVersion() uint16 { + return 0 +} + +func (t *TickerFullResponseTickers) PriceChangePercentInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.PriceChangePercentSinceVersion() +} + +func (*TickerFullResponseTickers) PriceChangePercentDeprecated() uint16 { + return 0 +} + +func (*TickerFullResponseTickers) PriceChangePercentMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*TickerFullResponseTickers) PriceChangePercentMinValue() float32 { + return -math.MaxFloat32 +} + +func (*TickerFullResponseTickers) PriceChangePercentMaxValue() float32 { + return math.MaxFloat32 +} + +func (*TickerFullResponseTickers) PriceChangePercentNullValue() float32 { + return float32(math.NaN()) +} + +func (*TickerFullResponseTickers) WeightedAvgPriceId() uint16 { + return 5 +} + +func (*TickerFullResponseTickers) WeightedAvgPriceSinceVersion() uint16 { + return 0 +} + +func (t *TickerFullResponseTickers) WeightedAvgPriceInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.WeightedAvgPriceSinceVersion() +} + +func (*TickerFullResponseTickers) WeightedAvgPriceDeprecated() uint16 { + return 0 +} + +func (*TickerFullResponseTickers) WeightedAvgPriceMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*TickerFullResponseTickers) WeightedAvgPriceMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*TickerFullResponseTickers) WeightedAvgPriceMaxValue() int64 { + return math.MaxInt64 +} + +func (*TickerFullResponseTickers) WeightedAvgPriceNullValue() int64 { + return math.MinInt64 +} + +func (*TickerFullResponseTickers) OpenPriceId() uint16 { + return 6 +} + +func (*TickerFullResponseTickers) OpenPriceSinceVersion() uint16 { + return 0 +} + +func (t *TickerFullResponseTickers) OpenPriceInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.OpenPriceSinceVersion() +} + +func (*TickerFullResponseTickers) OpenPriceDeprecated() uint16 { + return 0 +} + +func (*TickerFullResponseTickers) OpenPriceMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*TickerFullResponseTickers) OpenPriceMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*TickerFullResponseTickers) OpenPriceMaxValue() int64 { + return math.MaxInt64 +} + +func (*TickerFullResponseTickers) OpenPriceNullValue() int64 { + return math.MinInt64 +} + +func (*TickerFullResponseTickers) HighPriceId() uint16 { + return 7 +} + +func (*TickerFullResponseTickers) HighPriceSinceVersion() uint16 { + return 0 +} + +func (t *TickerFullResponseTickers) HighPriceInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.HighPriceSinceVersion() +} + +func (*TickerFullResponseTickers) HighPriceDeprecated() uint16 { + return 0 +} + +func (*TickerFullResponseTickers) HighPriceMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*TickerFullResponseTickers) HighPriceMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*TickerFullResponseTickers) HighPriceMaxValue() int64 { + return math.MaxInt64 +} + +func (*TickerFullResponseTickers) HighPriceNullValue() int64 { + return math.MinInt64 +} + +func (*TickerFullResponseTickers) LowPriceId() uint16 { + return 8 +} + +func (*TickerFullResponseTickers) LowPriceSinceVersion() uint16 { + return 0 +} + +func (t *TickerFullResponseTickers) LowPriceInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.LowPriceSinceVersion() +} + +func (*TickerFullResponseTickers) LowPriceDeprecated() uint16 { + return 0 +} + +func (*TickerFullResponseTickers) LowPriceMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*TickerFullResponseTickers) LowPriceMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*TickerFullResponseTickers) LowPriceMaxValue() int64 { + return math.MaxInt64 +} + +func (*TickerFullResponseTickers) LowPriceNullValue() int64 { + return math.MinInt64 +} + +func (*TickerFullResponseTickers) LastPriceId() uint16 { + return 9 +} + +func (*TickerFullResponseTickers) LastPriceSinceVersion() uint16 { + return 0 +} + +func (t *TickerFullResponseTickers) LastPriceInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.LastPriceSinceVersion() +} + +func (*TickerFullResponseTickers) LastPriceDeprecated() uint16 { + return 0 +} + +func (*TickerFullResponseTickers) LastPriceMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*TickerFullResponseTickers) LastPriceMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*TickerFullResponseTickers) LastPriceMaxValue() int64 { + return math.MaxInt64 +} + +func (*TickerFullResponseTickers) LastPriceNullValue() int64 { + return math.MinInt64 +} + +func (*TickerFullResponseTickers) VolumeId() uint16 { + return 10 +} + +func (*TickerFullResponseTickers) VolumeSinceVersion() uint16 { + return 0 +} + +func (t *TickerFullResponseTickers) VolumeInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.VolumeSinceVersion() +} + +func (*TickerFullResponseTickers) VolumeDeprecated() uint16 { + return 0 +} + +func (*TickerFullResponseTickers) VolumeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*TickerFullResponseTickers) VolumeMinValue() uint8 { + return 0 +} + +func (*TickerFullResponseTickers) VolumeMaxValue() uint8 { + return math.MaxUint8 - 1 +} + +func (*TickerFullResponseTickers) VolumeNullValue() uint8 { + return math.MaxUint8 +} + +func (*TickerFullResponseTickers) QuoteVolumeId() uint16 { + return 11 +} + +func (*TickerFullResponseTickers) QuoteVolumeSinceVersion() uint16 { + return 0 +} + +func (t *TickerFullResponseTickers) QuoteVolumeInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.QuoteVolumeSinceVersion() +} + +func (*TickerFullResponseTickers) QuoteVolumeDeprecated() uint16 { + return 0 +} + +func (*TickerFullResponseTickers) QuoteVolumeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*TickerFullResponseTickers) QuoteVolumeMinValue() uint8 { + return 0 +} + +func (*TickerFullResponseTickers) QuoteVolumeMaxValue() uint8 { + return math.MaxUint8 - 1 +} + +func (*TickerFullResponseTickers) QuoteVolumeNullValue() uint8 { + return math.MaxUint8 +} + +func (*TickerFullResponseTickers) OpenTimeId() uint16 { + return 12 +} + +func (*TickerFullResponseTickers) OpenTimeSinceVersion() uint16 { + return 0 +} + +func (t *TickerFullResponseTickers) OpenTimeInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.OpenTimeSinceVersion() +} + +func (*TickerFullResponseTickers) OpenTimeDeprecated() uint16 { + return 0 +} + +func (*TickerFullResponseTickers) OpenTimeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*TickerFullResponseTickers) OpenTimeMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*TickerFullResponseTickers) OpenTimeMaxValue() int64 { + return math.MaxInt64 +} + +func (*TickerFullResponseTickers) OpenTimeNullValue() int64 { + return math.MinInt64 +} + +func (*TickerFullResponseTickers) CloseTimeId() uint16 { + return 13 +} + +func (*TickerFullResponseTickers) CloseTimeSinceVersion() uint16 { + return 0 +} + +func (t *TickerFullResponseTickers) CloseTimeInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.CloseTimeSinceVersion() +} + +func (*TickerFullResponseTickers) CloseTimeDeprecated() uint16 { + return 0 +} + +func (*TickerFullResponseTickers) CloseTimeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*TickerFullResponseTickers) CloseTimeMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*TickerFullResponseTickers) CloseTimeMaxValue() int64 { + return math.MaxInt64 +} + +func (*TickerFullResponseTickers) CloseTimeNullValue() int64 { + return math.MinInt64 +} + +func (*TickerFullResponseTickers) FirstIdId() uint16 { + return 14 +} + +func (*TickerFullResponseTickers) FirstIdSinceVersion() uint16 { + return 0 +} + +func (t *TickerFullResponseTickers) FirstIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.FirstIdSinceVersion() +} + +func (*TickerFullResponseTickers) FirstIdDeprecated() uint16 { + return 0 +} + +func (*TickerFullResponseTickers) FirstIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*TickerFullResponseTickers) FirstIdMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*TickerFullResponseTickers) FirstIdMaxValue() int64 { + return math.MaxInt64 +} + +func (*TickerFullResponseTickers) FirstIdNullValue() int64 { + return math.MinInt64 +} + +func (*TickerFullResponseTickers) LastIdId() uint16 { + return 15 +} + +func (*TickerFullResponseTickers) LastIdSinceVersion() uint16 { + return 0 +} + +func (t *TickerFullResponseTickers) LastIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.LastIdSinceVersion() +} + +func (*TickerFullResponseTickers) LastIdDeprecated() uint16 { + return 0 +} + +func (*TickerFullResponseTickers) LastIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*TickerFullResponseTickers) LastIdMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*TickerFullResponseTickers) LastIdMaxValue() int64 { + return math.MaxInt64 +} + +func (*TickerFullResponseTickers) LastIdNullValue() int64 { + return math.MinInt64 +} + +func (*TickerFullResponseTickers) NumTradesId() uint16 { + return 16 +} + +func (*TickerFullResponseTickers) NumTradesSinceVersion() uint16 { + return 0 +} + +func (t *TickerFullResponseTickers) NumTradesInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.NumTradesSinceVersion() +} + +func (*TickerFullResponseTickers) NumTradesDeprecated() uint16 { + return 0 +} + +func (*TickerFullResponseTickers) NumTradesMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*TickerFullResponseTickers) NumTradesMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*TickerFullResponseTickers) NumTradesMaxValue() int64 { + return math.MaxInt64 +} + +func (*TickerFullResponseTickers) NumTradesNullValue() int64 { + return math.MinInt64 +} + +func (*TickerFullResponseTickers) SymbolMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*TickerFullResponseTickers) SymbolSinceVersion() uint16 { + return 0 +} + +func (t *TickerFullResponseTickers) SymbolInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.SymbolSinceVersion() +} + +func (*TickerFullResponseTickers) SymbolDeprecated() uint16 { + return 0 +} + +func (TickerFullResponseTickers) SymbolCharacterEncoding() string { + return "UTF-8" +} + +func (TickerFullResponseTickers) SymbolHeaderLength() uint64 { + return 1 +} + +func (*TickerFullResponse) TickersId() uint16 { + return 100 +} + +func (*TickerFullResponse) TickersSinceVersion() uint16 { + return 0 +} + +func (t *TickerFullResponse) TickersInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.TickersSinceVersion() +} + +func (*TickerFullResponse) TickersDeprecated() uint16 { + return 0 +} + +func (*TickerFullResponseTickers) SbeBlockLength() (blockLength uint) { + return 126 +} + +func (*TickerFullResponseTickers) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} diff --git a/v2/sbe/spot_3_1/TickerMiniResponse.go b/v2/sbe/spot_3_1/TickerMiniResponse.go new file mode 100644 index 00000000..42ce6d3f --- /dev/null +++ b/v2/sbe/spot_3_1/TickerMiniResponse.go @@ -0,0 +1,978 @@ +// Generated SBE (Simple Binary Encoding) message codec + +package sbe + +import ( + "errors" + "fmt" + "io" + "io/ioutil" + "math" + "unicode/utf8" +) + +type TickerMiniResponse struct { + Tickers []TickerMiniResponseTickers +} +type TickerMiniResponseTickers struct { + PriceExponent int8 + QtyExponent int8 + OpenPrice int64 + HighPrice int64 + LowPrice int64 + LastPrice int64 + Volume [16]uint8 + QuoteVolume [16]uint8 + OpenTime int64 + CloseTime int64 + FirstId int64 + LastId int64 + NumTrades int64 + Symbol []uint8 +} + +func (t *TickerMiniResponse) Encode(_m *SbeGoMarshaller, _w io.Writer, doRangeCheck bool) error { + if doRangeCheck { + if err := t.RangeCheck(t.SbeSchemaVersion(), t.SbeSchemaVersion()); err != nil { + return err + } + } + var TickersBlockLength uint16 = 106 + if err := _m.WriteUint16(_w, TickersBlockLength); err != nil { + return err + } + var TickersNumInGroup uint32 = uint32(len(t.Tickers)) + if err := _m.WriteUint32(_w, TickersNumInGroup); err != nil { + return err + } + for i := range t.Tickers { + if err := t.Tickers[i].Encode(_m, _w); err != nil { + return err + } + } + return nil +} + +func (t *TickerMiniResponse) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint16, doRangeCheck bool) error { + if actingVersion > t.SbeSchemaVersion() && blockLength > t.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-t.SbeBlockLength())) + } + + if t.TickersInActingVersion(actingVersion) { + var TickersBlockLength uint16 + if err := _m.ReadUint16(_r, &TickersBlockLength); err != nil { + return err + } + var TickersNumInGroup uint32 + if err := _m.ReadUint32(_r, &TickersNumInGroup); err != nil { + return err + } + if cap(t.Tickers) < int(TickersNumInGroup) { + t.Tickers = make([]TickerMiniResponseTickers, TickersNumInGroup) + } + t.Tickers = t.Tickers[:TickersNumInGroup] + for i := range t.Tickers { + if err := t.Tickers[i].Decode(_m, _r, actingVersion, uint(TickersBlockLength)); err != nil { + return err + } + } + } + if doRangeCheck { + if err := t.RangeCheck(actingVersion, t.SbeSchemaVersion()); err != nil { + return err + } + } + return nil +} + +func (t *TickerMiniResponse) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + for i := range t.Tickers { + if err := t.Tickers[i].RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + } + return nil +} + +func TickerMiniResponseInit(t *TickerMiniResponse) { + return +} + +func (t *TickerMiniResponseTickers) Encode(_m *SbeGoMarshaller, _w io.Writer) error { + if err := _m.WriteInt8(_w, t.PriceExponent); err != nil { + return err + } + if err := _m.WriteInt8(_w, t.QtyExponent); err != nil { + return err + } + if err := _m.WriteInt64(_w, t.OpenPrice); err != nil { + return err + } + if err := _m.WriteInt64(_w, t.HighPrice); err != nil { + return err + } + if err := _m.WriteInt64(_w, t.LowPrice); err != nil { + return err + } + if err := _m.WriteInt64(_w, t.LastPrice); err != nil { + return err + } + if err := _m.WriteBytes(_w, t.Volume[:]); err != nil { + return err + } + if err := _m.WriteBytes(_w, t.QuoteVolume[:]); err != nil { + return err + } + if err := _m.WriteInt64(_w, t.OpenTime); err != nil { + return err + } + if err := _m.WriteInt64(_w, t.CloseTime); err != nil { + return err + } + if err := _m.WriteInt64(_w, t.FirstId); err != nil { + return err + } + if err := _m.WriteInt64(_w, t.LastId); err != nil { + return err + } + if err := _m.WriteInt64(_w, t.NumTrades); err != nil { + return err + } + if err := _m.WriteUint8(_w, uint8(len(t.Symbol))); err != nil { + return err + } + if err := _m.WriteBytes(_w, t.Symbol); err != nil { + return err + } + return nil +} + +func (t *TickerMiniResponseTickers) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint) error { + if !t.PriceExponentInActingVersion(actingVersion) { + t.PriceExponent = t.PriceExponentNullValue() + } else { + if err := _m.ReadInt8(_r, &t.PriceExponent); err != nil { + return err + } + } + if !t.QtyExponentInActingVersion(actingVersion) { + t.QtyExponent = t.QtyExponentNullValue() + } else { + if err := _m.ReadInt8(_r, &t.QtyExponent); err != nil { + return err + } + } + if !t.OpenPriceInActingVersion(actingVersion) { + t.OpenPrice = t.OpenPriceNullValue() + } else { + if err := _m.ReadInt64(_r, &t.OpenPrice); err != nil { + return err + } + } + if !t.HighPriceInActingVersion(actingVersion) { + t.HighPrice = t.HighPriceNullValue() + } else { + if err := _m.ReadInt64(_r, &t.HighPrice); err != nil { + return err + } + } + if !t.LowPriceInActingVersion(actingVersion) { + t.LowPrice = t.LowPriceNullValue() + } else { + if err := _m.ReadInt64(_r, &t.LowPrice); err != nil { + return err + } + } + if !t.LastPriceInActingVersion(actingVersion) { + t.LastPrice = t.LastPriceNullValue() + } else { + if err := _m.ReadInt64(_r, &t.LastPrice); err != nil { + return err + } + } + if !t.VolumeInActingVersion(actingVersion) { + for idx := 0; idx < 16; idx++ { + t.Volume[idx] = t.VolumeNullValue() + } + } else { + if err := _m.ReadBytes(_r, t.Volume[:]); err != nil { + return err + } + } + if !t.QuoteVolumeInActingVersion(actingVersion) { + for idx := 0; idx < 16; idx++ { + t.QuoteVolume[idx] = t.QuoteVolumeNullValue() + } + } else { + if err := _m.ReadBytes(_r, t.QuoteVolume[:]); err != nil { + return err + } + } + if !t.OpenTimeInActingVersion(actingVersion) { + t.OpenTime = t.OpenTimeNullValue() + } else { + if err := _m.ReadInt64(_r, &t.OpenTime); err != nil { + return err + } + } + if !t.CloseTimeInActingVersion(actingVersion) { + t.CloseTime = t.CloseTimeNullValue() + } else { + if err := _m.ReadInt64(_r, &t.CloseTime); err != nil { + return err + } + } + if !t.FirstIdInActingVersion(actingVersion) { + t.FirstId = t.FirstIdNullValue() + } else { + if err := _m.ReadInt64(_r, &t.FirstId); err != nil { + return err + } + } + if !t.LastIdInActingVersion(actingVersion) { + t.LastId = t.LastIdNullValue() + } else { + if err := _m.ReadInt64(_r, &t.LastId); err != nil { + return err + } + } + if !t.NumTradesInActingVersion(actingVersion) { + t.NumTrades = t.NumTradesNullValue() + } else { + if err := _m.ReadInt64(_r, &t.NumTrades); err != nil { + return err + } + } + if actingVersion > t.SbeSchemaVersion() && blockLength > t.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-t.SbeBlockLength())) + } + + if t.SymbolInActingVersion(actingVersion) { + var SymbolLength uint8 + if err := _m.ReadUint8(_r, &SymbolLength); err != nil { + return err + } + if cap(t.Symbol) < int(SymbolLength) { + t.Symbol = make([]uint8, SymbolLength) + } + t.Symbol = t.Symbol[:SymbolLength] + if err := _m.ReadBytes(_r, t.Symbol); err != nil { + return err + } + } + return nil +} + +func (t *TickerMiniResponseTickers) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if t.PriceExponentInActingVersion(actingVersion) { + if t.PriceExponent < t.PriceExponentMinValue() || t.PriceExponent > t.PriceExponentMaxValue() { + return fmt.Errorf("Range check failed on t.PriceExponent (%v < %v > %v)", t.PriceExponentMinValue(), t.PriceExponent, t.PriceExponentMaxValue()) + } + } + if t.QtyExponentInActingVersion(actingVersion) { + if t.QtyExponent < t.QtyExponentMinValue() || t.QtyExponent > t.QtyExponentMaxValue() { + return fmt.Errorf("Range check failed on t.QtyExponent (%v < %v > %v)", t.QtyExponentMinValue(), t.QtyExponent, t.QtyExponentMaxValue()) + } + } + if t.OpenPriceInActingVersion(actingVersion) { + if t.OpenPrice != t.OpenPriceNullValue() && (t.OpenPrice < t.OpenPriceMinValue() || t.OpenPrice > t.OpenPriceMaxValue()) { + return fmt.Errorf("Range check failed on t.OpenPrice (%v < %v > %v)", t.OpenPriceMinValue(), t.OpenPrice, t.OpenPriceMaxValue()) + } + } + if t.HighPriceInActingVersion(actingVersion) { + if t.HighPrice != t.HighPriceNullValue() && (t.HighPrice < t.HighPriceMinValue() || t.HighPrice > t.HighPriceMaxValue()) { + return fmt.Errorf("Range check failed on t.HighPrice (%v < %v > %v)", t.HighPriceMinValue(), t.HighPrice, t.HighPriceMaxValue()) + } + } + if t.LowPriceInActingVersion(actingVersion) { + if t.LowPrice != t.LowPriceNullValue() && (t.LowPrice < t.LowPriceMinValue() || t.LowPrice > t.LowPriceMaxValue()) { + return fmt.Errorf("Range check failed on t.LowPrice (%v < %v > %v)", t.LowPriceMinValue(), t.LowPrice, t.LowPriceMaxValue()) + } + } + if t.LastPriceInActingVersion(actingVersion) { + if t.LastPrice != t.LastPriceNullValue() && (t.LastPrice < t.LastPriceMinValue() || t.LastPrice > t.LastPriceMaxValue()) { + return fmt.Errorf("Range check failed on t.LastPrice (%v < %v > %v)", t.LastPriceMinValue(), t.LastPrice, t.LastPriceMaxValue()) + } + } + if t.VolumeInActingVersion(actingVersion) { + for idx := 0; idx < 16; idx++ { + if t.Volume[idx] < t.VolumeMinValue() || t.Volume[idx] > t.VolumeMaxValue() { + return fmt.Errorf("Range check failed on t.Volume[%d] (%v < %v > %v)", idx, t.VolumeMinValue(), t.Volume[idx], t.VolumeMaxValue()) + } + } + } + if t.QuoteVolumeInActingVersion(actingVersion) { + for idx := 0; idx < 16; idx++ { + if t.QuoteVolume[idx] < t.QuoteVolumeMinValue() || t.QuoteVolume[idx] > t.QuoteVolumeMaxValue() { + return fmt.Errorf("Range check failed on t.QuoteVolume[%d] (%v < %v > %v)", idx, t.QuoteVolumeMinValue(), t.QuoteVolume[idx], t.QuoteVolumeMaxValue()) + } + } + } + if t.OpenTimeInActingVersion(actingVersion) { + if t.OpenTime < t.OpenTimeMinValue() || t.OpenTime > t.OpenTimeMaxValue() { + return fmt.Errorf("Range check failed on t.OpenTime (%v < %v > %v)", t.OpenTimeMinValue(), t.OpenTime, t.OpenTimeMaxValue()) + } + } + if t.CloseTimeInActingVersion(actingVersion) { + if t.CloseTime < t.CloseTimeMinValue() || t.CloseTime > t.CloseTimeMaxValue() { + return fmt.Errorf("Range check failed on t.CloseTime (%v < %v > %v)", t.CloseTimeMinValue(), t.CloseTime, t.CloseTimeMaxValue()) + } + } + if t.FirstIdInActingVersion(actingVersion) { + if t.FirstId != t.FirstIdNullValue() && (t.FirstId < t.FirstIdMinValue() || t.FirstId > t.FirstIdMaxValue()) { + return fmt.Errorf("Range check failed on t.FirstId (%v < %v > %v)", t.FirstIdMinValue(), t.FirstId, t.FirstIdMaxValue()) + } + } + if t.LastIdInActingVersion(actingVersion) { + if t.LastId != t.LastIdNullValue() && (t.LastId < t.LastIdMinValue() || t.LastId > t.LastIdMaxValue()) { + return fmt.Errorf("Range check failed on t.LastId (%v < %v > %v)", t.LastIdMinValue(), t.LastId, t.LastIdMaxValue()) + } + } + if t.NumTradesInActingVersion(actingVersion) { + if t.NumTrades < t.NumTradesMinValue() || t.NumTrades > t.NumTradesMaxValue() { + return fmt.Errorf("Range check failed on t.NumTrades (%v < %v > %v)", t.NumTradesMinValue(), t.NumTrades, t.NumTradesMaxValue()) + } + } + if !utf8.Valid(t.Symbol[:]) { + return errors.New("t.Symbol failed UTF-8 validation") + } + return nil +} + +func TickerMiniResponseTickersInit(t *TickerMiniResponseTickers) { + t.OpenPrice = math.MinInt64 + t.HighPrice = math.MinInt64 + t.LowPrice = math.MinInt64 + t.LastPrice = math.MinInt64 + t.FirstId = math.MinInt64 + t.LastId = math.MinInt64 + return +} + +func (*TickerMiniResponse) SbeBlockLength() (blockLength uint16) { + return 0 +} + +func (*TickerMiniResponse) SbeTemplateId() (templateId uint16) { + return 216 +} + +func (*TickerMiniResponse) SbeSchemaId() (schemaId uint16) { + return 3 +} + +func (*TickerMiniResponse) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} + +func (*TickerMiniResponse) SbeSemanticType() (semanticType []byte) { + return []byte("") +} + +func (*TickerMiniResponse) SbeSemanticVersion() (semanticVersion string) { + return "5.2" +} + +func (*TickerMiniResponseTickers) PriceExponentId() uint16 { + return 1 +} + +func (*TickerMiniResponseTickers) PriceExponentSinceVersion() uint16 { + return 0 +} + +func (t *TickerMiniResponseTickers) PriceExponentInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.PriceExponentSinceVersion() +} + +func (*TickerMiniResponseTickers) PriceExponentDeprecated() uint16 { + return 0 +} + +func (*TickerMiniResponseTickers) PriceExponentMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*TickerMiniResponseTickers) PriceExponentMinValue() int8 { + return math.MinInt8 + 1 +} + +func (*TickerMiniResponseTickers) PriceExponentMaxValue() int8 { + return math.MaxInt8 +} + +func (*TickerMiniResponseTickers) PriceExponentNullValue() int8 { + return math.MinInt8 +} + +func (*TickerMiniResponseTickers) QtyExponentId() uint16 { + return 2 +} + +func (*TickerMiniResponseTickers) QtyExponentSinceVersion() uint16 { + return 0 +} + +func (t *TickerMiniResponseTickers) QtyExponentInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.QtyExponentSinceVersion() +} + +func (*TickerMiniResponseTickers) QtyExponentDeprecated() uint16 { + return 0 +} + +func (*TickerMiniResponseTickers) QtyExponentMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*TickerMiniResponseTickers) QtyExponentMinValue() int8 { + return math.MinInt8 + 1 +} + +func (*TickerMiniResponseTickers) QtyExponentMaxValue() int8 { + return math.MaxInt8 +} + +func (*TickerMiniResponseTickers) QtyExponentNullValue() int8 { + return math.MinInt8 +} + +func (*TickerMiniResponseTickers) OpenPriceId() uint16 { + return 3 +} + +func (*TickerMiniResponseTickers) OpenPriceSinceVersion() uint16 { + return 0 +} + +func (t *TickerMiniResponseTickers) OpenPriceInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.OpenPriceSinceVersion() +} + +func (*TickerMiniResponseTickers) OpenPriceDeprecated() uint16 { + return 0 +} + +func (*TickerMiniResponseTickers) OpenPriceMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*TickerMiniResponseTickers) OpenPriceMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*TickerMiniResponseTickers) OpenPriceMaxValue() int64 { + return math.MaxInt64 +} + +func (*TickerMiniResponseTickers) OpenPriceNullValue() int64 { + return math.MinInt64 +} + +func (*TickerMiniResponseTickers) HighPriceId() uint16 { + return 4 +} + +func (*TickerMiniResponseTickers) HighPriceSinceVersion() uint16 { + return 0 +} + +func (t *TickerMiniResponseTickers) HighPriceInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.HighPriceSinceVersion() +} + +func (*TickerMiniResponseTickers) HighPriceDeprecated() uint16 { + return 0 +} + +func (*TickerMiniResponseTickers) HighPriceMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*TickerMiniResponseTickers) HighPriceMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*TickerMiniResponseTickers) HighPriceMaxValue() int64 { + return math.MaxInt64 +} + +func (*TickerMiniResponseTickers) HighPriceNullValue() int64 { + return math.MinInt64 +} + +func (*TickerMiniResponseTickers) LowPriceId() uint16 { + return 5 +} + +func (*TickerMiniResponseTickers) LowPriceSinceVersion() uint16 { + return 0 +} + +func (t *TickerMiniResponseTickers) LowPriceInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.LowPriceSinceVersion() +} + +func (*TickerMiniResponseTickers) LowPriceDeprecated() uint16 { + return 0 +} + +func (*TickerMiniResponseTickers) LowPriceMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*TickerMiniResponseTickers) LowPriceMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*TickerMiniResponseTickers) LowPriceMaxValue() int64 { + return math.MaxInt64 +} + +func (*TickerMiniResponseTickers) LowPriceNullValue() int64 { + return math.MinInt64 +} + +func (*TickerMiniResponseTickers) LastPriceId() uint16 { + return 6 +} + +func (*TickerMiniResponseTickers) LastPriceSinceVersion() uint16 { + return 0 +} + +func (t *TickerMiniResponseTickers) LastPriceInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.LastPriceSinceVersion() +} + +func (*TickerMiniResponseTickers) LastPriceDeprecated() uint16 { + return 0 +} + +func (*TickerMiniResponseTickers) LastPriceMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*TickerMiniResponseTickers) LastPriceMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*TickerMiniResponseTickers) LastPriceMaxValue() int64 { + return math.MaxInt64 +} + +func (*TickerMiniResponseTickers) LastPriceNullValue() int64 { + return math.MinInt64 +} + +func (*TickerMiniResponseTickers) VolumeId() uint16 { + return 7 +} + +func (*TickerMiniResponseTickers) VolumeSinceVersion() uint16 { + return 0 +} + +func (t *TickerMiniResponseTickers) VolumeInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.VolumeSinceVersion() +} + +func (*TickerMiniResponseTickers) VolumeDeprecated() uint16 { + return 0 +} + +func (*TickerMiniResponseTickers) VolumeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*TickerMiniResponseTickers) VolumeMinValue() uint8 { + return 0 +} + +func (*TickerMiniResponseTickers) VolumeMaxValue() uint8 { + return math.MaxUint8 - 1 +} + +func (*TickerMiniResponseTickers) VolumeNullValue() uint8 { + return math.MaxUint8 +} + +func (*TickerMiniResponseTickers) QuoteVolumeId() uint16 { + return 8 +} + +func (*TickerMiniResponseTickers) QuoteVolumeSinceVersion() uint16 { + return 0 +} + +func (t *TickerMiniResponseTickers) QuoteVolumeInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.QuoteVolumeSinceVersion() +} + +func (*TickerMiniResponseTickers) QuoteVolumeDeprecated() uint16 { + return 0 +} + +func (*TickerMiniResponseTickers) QuoteVolumeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*TickerMiniResponseTickers) QuoteVolumeMinValue() uint8 { + return 0 +} + +func (*TickerMiniResponseTickers) QuoteVolumeMaxValue() uint8 { + return math.MaxUint8 - 1 +} + +func (*TickerMiniResponseTickers) QuoteVolumeNullValue() uint8 { + return math.MaxUint8 +} + +func (*TickerMiniResponseTickers) OpenTimeId() uint16 { + return 9 +} + +func (*TickerMiniResponseTickers) OpenTimeSinceVersion() uint16 { + return 0 +} + +func (t *TickerMiniResponseTickers) OpenTimeInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.OpenTimeSinceVersion() +} + +func (*TickerMiniResponseTickers) OpenTimeDeprecated() uint16 { + return 0 +} + +func (*TickerMiniResponseTickers) OpenTimeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*TickerMiniResponseTickers) OpenTimeMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*TickerMiniResponseTickers) OpenTimeMaxValue() int64 { + return math.MaxInt64 +} + +func (*TickerMiniResponseTickers) OpenTimeNullValue() int64 { + return math.MinInt64 +} + +func (*TickerMiniResponseTickers) CloseTimeId() uint16 { + return 10 +} + +func (*TickerMiniResponseTickers) CloseTimeSinceVersion() uint16 { + return 0 +} + +func (t *TickerMiniResponseTickers) CloseTimeInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.CloseTimeSinceVersion() +} + +func (*TickerMiniResponseTickers) CloseTimeDeprecated() uint16 { + return 0 +} + +func (*TickerMiniResponseTickers) CloseTimeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*TickerMiniResponseTickers) CloseTimeMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*TickerMiniResponseTickers) CloseTimeMaxValue() int64 { + return math.MaxInt64 +} + +func (*TickerMiniResponseTickers) CloseTimeNullValue() int64 { + return math.MinInt64 +} + +func (*TickerMiniResponseTickers) FirstIdId() uint16 { + return 11 +} + +func (*TickerMiniResponseTickers) FirstIdSinceVersion() uint16 { + return 0 +} + +func (t *TickerMiniResponseTickers) FirstIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.FirstIdSinceVersion() +} + +func (*TickerMiniResponseTickers) FirstIdDeprecated() uint16 { + return 0 +} + +func (*TickerMiniResponseTickers) FirstIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*TickerMiniResponseTickers) FirstIdMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*TickerMiniResponseTickers) FirstIdMaxValue() int64 { + return math.MaxInt64 +} + +func (*TickerMiniResponseTickers) FirstIdNullValue() int64 { + return math.MinInt64 +} + +func (*TickerMiniResponseTickers) LastIdId() uint16 { + return 12 +} + +func (*TickerMiniResponseTickers) LastIdSinceVersion() uint16 { + return 0 +} + +func (t *TickerMiniResponseTickers) LastIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.LastIdSinceVersion() +} + +func (*TickerMiniResponseTickers) LastIdDeprecated() uint16 { + return 0 +} + +func (*TickerMiniResponseTickers) LastIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*TickerMiniResponseTickers) LastIdMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*TickerMiniResponseTickers) LastIdMaxValue() int64 { + return math.MaxInt64 +} + +func (*TickerMiniResponseTickers) LastIdNullValue() int64 { + return math.MinInt64 +} + +func (*TickerMiniResponseTickers) NumTradesId() uint16 { + return 13 +} + +func (*TickerMiniResponseTickers) NumTradesSinceVersion() uint16 { + return 0 +} + +func (t *TickerMiniResponseTickers) NumTradesInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.NumTradesSinceVersion() +} + +func (*TickerMiniResponseTickers) NumTradesDeprecated() uint16 { + return 0 +} + +func (*TickerMiniResponseTickers) NumTradesMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*TickerMiniResponseTickers) NumTradesMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*TickerMiniResponseTickers) NumTradesMaxValue() int64 { + return math.MaxInt64 +} + +func (*TickerMiniResponseTickers) NumTradesNullValue() int64 { + return math.MinInt64 +} + +func (*TickerMiniResponseTickers) SymbolMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*TickerMiniResponseTickers) SymbolSinceVersion() uint16 { + return 0 +} + +func (t *TickerMiniResponseTickers) SymbolInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.SymbolSinceVersion() +} + +func (*TickerMiniResponseTickers) SymbolDeprecated() uint16 { + return 0 +} + +func (TickerMiniResponseTickers) SymbolCharacterEncoding() string { + return "UTF-8" +} + +func (TickerMiniResponseTickers) SymbolHeaderLength() uint64 { + return 1 +} + +func (*TickerMiniResponse) TickersId() uint16 { + return 100 +} + +func (*TickerMiniResponse) TickersSinceVersion() uint16 { + return 0 +} + +func (t *TickerMiniResponse) TickersInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.TickersSinceVersion() +} + +func (*TickerMiniResponse) TickersDeprecated() uint16 { + return 0 +} + +func (*TickerMiniResponseTickers) SbeBlockLength() (blockLength uint) { + return 106 +} + +func (*TickerMiniResponseTickers) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} diff --git a/v2/sbe/spot_3_1/TickerSymbolFullResponse.go b/v2/sbe/spot_3_1/TickerSymbolFullResponse.go new file mode 100644 index 00000000..40cd2daa --- /dev/null +++ b/v2/sbe/spot_3_1/TickerSymbolFullResponse.go @@ -0,0 +1,1071 @@ +// Generated SBE (Simple Binary Encoding) message codec + +package sbe + +import ( + "errors" + "fmt" + "io" + "io/ioutil" + "math" + "unicode/utf8" +) + +type TickerSymbolFullResponse struct { + PriceExponent int8 + QtyExponent int8 + PriceChange int64 + PriceChangePercent float32 + WeightedAvgPrice int64 + OpenPrice int64 + HighPrice int64 + LowPrice int64 + LastPrice int64 + Volume [16]uint8 + QuoteVolume [16]uint8 + OpenTime int64 + CloseTime int64 + FirstId int64 + LastId int64 + NumTrades int64 + Symbol []uint8 +} + +func (t *TickerSymbolFullResponse) Encode(_m *SbeGoMarshaller, _w io.Writer, doRangeCheck bool) error { + if doRangeCheck { + if err := t.RangeCheck(t.SbeSchemaVersion(), t.SbeSchemaVersion()); err != nil { + return err + } + } + if err := _m.WriteInt8(_w, t.PriceExponent); err != nil { + return err + } + if err := _m.WriteInt8(_w, t.QtyExponent); err != nil { + return err + } + if err := _m.WriteInt64(_w, t.PriceChange); err != nil { + return err + } + if err := _m.WriteFloat32(_w, t.PriceChangePercent); err != nil { + return err + } + if err := _m.WriteInt64(_w, t.WeightedAvgPrice); err != nil { + return err + } + if err := _m.WriteInt64(_w, t.OpenPrice); err != nil { + return err + } + if err := _m.WriteInt64(_w, t.HighPrice); err != nil { + return err + } + if err := _m.WriteInt64(_w, t.LowPrice); err != nil { + return err + } + if err := _m.WriteInt64(_w, t.LastPrice); err != nil { + return err + } + if err := _m.WriteBytes(_w, t.Volume[:]); err != nil { + return err + } + if err := _m.WriteBytes(_w, t.QuoteVolume[:]); err != nil { + return err + } + if err := _m.WriteInt64(_w, t.OpenTime); err != nil { + return err + } + if err := _m.WriteInt64(_w, t.CloseTime); err != nil { + return err + } + if err := _m.WriteInt64(_w, t.FirstId); err != nil { + return err + } + if err := _m.WriteInt64(_w, t.LastId); err != nil { + return err + } + if err := _m.WriteInt64(_w, t.NumTrades); err != nil { + return err + } + if err := _m.WriteUint8(_w, uint8(len(t.Symbol))); err != nil { + return err + } + if err := _m.WriteBytes(_w, t.Symbol); err != nil { + return err + } + return nil +} + +func (t *TickerSymbolFullResponse) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint16, doRangeCheck bool) error { + if !t.PriceExponentInActingVersion(actingVersion) { + t.PriceExponent = t.PriceExponentNullValue() + } else { + if err := _m.ReadInt8(_r, &t.PriceExponent); err != nil { + return err + } + } + if !t.QtyExponentInActingVersion(actingVersion) { + t.QtyExponent = t.QtyExponentNullValue() + } else { + if err := _m.ReadInt8(_r, &t.QtyExponent); err != nil { + return err + } + } + if !t.PriceChangeInActingVersion(actingVersion) { + t.PriceChange = t.PriceChangeNullValue() + } else { + if err := _m.ReadInt64(_r, &t.PriceChange); err != nil { + return err + } + } + if !t.PriceChangePercentInActingVersion(actingVersion) { + t.PriceChangePercent = t.PriceChangePercentNullValue() + } else { + if err := _m.ReadFloat32(_r, &t.PriceChangePercent); err != nil { + return err + } + } + if !t.WeightedAvgPriceInActingVersion(actingVersion) { + t.WeightedAvgPrice = t.WeightedAvgPriceNullValue() + } else { + if err := _m.ReadInt64(_r, &t.WeightedAvgPrice); err != nil { + return err + } + } + if !t.OpenPriceInActingVersion(actingVersion) { + t.OpenPrice = t.OpenPriceNullValue() + } else { + if err := _m.ReadInt64(_r, &t.OpenPrice); err != nil { + return err + } + } + if !t.HighPriceInActingVersion(actingVersion) { + t.HighPrice = t.HighPriceNullValue() + } else { + if err := _m.ReadInt64(_r, &t.HighPrice); err != nil { + return err + } + } + if !t.LowPriceInActingVersion(actingVersion) { + t.LowPrice = t.LowPriceNullValue() + } else { + if err := _m.ReadInt64(_r, &t.LowPrice); err != nil { + return err + } + } + if !t.LastPriceInActingVersion(actingVersion) { + t.LastPrice = t.LastPriceNullValue() + } else { + if err := _m.ReadInt64(_r, &t.LastPrice); err != nil { + return err + } + } + if !t.VolumeInActingVersion(actingVersion) { + for idx := 0; idx < 16; idx++ { + t.Volume[idx] = t.VolumeNullValue() + } + } else { + if err := _m.ReadBytes(_r, t.Volume[:]); err != nil { + return err + } + } + if !t.QuoteVolumeInActingVersion(actingVersion) { + for idx := 0; idx < 16; idx++ { + t.QuoteVolume[idx] = t.QuoteVolumeNullValue() + } + } else { + if err := _m.ReadBytes(_r, t.QuoteVolume[:]); err != nil { + return err + } + } + if !t.OpenTimeInActingVersion(actingVersion) { + t.OpenTime = t.OpenTimeNullValue() + } else { + if err := _m.ReadInt64(_r, &t.OpenTime); err != nil { + return err + } + } + if !t.CloseTimeInActingVersion(actingVersion) { + t.CloseTime = t.CloseTimeNullValue() + } else { + if err := _m.ReadInt64(_r, &t.CloseTime); err != nil { + return err + } + } + if !t.FirstIdInActingVersion(actingVersion) { + t.FirstId = t.FirstIdNullValue() + } else { + if err := _m.ReadInt64(_r, &t.FirstId); err != nil { + return err + } + } + if !t.LastIdInActingVersion(actingVersion) { + t.LastId = t.LastIdNullValue() + } else { + if err := _m.ReadInt64(_r, &t.LastId); err != nil { + return err + } + } + if !t.NumTradesInActingVersion(actingVersion) { + t.NumTrades = t.NumTradesNullValue() + } else { + if err := _m.ReadInt64(_r, &t.NumTrades); err != nil { + return err + } + } + if actingVersion > t.SbeSchemaVersion() && blockLength > t.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-t.SbeBlockLength())) + } + + if t.SymbolInActingVersion(actingVersion) { + var SymbolLength uint8 + if err := _m.ReadUint8(_r, &SymbolLength); err != nil { + return err + } + if cap(t.Symbol) < int(SymbolLength) { + t.Symbol = make([]uint8, SymbolLength) + } + t.Symbol = t.Symbol[:SymbolLength] + if err := _m.ReadBytes(_r, t.Symbol); err != nil { + return err + } + } + if doRangeCheck { + if err := t.RangeCheck(actingVersion, t.SbeSchemaVersion()); err != nil { + return err + } + } + return nil +} + +func (t *TickerSymbolFullResponse) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if t.PriceExponentInActingVersion(actingVersion) { + if t.PriceExponent < t.PriceExponentMinValue() || t.PriceExponent > t.PriceExponentMaxValue() { + return fmt.Errorf("Range check failed on t.PriceExponent (%v < %v > %v)", t.PriceExponentMinValue(), t.PriceExponent, t.PriceExponentMaxValue()) + } + } + if t.QtyExponentInActingVersion(actingVersion) { + if t.QtyExponent < t.QtyExponentMinValue() || t.QtyExponent > t.QtyExponentMaxValue() { + return fmt.Errorf("Range check failed on t.QtyExponent (%v < %v > %v)", t.QtyExponentMinValue(), t.QtyExponent, t.QtyExponentMaxValue()) + } + } + if t.PriceChangeInActingVersion(actingVersion) { + if t.PriceChange != t.PriceChangeNullValue() && (t.PriceChange < t.PriceChangeMinValue() || t.PriceChange > t.PriceChangeMaxValue()) { + return fmt.Errorf("Range check failed on t.PriceChange (%v < %v > %v)", t.PriceChangeMinValue(), t.PriceChange, t.PriceChangeMaxValue()) + } + } + if t.PriceChangePercentInActingVersion(actingVersion) { + if t.PriceChangePercent != t.PriceChangePercentNullValue() && (t.PriceChangePercent < t.PriceChangePercentMinValue() || t.PriceChangePercent > t.PriceChangePercentMaxValue()) { + return fmt.Errorf("Range check failed on t.PriceChangePercent (%v < %v > %v)", t.PriceChangePercentMinValue(), t.PriceChangePercent, t.PriceChangePercentMaxValue()) + } + } + if t.WeightedAvgPriceInActingVersion(actingVersion) { + if t.WeightedAvgPrice != t.WeightedAvgPriceNullValue() && (t.WeightedAvgPrice < t.WeightedAvgPriceMinValue() || t.WeightedAvgPrice > t.WeightedAvgPriceMaxValue()) { + return fmt.Errorf("Range check failed on t.WeightedAvgPrice (%v < %v > %v)", t.WeightedAvgPriceMinValue(), t.WeightedAvgPrice, t.WeightedAvgPriceMaxValue()) + } + } + if t.OpenPriceInActingVersion(actingVersion) { + if t.OpenPrice != t.OpenPriceNullValue() && (t.OpenPrice < t.OpenPriceMinValue() || t.OpenPrice > t.OpenPriceMaxValue()) { + return fmt.Errorf("Range check failed on t.OpenPrice (%v < %v > %v)", t.OpenPriceMinValue(), t.OpenPrice, t.OpenPriceMaxValue()) + } + } + if t.HighPriceInActingVersion(actingVersion) { + if t.HighPrice != t.HighPriceNullValue() && (t.HighPrice < t.HighPriceMinValue() || t.HighPrice > t.HighPriceMaxValue()) { + return fmt.Errorf("Range check failed on t.HighPrice (%v < %v > %v)", t.HighPriceMinValue(), t.HighPrice, t.HighPriceMaxValue()) + } + } + if t.LowPriceInActingVersion(actingVersion) { + if t.LowPrice != t.LowPriceNullValue() && (t.LowPrice < t.LowPriceMinValue() || t.LowPrice > t.LowPriceMaxValue()) { + return fmt.Errorf("Range check failed on t.LowPrice (%v < %v > %v)", t.LowPriceMinValue(), t.LowPrice, t.LowPriceMaxValue()) + } + } + if t.LastPriceInActingVersion(actingVersion) { + if t.LastPrice != t.LastPriceNullValue() && (t.LastPrice < t.LastPriceMinValue() || t.LastPrice > t.LastPriceMaxValue()) { + return fmt.Errorf("Range check failed on t.LastPrice (%v < %v > %v)", t.LastPriceMinValue(), t.LastPrice, t.LastPriceMaxValue()) + } + } + if t.VolumeInActingVersion(actingVersion) { + for idx := 0; idx < 16; idx++ { + if t.Volume[idx] < t.VolumeMinValue() || t.Volume[idx] > t.VolumeMaxValue() { + return fmt.Errorf("Range check failed on t.Volume[%d] (%v < %v > %v)", idx, t.VolumeMinValue(), t.Volume[idx], t.VolumeMaxValue()) + } + } + } + if t.QuoteVolumeInActingVersion(actingVersion) { + for idx := 0; idx < 16; idx++ { + if t.QuoteVolume[idx] < t.QuoteVolumeMinValue() || t.QuoteVolume[idx] > t.QuoteVolumeMaxValue() { + return fmt.Errorf("Range check failed on t.QuoteVolume[%d] (%v < %v > %v)", idx, t.QuoteVolumeMinValue(), t.QuoteVolume[idx], t.QuoteVolumeMaxValue()) + } + } + } + if t.OpenTimeInActingVersion(actingVersion) { + if t.OpenTime < t.OpenTimeMinValue() || t.OpenTime > t.OpenTimeMaxValue() { + return fmt.Errorf("Range check failed on t.OpenTime (%v < %v > %v)", t.OpenTimeMinValue(), t.OpenTime, t.OpenTimeMaxValue()) + } + } + if t.CloseTimeInActingVersion(actingVersion) { + if t.CloseTime < t.CloseTimeMinValue() || t.CloseTime > t.CloseTimeMaxValue() { + return fmt.Errorf("Range check failed on t.CloseTime (%v < %v > %v)", t.CloseTimeMinValue(), t.CloseTime, t.CloseTimeMaxValue()) + } + } + if t.FirstIdInActingVersion(actingVersion) { + if t.FirstId != t.FirstIdNullValue() && (t.FirstId < t.FirstIdMinValue() || t.FirstId > t.FirstIdMaxValue()) { + return fmt.Errorf("Range check failed on t.FirstId (%v < %v > %v)", t.FirstIdMinValue(), t.FirstId, t.FirstIdMaxValue()) + } + } + if t.LastIdInActingVersion(actingVersion) { + if t.LastId != t.LastIdNullValue() && (t.LastId < t.LastIdMinValue() || t.LastId > t.LastIdMaxValue()) { + return fmt.Errorf("Range check failed on t.LastId (%v < %v > %v)", t.LastIdMinValue(), t.LastId, t.LastIdMaxValue()) + } + } + if t.NumTradesInActingVersion(actingVersion) { + if t.NumTrades < t.NumTradesMinValue() || t.NumTrades > t.NumTradesMaxValue() { + return fmt.Errorf("Range check failed on t.NumTrades (%v < %v > %v)", t.NumTradesMinValue(), t.NumTrades, t.NumTradesMaxValue()) + } + } + if !utf8.Valid(t.Symbol[:]) { + return errors.New("t.Symbol failed UTF-8 validation") + } + return nil +} + +func TickerSymbolFullResponseInit(t *TickerSymbolFullResponse) { + t.PriceChange = math.MinInt64 + t.PriceChangePercent = float32(math.NaN()) + t.WeightedAvgPrice = math.MinInt64 + t.OpenPrice = math.MinInt64 + t.HighPrice = math.MinInt64 + t.LowPrice = math.MinInt64 + t.LastPrice = math.MinInt64 + t.FirstId = math.MinInt64 + t.LastId = math.MinInt64 + return +} + +func (*TickerSymbolFullResponse) SbeBlockLength() (blockLength uint16) { + return 126 +} + +func (*TickerSymbolFullResponse) SbeTemplateId() (templateId uint16) { + return 213 +} + +func (*TickerSymbolFullResponse) SbeSchemaId() (schemaId uint16) { + return 3 +} + +func (*TickerSymbolFullResponse) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} + +func (*TickerSymbolFullResponse) SbeSemanticType() (semanticType []byte) { + return []byte("") +} + +func (*TickerSymbolFullResponse) SbeSemanticVersion() (semanticVersion string) { + return "5.2" +} + +func (*TickerSymbolFullResponse) PriceExponentId() uint16 { + return 1 +} + +func (*TickerSymbolFullResponse) PriceExponentSinceVersion() uint16 { + return 0 +} + +func (t *TickerSymbolFullResponse) PriceExponentInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.PriceExponentSinceVersion() +} + +func (*TickerSymbolFullResponse) PriceExponentDeprecated() uint16 { + return 0 +} + +func (*TickerSymbolFullResponse) PriceExponentMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*TickerSymbolFullResponse) PriceExponentMinValue() int8 { + return math.MinInt8 + 1 +} + +func (*TickerSymbolFullResponse) PriceExponentMaxValue() int8 { + return math.MaxInt8 +} + +func (*TickerSymbolFullResponse) PriceExponentNullValue() int8 { + return math.MinInt8 +} + +func (*TickerSymbolFullResponse) QtyExponentId() uint16 { + return 2 +} + +func (*TickerSymbolFullResponse) QtyExponentSinceVersion() uint16 { + return 0 +} + +func (t *TickerSymbolFullResponse) QtyExponentInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.QtyExponentSinceVersion() +} + +func (*TickerSymbolFullResponse) QtyExponentDeprecated() uint16 { + return 0 +} + +func (*TickerSymbolFullResponse) QtyExponentMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*TickerSymbolFullResponse) QtyExponentMinValue() int8 { + return math.MinInt8 + 1 +} + +func (*TickerSymbolFullResponse) QtyExponentMaxValue() int8 { + return math.MaxInt8 +} + +func (*TickerSymbolFullResponse) QtyExponentNullValue() int8 { + return math.MinInt8 +} + +func (*TickerSymbolFullResponse) PriceChangeId() uint16 { + return 3 +} + +func (*TickerSymbolFullResponse) PriceChangeSinceVersion() uint16 { + return 0 +} + +func (t *TickerSymbolFullResponse) PriceChangeInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.PriceChangeSinceVersion() +} + +func (*TickerSymbolFullResponse) PriceChangeDeprecated() uint16 { + return 0 +} + +func (*TickerSymbolFullResponse) PriceChangeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*TickerSymbolFullResponse) PriceChangeMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*TickerSymbolFullResponse) PriceChangeMaxValue() int64 { + return math.MaxInt64 +} + +func (*TickerSymbolFullResponse) PriceChangeNullValue() int64 { + return math.MinInt64 +} + +func (*TickerSymbolFullResponse) PriceChangePercentId() uint16 { + return 4 +} + +func (*TickerSymbolFullResponse) PriceChangePercentSinceVersion() uint16 { + return 0 +} + +func (t *TickerSymbolFullResponse) PriceChangePercentInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.PriceChangePercentSinceVersion() +} + +func (*TickerSymbolFullResponse) PriceChangePercentDeprecated() uint16 { + return 0 +} + +func (*TickerSymbolFullResponse) PriceChangePercentMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*TickerSymbolFullResponse) PriceChangePercentMinValue() float32 { + return -math.MaxFloat32 +} + +func (*TickerSymbolFullResponse) PriceChangePercentMaxValue() float32 { + return math.MaxFloat32 +} + +func (*TickerSymbolFullResponse) PriceChangePercentNullValue() float32 { + return float32(math.NaN()) +} + +func (*TickerSymbolFullResponse) WeightedAvgPriceId() uint16 { + return 5 +} + +func (*TickerSymbolFullResponse) WeightedAvgPriceSinceVersion() uint16 { + return 0 +} + +func (t *TickerSymbolFullResponse) WeightedAvgPriceInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.WeightedAvgPriceSinceVersion() +} + +func (*TickerSymbolFullResponse) WeightedAvgPriceDeprecated() uint16 { + return 0 +} + +func (*TickerSymbolFullResponse) WeightedAvgPriceMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*TickerSymbolFullResponse) WeightedAvgPriceMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*TickerSymbolFullResponse) WeightedAvgPriceMaxValue() int64 { + return math.MaxInt64 +} + +func (*TickerSymbolFullResponse) WeightedAvgPriceNullValue() int64 { + return math.MinInt64 +} + +func (*TickerSymbolFullResponse) OpenPriceId() uint16 { + return 6 +} + +func (*TickerSymbolFullResponse) OpenPriceSinceVersion() uint16 { + return 0 +} + +func (t *TickerSymbolFullResponse) OpenPriceInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.OpenPriceSinceVersion() +} + +func (*TickerSymbolFullResponse) OpenPriceDeprecated() uint16 { + return 0 +} + +func (*TickerSymbolFullResponse) OpenPriceMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*TickerSymbolFullResponse) OpenPriceMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*TickerSymbolFullResponse) OpenPriceMaxValue() int64 { + return math.MaxInt64 +} + +func (*TickerSymbolFullResponse) OpenPriceNullValue() int64 { + return math.MinInt64 +} + +func (*TickerSymbolFullResponse) HighPriceId() uint16 { + return 7 +} + +func (*TickerSymbolFullResponse) HighPriceSinceVersion() uint16 { + return 0 +} + +func (t *TickerSymbolFullResponse) HighPriceInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.HighPriceSinceVersion() +} + +func (*TickerSymbolFullResponse) HighPriceDeprecated() uint16 { + return 0 +} + +func (*TickerSymbolFullResponse) HighPriceMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*TickerSymbolFullResponse) HighPriceMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*TickerSymbolFullResponse) HighPriceMaxValue() int64 { + return math.MaxInt64 +} + +func (*TickerSymbolFullResponse) HighPriceNullValue() int64 { + return math.MinInt64 +} + +func (*TickerSymbolFullResponse) LowPriceId() uint16 { + return 8 +} + +func (*TickerSymbolFullResponse) LowPriceSinceVersion() uint16 { + return 0 +} + +func (t *TickerSymbolFullResponse) LowPriceInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.LowPriceSinceVersion() +} + +func (*TickerSymbolFullResponse) LowPriceDeprecated() uint16 { + return 0 +} + +func (*TickerSymbolFullResponse) LowPriceMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*TickerSymbolFullResponse) LowPriceMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*TickerSymbolFullResponse) LowPriceMaxValue() int64 { + return math.MaxInt64 +} + +func (*TickerSymbolFullResponse) LowPriceNullValue() int64 { + return math.MinInt64 +} + +func (*TickerSymbolFullResponse) LastPriceId() uint16 { + return 9 +} + +func (*TickerSymbolFullResponse) LastPriceSinceVersion() uint16 { + return 0 +} + +func (t *TickerSymbolFullResponse) LastPriceInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.LastPriceSinceVersion() +} + +func (*TickerSymbolFullResponse) LastPriceDeprecated() uint16 { + return 0 +} + +func (*TickerSymbolFullResponse) LastPriceMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*TickerSymbolFullResponse) LastPriceMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*TickerSymbolFullResponse) LastPriceMaxValue() int64 { + return math.MaxInt64 +} + +func (*TickerSymbolFullResponse) LastPriceNullValue() int64 { + return math.MinInt64 +} + +func (*TickerSymbolFullResponse) VolumeId() uint16 { + return 10 +} + +func (*TickerSymbolFullResponse) VolumeSinceVersion() uint16 { + return 0 +} + +func (t *TickerSymbolFullResponse) VolumeInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.VolumeSinceVersion() +} + +func (*TickerSymbolFullResponse) VolumeDeprecated() uint16 { + return 0 +} + +func (*TickerSymbolFullResponse) VolumeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*TickerSymbolFullResponse) VolumeMinValue() uint8 { + return 0 +} + +func (*TickerSymbolFullResponse) VolumeMaxValue() uint8 { + return math.MaxUint8 - 1 +} + +func (*TickerSymbolFullResponse) VolumeNullValue() uint8 { + return math.MaxUint8 +} + +func (*TickerSymbolFullResponse) QuoteVolumeId() uint16 { + return 11 +} + +func (*TickerSymbolFullResponse) QuoteVolumeSinceVersion() uint16 { + return 0 +} + +func (t *TickerSymbolFullResponse) QuoteVolumeInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.QuoteVolumeSinceVersion() +} + +func (*TickerSymbolFullResponse) QuoteVolumeDeprecated() uint16 { + return 0 +} + +func (*TickerSymbolFullResponse) QuoteVolumeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*TickerSymbolFullResponse) QuoteVolumeMinValue() uint8 { + return 0 +} + +func (*TickerSymbolFullResponse) QuoteVolumeMaxValue() uint8 { + return math.MaxUint8 - 1 +} + +func (*TickerSymbolFullResponse) QuoteVolumeNullValue() uint8 { + return math.MaxUint8 +} + +func (*TickerSymbolFullResponse) OpenTimeId() uint16 { + return 12 +} + +func (*TickerSymbolFullResponse) OpenTimeSinceVersion() uint16 { + return 0 +} + +func (t *TickerSymbolFullResponse) OpenTimeInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.OpenTimeSinceVersion() +} + +func (*TickerSymbolFullResponse) OpenTimeDeprecated() uint16 { + return 0 +} + +func (*TickerSymbolFullResponse) OpenTimeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*TickerSymbolFullResponse) OpenTimeMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*TickerSymbolFullResponse) OpenTimeMaxValue() int64 { + return math.MaxInt64 +} + +func (*TickerSymbolFullResponse) OpenTimeNullValue() int64 { + return math.MinInt64 +} + +func (*TickerSymbolFullResponse) CloseTimeId() uint16 { + return 13 +} + +func (*TickerSymbolFullResponse) CloseTimeSinceVersion() uint16 { + return 0 +} + +func (t *TickerSymbolFullResponse) CloseTimeInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.CloseTimeSinceVersion() +} + +func (*TickerSymbolFullResponse) CloseTimeDeprecated() uint16 { + return 0 +} + +func (*TickerSymbolFullResponse) CloseTimeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*TickerSymbolFullResponse) CloseTimeMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*TickerSymbolFullResponse) CloseTimeMaxValue() int64 { + return math.MaxInt64 +} + +func (*TickerSymbolFullResponse) CloseTimeNullValue() int64 { + return math.MinInt64 +} + +func (*TickerSymbolFullResponse) FirstIdId() uint16 { + return 14 +} + +func (*TickerSymbolFullResponse) FirstIdSinceVersion() uint16 { + return 0 +} + +func (t *TickerSymbolFullResponse) FirstIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.FirstIdSinceVersion() +} + +func (*TickerSymbolFullResponse) FirstIdDeprecated() uint16 { + return 0 +} + +func (*TickerSymbolFullResponse) FirstIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*TickerSymbolFullResponse) FirstIdMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*TickerSymbolFullResponse) FirstIdMaxValue() int64 { + return math.MaxInt64 +} + +func (*TickerSymbolFullResponse) FirstIdNullValue() int64 { + return math.MinInt64 +} + +func (*TickerSymbolFullResponse) LastIdId() uint16 { + return 15 +} + +func (*TickerSymbolFullResponse) LastIdSinceVersion() uint16 { + return 0 +} + +func (t *TickerSymbolFullResponse) LastIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.LastIdSinceVersion() +} + +func (*TickerSymbolFullResponse) LastIdDeprecated() uint16 { + return 0 +} + +func (*TickerSymbolFullResponse) LastIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*TickerSymbolFullResponse) LastIdMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*TickerSymbolFullResponse) LastIdMaxValue() int64 { + return math.MaxInt64 +} + +func (*TickerSymbolFullResponse) LastIdNullValue() int64 { + return math.MinInt64 +} + +func (*TickerSymbolFullResponse) NumTradesId() uint16 { + return 16 +} + +func (*TickerSymbolFullResponse) NumTradesSinceVersion() uint16 { + return 0 +} + +func (t *TickerSymbolFullResponse) NumTradesInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.NumTradesSinceVersion() +} + +func (*TickerSymbolFullResponse) NumTradesDeprecated() uint16 { + return 0 +} + +func (*TickerSymbolFullResponse) NumTradesMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*TickerSymbolFullResponse) NumTradesMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*TickerSymbolFullResponse) NumTradesMaxValue() int64 { + return math.MaxInt64 +} + +func (*TickerSymbolFullResponse) NumTradesNullValue() int64 { + return math.MinInt64 +} + +func (*TickerSymbolFullResponse) SymbolMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*TickerSymbolFullResponse) SymbolSinceVersion() uint16 { + return 0 +} + +func (t *TickerSymbolFullResponse) SymbolInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.SymbolSinceVersion() +} + +func (*TickerSymbolFullResponse) SymbolDeprecated() uint16 { + return 0 +} + +func (TickerSymbolFullResponse) SymbolCharacterEncoding() string { + return "UTF-8" +} + +func (TickerSymbolFullResponse) SymbolHeaderLength() uint64 { + return 1 +} diff --git a/v2/sbe/spot_3_1/TickerSymbolMiniResponse.go b/v2/sbe/spot_3_1/TickerSymbolMiniResponse.go new file mode 100644 index 00000000..5deceef7 --- /dev/null +++ b/v2/sbe/spot_3_1/TickerSymbolMiniResponse.go @@ -0,0 +1,894 @@ +// Generated SBE (Simple Binary Encoding) message codec + +package sbe + +import ( + "errors" + "fmt" + "io" + "io/ioutil" + "math" + "unicode/utf8" +) + +type TickerSymbolMiniResponse struct { + PriceExponent int8 + QtyExponent int8 + OpenPrice int64 + HighPrice int64 + LowPrice int64 + LastPrice int64 + Volume [16]uint8 + QuoteVolume [16]uint8 + OpenTime int64 + CloseTime int64 + FirstId int64 + LastId int64 + NumTrades int64 + Symbol []uint8 +} + +func (t *TickerSymbolMiniResponse) Encode(_m *SbeGoMarshaller, _w io.Writer, doRangeCheck bool) error { + if doRangeCheck { + if err := t.RangeCheck(t.SbeSchemaVersion(), t.SbeSchemaVersion()); err != nil { + return err + } + } + if err := _m.WriteInt8(_w, t.PriceExponent); err != nil { + return err + } + if err := _m.WriteInt8(_w, t.QtyExponent); err != nil { + return err + } + if err := _m.WriteInt64(_w, t.OpenPrice); err != nil { + return err + } + if err := _m.WriteInt64(_w, t.HighPrice); err != nil { + return err + } + if err := _m.WriteInt64(_w, t.LowPrice); err != nil { + return err + } + if err := _m.WriteInt64(_w, t.LastPrice); err != nil { + return err + } + if err := _m.WriteBytes(_w, t.Volume[:]); err != nil { + return err + } + if err := _m.WriteBytes(_w, t.QuoteVolume[:]); err != nil { + return err + } + if err := _m.WriteInt64(_w, t.OpenTime); err != nil { + return err + } + if err := _m.WriteInt64(_w, t.CloseTime); err != nil { + return err + } + if err := _m.WriteInt64(_w, t.FirstId); err != nil { + return err + } + if err := _m.WriteInt64(_w, t.LastId); err != nil { + return err + } + if err := _m.WriteInt64(_w, t.NumTrades); err != nil { + return err + } + if err := _m.WriteUint8(_w, uint8(len(t.Symbol))); err != nil { + return err + } + if err := _m.WriteBytes(_w, t.Symbol); err != nil { + return err + } + return nil +} + +func (t *TickerSymbolMiniResponse) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint16, doRangeCheck bool) error { + if !t.PriceExponentInActingVersion(actingVersion) { + t.PriceExponent = t.PriceExponentNullValue() + } else { + if err := _m.ReadInt8(_r, &t.PriceExponent); err != nil { + return err + } + } + if !t.QtyExponentInActingVersion(actingVersion) { + t.QtyExponent = t.QtyExponentNullValue() + } else { + if err := _m.ReadInt8(_r, &t.QtyExponent); err != nil { + return err + } + } + if !t.OpenPriceInActingVersion(actingVersion) { + t.OpenPrice = t.OpenPriceNullValue() + } else { + if err := _m.ReadInt64(_r, &t.OpenPrice); err != nil { + return err + } + } + if !t.HighPriceInActingVersion(actingVersion) { + t.HighPrice = t.HighPriceNullValue() + } else { + if err := _m.ReadInt64(_r, &t.HighPrice); err != nil { + return err + } + } + if !t.LowPriceInActingVersion(actingVersion) { + t.LowPrice = t.LowPriceNullValue() + } else { + if err := _m.ReadInt64(_r, &t.LowPrice); err != nil { + return err + } + } + if !t.LastPriceInActingVersion(actingVersion) { + t.LastPrice = t.LastPriceNullValue() + } else { + if err := _m.ReadInt64(_r, &t.LastPrice); err != nil { + return err + } + } + if !t.VolumeInActingVersion(actingVersion) { + for idx := 0; idx < 16; idx++ { + t.Volume[idx] = t.VolumeNullValue() + } + } else { + if err := _m.ReadBytes(_r, t.Volume[:]); err != nil { + return err + } + } + if !t.QuoteVolumeInActingVersion(actingVersion) { + for idx := 0; idx < 16; idx++ { + t.QuoteVolume[idx] = t.QuoteVolumeNullValue() + } + } else { + if err := _m.ReadBytes(_r, t.QuoteVolume[:]); err != nil { + return err + } + } + if !t.OpenTimeInActingVersion(actingVersion) { + t.OpenTime = t.OpenTimeNullValue() + } else { + if err := _m.ReadInt64(_r, &t.OpenTime); err != nil { + return err + } + } + if !t.CloseTimeInActingVersion(actingVersion) { + t.CloseTime = t.CloseTimeNullValue() + } else { + if err := _m.ReadInt64(_r, &t.CloseTime); err != nil { + return err + } + } + if !t.FirstIdInActingVersion(actingVersion) { + t.FirstId = t.FirstIdNullValue() + } else { + if err := _m.ReadInt64(_r, &t.FirstId); err != nil { + return err + } + } + if !t.LastIdInActingVersion(actingVersion) { + t.LastId = t.LastIdNullValue() + } else { + if err := _m.ReadInt64(_r, &t.LastId); err != nil { + return err + } + } + if !t.NumTradesInActingVersion(actingVersion) { + t.NumTrades = t.NumTradesNullValue() + } else { + if err := _m.ReadInt64(_r, &t.NumTrades); err != nil { + return err + } + } + if actingVersion > t.SbeSchemaVersion() && blockLength > t.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-t.SbeBlockLength())) + } + + if t.SymbolInActingVersion(actingVersion) { + var SymbolLength uint8 + if err := _m.ReadUint8(_r, &SymbolLength); err != nil { + return err + } + if cap(t.Symbol) < int(SymbolLength) { + t.Symbol = make([]uint8, SymbolLength) + } + t.Symbol = t.Symbol[:SymbolLength] + if err := _m.ReadBytes(_r, t.Symbol); err != nil { + return err + } + } + if doRangeCheck { + if err := t.RangeCheck(actingVersion, t.SbeSchemaVersion()); err != nil { + return err + } + } + return nil +} + +func (t *TickerSymbolMiniResponse) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if t.PriceExponentInActingVersion(actingVersion) { + if t.PriceExponent < t.PriceExponentMinValue() || t.PriceExponent > t.PriceExponentMaxValue() { + return fmt.Errorf("Range check failed on t.PriceExponent (%v < %v > %v)", t.PriceExponentMinValue(), t.PriceExponent, t.PriceExponentMaxValue()) + } + } + if t.QtyExponentInActingVersion(actingVersion) { + if t.QtyExponent < t.QtyExponentMinValue() || t.QtyExponent > t.QtyExponentMaxValue() { + return fmt.Errorf("Range check failed on t.QtyExponent (%v < %v > %v)", t.QtyExponentMinValue(), t.QtyExponent, t.QtyExponentMaxValue()) + } + } + if t.OpenPriceInActingVersion(actingVersion) { + if t.OpenPrice != t.OpenPriceNullValue() && (t.OpenPrice < t.OpenPriceMinValue() || t.OpenPrice > t.OpenPriceMaxValue()) { + return fmt.Errorf("Range check failed on t.OpenPrice (%v < %v > %v)", t.OpenPriceMinValue(), t.OpenPrice, t.OpenPriceMaxValue()) + } + } + if t.HighPriceInActingVersion(actingVersion) { + if t.HighPrice != t.HighPriceNullValue() && (t.HighPrice < t.HighPriceMinValue() || t.HighPrice > t.HighPriceMaxValue()) { + return fmt.Errorf("Range check failed on t.HighPrice (%v < %v > %v)", t.HighPriceMinValue(), t.HighPrice, t.HighPriceMaxValue()) + } + } + if t.LowPriceInActingVersion(actingVersion) { + if t.LowPrice != t.LowPriceNullValue() && (t.LowPrice < t.LowPriceMinValue() || t.LowPrice > t.LowPriceMaxValue()) { + return fmt.Errorf("Range check failed on t.LowPrice (%v < %v > %v)", t.LowPriceMinValue(), t.LowPrice, t.LowPriceMaxValue()) + } + } + if t.LastPriceInActingVersion(actingVersion) { + if t.LastPrice != t.LastPriceNullValue() && (t.LastPrice < t.LastPriceMinValue() || t.LastPrice > t.LastPriceMaxValue()) { + return fmt.Errorf("Range check failed on t.LastPrice (%v < %v > %v)", t.LastPriceMinValue(), t.LastPrice, t.LastPriceMaxValue()) + } + } + if t.VolumeInActingVersion(actingVersion) { + for idx := 0; idx < 16; idx++ { + if t.Volume[idx] < t.VolumeMinValue() || t.Volume[idx] > t.VolumeMaxValue() { + return fmt.Errorf("Range check failed on t.Volume[%d] (%v < %v > %v)", idx, t.VolumeMinValue(), t.Volume[idx], t.VolumeMaxValue()) + } + } + } + if t.QuoteVolumeInActingVersion(actingVersion) { + for idx := 0; idx < 16; idx++ { + if t.QuoteVolume[idx] < t.QuoteVolumeMinValue() || t.QuoteVolume[idx] > t.QuoteVolumeMaxValue() { + return fmt.Errorf("Range check failed on t.QuoteVolume[%d] (%v < %v > %v)", idx, t.QuoteVolumeMinValue(), t.QuoteVolume[idx], t.QuoteVolumeMaxValue()) + } + } + } + if t.OpenTimeInActingVersion(actingVersion) { + if t.OpenTime < t.OpenTimeMinValue() || t.OpenTime > t.OpenTimeMaxValue() { + return fmt.Errorf("Range check failed on t.OpenTime (%v < %v > %v)", t.OpenTimeMinValue(), t.OpenTime, t.OpenTimeMaxValue()) + } + } + if t.CloseTimeInActingVersion(actingVersion) { + if t.CloseTime < t.CloseTimeMinValue() || t.CloseTime > t.CloseTimeMaxValue() { + return fmt.Errorf("Range check failed on t.CloseTime (%v < %v > %v)", t.CloseTimeMinValue(), t.CloseTime, t.CloseTimeMaxValue()) + } + } + if t.FirstIdInActingVersion(actingVersion) { + if t.FirstId != t.FirstIdNullValue() && (t.FirstId < t.FirstIdMinValue() || t.FirstId > t.FirstIdMaxValue()) { + return fmt.Errorf("Range check failed on t.FirstId (%v < %v > %v)", t.FirstIdMinValue(), t.FirstId, t.FirstIdMaxValue()) + } + } + if t.LastIdInActingVersion(actingVersion) { + if t.LastId != t.LastIdNullValue() && (t.LastId < t.LastIdMinValue() || t.LastId > t.LastIdMaxValue()) { + return fmt.Errorf("Range check failed on t.LastId (%v < %v > %v)", t.LastIdMinValue(), t.LastId, t.LastIdMaxValue()) + } + } + if t.NumTradesInActingVersion(actingVersion) { + if t.NumTrades < t.NumTradesMinValue() || t.NumTrades > t.NumTradesMaxValue() { + return fmt.Errorf("Range check failed on t.NumTrades (%v < %v > %v)", t.NumTradesMinValue(), t.NumTrades, t.NumTradesMaxValue()) + } + } + if !utf8.Valid(t.Symbol[:]) { + return errors.New("t.Symbol failed UTF-8 validation") + } + return nil +} + +func TickerSymbolMiniResponseInit(t *TickerSymbolMiniResponse) { + t.OpenPrice = math.MinInt64 + t.HighPrice = math.MinInt64 + t.LowPrice = math.MinInt64 + t.LastPrice = math.MinInt64 + t.FirstId = math.MinInt64 + t.LastId = math.MinInt64 + return +} + +func (*TickerSymbolMiniResponse) SbeBlockLength() (blockLength uint16) { + return 106 +} + +func (*TickerSymbolMiniResponse) SbeTemplateId() (templateId uint16) { + return 215 +} + +func (*TickerSymbolMiniResponse) SbeSchemaId() (schemaId uint16) { + return 3 +} + +func (*TickerSymbolMiniResponse) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} + +func (*TickerSymbolMiniResponse) SbeSemanticType() (semanticType []byte) { + return []byte("") +} + +func (*TickerSymbolMiniResponse) SbeSemanticVersion() (semanticVersion string) { + return "5.2" +} + +func (*TickerSymbolMiniResponse) PriceExponentId() uint16 { + return 1 +} + +func (*TickerSymbolMiniResponse) PriceExponentSinceVersion() uint16 { + return 0 +} + +func (t *TickerSymbolMiniResponse) PriceExponentInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.PriceExponentSinceVersion() +} + +func (*TickerSymbolMiniResponse) PriceExponentDeprecated() uint16 { + return 0 +} + +func (*TickerSymbolMiniResponse) PriceExponentMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*TickerSymbolMiniResponse) PriceExponentMinValue() int8 { + return math.MinInt8 + 1 +} + +func (*TickerSymbolMiniResponse) PriceExponentMaxValue() int8 { + return math.MaxInt8 +} + +func (*TickerSymbolMiniResponse) PriceExponentNullValue() int8 { + return math.MinInt8 +} + +func (*TickerSymbolMiniResponse) QtyExponentId() uint16 { + return 2 +} + +func (*TickerSymbolMiniResponse) QtyExponentSinceVersion() uint16 { + return 0 +} + +func (t *TickerSymbolMiniResponse) QtyExponentInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.QtyExponentSinceVersion() +} + +func (*TickerSymbolMiniResponse) QtyExponentDeprecated() uint16 { + return 0 +} + +func (*TickerSymbolMiniResponse) QtyExponentMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*TickerSymbolMiniResponse) QtyExponentMinValue() int8 { + return math.MinInt8 + 1 +} + +func (*TickerSymbolMiniResponse) QtyExponentMaxValue() int8 { + return math.MaxInt8 +} + +func (*TickerSymbolMiniResponse) QtyExponentNullValue() int8 { + return math.MinInt8 +} + +func (*TickerSymbolMiniResponse) OpenPriceId() uint16 { + return 3 +} + +func (*TickerSymbolMiniResponse) OpenPriceSinceVersion() uint16 { + return 0 +} + +func (t *TickerSymbolMiniResponse) OpenPriceInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.OpenPriceSinceVersion() +} + +func (*TickerSymbolMiniResponse) OpenPriceDeprecated() uint16 { + return 0 +} + +func (*TickerSymbolMiniResponse) OpenPriceMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*TickerSymbolMiniResponse) OpenPriceMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*TickerSymbolMiniResponse) OpenPriceMaxValue() int64 { + return math.MaxInt64 +} + +func (*TickerSymbolMiniResponse) OpenPriceNullValue() int64 { + return math.MinInt64 +} + +func (*TickerSymbolMiniResponse) HighPriceId() uint16 { + return 4 +} + +func (*TickerSymbolMiniResponse) HighPriceSinceVersion() uint16 { + return 0 +} + +func (t *TickerSymbolMiniResponse) HighPriceInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.HighPriceSinceVersion() +} + +func (*TickerSymbolMiniResponse) HighPriceDeprecated() uint16 { + return 0 +} + +func (*TickerSymbolMiniResponse) HighPriceMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*TickerSymbolMiniResponse) HighPriceMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*TickerSymbolMiniResponse) HighPriceMaxValue() int64 { + return math.MaxInt64 +} + +func (*TickerSymbolMiniResponse) HighPriceNullValue() int64 { + return math.MinInt64 +} + +func (*TickerSymbolMiniResponse) LowPriceId() uint16 { + return 5 +} + +func (*TickerSymbolMiniResponse) LowPriceSinceVersion() uint16 { + return 0 +} + +func (t *TickerSymbolMiniResponse) LowPriceInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.LowPriceSinceVersion() +} + +func (*TickerSymbolMiniResponse) LowPriceDeprecated() uint16 { + return 0 +} + +func (*TickerSymbolMiniResponse) LowPriceMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*TickerSymbolMiniResponse) LowPriceMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*TickerSymbolMiniResponse) LowPriceMaxValue() int64 { + return math.MaxInt64 +} + +func (*TickerSymbolMiniResponse) LowPriceNullValue() int64 { + return math.MinInt64 +} + +func (*TickerSymbolMiniResponse) LastPriceId() uint16 { + return 6 +} + +func (*TickerSymbolMiniResponse) LastPriceSinceVersion() uint16 { + return 0 +} + +func (t *TickerSymbolMiniResponse) LastPriceInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.LastPriceSinceVersion() +} + +func (*TickerSymbolMiniResponse) LastPriceDeprecated() uint16 { + return 0 +} + +func (*TickerSymbolMiniResponse) LastPriceMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*TickerSymbolMiniResponse) LastPriceMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*TickerSymbolMiniResponse) LastPriceMaxValue() int64 { + return math.MaxInt64 +} + +func (*TickerSymbolMiniResponse) LastPriceNullValue() int64 { + return math.MinInt64 +} + +func (*TickerSymbolMiniResponse) VolumeId() uint16 { + return 7 +} + +func (*TickerSymbolMiniResponse) VolumeSinceVersion() uint16 { + return 0 +} + +func (t *TickerSymbolMiniResponse) VolumeInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.VolumeSinceVersion() +} + +func (*TickerSymbolMiniResponse) VolumeDeprecated() uint16 { + return 0 +} + +func (*TickerSymbolMiniResponse) VolumeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*TickerSymbolMiniResponse) VolumeMinValue() uint8 { + return 0 +} + +func (*TickerSymbolMiniResponse) VolumeMaxValue() uint8 { + return math.MaxUint8 - 1 +} + +func (*TickerSymbolMiniResponse) VolumeNullValue() uint8 { + return math.MaxUint8 +} + +func (*TickerSymbolMiniResponse) QuoteVolumeId() uint16 { + return 8 +} + +func (*TickerSymbolMiniResponse) QuoteVolumeSinceVersion() uint16 { + return 0 +} + +func (t *TickerSymbolMiniResponse) QuoteVolumeInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.QuoteVolumeSinceVersion() +} + +func (*TickerSymbolMiniResponse) QuoteVolumeDeprecated() uint16 { + return 0 +} + +func (*TickerSymbolMiniResponse) QuoteVolumeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*TickerSymbolMiniResponse) QuoteVolumeMinValue() uint8 { + return 0 +} + +func (*TickerSymbolMiniResponse) QuoteVolumeMaxValue() uint8 { + return math.MaxUint8 - 1 +} + +func (*TickerSymbolMiniResponse) QuoteVolumeNullValue() uint8 { + return math.MaxUint8 +} + +func (*TickerSymbolMiniResponse) OpenTimeId() uint16 { + return 9 +} + +func (*TickerSymbolMiniResponse) OpenTimeSinceVersion() uint16 { + return 0 +} + +func (t *TickerSymbolMiniResponse) OpenTimeInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.OpenTimeSinceVersion() +} + +func (*TickerSymbolMiniResponse) OpenTimeDeprecated() uint16 { + return 0 +} + +func (*TickerSymbolMiniResponse) OpenTimeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*TickerSymbolMiniResponse) OpenTimeMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*TickerSymbolMiniResponse) OpenTimeMaxValue() int64 { + return math.MaxInt64 +} + +func (*TickerSymbolMiniResponse) OpenTimeNullValue() int64 { + return math.MinInt64 +} + +func (*TickerSymbolMiniResponse) CloseTimeId() uint16 { + return 10 +} + +func (*TickerSymbolMiniResponse) CloseTimeSinceVersion() uint16 { + return 0 +} + +func (t *TickerSymbolMiniResponse) CloseTimeInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.CloseTimeSinceVersion() +} + +func (*TickerSymbolMiniResponse) CloseTimeDeprecated() uint16 { + return 0 +} + +func (*TickerSymbolMiniResponse) CloseTimeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*TickerSymbolMiniResponse) CloseTimeMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*TickerSymbolMiniResponse) CloseTimeMaxValue() int64 { + return math.MaxInt64 +} + +func (*TickerSymbolMiniResponse) CloseTimeNullValue() int64 { + return math.MinInt64 +} + +func (*TickerSymbolMiniResponse) FirstIdId() uint16 { + return 11 +} + +func (*TickerSymbolMiniResponse) FirstIdSinceVersion() uint16 { + return 0 +} + +func (t *TickerSymbolMiniResponse) FirstIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.FirstIdSinceVersion() +} + +func (*TickerSymbolMiniResponse) FirstIdDeprecated() uint16 { + return 0 +} + +func (*TickerSymbolMiniResponse) FirstIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*TickerSymbolMiniResponse) FirstIdMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*TickerSymbolMiniResponse) FirstIdMaxValue() int64 { + return math.MaxInt64 +} + +func (*TickerSymbolMiniResponse) FirstIdNullValue() int64 { + return math.MinInt64 +} + +func (*TickerSymbolMiniResponse) LastIdId() uint16 { + return 12 +} + +func (*TickerSymbolMiniResponse) LastIdSinceVersion() uint16 { + return 0 +} + +func (t *TickerSymbolMiniResponse) LastIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.LastIdSinceVersion() +} + +func (*TickerSymbolMiniResponse) LastIdDeprecated() uint16 { + return 0 +} + +func (*TickerSymbolMiniResponse) LastIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*TickerSymbolMiniResponse) LastIdMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*TickerSymbolMiniResponse) LastIdMaxValue() int64 { + return math.MaxInt64 +} + +func (*TickerSymbolMiniResponse) LastIdNullValue() int64 { + return math.MinInt64 +} + +func (*TickerSymbolMiniResponse) NumTradesId() uint16 { + return 13 +} + +func (*TickerSymbolMiniResponse) NumTradesSinceVersion() uint16 { + return 0 +} + +func (t *TickerSymbolMiniResponse) NumTradesInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.NumTradesSinceVersion() +} + +func (*TickerSymbolMiniResponse) NumTradesDeprecated() uint16 { + return 0 +} + +func (*TickerSymbolMiniResponse) NumTradesMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*TickerSymbolMiniResponse) NumTradesMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*TickerSymbolMiniResponse) NumTradesMaxValue() int64 { + return math.MaxInt64 +} + +func (*TickerSymbolMiniResponse) NumTradesNullValue() int64 { + return math.MinInt64 +} + +func (*TickerSymbolMiniResponse) SymbolMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*TickerSymbolMiniResponse) SymbolSinceVersion() uint16 { + return 0 +} + +func (t *TickerSymbolMiniResponse) SymbolInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.SymbolSinceVersion() +} + +func (*TickerSymbolMiniResponse) SymbolDeprecated() uint16 { + return 0 +} + +func (TickerSymbolMiniResponse) SymbolCharacterEncoding() string { + return "UTF-8" +} + +func (TickerSymbolMiniResponse) SymbolHeaderLength() uint64 { + return 1 +} diff --git a/v2/sbe/spot_3_1/TimeInForce.go b/v2/sbe/spot_3_1/TimeInForce.go new file mode 100644 index 00000000..390e9950 --- /dev/null +++ b/v2/sbe/spot_3_1/TimeInForce.go @@ -0,0 +1,99 @@ +// Generated SBE (Simple Binary Encoding) message codec + +package sbe + +import ( + "fmt" + "io" + "reflect" +) + +type TimeInForceEnum uint8 +type TimeInForceValues struct { + Gtc TimeInForceEnum + Ioc TimeInForceEnum + Fok TimeInForceEnum + NonRepresentable TimeInForceEnum + NullValue TimeInForceEnum +} + +var TimeInForce = TimeInForceValues{0, 1, 2, 254, 255} + +func (t TimeInForceEnum) Encode(_m *SbeGoMarshaller, _w io.Writer) error { + if err := _m.WriteUint8(_w, uint8(t)); err != nil { + return err + } + return nil +} + +func (t *TimeInForceEnum) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16) error { + if err := _m.ReadUint8(_r, (*uint8)(t)); err != nil { + return err + } + return nil +} + +func (t TimeInForceEnum) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if actingVersion > schemaVersion { + return nil + } + value := reflect.ValueOf(TimeInForce) + for idx := 0; idx < value.NumField(); idx++ { + if t == value.Field(idx).Interface() { + return nil + } + } + return fmt.Errorf("Range check failed on TimeInForce, unknown enumeration value %d", t) +} + +func (*TimeInForceEnum) EncodedLength() int64 { + return 1 +} + +func (*TimeInForceEnum) GtcSinceVersion() uint16 { + return 0 +} + +func (t *TimeInForceEnum) GtcInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.GtcSinceVersion() +} + +func (*TimeInForceEnum) GtcDeprecated() uint16 { + return 0 +} + +func (*TimeInForceEnum) IocSinceVersion() uint16 { + return 0 +} + +func (t *TimeInForceEnum) IocInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.IocSinceVersion() +} + +func (*TimeInForceEnum) IocDeprecated() uint16 { + return 0 +} + +func (*TimeInForceEnum) FokSinceVersion() uint16 { + return 0 +} + +func (t *TimeInForceEnum) FokInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.FokSinceVersion() +} + +func (*TimeInForceEnum) FokDeprecated() uint16 { + return 0 +} + +func (*TimeInForceEnum) NonRepresentableSinceVersion() uint16 { + return 0 +} + +func (t *TimeInForceEnum) NonRepresentableInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.NonRepresentableSinceVersion() +} + +func (*TimeInForceEnum) NonRepresentableDeprecated() uint16 { + return 0 +} diff --git a/v2/sbe/spot_3_1/TradesResponse.go b/v2/sbe/spot_3_1/TradesResponse.go new file mode 100644 index 00000000..1868937d --- /dev/null +++ b/v2/sbe/spot_3_1/TradesResponse.go @@ -0,0 +1,640 @@ +// Generated SBE (Simple Binary Encoding) message codec + +package sbe + +import ( + "fmt" + "io" + "io/ioutil" + "math" +) + +type TradesResponse struct { + PriceExponent int8 + QtyExponent int8 + Trades []TradesResponseTrades +} +type TradesResponseTrades struct { + Id int64 + Price int64 + Qty int64 + QuoteQty int64 + Time int64 + IsBuyerMaker BoolEnumEnum + IsBestMatch BoolEnumEnum +} + +func (t *TradesResponse) Encode(_m *SbeGoMarshaller, _w io.Writer, doRangeCheck bool) error { + if doRangeCheck { + if err := t.RangeCheck(t.SbeSchemaVersion(), t.SbeSchemaVersion()); err != nil { + return err + } + } + if err := _m.WriteInt8(_w, t.PriceExponent); err != nil { + return err + } + if err := _m.WriteInt8(_w, t.QtyExponent); err != nil { + return err + } + var TradesBlockLength uint16 = 42 + if err := _m.WriteUint16(_w, TradesBlockLength); err != nil { + return err + } + var TradesNumInGroup uint32 = uint32(len(t.Trades)) + if err := _m.WriteUint32(_w, TradesNumInGroup); err != nil { + return err + } + for i := range t.Trades { + if err := t.Trades[i].Encode(_m, _w); err != nil { + return err + } + } + return nil +} + +func (t *TradesResponse) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint16, doRangeCheck bool) error { + if !t.PriceExponentInActingVersion(actingVersion) { + t.PriceExponent = t.PriceExponentNullValue() + } else { + if err := _m.ReadInt8(_r, &t.PriceExponent); err != nil { + return err + } + } + if !t.QtyExponentInActingVersion(actingVersion) { + t.QtyExponent = t.QtyExponentNullValue() + } else { + if err := _m.ReadInt8(_r, &t.QtyExponent); err != nil { + return err + } + } + if actingVersion > t.SbeSchemaVersion() && blockLength > t.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-t.SbeBlockLength())) + } + + if t.TradesInActingVersion(actingVersion) { + var TradesBlockLength uint16 + if err := _m.ReadUint16(_r, &TradesBlockLength); err != nil { + return err + } + var TradesNumInGroup uint32 + if err := _m.ReadUint32(_r, &TradesNumInGroup); err != nil { + return err + } + if cap(t.Trades) < int(TradesNumInGroup) { + t.Trades = make([]TradesResponseTrades, TradesNumInGroup) + } + t.Trades = t.Trades[:TradesNumInGroup] + for i := range t.Trades { + if err := t.Trades[i].Decode(_m, _r, actingVersion, uint(TradesBlockLength)); err != nil { + return err + } + } + } + if doRangeCheck { + if err := t.RangeCheck(actingVersion, t.SbeSchemaVersion()); err != nil { + return err + } + } + return nil +} + +func (t *TradesResponse) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if t.PriceExponentInActingVersion(actingVersion) { + if t.PriceExponent < t.PriceExponentMinValue() || t.PriceExponent > t.PriceExponentMaxValue() { + return fmt.Errorf("Range check failed on t.PriceExponent (%v < %v > %v)", t.PriceExponentMinValue(), t.PriceExponent, t.PriceExponentMaxValue()) + } + } + if t.QtyExponentInActingVersion(actingVersion) { + if t.QtyExponent < t.QtyExponentMinValue() || t.QtyExponent > t.QtyExponentMaxValue() { + return fmt.Errorf("Range check failed on t.QtyExponent (%v < %v > %v)", t.QtyExponentMinValue(), t.QtyExponent, t.QtyExponentMaxValue()) + } + } + for i := range t.Trades { + if err := t.Trades[i].RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + } + return nil +} + +func TradesResponseInit(t *TradesResponse) { + return +} + +func (t *TradesResponseTrades) Encode(_m *SbeGoMarshaller, _w io.Writer) error { + if err := _m.WriteInt64(_w, t.Id); err != nil { + return err + } + if err := _m.WriteInt64(_w, t.Price); err != nil { + return err + } + if err := _m.WriteInt64(_w, t.Qty); err != nil { + return err + } + if err := _m.WriteInt64(_w, t.QuoteQty); err != nil { + return err + } + if err := _m.WriteInt64(_w, t.Time); err != nil { + return err + } + if err := t.IsBuyerMaker.Encode(_m, _w); err != nil { + return err + } + if err := t.IsBestMatch.Encode(_m, _w); err != nil { + return err + } + return nil +} + +func (t *TradesResponseTrades) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint) error { + if !t.IdInActingVersion(actingVersion) { + t.Id = t.IdNullValue() + } else { + if err := _m.ReadInt64(_r, &t.Id); err != nil { + return err + } + } + if !t.PriceInActingVersion(actingVersion) { + t.Price = t.PriceNullValue() + } else { + if err := _m.ReadInt64(_r, &t.Price); err != nil { + return err + } + } + if !t.QtyInActingVersion(actingVersion) { + t.Qty = t.QtyNullValue() + } else { + if err := _m.ReadInt64(_r, &t.Qty); err != nil { + return err + } + } + if !t.QuoteQtyInActingVersion(actingVersion) { + t.QuoteQty = t.QuoteQtyNullValue() + } else { + if err := _m.ReadInt64(_r, &t.QuoteQty); err != nil { + return err + } + } + if !t.TimeInActingVersion(actingVersion) { + t.Time = t.TimeNullValue() + } else { + if err := _m.ReadInt64(_r, &t.Time); err != nil { + return err + } + } + if t.IsBuyerMakerInActingVersion(actingVersion) { + if err := t.IsBuyerMaker.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if t.IsBestMatchInActingVersion(actingVersion) { + if err := t.IsBestMatch.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if actingVersion > t.SbeSchemaVersion() && blockLength > t.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-t.SbeBlockLength())) + } + return nil +} + +func (t *TradesResponseTrades) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if t.IdInActingVersion(actingVersion) { + if t.Id < t.IdMinValue() || t.Id > t.IdMaxValue() { + return fmt.Errorf("Range check failed on t.Id (%v < %v > %v)", t.IdMinValue(), t.Id, t.IdMaxValue()) + } + } + if t.PriceInActingVersion(actingVersion) { + if t.Price < t.PriceMinValue() || t.Price > t.PriceMaxValue() { + return fmt.Errorf("Range check failed on t.Price (%v < %v > %v)", t.PriceMinValue(), t.Price, t.PriceMaxValue()) + } + } + if t.QtyInActingVersion(actingVersion) { + if t.Qty < t.QtyMinValue() || t.Qty > t.QtyMaxValue() { + return fmt.Errorf("Range check failed on t.Qty (%v < %v > %v)", t.QtyMinValue(), t.Qty, t.QtyMaxValue()) + } + } + if t.QuoteQtyInActingVersion(actingVersion) { + if t.QuoteQty < t.QuoteQtyMinValue() || t.QuoteQty > t.QuoteQtyMaxValue() { + return fmt.Errorf("Range check failed on t.QuoteQty (%v < %v > %v)", t.QuoteQtyMinValue(), t.QuoteQty, t.QuoteQtyMaxValue()) + } + } + if t.TimeInActingVersion(actingVersion) { + if t.Time < t.TimeMinValue() || t.Time > t.TimeMaxValue() { + return fmt.Errorf("Range check failed on t.Time (%v < %v > %v)", t.TimeMinValue(), t.Time, t.TimeMaxValue()) + } + } + if err := t.IsBuyerMaker.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if err := t.IsBestMatch.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + return nil +} + +func TradesResponseTradesInit(t *TradesResponseTrades) { + return +} + +func (*TradesResponse) SbeBlockLength() (blockLength uint16) { + return 2 +} + +func (*TradesResponse) SbeTemplateId() (templateId uint16) { + return 201 +} + +func (*TradesResponse) SbeSchemaId() (schemaId uint16) { + return 3 +} + +func (*TradesResponse) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} + +func (*TradesResponse) SbeSemanticType() (semanticType []byte) { + return []byte("") +} + +func (*TradesResponse) SbeSemanticVersion() (semanticVersion string) { + return "5.2" +} + +func (*TradesResponse) PriceExponentId() uint16 { + return 1 +} + +func (*TradesResponse) PriceExponentSinceVersion() uint16 { + return 0 +} + +func (t *TradesResponse) PriceExponentInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.PriceExponentSinceVersion() +} + +func (*TradesResponse) PriceExponentDeprecated() uint16 { + return 0 +} + +func (*TradesResponse) PriceExponentMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*TradesResponse) PriceExponentMinValue() int8 { + return math.MinInt8 + 1 +} + +func (*TradesResponse) PriceExponentMaxValue() int8 { + return math.MaxInt8 +} + +func (*TradesResponse) PriceExponentNullValue() int8 { + return math.MinInt8 +} + +func (*TradesResponse) QtyExponentId() uint16 { + return 2 +} + +func (*TradesResponse) QtyExponentSinceVersion() uint16 { + return 0 +} + +func (t *TradesResponse) QtyExponentInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.QtyExponentSinceVersion() +} + +func (*TradesResponse) QtyExponentDeprecated() uint16 { + return 0 +} + +func (*TradesResponse) QtyExponentMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*TradesResponse) QtyExponentMinValue() int8 { + return math.MinInt8 + 1 +} + +func (*TradesResponse) QtyExponentMaxValue() int8 { + return math.MaxInt8 +} + +func (*TradesResponse) QtyExponentNullValue() int8 { + return math.MinInt8 +} + +func (*TradesResponseTrades) IdId() uint16 { + return 1 +} + +func (*TradesResponseTrades) IdSinceVersion() uint16 { + return 0 +} + +func (t *TradesResponseTrades) IdInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.IdSinceVersion() +} + +func (*TradesResponseTrades) IdDeprecated() uint16 { + return 0 +} + +func (*TradesResponseTrades) IdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*TradesResponseTrades) IdMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*TradesResponseTrades) IdMaxValue() int64 { + return math.MaxInt64 +} + +func (*TradesResponseTrades) IdNullValue() int64 { + return math.MinInt64 +} + +func (*TradesResponseTrades) PriceId() uint16 { + return 2 +} + +func (*TradesResponseTrades) PriceSinceVersion() uint16 { + return 0 +} + +func (t *TradesResponseTrades) PriceInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.PriceSinceVersion() +} + +func (*TradesResponseTrades) PriceDeprecated() uint16 { + return 0 +} + +func (*TradesResponseTrades) PriceMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*TradesResponseTrades) PriceMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*TradesResponseTrades) PriceMaxValue() int64 { + return math.MaxInt64 +} + +func (*TradesResponseTrades) PriceNullValue() int64 { + return math.MinInt64 +} + +func (*TradesResponseTrades) QtyId() uint16 { + return 3 +} + +func (*TradesResponseTrades) QtySinceVersion() uint16 { + return 0 +} + +func (t *TradesResponseTrades) QtyInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.QtySinceVersion() +} + +func (*TradesResponseTrades) QtyDeprecated() uint16 { + return 0 +} + +func (*TradesResponseTrades) QtyMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*TradesResponseTrades) QtyMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*TradesResponseTrades) QtyMaxValue() int64 { + return math.MaxInt64 +} + +func (*TradesResponseTrades) QtyNullValue() int64 { + return math.MinInt64 +} + +func (*TradesResponseTrades) QuoteQtyId() uint16 { + return 4 +} + +func (*TradesResponseTrades) QuoteQtySinceVersion() uint16 { + return 0 +} + +func (t *TradesResponseTrades) QuoteQtyInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.QuoteQtySinceVersion() +} + +func (*TradesResponseTrades) QuoteQtyDeprecated() uint16 { + return 0 +} + +func (*TradesResponseTrades) QuoteQtyMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*TradesResponseTrades) QuoteQtyMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*TradesResponseTrades) QuoteQtyMaxValue() int64 { + return math.MaxInt64 +} + +func (*TradesResponseTrades) QuoteQtyNullValue() int64 { + return math.MinInt64 +} + +func (*TradesResponseTrades) TimeId() uint16 { + return 5 +} + +func (*TradesResponseTrades) TimeSinceVersion() uint16 { + return 0 +} + +func (t *TradesResponseTrades) TimeInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.TimeSinceVersion() +} + +func (*TradesResponseTrades) TimeDeprecated() uint16 { + return 0 +} + +func (*TradesResponseTrades) TimeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*TradesResponseTrades) TimeMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*TradesResponseTrades) TimeMaxValue() int64 { + return math.MaxInt64 +} + +func (*TradesResponseTrades) TimeNullValue() int64 { + return math.MinInt64 +} + +func (*TradesResponseTrades) IsBuyerMakerId() uint16 { + return 6 +} + +func (*TradesResponseTrades) IsBuyerMakerSinceVersion() uint16 { + return 0 +} + +func (t *TradesResponseTrades) IsBuyerMakerInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.IsBuyerMakerSinceVersion() +} + +func (*TradesResponseTrades) IsBuyerMakerDeprecated() uint16 { + return 0 +} + +func (*TradesResponseTrades) IsBuyerMakerMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*TradesResponseTrades) IsBestMatchId() uint16 { + return 7 +} + +func (*TradesResponseTrades) IsBestMatchSinceVersion() uint16 { + return 0 +} + +func (t *TradesResponseTrades) IsBestMatchInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.IsBestMatchSinceVersion() +} + +func (*TradesResponseTrades) IsBestMatchDeprecated() uint16 { + return 0 +} + +func (*TradesResponseTrades) IsBestMatchMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*TradesResponse) TradesId() uint16 { + return 100 +} + +func (*TradesResponse) TradesSinceVersion() uint16 { + return 0 +} + +func (t *TradesResponse) TradesInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.TradesSinceVersion() +} + +func (*TradesResponse) TradesDeprecated() uint16 { + return 0 +} + +func (*TradesResponseTrades) SbeBlockLength() (blockLength uint) { + return 42 +} + +func (*TradesResponseTrades) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} diff --git a/v2/sbe/spot_3_1/TrailingDeltaFilter.go b/v2/sbe/spot_3_1/TrailingDeltaFilter.go new file mode 100644 index 00000000..5773fec4 --- /dev/null +++ b/v2/sbe/spot_3_1/TrailingDeltaFilter.go @@ -0,0 +1,334 @@ +// Generated SBE (Simple Binary Encoding) message codec + +package sbe + +import ( + "fmt" + "io" + "io/ioutil" + "math" +) + +type TrailingDeltaFilter struct { + FilterType FilterTypeEnum + MinTrailingAboveDelta int64 + MaxTrailingAboveDelta int64 + MinTrailingBelowDelta int64 + MaxTrailingBelowDelta int64 +} + +func (t *TrailingDeltaFilter) Encode(_m *SbeGoMarshaller, _w io.Writer, doRangeCheck bool) error { + if doRangeCheck { + if err := t.RangeCheck(t.SbeSchemaVersion(), t.SbeSchemaVersion()); err != nil { + return err + } + } + if err := _m.WriteInt64(_w, t.MinTrailingAboveDelta); err != nil { + return err + } + if err := _m.WriteInt64(_w, t.MaxTrailingAboveDelta); err != nil { + return err + } + if err := _m.WriteInt64(_w, t.MinTrailingBelowDelta); err != nil { + return err + } + if err := _m.WriteInt64(_w, t.MaxTrailingBelowDelta); err != nil { + return err + } + return nil +} + +func (t *TrailingDeltaFilter) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint16, doRangeCheck bool) error { + t.FilterType = FilterType.TrailingDelta + if !t.MinTrailingAboveDeltaInActingVersion(actingVersion) { + t.MinTrailingAboveDelta = t.MinTrailingAboveDeltaNullValue() + } else { + if err := _m.ReadInt64(_r, &t.MinTrailingAboveDelta); err != nil { + return err + } + } + if !t.MaxTrailingAboveDeltaInActingVersion(actingVersion) { + t.MaxTrailingAboveDelta = t.MaxTrailingAboveDeltaNullValue() + } else { + if err := _m.ReadInt64(_r, &t.MaxTrailingAboveDelta); err != nil { + return err + } + } + if !t.MinTrailingBelowDeltaInActingVersion(actingVersion) { + t.MinTrailingBelowDelta = t.MinTrailingBelowDeltaNullValue() + } else { + if err := _m.ReadInt64(_r, &t.MinTrailingBelowDelta); err != nil { + return err + } + } + if !t.MaxTrailingBelowDeltaInActingVersion(actingVersion) { + t.MaxTrailingBelowDelta = t.MaxTrailingBelowDeltaNullValue() + } else { + if err := _m.ReadInt64(_r, &t.MaxTrailingBelowDelta); err != nil { + return err + } + } + if actingVersion > t.SbeSchemaVersion() && blockLength > t.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-t.SbeBlockLength())) + } + if doRangeCheck { + if err := t.RangeCheck(actingVersion, t.SbeSchemaVersion()); err != nil { + return err + } + } + return nil +} + +func (t *TrailingDeltaFilter) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if err := t.FilterType.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if t.MinTrailingAboveDeltaInActingVersion(actingVersion) { + if t.MinTrailingAboveDelta < t.MinTrailingAboveDeltaMinValue() || t.MinTrailingAboveDelta > t.MinTrailingAboveDeltaMaxValue() { + return fmt.Errorf("Range check failed on t.MinTrailingAboveDelta (%v < %v > %v)", t.MinTrailingAboveDeltaMinValue(), t.MinTrailingAboveDelta, t.MinTrailingAboveDeltaMaxValue()) + } + } + if t.MaxTrailingAboveDeltaInActingVersion(actingVersion) { + if t.MaxTrailingAboveDelta < t.MaxTrailingAboveDeltaMinValue() || t.MaxTrailingAboveDelta > t.MaxTrailingAboveDeltaMaxValue() { + return fmt.Errorf("Range check failed on t.MaxTrailingAboveDelta (%v < %v > %v)", t.MaxTrailingAboveDeltaMinValue(), t.MaxTrailingAboveDelta, t.MaxTrailingAboveDeltaMaxValue()) + } + } + if t.MinTrailingBelowDeltaInActingVersion(actingVersion) { + if t.MinTrailingBelowDelta < t.MinTrailingBelowDeltaMinValue() || t.MinTrailingBelowDelta > t.MinTrailingBelowDeltaMaxValue() { + return fmt.Errorf("Range check failed on t.MinTrailingBelowDelta (%v < %v > %v)", t.MinTrailingBelowDeltaMinValue(), t.MinTrailingBelowDelta, t.MinTrailingBelowDeltaMaxValue()) + } + } + if t.MaxTrailingBelowDeltaInActingVersion(actingVersion) { + if t.MaxTrailingBelowDelta < t.MaxTrailingBelowDeltaMinValue() || t.MaxTrailingBelowDelta > t.MaxTrailingBelowDeltaMaxValue() { + return fmt.Errorf("Range check failed on t.MaxTrailingBelowDelta (%v < %v > %v)", t.MaxTrailingBelowDeltaMinValue(), t.MaxTrailingBelowDelta, t.MaxTrailingBelowDeltaMaxValue()) + } + } + return nil +} + +func TrailingDeltaFilterInit(t *TrailingDeltaFilter) { + t.FilterType = FilterType.TrailingDelta + return +} + +func (*TrailingDeltaFilter) SbeBlockLength() (blockLength uint16) { + return 32 +} + +func (*TrailingDeltaFilter) SbeTemplateId() (templateId uint16) { + return 13 +} + +func (*TrailingDeltaFilter) SbeSchemaId() (schemaId uint16) { + return 3 +} + +func (*TrailingDeltaFilter) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} + +func (*TrailingDeltaFilter) SbeSemanticType() (semanticType []byte) { + return []byte("") +} + +func (*TrailingDeltaFilter) SbeSemanticVersion() (semanticVersion string) { + return "5.2" +} + +func (*TrailingDeltaFilter) FilterTypeId() uint16 { + return 1 +} + +func (*TrailingDeltaFilter) FilterTypeSinceVersion() uint16 { + return 0 +} + +func (t *TrailingDeltaFilter) FilterTypeInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.FilterTypeSinceVersion() +} + +func (*TrailingDeltaFilter) FilterTypeDeprecated() uint16 { + return 0 +} + +func (*TrailingDeltaFilter) FilterTypeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "constant" + } + return "" +} + +func (*TrailingDeltaFilter) MinTrailingAboveDeltaId() uint16 { + return 2 +} + +func (*TrailingDeltaFilter) MinTrailingAboveDeltaSinceVersion() uint16 { + return 0 +} + +func (t *TrailingDeltaFilter) MinTrailingAboveDeltaInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.MinTrailingAboveDeltaSinceVersion() +} + +func (*TrailingDeltaFilter) MinTrailingAboveDeltaDeprecated() uint16 { + return 0 +} + +func (*TrailingDeltaFilter) MinTrailingAboveDeltaMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*TrailingDeltaFilter) MinTrailingAboveDeltaMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*TrailingDeltaFilter) MinTrailingAboveDeltaMaxValue() int64 { + return math.MaxInt64 +} + +func (*TrailingDeltaFilter) MinTrailingAboveDeltaNullValue() int64 { + return math.MinInt64 +} + +func (*TrailingDeltaFilter) MaxTrailingAboveDeltaId() uint16 { + return 3 +} + +func (*TrailingDeltaFilter) MaxTrailingAboveDeltaSinceVersion() uint16 { + return 0 +} + +func (t *TrailingDeltaFilter) MaxTrailingAboveDeltaInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.MaxTrailingAboveDeltaSinceVersion() +} + +func (*TrailingDeltaFilter) MaxTrailingAboveDeltaDeprecated() uint16 { + return 0 +} + +func (*TrailingDeltaFilter) MaxTrailingAboveDeltaMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*TrailingDeltaFilter) MaxTrailingAboveDeltaMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*TrailingDeltaFilter) MaxTrailingAboveDeltaMaxValue() int64 { + return math.MaxInt64 +} + +func (*TrailingDeltaFilter) MaxTrailingAboveDeltaNullValue() int64 { + return math.MinInt64 +} + +func (*TrailingDeltaFilter) MinTrailingBelowDeltaId() uint16 { + return 4 +} + +func (*TrailingDeltaFilter) MinTrailingBelowDeltaSinceVersion() uint16 { + return 0 +} + +func (t *TrailingDeltaFilter) MinTrailingBelowDeltaInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.MinTrailingBelowDeltaSinceVersion() +} + +func (*TrailingDeltaFilter) MinTrailingBelowDeltaDeprecated() uint16 { + return 0 +} + +func (*TrailingDeltaFilter) MinTrailingBelowDeltaMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*TrailingDeltaFilter) MinTrailingBelowDeltaMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*TrailingDeltaFilter) MinTrailingBelowDeltaMaxValue() int64 { + return math.MaxInt64 +} + +func (*TrailingDeltaFilter) MinTrailingBelowDeltaNullValue() int64 { + return math.MinInt64 +} + +func (*TrailingDeltaFilter) MaxTrailingBelowDeltaId() uint16 { + return 5 +} + +func (*TrailingDeltaFilter) MaxTrailingBelowDeltaSinceVersion() uint16 { + return 0 +} + +func (t *TrailingDeltaFilter) MaxTrailingBelowDeltaInActingVersion(actingVersion uint16) bool { + return actingVersion >= t.MaxTrailingBelowDeltaSinceVersion() +} + +func (*TrailingDeltaFilter) MaxTrailingBelowDeltaDeprecated() uint16 { + return 0 +} + +func (*TrailingDeltaFilter) MaxTrailingBelowDeltaMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*TrailingDeltaFilter) MaxTrailingBelowDeltaMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*TrailingDeltaFilter) MaxTrailingBelowDeltaMaxValue() int64 { + return math.MaxInt64 +} + +func (*TrailingDeltaFilter) MaxTrailingBelowDeltaNullValue() int64 { + return math.MinInt64 +} diff --git a/v2/sbe/spot_3_1/UserDataStreamPingResponse.go b/v2/sbe/spot_3_1/UserDataStreamPingResponse.go new file mode 100644 index 00000000..461dee67 --- /dev/null +++ b/v2/sbe/spot_3_1/UserDataStreamPingResponse.go @@ -0,0 +1,64 @@ +// Generated SBE (Simple Binary Encoding) message codec + +package sbe + +import ( + "io" + "io/ioutil" +) + +type UserDataStreamPingResponse struct { +} + +func (u *UserDataStreamPingResponse) Encode(_m *SbeGoMarshaller, _w io.Writer, doRangeCheck bool) error { + if doRangeCheck { + if err := u.RangeCheck(u.SbeSchemaVersion(), u.SbeSchemaVersion()); err != nil { + return err + } + } + return nil +} + +func (u *UserDataStreamPingResponse) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint16, doRangeCheck bool) error { + if actingVersion > u.SbeSchemaVersion() && blockLength > u.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-u.SbeBlockLength())) + } + if doRangeCheck { + if err := u.RangeCheck(actingVersion, u.SbeSchemaVersion()); err != nil { + return err + } + } + return nil +} + +func (u *UserDataStreamPingResponse) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + return nil +} + +func UserDataStreamPingResponseInit(u *UserDataStreamPingResponse) { + return +} + +func (*UserDataStreamPingResponse) SbeBlockLength() (blockLength uint16) { + return 0 +} + +func (*UserDataStreamPingResponse) SbeTemplateId() (templateId uint16) { + return 501 +} + +func (*UserDataStreamPingResponse) SbeSchemaId() (schemaId uint16) { + return 3 +} + +func (*UserDataStreamPingResponse) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} + +func (*UserDataStreamPingResponse) SbeSemanticType() (semanticType []byte) { + return []byte("") +} + +func (*UserDataStreamPingResponse) SbeSemanticVersion() (semanticVersion string) { + return "5.2" +} diff --git a/v2/sbe/spot_3_1/UserDataStreamStartResponse.go b/v2/sbe/spot_3_1/UserDataStreamStartResponse.go new file mode 100644 index 00000000..bbf0ca7e --- /dev/null +++ b/v2/sbe/spot_3_1/UserDataStreamStartResponse.go @@ -0,0 +1,124 @@ +// Generated SBE (Simple Binary Encoding) message codec + +package sbe + +import ( + "errors" + "io" + "io/ioutil" + "unicode/utf8" +) + +type UserDataStreamStartResponse struct { + ListenKey []uint8 +} + +func (u *UserDataStreamStartResponse) Encode(_m *SbeGoMarshaller, _w io.Writer, doRangeCheck bool) error { + if doRangeCheck { + if err := u.RangeCheck(u.SbeSchemaVersion(), u.SbeSchemaVersion()); err != nil { + return err + } + } + if err := _m.WriteUint8(_w, uint8(len(u.ListenKey))); err != nil { + return err + } + if err := _m.WriteBytes(_w, u.ListenKey); err != nil { + return err + } + return nil +} + +func (u *UserDataStreamStartResponse) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint16, doRangeCheck bool) error { + if actingVersion > u.SbeSchemaVersion() && blockLength > u.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-u.SbeBlockLength())) + } + + if u.ListenKeyInActingVersion(actingVersion) { + var ListenKeyLength uint8 + if err := _m.ReadUint8(_r, &ListenKeyLength); err != nil { + return err + } + if cap(u.ListenKey) < int(ListenKeyLength) { + u.ListenKey = make([]uint8, ListenKeyLength) + } + u.ListenKey = u.ListenKey[:ListenKeyLength] + if err := _m.ReadBytes(_r, u.ListenKey); err != nil { + return err + } + } + if doRangeCheck { + if err := u.RangeCheck(actingVersion, u.SbeSchemaVersion()); err != nil { + return err + } + } + return nil +} + +func (u *UserDataStreamStartResponse) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if !utf8.Valid(u.ListenKey[:]) { + return errors.New("u.ListenKey failed UTF-8 validation") + } + return nil +} + +func UserDataStreamStartResponseInit(u *UserDataStreamStartResponse) { + return +} + +func (*UserDataStreamStartResponse) SbeBlockLength() (blockLength uint16) { + return 0 +} + +func (*UserDataStreamStartResponse) SbeTemplateId() (templateId uint16) { + return 500 +} + +func (*UserDataStreamStartResponse) SbeSchemaId() (schemaId uint16) { + return 3 +} + +func (*UserDataStreamStartResponse) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} + +func (*UserDataStreamStartResponse) SbeSemanticType() (semanticType []byte) { + return []byte("") +} + +func (*UserDataStreamStartResponse) SbeSemanticVersion() (semanticVersion string) { + return "5.2" +} + +func (*UserDataStreamStartResponse) ListenKeyMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*UserDataStreamStartResponse) ListenKeySinceVersion() uint16 { + return 0 +} + +func (u *UserDataStreamStartResponse) ListenKeyInActingVersion(actingVersion uint16) bool { + return actingVersion >= u.ListenKeySinceVersion() +} + +func (*UserDataStreamStartResponse) ListenKeyDeprecated() uint16 { + return 0 +} + +func (UserDataStreamStartResponse) ListenKeyCharacterEncoding() string { + return "UTF-8" +} + +func (UserDataStreamStartResponse) ListenKeyHeaderLength() uint64 { + return 1 +} diff --git a/v2/sbe/spot_3_1/UserDataStreamStopResponse.go b/v2/sbe/spot_3_1/UserDataStreamStopResponse.go new file mode 100644 index 00000000..807361e0 --- /dev/null +++ b/v2/sbe/spot_3_1/UserDataStreamStopResponse.go @@ -0,0 +1,64 @@ +// Generated SBE (Simple Binary Encoding) message codec + +package sbe + +import ( + "io" + "io/ioutil" +) + +type UserDataStreamStopResponse struct { +} + +func (u *UserDataStreamStopResponse) Encode(_m *SbeGoMarshaller, _w io.Writer, doRangeCheck bool) error { + if doRangeCheck { + if err := u.RangeCheck(u.SbeSchemaVersion(), u.SbeSchemaVersion()); err != nil { + return err + } + } + return nil +} + +func (u *UserDataStreamStopResponse) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint16, doRangeCheck bool) error { + if actingVersion > u.SbeSchemaVersion() && blockLength > u.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-u.SbeBlockLength())) + } + if doRangeCheck { + if err := u.RangeCheck(actingVersion, u.SbeSchemaVersion()); err != nil { + return err + } + } + return nil +} + +func (u *UserDataStreamStopResponse) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + return nil +} + +func UserDataStreamStopResponseInit(u *UserDataStreamStopResponse) { + return +} + +func (*UserDataStreamStopResponse) SbeBlockLength() (blockLength uint16) { + return 0 +} + +func (*UserDataStreamStopResponse) SbeTemplateId() (templateId uint16) { + return 502 +} + +func (*UserDataStreamStopResponse) SbeSchemaId() (schemaId uint16) { + return 3 +} + +func (*UserDataStreamStopResponse) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} + +func (*UserDataStreamStopResponse) SbeSemanticType() (semanticType []byte) { + return []byte("") +} + +func (*UserDataStreamStopResponse) SbeSemanticVersion() (semanticVersion string) { + return "5.2" +} diff --git a/v2/sbe/spot_3_1/UserDataStreamSubscribeListenTokenResponse.go b/v2/sbe/spot_3_1/UserDataStreamSubscribeListenTokenResponse.go new file mode 100644 index 00000000..c92bafd2 --- /dev/null +++ b/v2/sbe/spot_3_1/UserDataStreamSubscribeListenTokenResponse.go @@ -0,0 +1,182 @@ +// Generated SBE (Simple Binary Encoding) message codec + +package sbe + +import ( + "fmt" + "io" + "io/ioutil" + "math" +) + +type UserDataStreamSubscribeListenTokenResponse struct { + SubscriptionId uint16 + ExpirationTime int64 +} + +func (u *UserDataStreamSubscribeListenTokenResponse) Encode(_m *SbeGoMarshaller, _w io.Writer, doRangeCheck bool) error { + if doRangeCheck { + if err := u.RangeCheck(u.SbeSchemaVersion(), u.SbeSchemaVersion()); err != nil { + return err + } + } + if err := _m.WriteUint16(_w, u.SubscriptionId); err != nil { + return err + } + if err := _m.WriteInt64(_w, u.ExpirationTime); err != nil { + return err + } + return nil +} + +func (u *UserDataStreamSubscribeListenTokenResponse) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint16, doRangeCheck bool) error { + if !u.SubscriptionIdInActingVersion(actingVersion) { + u.SubscriptionId = u.SubscriptionIdNullValue() + } else { + if err := _m.ReadUint16(_r, &u.SubscriptionId); err != nil { + return err + } + } + if !u.ExpirationTimeInActingVersion(actingVersion) { + u.ExpirationTime = u.ExpirationTimeNullValue() + } else { + if err := _m.ReadInt64(_r, &u.ExpirationTime); err != nil { + return err + } + } + if actingVersion > u.SbeSchemaVersion() && blockLength > u.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-u.SbeBlockLength())) + } + if doRangeCheck { + if err := u.RangeCheck(actingVersion, u.SbeSchemaVersion()); err != nil { + return err + } + } + return nil +} + +func (u *UserDataStreamSubscribeListenTokenResponse) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if u.SubscriptionIdInActingVersion(actingVersion) { + if u.SubscriptionId < u.SubscriptionIdMinValue() || u.SubscriptionId > u.SubscriptionIdMaxValue() { + return fmt.Errorf("Range check failed on u.SubscriptionId (%v < %v > %v)", u.SubscriptionIdMinValue(), u.SubscriptionId, u.SubscriptionIdMaxValue()) + } + } + if u.ExpirationTimeInActingVersion(actingVersion) { + if u.ExpirationTime < u.ExpirationTimeMinValue() || u.ExpirationTime > u.ExpirationTimeMaxValue() { + return fmt.Errorf("Range check failed on u.ExpirationTime (%v < %v > %v)", u.ExpirationTimeMinValue(), u.ExpirationTime, u.ExpirationTimeMaxValue()) + } + } + return nil +} + +func UserDataStreamSubscribeListenTokenResponseInit(u *UserDataStreamSubscribeListenTokenResponse) { + return +} + +func (*UserDataStreamSubscribeListenTokenResponse) SbeBlockLength() (blockLength uint16) { + return 10 +} + +func (*UserDataStreamSubscribeListenTokenResponse) SbeTemplateId() (templateId uint16) { + return 505 +} + +func (*UserDataStreamSubscribeListenTokenResponse) SbeSchemaId() (schemaId uint16) { + return 3 +} + +func (*UserDataStreamSubscribeListenTokenResponse) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} + +func (*UserDataStreamSubscribeListenTokenResponse) SbeSemanticType() (semanticType []byte) { + return []byte("") +} + +func (*UserDataStreamSubscribeListenTokenResponse) SbeSemanticVersion() (semanticVersion string) { + return "5.2" +} + +func (*UserDataStreamSubscribeListenTokenResponse) SubscriptionIdId() uint16 { + return 1 +} + +func (*UserDataStreamSubscribeListenTokenResponse) SubscriptionIdSinceVersion() uint16 { + return 0 +} + +func (u *UserDataStreamSubscribeListenTokenResponse) SubscriptionIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= u.SubscriptionIdSinceVersion() +} + +func (*UserDataStreamSubscribeListenTokenResponse) SubscriptionIdDeprecated() uint16 { + return 0 +} + +func (*UserDataStreamSubscribeListenTokenResponse) SubscriptionIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*UserDataStreamSubscribeListenTokenResponse) SubscriptionIdMinValue() uint16 { + return 0 +} + +func (*UserDataStreamSubscribeListenTokenResponse) SubscriptionIdMaxValue() uint16 { + return math.MaxUint16 - 1 +} + +func (*UserDataStreamSubscribeListenTokenResponse) SubscriptionIdNullValue() uint16 { + return math.MaxUint16 +} + +func (*UserDataStreamSubscribeListenTokenResponse) ExpirationTimeId() uint16 { + return 2 +} + +func (*UserDataStreamSubscribeListenTokenResponse) ExpirationTimeSinceVersion() uint16 { + return 0 +} + +func (u *UserDataStreamSubscribeListenTokenResponse) ExpirationTimeInActingVersion(actingVersion uint16) bool { + return actingVersion >= u.ExpirationTimeSinceVersion() +} + +func (*UserDataStreamSubscribeListenTokenResponse) ExpirationTimeDeprecated() uint16 { + return 0 +} + +func (*UserDataStreamSubscribeListenTokenResponse) ExpirationTimeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*UserDataStreamSubscribeListenTokenResponse) ExpirationTimeMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*UserDataStreamSubscribeListenTokenResponse) ExpirationTimeMaxValue() int64 { + return math.MaxInt64 +} + +func (*UserDataStreamSubscribeListenTokenResponse) ExpirationTimeNullValue() int64 { + return math.MinInt64 +} diff --git a/v2/sbe/spot_3_1/UserDataStreamSubscribeResponse.go b/v2/sbe/spot_3_1/UserDataStreamSubscribeResponse.go new file mode 100644 index 00000000..7b693a57 --- /dev/null +++ b/v2/sbe/spot_3_1/UserDataStreamSubscribeResponse.go @@ -0,0 +1,125 @@ +// Generated SBE (Simple Binary Encoding) message codec + +package sbe + +import ( + "fmt" + "io" + "io/ioutil" + "math" +) + +type UserDataStreamSubscribeResponse struct { + SubscriptionId uint16 +} + +func (u *UserDataStreamSubscribeResponse) Encode(_m *SbeGoMarshaller, _w io.Writer, doRangeCheck bool) error { + if doRangeCheck { + if err := u.RangeCheck(u.SbeSchemaVersion(), u.SbeSchemaVersion()); err != nil { + return err + } + } + if err := _m.WriteUint16(_w, u.SubscriptionId); err != nil { + return err + } + return nil +} + +func (u *UserDataStreamSubscribeResponse) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint16, doRangeCheck bool) error { + if !u.SubscriptionIdInActingVersion(actingVersion) { + u.SubscriptionId = u.SubscriptionIdNullValue() + } else { + if err := _m.ReadUint16(_r, &u.SubscriptionId); err != nil { + return err + } + } + if actingVersion > u.SbeSchemaVersion() && blockLength > u.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-u.SbeBlockLength())) + } + if doRangeCheck { + if err := u.RangeCheck(actingVersion, u.SbeSchemaVersion()); err != nil { + return err + } + } + return nil +} + +func (u *UserDataStreamSubscribeResponse) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if u.SubscriptionIdInActingVersion(actingVersion) { + if u.SubscriptionId != u.SubscriptionIdNullValue() && (u.SubscriptionId < u.SubscriptionIdMinValue() || u.SubscriptionId > u.SubscriptionIdMaxValue()) { + return fmt.Errorf("Range check failed on u.SubscriptionId (%v < %v > %v)", u.SubscriptionIdMinValue(), u.SubscriptionId, u.SubscriptionIdMaxValue()) + } + } + return nil +} + +func UserDataStreamSubscribeResponseInit(u *UserDataStreamSubscribeResponse) { + u.SubscriptionId = math.MaxUint16 + return +} + +func (*UserDataStreamSubscribeResponse) SbeBlockLength() (blockLength uint16) { + return 2 +} + +func (*UserDataStreamSubscribeResponse) SbeTemplateId() (templateId uint16) { + return 503 +} + +func (*UserDataStreamSubscribeResponse) SbeSchemaId() (schemaId uint16) { + return 3 +} + +func (*UserDataStreamSubscribeResponse) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} + +func (*UserDataStreamSubscribeResponse) SbeSemanticType() (semanticType []byte) { + return []byte("") +} + +func (*UserDataStreamSubscribeResponse) SbeSemanticVersion() (semanticVersion string) { + return "5.2" +} + +func (*UserDataStreamSubscribeResponse) SubscriptionIdId() uint16 { + return 1 +} + +func (*UserDataStreamSubscribeResponse) SubscriptionIdSinceVersion() uint16 { + return 1 +} + +func (u *UserDataStreamSubscribeResponse) SubscriptionIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= u.SubscriptionIdSinceVersion() +} + +func (*UserDataStreamSubscribeResponse) SubscriptionIdDeprecated() uint16 { + return 0 +} + +func (*UserDataStreamSubscribeResponse) SubscriptionIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*UserDataStreamSubscribeResponse) SubscriptionIdMinValue() uint16 { + return 0 +} + +func (*UserDataStreamSubscribeResponse) SubscriptionIdMaxValue() uint16 { + return math.MaxUint16 - 1 +} + +func (*UserDataStreamSubscribeResponse) SubscriptionIdNullValue() uint16 { + return math.MaxUint16 +} diff --git a/v2/sbe/spot_3_1/UserDataStreamUnsubscribeResponse.go b/v2/sbe/spot_3_1/UserDataStreamUnsubscribeResponse.go new file mode 100644 index 00000000..8737b811 --- /dev/null +++ b/v2/sbe/spot_3_1/UserDataStreamUnsubscribeResponse.go @@ -0,0 +1,64 @@ +// Generated SBE (Simple Binary Encoding) message codec + +package sbe + +import ( + "io" + "io/ioutil" +) + +type UserDataStreamUnsubscribeResponse struct { +} + +func (u *UserDataStreamUnsubscribeResponse) Encode(_m *SbeGoMarshaller, _w io.Writer, doRangeCheck bool) error { + if doRangeCheck { + if err := u.RangeCheck(u.SbeSchemaVersion(), u.SbeSchemaVersion()); err != nil { + return err + } + } + return nil +} + +func (u *UserDataStreamUnsubscribeResponse) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint16, doRangeCheck bool) error { + if actingVersion > u.SbeSchemaVersion() && blockLength > u.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-u.SbeBlockLength())) + } + if doRangeCheck { + if err := u.RangeCheck(actingVersion, u.SbeSchemaVersion()); err != nil { + return err + } + } + return nil +} + +func (u *UserDataStreamUnsubscribeResponse) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + return nil +} + +func UserDataStreamUnsubscribeResponseInit(u *UserDataStreamUnsubscribeResponse) { + return +} + +func (*UserDataStreamUnsubscribeResponse) SbeBlockLength() (blockLength uint16) { + return 0 +} + +func (*UserDataStreamUnsubscribeResponse) SbeTemplateId() (templateId uint16) { + return 504 +} + +func (*UserDataStreamUnsubscribeResponse) SbeSchemaId() (schemaId uint16) { + return 3 +} + +func (*UserDataStreamUnsubscribeResponse) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} + +func (*UserDataStreamUnsubscribeResponse) SbeSemanticType() (semanticType []byte) { + return []byte("") +} + +func (*UserDataStreamUnsubscribeResponse) SbeSemanticVersion() (semanticVersion string) { + return "5.2" +} diff --git a/v2/sbe/spot_3_1/VarString.go b/v2/sbe/spot_3_1/VarString.go new file mode 100644 index 00000000..e925e82e --- /dev/null +++ b/v2/sbe/spot_3_1/VarString.go @@ -0,0 +1,112 @@ +// Generated SBE (Simple Binary Encoding) message codec + +package sbe + +import ( + "fmt" + "io" + "math" +) + +type VarString struct { + Length uint16 + VarData uint8 +} + +func (v *VarString) Encode(_m *SbeGoMarshaller, _w io.Writer) error { + if err := _m.WriteUint16(_w, v.Length); err != nil { + return err + } + if err := _m.WriteUint8(_w, v.VarData); err != nil { + return err + } + return nil +} + +func (v *VarString) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16) error { + if !v.LengthInActingVersion(actingVersion) { + v.Length = v.LengthNullValue() + } else { + if err := _m.ReadUint16(_r, &v.Length); err != nil { + return err + } + } + if !v.VarDataInActingVersion(actingVersion) { + v.VarData = v.VarDataNullValue() + } else { + if err := _m.ReadUint8(_r, &v.VarData); err != nil { + return err + } + } + return nil +} + +func (v *VarString) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if v.LengthInActingVersion(actingVersion) { + if v.Length < v.LengthMinValue() || v.Length > v.LengthMaxValue() { + return fmt.Errorf("Range check failed on v.Length (%v < %v > %v)", v.LengthMinValue(), v.Length, v.LengthMaxValue()) + } + } + if v.VarDataInActingVersion(actingVersion) { + if v.VarData < v.VarDataMinValue() || v.VarData > v.VarDataMaxValue() { + return fmt.Errorf("Range check failed on v.VarData (%v < %v > %v)", v.VarDataMinValue(), v.VarData, v.VarDataMaxValue()) + } + } + return nil +} + +func VarStringInit(v *VarString) { + return +} + +func (*VarString) EncodedLength() int64 { + return -1 +} + +func (*VarString) LengthMinValue() uint16 { + return 0 +} + +func (*VarString) LengthMaxValue() uint16 { + return math.MaxUint16 - 1 +} + +func (*VarString) LengthNullValue() uint16 { + return math.MaxUint16 +} + +func (*VarString) LengthSinceVersion() uint16 { + return 0 +} + +func (v *VarString) LengthInActingVersion(actingVersion uint16) bool { + return actingVersion >= v.LengthSinceVersion() +} + +func (*VarString) LengthDeprecated() uint16 { + return 0 +} + +func (*VarString) VarDataMinValue() uint8 { + return 0 +} + +func (*VarString) VarDataMaxValue() uint8 { + return math.MaxUint8 - 1 +} + +func (*VarString) VarDataNullValue() uint8 { + return math.MaxUint8 +} + +func (*VarString) VarDataSinceVersion() uint16 { + return 0 +} + +func (v *VarString) VarDataInActingVersion(actingVersion uint16) bool { + return actingVersion >= v.VarDataSinceVersion() +} + +func (*VarString) VarDataDeprecated() uint16 { + return 0 +} diff --git a/v2/sbe/spot_3_1/VarString8.go b/v2/sbe/spot_3_1/VarString8.go new file mode 100644 index 00000000..8deb3dbd --- /dev/null +++ b/v2/sbe/spot_3_1/VarString8.go @@ -0,0 +1,112 @@ +// Generated SBE (Simple Binary Encoding) message codec + +package sbe + +import ( + "fmt" + "io" + "math" +) + +type VarString8 struct { + Length uint8 + VarData uint8 +} + +func (v *VarString8) Encode(_m *SbeGoMarshaller, _w io.Writer) error { + if err := _m.WriteUint8(_w, v.Length); err != nil { + return err + } + if err := _m.WriteUint8(_w, v.VarData); err != nil { + return err + } + return nil +} + +func (v *VarString8) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16) error { + if !v.LengthInActingVersion(actingVersion) { + v.Length = v.LengthNullValue() + } else { + if err := _m.ReadUint8(_r, &v.Length); err != nil { + return err + } + } + if !v.VarDataInActingVersion(actingVersion) { + v.VarData = v.VarDataNullValue() + } else { + if err := _m.ReadUint8(_r, &v.VarData); err != nil { + return err + } + } + return nil +} + +func (v *VarString8) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if v.LengthInActingVersion(actingVersion) { + if v.Length < v.LengthMinValue() || v.Length > v.LengthMaxValue() { + return fmt.Errorf("Range check failed on v.Length (%v < %v > %v)", v.LengthMinValue(), v.Length, v.LengthMaxValue()) + } + } + if v.VarDataInActingVersion(actingVersion) { + if v.VarData < v.VarDataMinValue() || v.VarData > v.VarDataMaxValue() { + return fmt.Errorf("Range check failed on v.VarData (%v < %v > %v)", v.VarDataMinValue(), v.VarData, v.VarDataMaxValue()) + } + } + return nil +} + +func VarString8Init(v *VarString8) { + return +} + +func (*VarString8) EncodedLength() int64 { + return -1 +} + +func (*VarString8) LengthMinValue() uint8 { + return 0 +} + +func (*VarString8) LengthMaxValue() uint8 { + return math.MaxUint8 - 1 +} + +func (*VarString8) LengthNullValue() uint8 { + return math.MaxUint8 +} + +func (*VarString8) LengthSinceVersion() uint16 { + return 0 +} + +func (v *VarString8) LengthInActingVersion(actingVersion uint16) bool { + return actingVersion >= v.LengthSinceVersion() +} + +func (*VarString8) LengthDeprecated() uint16 { + return 0 +} + +func (*VarString8) VarDataMinValue() uint8 { + return 0 +} + +func (*VarString8) VarDataMaxValue() uint8 { + return math.MaxUint8 - 1 +} + +func (*VarString8) VarDataNullValue() uint8 { + return math.MaxUint8 +} + +func (*VarString8) VarDataSinceVersion() uint16 { + return 0 +} + +func (v *VarString8) VarDataInActingVersion(actingVersion uint16) bool { + return actingVersion >= v.VarDataSinceVersion() +} + +func (*VarString8) VarDataDeprecated() uint16 { + return 0 +} diff --git a/v2/sbe/spot_3_1/WebSocketResponse.go b/v2/sbe/spot_3_1/WebSocketResponse.go new file mode 100644 index 00000000..69ce80a1 --- /dev/null +++ b/v2/sbe/spot_3_1/WebSocketResponse.go @@ -0,0 +1,623 @@ +// Generated SBE (Simple Binary Encoding) message codec + +package sbe + +import ( + "errors" + "fmt" + "io" + "io/ioutil" + "math" + "unicode/utf8" +) + +type WebSocketResponse struct { + SbeSchemaIdVersionDeprecated BoolEnumEnum + Status uint16 + RateLimits []WebSocketResponseRateLimits + Id []uint8 + Result []uint8 +} +type WebSocketResponseRateLimits struct { + RateLimitType RateLimitTypeEnum + Interval RateLimitIntervalEnum + IntervalNum uint8 + RateLimit int64 + Current int64 +} + +func (w *WebSocketResponse) Encode(_m *SbeGoMarshaller, _w io.Writer, doRangeCheck bool) error { + if doRangeCheck { + if err := w.RangeCheck(w.SbeSchemaVersion(), w.SbeSchemaVersion()); err != nil { + return err + } + } + if err := w.SbeSchemaIdVersionDeprecated.Encode(_m, _w); err != nil { + return err + } + if err := _m.WriteUint16(_w, w.Status); err != nil { + return err + } + var RateLimitsBlockLength uint16 = 19 + if err := _m.WriteUint16(_w, RateLimitsBlockLength); err != nil { + return err + } + var RateLimitsNumInGroup uint16 = uint16(len(w.RateLimits)) + if err := _m.WriteUint16(_w, RateLimitsNumInGroup); err != nil { + return err + } + for i := range w.RateLimits { + if err := w.RateLimits[i].Encode(_m, _w); err != nil { + return err + } + } + if err := _m.WriteUint8(_w, uint8(len(w.Id))); err != nil { + return err + } + if err := _m.WriteBytes(_w, w.Id); err != nil { + return err + } + if err := _m.WriteUint32(_w, uint32(len(w.Result))); err != nil { + return err + } + if err := _m.WriteBytes(_w, w.Result); err != nil { + return err + } + return nil +} + +func (w *WebSocketResponse) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint16, doRangeCheck bool) error { + if w.SbeSchemaIdVersionDeprecatedInActingVersion(actingVersion) { + if err := w.SbeSchemaIdVersionDeprecated.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if !w.StatusInActingVersion(actingVersion) { + w.Status = w.StatusNullValue() + } else { + if err := _m.ReadUint16(_r, &w.Status); err != nil { + return err + } + } + if actingVersion > w.SbeSchemaVersion() && blockLength > w.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-w.SbeBlockLength())) + } + + if w.RateLimitsInActingVersion(actingVersion) { + var RateLimitsBlockLength uint16 + if err := _m.ReadUint16(_r, &RateLimitsBlockLength); err != nil { + return err + } + var RateLimitsNumInGroup uint16 + if err := _m.ReadUint16(_r, &RateLimitsNumInGroup); err != nil { + return err + } + if cap(w.RateLimits) < int(RateLimitsNumInGroup) { + w.RateLimits = make([]WebSocketResponseRateLimits, RateLimitsNumInGroup) + } + w.RateLimits = w.RateLimits[:RateLimitsNumInGroup] + for i := range w.RateLimits { + if err := w.RateLimits[i].Decode(_m, _r, actingVersion, uint(RateLimitsBlockLength)); err != nil { + return err + } + } + } + + if w.IdInActingVersion(actingVersion) { + var IdLength uint8 + if err := _m.ReadUint8(_r, &IdLength); err != nil { + return err + } + if cap(w.Id) < int(IdLength) { + w.Id = make([]uint8, IdLength) + } + w.Id = w.Id[:IdLength] + if err := _m.ReadBytes(_r, w.Id); err != nil { + return err + } + } + + if w.ResultInActingVersion(actingVersion) { + var ResultLength uint32 + if err := _m.ReadUint32(_r, &ResultLength); err != nil { + return err + } + if cap(w.Result) < int(ResultLength) { + w.Result = make([]uint8, ResultLength) + } + w.Result = w.Result[:ResultLength] + if err := _m.ReadBytes(_r, w.Result); err != nil { + return err + } + } + if doRangeCheck { + if err := w.RangeCheck(actingVersion, w.SbeSchemaVersion()); err != nil { + return err + } + } + return nil +} + +func (w *WebSocketResponse) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if err := w.SbeSchemaIdVersionDeprecated.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if w.StatusInActingVersion(actingVersion) { + if w.Status < w.StatusMinValue() || w.Status > w.StatusMaxValue() { + return fmt.Errorf("Range check failed on w.Status (%v < %v > %v)", w.StatusMinValue(), w.Status, w.StatusMaxValue()) + } + } + for i := range w.RateLimits { + if err := w.RateLimits[i].RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + } + if !utf8.Valid(w.Id[:]) { + return errors.New("w.Id failed UTF-8 validation") + } + return nil +} + +func WebSocketResponseInit(w *WebSocketResponse) { + return +} + +func (w *WebSocketResponseRateLimits) Encode(_m *SbeGoMarshaller, _w io.Writer) error { + if err := w.RateLimitType.Encode(_m, _w); err != nil { + return err + } + if err := w.Interval.Encode(_m, _w); err != nil { + return err + } + if err := _m.WriteUint8(_w, w.IntervalNum); err != nil { + return err + } + if err := _m.WriteInt64(_w, w.RateLimit); err != nil { + return err + } + if err := _m.WriteInt64(_w, w.Current); err != nil { + return err + } + return nil +} + +func (w *WebSocketResponseRateLimits) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint) error { + if w.RateLimitTypeInActingVersion(actingVersion) { + if err := w.RateLimitType.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if w.IntervalInActingVersion(actingVersion) { + if err := w.Interval.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if !w.IntervalNumInActingVersion(actingVersion) { + w.IntervalNum = w.IntervalNumNullValue() + } else { + if err := _m.ReadUint8(_r, &w.IntervalNum); err != nil { + return err + } + } + if !w.RateLimitInActingVersion(actingVersion) { + w.RateLimit = w.RateLimitNullValue() + } else { + if err := _m.ReadInt64(_r, &w.RateLimit); err != nil { + return err + } + } + if !w.CurrentInActingVersion(actingVersion) { + w.Current = w.CurrentNullValue() + } else { + if err := _m.ReadInt64(_r, &w.Current); err != nil { + return err + } + } + if actingVersion > w.SbeSchemaVersion() && blockLength > w.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-w.SbeBlockLength())) + } + return nil +} + +func (w *WebSocketResponseRateLimits) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if err := w.RateLimitType.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if err := w.Interval.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if w.IntervalNumInActingVersion(actingVersion) { + if w.IntervalNum < w.IntervalNumMinValue() || w.IntervalNum > w.IntervalNumMaxValue() { + return fmt.Errorf("Range check failed on w.IntervalNum (%v < %v > %v)", w.IntervalNumMinValue(), w.IntervalNum, w.IntervalNumMaxValue()) + } + } + if w.RateLimitInActingVersion(actingVersion) { + if w.RateLimit < w.RateLimitMinValue() || w.RateLimit > w.RateLimitMaxValue() { + return fmt.Errorf("Range check failed on w.RateLimit (%v < %v > %v)", w.RateLimitMinValue(), w.RateLimit, w.RateLimitMaxValue()) + } + } + if w.CurrentInActingVersion(actingVersion) { + if w.Current < w.CurrentMinValue() || w.Current > w.CurrentMaxValue() { + return fmt.Errorf("Range check failed on w.Current (%v < %v > %v)", w.CurrentMinValue(), w.Current, w.CurrentMaxValue()) + } + } + return nil +} + +func WebSocketResponseRateLimitsInit(w *WebSocketResponseRateLimits) { + return +} + +func (*WebSocketResponse) SbeBlockLength() (blockLength uint16) { + return 3 +} + +func (*WebSocketResponse) SbeTemplateId() (templateId uint16) { + return 50 +} + +func (*WebSocketResponse) SbeSchemaId() (schemaId uint16) { + return 3 +} + +func (*WebSocketResponse) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} + +func (*WebSocketResponse) SbeSemanticType() (semanticType []byte) { + return []byte("") +} + +func (*WebSocketResponse) SbeSemanticVersion() (semanticVersion string) { + return "5.2" +} + +func (*WebSocketResponse) SbeSchemaIdVersionDeprecatedId() uint16 { + return 1 +} + +func (*WebSocketResponse) SbeSchemaIdVersionDeprecatedSinceVersion() uint16 { + return 0 +} + +func (w *WebSocketResponse) SbeSchemaIdVersionDeprecatedInActingVersion(actingVersion uint16) bool { + return actingVersion >= w.SbeSchemaIdVersionDeprecatedSinceVersion() +} + +func (*WebSocketResponse) SbeSchemaIdVersionDeprecatedDeprecated() uint16 { + return 0 +} + +func (*WebSocketResponse) SbeSchemaIdVersionDeprecatedMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*WebSocketResponse) StatusId() uint16 { + return 2 +} + +func (*WebSocketResponse) StatusSinceVersion() uint16 { + return 0 +} + +func (w *WebSocketResponse) StatusInActingVersion(actingVersion uint16) bool { + return actingVersion >= w.StatusSinceVersion() +} + +func (*WebSocketResponse) StatusDeprecated() uint16 { + return 0 +} + +func (*WebSocketResponse) StatusMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*WebSocketResponse) StatusMinValue() uint16 { + return 0 +} + +func (*WebSocketResponse) StatusMaxValue() uint16 { + return math.MaxUint16 - 1 +} + +func (*WebSocketResponse) StatusNullValue() uint16 { + return math.MaxUint16 +} + +func (*WebSocketResponseRateLimits) RateLimitTypeId() uint16 { + return 1 +} + +func (*WebSocketResponseRateLimits) RateLimitTypeSinceVersion() uint16 { + return 0 +} + +func (w *WebSocketResponseRateLimits) RateLimitTypeInActingVersion(actingVersion uint16) bool { + return actingVersion >= w.RateLimitTypeSinceVersion() +} + +func (*WebSocketResponseRateLimits) RateLimitTypeDeprecated() uint16 { + return 0 +} + +func (*WebSocketResponseRateLimits) RateLimitTypeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*WebSocketResponseRateLimits) IntervalId() uint16 { + return 2 +} + +func (*WebSocketResponseRateLimits) IntervalSinceVersion() uint16 { + return 0 +} + +func (w *WebSocketResponseRateLimits) IntervalInActingVersion(actingVersion uint16) bool { + return actingVersion >= w.IntervalSinceVersion() +} + +func (*WebSocketResponseRateLimits) IntervalDeprecated() uint16 { + return 0 +} + +func (*WebSocketResponseRateLimits) IntervalMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*WebSocketResponseRateLimits) IntervalNumId() uint16 { + return 3 +} + +func (*WebSocketResponseRateLimits) IntervalNumSinceVersion() uint16 { + return 0 +} + +func (w *WebSocketResponseRateLimits) IntervalNumInActingVersion(actingVersion uint16) bool { + return actingVersion >= w.IntervalNumSinceVersion() +} + +func (*WebSocketResponseRateLimits) IntervalNumDeprecated() uint16 { + return 0 +} + +func (*WebSocketResponseRateLimits) IntervalNumMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*WebSocketResponseRateLimits) IntervalNumMinValue() uint8 { + return 0 +} + +func (*WebSocketResponseRateLimits) IntervalNumMaxValue() uint8 { + return math.MaxUint8 - 1 +} + +func (*WebSocketResponseRateLimits) IntervalNumNullValue() uint8 { + return math.MaxUint8 +} + +func (*WebSocketResponseRateLimits) RateLimitId() uint16 { + return 4 +} + +func (*WebSocketResponseRateLimits) RateLimitSinceVersion() uint16 { + return 0 +} + +func (w *WebSocketResponseRateLimits) RateLimitInActingVersion(actingVersion uint16) bool { + return actingVersion >= w.RateLimitSinceVersion() +} + +func (*WebSocketResponseRateLimits) RateLimitDeprecated() uint16 { + return 0 +} + +func (*WebSocketResponseRateLimits) RateLimitMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*WebSocketResponseRateLimits) RateLimitMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*WebSocketResponseRateLimits) RateLimitMaxValue() int64 { + return math.MaxInt64 +} + +func (*WebSocketResponseRateLimits) RateLimitNullValue() int64 { + return math.MinInt64 +} + +func (*WebSocketResponseRateLimits) CurrentId() uint16 { + return 5 +} + +func (*WebSocketResponseRateLimits) CurrentSinceVersion() uint16 { + return 0 +} + +func (w *WebSocketResponseRateLimits) CurrentInActingVersion(actingVersion uint16) bool { + return actingVersion >= w.CurrentSinceVersion() +} + +func (*WebSocketResponseRateLimits) CurrentDeprecated() uint16 { + return 0 +} + +func (*WebSocketResponseRateLimits) CurrentMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*WebSocketResponseRateLimits) CurrentMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*WebSocketResponseRateLimits) CurrentMaxValue() int64 { + return math.MaxInt64 +} + +func (*WebSocketResponseRateLimits) CurrentNullValue() int64 { + return math.MinInt64 +} + +func (*WebSocketResponse) RateLimitsId() uint16 { + return 100 +} + +func (*WebSocketResponse) RateLimitsSinceVersion() uint16 { + return 0 +} + +func (w *WebSocketResponse) RateLimitsInActingVersion(actingVersion uint16) bool { + return actingVersion >= w.RateLimitsSinceVersion() +} + +func (*WebSocketResponse) RateLimitsDeprecated() uint16 { + return 0 +} + +func (*WebSocketResponseRateLimits) SbeBlockLength() (blockLength uint) { + return 19 +} + +func (*WebSocketResponseRateLimits) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} + +func (*WebSocketResponse) IdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*WebSocketResponse) IdSinceVersion() uint16 { + return 0 +} + +func (w *WebSocketResponse) IdInActingVersion(actingVersion uint16) bool { + return actingVersion >= w.IdSinceVersion() +} + +func (*WebSocketResponse) IdDeprecated() uint16 { + return 0 +} + +func (WebSocketResponse) IdCharacterEncoding() string { + return "UTF-8" +} + +func (WebSocketResponse) IdHeaderLength() uint64 { + return 1 +} + +func (*WebSocketResponse) ResultMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*WebSocketResponse) ResultSinceVersion() uint16 { + return 0 +} + +func (w *WebSocketResponse) ResultInActingVersion(actingVersion uint16) bool { + return actingVersion >= w.ResultSinceVersion() +} + +func (*WebSocketResponse) ResultDeprecated() uint16 { + return 0 +} + +func (WebSocketResponse) ResultCharacterEncoding() string { + return "null" +} + +func (WebSocketResponse) ResultHeaderLength() uint64 { + return 4 +} diff --git a/v2/sbe/spot_3_1/WebSocketSessionLogonResponse.go b/v2/sbe/spot_3_1/WebSocketSessionLogonResponse.go new file mode 100644 index 00000000..4e5f1817 --- /dev/null +++ b/v2/sbe/spot_3_1/WebSocketSessionLogonResponse.go @@ -0,0 +1,384 @@ +// Generated SBE (Simple Binary Encoding) message codec + +package sbe + +import ( + "errors" + "fmt" + "io" + "io/ioutil" + "math" + "unicode/utf8" +) + +type WebSocketSessionLogonResponse struct { + AuthorizedSince int64 + ConnectedSince int64 + ReturnRateLimits BoolEnumEnum + ServerTime int64 + UserDataStream BoolEnumEnum + LoggedOnApiKey []uint8 +} + +func (w *WebSocketSessionLogonResponse) Encode(_m *SbeGoMarshaller, _w io.Writer, doRangeCheck bool) error { + if doRangeCheck { + if err := w.RangeCheck(w.SbeSchemaVersion(), w.SbeSchemaVersion()); err != nil { + return err + } + } + if err := _m.WriteInt64(_w, w.AuthorizedSince); err != nil { + return err + } + if err := _m.WriteInt64(_w, w.ConnectedSince); err != nil { + return err + } + if err := w.ReturnRateLimits.Encode(_m, _w); err != nil { + return err + } + if err := _m.WriteInt64(_w, w.ServerTime); err != nil { + return err + } + if err := w.UserDataStream.Encode(_m, _w); err != nil { + return err + } + if err := _m.WriteUint16(_w, uint16(len(w.LoggedOnApiKey))); err != nil { + return err + } + if err := _m.WriteBytes(_w, w.LoggedOnApiKey); err != nil { + return err + } + return nil +} + +func (w *WebSocketSessionLogonResponse) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint16, doRangeCheck bool) error { + if !w.AuthorizedSinceInActingVersion(actingVersion) { + w.AuthorizedSince = w.AuthorizedSinceNullValue() + } else { + if err := _m.ReadInt64(_r, &w.AuthorizedSince); err != nil { + return err + } + } + if !w.ConnectedSinceInActingVersion(actingVersion) { + w.ConnectedSince = w.ConnectedSinceNullValue() + } else { + if err := _m.ReadInt64(_r, &w.ConnectedSince); err != nil { + return err + } + } + if w.ReturnRateLimitsInActingVersion(actingVersion) { + if err := w.ReturnRateLimits.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if !w.ServerTimeInActingVersion(actingVersion) { + w.ServerTime = w.ServerTimeNullValue() + } else { + if err := _m.ReadInt64(_r, &w.ServerTime); err != nil { + return err + } + } + if w.UserDataStreamInActingVersion(actingVersion) { + if err := w.UserDataStream.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if actingVersion > w.SbeSchemaVersion() && blockLength > w.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-w.SbeBlockLength())) + } + + if w.LoggedOnApiKeyInActingVersion(actingVersion) { + var LoggedOnApiKeyLength uint16 + if err := _m.ReadUint16(_r, &LoggedOnApiKeyLength); err != nil { + return err + } + if cap(w.LoggedOnApiKey) < int(LoggedOnApiKeyLength) { + w.LoggedOnApiKey = make([]uint8, LoggedOnApiKeyLength) + } + w.LoggedOnApiKey = w.LoggedOnApiKey[:LoggedOnApiKeyLength] + if err := _m.ReadBytes(_r, w.LoggedOnApiKey); err != nil { + return err + } + } + if doRangeCheck { + if err := w.RangeCheck(actingVersion, w.SbeSchemaVersion()); err != nil { + return err + } + } + return nil +} + +func (w *WebSocketSessionLogonResponse) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if w.AuthorizedSinceInActingVersion(actingVersion) { + if w.AuthorizedSince < w.AuthorizedSinceMinValue() || w.AuthorizedSince > w.AuthorizedSinceMaxValue() { + return fmt.Errorf("Range check failed on w.AuthorizedSince (%v < %v > %v)", w.AuthorizedSinceMinValue(), w.AuthorizedSince, w.AuthorizedSinceMaxValue()) + } + } + if w.ConnectedSinceInActingVersion(actingVersion) { + if w.ConnectedSince < w.ConnectedSinceMinValue() || w.ConnectedSince > w.ConnectedSinceMaxValue() { + return fmt.Errorf("Range check failed on w.ConnectedSince (%v < %v > %v)", w.ConnectedSinceMinValue(), w.ConnectedSince, w.ConnectedSinceMaxValue()) + } + } + if err := w.ReturnRateLimits.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if w.ServerTimeInActingVersion(actingVersion) { + if w.ServerTime < w.ServerTimeMinValue() || w.ServerTime > w.ServerTimeMaxValue() { + return fmt.Errorf("Range check failed on w.ServerTime (%v < %v > %v)", w.ServerTimeMinValue(), w.ServerTime, w.ServerTimeMaxValue()) + } + } + if err := w.UserDataStream.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if !utf8.Valid(w.LoggedOnApiKey[:]) { + return errors.New("w.LoggedOnApiKey failed UTF-8 validation") + } + return nil +} + +func WebSocketSessionLogonResponseInit(w *WebSocketSessionLogonResponse) { + return +} + +func (*WebSocketSessionLogonResponse) SbeBlockLength() (blockLength uint16) { + return 26 +} + +func (*WebSocketSessionLogonResponse) SbeTemplateId() (templateId uint16) { + return 51 +} + +func (*WebSocketSessionLogonResponse) SbeSchemaId() (schemaId uint16) { + return 3 +} + +func (*WebSocketSessionLogonResponse) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} + +func (*WebSocketSessionLogonResponse) SbeSemanticType() (semanticType []byte) { + return []byte("") +} + +func (*WebSocketSessionLogonResponse) SbeSemanticVersion() (semanticVersion string) { + return "5.2" +} + +func (*WebSocketSessionLogonResponse) AuthorizedSinceId() uint16 { + return 1 +} + +func (*WebSocketSessionLogonResponse) AuthorizedSinceSinceVersion() uint16 { + return 0 +} + +func (w *WebSocketSessionLogonResponse) AuthorizedSinceInActingVersion(actingVersion uint16) bool { + return actingVersion >= w.AuthorizedSinceSinceVersion() +} + +func (*WebSocketSessionLogonResponse) AuthorizedSinceDeprecated() uint16 { + return 0 +} + +func (*WebSocketSessionLogonResponse) AuthorizedSinceMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*WebSocketSessionLogonResponse) AuthorizedSinceMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*WebSocketSessionLogonResponse) AuthorizedSinceMaxValue() int64 { + return math.MaxInt64 +} + +func (*WebSocketSessionLogonResponse) AuthorizedSinceNullValue() int64 { + return math.MinInt64 +} + +func (*WebSocketSessionLogonResponse) ConnectedSinceId() uint16 { + return 2 +} + +func (*WebSocketSessionLogonResponse) ConnectedSinceSinceVersion() uint16 { + return 0 +} + +func (w *WebSocketSessionLogonResponse) ConnectedSinceInActingVersion(actingVersion uint16) bool { + return actingVersion >= w.ConnectedSinceSinceVersion() +} + +func (*WebSocketSessionLogonResponse) ConnectedSinceDeprecated() uint16 { + return 0 +} + +func (*WebSocketSessionLogonResponse) ConnectedSinceMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*WebSocketSessionLogonResponse) ConnectedSinceMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*WebSocketSessionLogonResponse) ConnectedSinceMaxValue() int64 { + return math.MaxInt64 +} + +func (*WebSocketSessionLogonResponse) ConnectedSinceNullValue() int64 { + return math.MinInt64 +} + +func (*WebSocketSessionLogonResponse) ReturnRateLimitsId() uint16 { + return 3 +} + +func (*WebSocketSessionLogonResponse) ReturnRateLimitsSinceVersion() uint16 { + return 0 +} + +func (w *WebSocketSessionLogonResponse) ReturnRateLimitsInActingVersion(actingVersion uint16) bool { + return actingVersion >= w.ReturnRateLimitsSinceVersion() +} + +func (*WebSocketSessionLogonResponse) ReturnRateLimitsDeprecated() uint16 { + return 0 +} + +func (*WebSocketSessionLogonResponse) ReturnRateLimitsMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*WebSocketSessionLogonResponse) ServerTimeId() uint16 { + return 4 +} + +func (*WebSocketSessionLogonResponse) ServerTimeSinceVersion() uint16 { + return 0 +} + +func (w *WebSocketSessionLogonResponse) ServerTimeInActingVersion(actingVersion uint16) bool { + return actingVersion >= w.ServerTimeSinceVersion() +} + +func (*WebSocketSessionLogonResponse) ServerTimeDeprecated() uint16 { + return 0 +} + +func (*WebSocketSessionLogonResponse) ServerTimeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*WebSocketSessionLogonResponse) ServerTimeMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*WebSocketSessionLogonResponse) ServerTimeMaxValue() int64 { + return math.MaxInt64 +} + +func (*WebSocketSessionLogonResponse) ServerTimeNullValue() int64 { + return math.MinInt64 +} + +func (*WebSocketSessionLogonResponse) UserDataStreamId() uint16 { + return 5 +} + +func (*WebSocketSessionLogonResponse) UserDataStreamSinceVersion() uint16 { + return 0 +} + +func (w *WebSocketSessionLogonResponse) UserDataStreamInActingVersion(actingVersion uint16) bool { + return actingVersion >= w.UserDataStreamSinceVersion() +} + +func (*WebSocketSessionLogonResponse) UserDataStreamDeprecated() uint16 { + return 0 +} + +func (*WebSocketSessionLogonResponse) UserDataStreamMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*WebSocketSessionLogonResponse) LoggedOnApiKeyMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*WebSocketSessionLogonResponse) LoggedOnApiKeySinceVersion() uint16 { + return 0 +} + +func (w *WebSocketSessionLogonResponse) LoggedOnApiKeyInActingVersion(actingVersion uint16) bool { + return actingVersion >= w.LoggedOnApiKeySinceVersion() +} + +func (*WebSocketSessionLogonResponse) LoggedOnApiKeyDeprecated() uint16 { + return 0 +} + +func (WebSocketSessionLogonResponse) LoggedOnApiKeyCharacterEncoding() string { + return "UTF-8" +} + +func (WebSocketSessionLogonResponse) LoggedOnApiKeyHeaderLength() uint64 { + return 2 +} diff --git a/v2/sbe/spot_3_1/WebSocketSessionLogoutResponse.go b/v2/sbe/spot_3_1/WebSocketSessionLogoutResponse.go new file mode 100644 index 00000000..62e17acf --- /dev/null +++ b/v2/sbe/spot_3_1/WebSocketSessionLogoutResponse.go @@ -0,0 +1,385 @@ +// Generated SBE (Simple Binary Encoding) message codec + +package sbe + +import ( + "errors" + "fmt" + "io" + "io/ioutil" + "math" + "unicode/utf8" +) + +type WebSocketSessionLogoutResponse struct { + AuthorizedSince int64 + ConnectedSince int64 + ReturnRateLimits BoolEnumEnum + ServerTime int64 + UserDataStream BoolEnumEnum + LoggedOnApiKey []uint8 +} + +func (w *WebSocketSessionLogoutResponse) Encode(_m *SbeGoMarshaller, _w io.Writer, doRangeCheck bool) error { + if doRangeCheck { + if err := w.RangeCheck(w.SbeSchemaVersion(), w.SbeSchemaVersion()); err != nil { + return err + } + } + if err := _m.WriteInt64(_w, w.AuthorizedSince); err != nil { + return err + } + if err := _m.WriteInt64(_w, w.ConnectedSince); err != nil { + return err + } + if err := w.ReturnRateLimits.Encode(_m, _w); err != nil { + return err + } + if err := _m.WriteInt64(_w, w.ServerTime); err != nil { + return err + } + if err := w.UserDataStream.Encode(_m, _w); err != nil { + return err + } + if err := _m.WriteUint16(_w, uint16(len(w.LoggedOnApiKey))); err != nil { + return err + } + if err := _m.WriteBytes(_w, w.LoggedOnApiKey); err != nil { + return err + } + return nil +} + +func (w *WebSocketSessionLogoutResponse) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint16, doRangeCheck bool) error { + if !w.AuthorizedSinceInActingVersion(actingVersion) { + w.AuthorizedSince = w.AuthorizedSinceNullValue() + } else { + if err := _m.ReadInt64(_r, &w.AuthorizedSince); err != nil { + return err + } + } + if !w.ConnectedSinceInActingVersion(actingVersion) { + w.ConnectedSince = w.ConnectedSinceNullValue() + } else { + if err := _m.ReadInt64(_r, &w.ConnectedSince); err != nil { + return err + } + } + if w.ReturnRateLimitsInActingVersion(actingVersion) { + if err := w.ReturnRateLimits.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if !w.ServerTimeInActingVersion(actingVersion) { + w.ServerTime = w.ServerTimeNullValue() + } else { + if err := _m.ReadInt64(_r, &w.ServerTime); err != nil { + return err + } + } + if w.UserDataStreamInActingVersion(actingVersion) { + if err := w.UserDataStream.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if actingVersion > w.SbeSchemaVersion() && blockLength > w.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-w.SbeBlockLength())) + } + + if w.LoggedOnApiKeyInActingVersion(actingVersion) { + var LoggedOnApiKeyLength uint16 + if err := _m.ReadUint16(_r, &LoggedOnApiKeyLength); err != nil { + return err + } + if cap(w.LoggedOnApiKey) < int(LoggedOnApiKeyLength) { + w.LoggedOnApiKey = make([]uint8, LoggedOnApiKeyLength) + } + w.LoggedOnApiKey = w.LoggedOnApiKey[:LoggedOnApiKeyLength] + if err := _m.ReadBytes(_r, w.LoggedOnApiKey); err != nil { + return err + } + } + if doRangeCheck { + if err := w.RangeCheck(actingVersion, w.SbeSchemaVersion()); err != nil { + return err + } + } + return nil +} + +func (w *WebSocketSessionLogoutResponse) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if w.AuthorizedSinceInActingVersion(actingVersion) { + if w.AuthorizedSince != w.AuthorizedSinceNullValue() && (w.AuthorizedSince < w.AuthorizedSinceMinValue() || w.AuthorizedSince > w.AuthorizedSinceMaxValue()) { + return fmt.Errorf("Range check failed on w.AuthorizedSince (%v < %v > %v)", w.AuthorizedSinceMinValue(), w.AuthorizedSince, w.AuthorizedSinceMaxValue()) + } + } + if w.ConnectedSinceInActingVersion(actingVersion) { + if w.ConnectedSince < w.ConnectedSinceMinValue() || w.ConnectedSince > w.ConnectedSinceMaxValue() { + return fmt.Errorf("Range check failed on w.ConnectedSince (%v < %v > %v)", w.ConnectedSinceMinValue(), w.ConnectedSince, w.ConnectedSinceMaxValue()) + } + } + if err := w.ReturnRateLimits.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if w.ServerTimeInActingVersion(actingVersion) { + if w.ServerTime < w.ServerTimeMinValue() || w.ServerTime > w.ServerTimeMaxValue() { + return fmt.Errorf("Range check failed on w.ServerTime (%v < %v > %v)", w.ServerTimeMinValue(), w.ServerTime, w.ServerTimeMaxValue()) + } + } + if err := w.UserDataStream.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if !utf8.Valid(w.LoggedOnApiKey[:]) { + return errors.New("w.LoggedOnApiKey failed UTF-8 validation") + } + return nil +} + +func WebSocketSessionLogoutResponseInit(w *WebSocketSessionLogoutResponse) { + w.AuthorizedSince = math.MinInt64 + return +} + +func (*WebSocketSessionLogoutResponse) SbeBlockLength() (blockLength uint16) { + return 26 +} + +func (*WebSocketSessionLogoutResponse) SbeTemplateId() (templateId uint16) { + return 53 +} + +func (*WebSocketSessionLogoutResponse) SbeSchemaId() (schemaId uint16) { + return 3 +} + +func (*WebSocketSessionLogoutResponse) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} + +func (*WebSocketSessionLogoutResponse) SbeSemanticType() (semanticType []byte) { + return []byte("") +} + +func (*WebSocketSessionLogoutResponse) SbeSemanticVersion() (semanticVersion string) { + return "5.2" +} + +func (*WebSocketSessionLogoutResponse) AuthorizedSinceId() uint16 { + return 1 +} + +func (*WebSocketSessionLogoutResponse) AuthorizedSinceSinceVersion() uint16 { + return 0 +} + +func (w *WebSocketSessionLogoutResponse) AuthorizedSinceInActingVersion(actingVersion uint16) bool { + return actingVersion >= w.AuthorizedSinceSinceVersion() +} + +func (*WebSocketSessionLogoutResponse) AuthorizedSinceDeprecated() uint16 { + return 0 +} + +func (*WebSocketSessionLogoutResponse) AuthorizedSinceMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*WebSocketSessionLogoutResponse) AuthorizedSinceMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*WebSocketSessionLogoutResponse) AuthorizedSinceMaxValue() int64 { + return math.MaxInt64 +} + +func (*WebSocketSessionLogoutResponse) AuthorizedSinceNullValue() int64 { + return math.MinInt64 +} + +func (*WebSocketSessionLogoutResponse) ConnectedSinceId() uint16 { + return 2 +} + +func (*WebSocketSessionLogoutResponse) ConnectedSinceSinceVersion() uint16 { + return 0 +} + +func (w *WebSocketSessionLogoutResponse) ConnectedSinceInActingVersion(actingVersion uint16) bool { + return actingVersion >= w.ConnectedSinceSinceVersion() +} + +func (*WebSocketSessionLogoutResponse) ConnectedSinceDeprecated() uint16 { + return 0 +} + +func (*WebSocketSessionLogoutResponse) ConnectedSinceMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*WebSocketSessionLogoutResponse) ConnectedSinceMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*WebSocketSessionLogoutResponse) ConnectedSinceMaxValue() int64 { + return math.MaxInt64 +} + +func (*WebSocketSessionLogoutResponse) ConnectedSinceNullValue() int64 { + return math.MinInt64 +} + +func (*WebSocketSessionLogoutResponse) ReturnRateLimitsId() uint16 { + return 3 +} + +func (*WebSocketSessionLogoutResponse) ReturnRateLimitsSinceVersion() uint16 { + return 0 +} + +func (w *WebSocketSessionLogoutResponse) ReturnRateLimitsInActingVersion(actingVersion uint16) bool { + return actingVersion >= w.ReturnRateLimitsSinceVersion() +} + +func (*WebSocketSessionLogoutResponse) ReturnRateLimitsDeprecated() uint16 { + return 0 +} + +func (*WebSocketSessionLogoutResponse) ReturnRateLimitsMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*WebSocketSessionLogoutResponse) ServerTimeId() uint16 { + return 4 +} + +func (*WebSocketSessionLogoutResponse) ServerTimeSinceVersion() uint16 { + return 0 +} + +func (w *WebSocketSessionLogoutResponse) ServerTimeInActingVersion(actingVersion uint16) bool { + return actingVersion >= w.ServerTimeSinceVersion() +} + +func (*WebSocketSessionLogoutResponse) ServerTimeDeprecated() uint16 { + return 0 +} + +func (*WebSocketSessionLogoutResponse) ServerTimeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*WebSocketSessionLogoutResponse) ServerTimeMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*WebSocketSessionLogoutResponse) ServerTimeMaxValue() int64 { + return math.MaxInt64 +} + +func (*WebSocketSessionLogoutResponse) ServerTimeNullValue() int64 { + return math.MinInt64 +} + +func (*WebSocketSessionLogoutResponse) UserDataStreamId() uint16 { + return 5 +} + +func (*WebSocketSessionLogoutResponse) UserDataStreamSinceVersion() uint16 { + return 0 +} + +func (w *WebSocketSessionLogoutResponse) UserDataStreamInActingVersion(actingVersion uint16) bool { + return actingVersion >= w.UserDataStreamSinceVersion() +} + +func (*WebSocketSessionLogoutResponse) UserDataStreamDeprecated() uint16 { + return 0 +} + +func (*WebSocketSessionLogoutResponse) UserDataStreamMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*WebSocketSessionLogoutResponse) LoggedOnApiKeyMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*WebSocketSessionLogoutResponse) LoggedOnApiKeySinceVersion() uint16 { + return 0 +} + +func (w *WebSocketSessionLogoutResponse) LoggedOnApiKeyInActingVersion(actingVersion uint16) bool { + return actingVersion >= w.LoggedOnApiKeySinceVersion() +} + +func (*WebSocketSessionLogoutResponse) LoggedOnApiKeyDeprecated() uint16 { + return 0 +} + +func (WebSocketSessionLogoutResponse) LoggedOnApiKeyCharacterEncoding() string { + return "UTF-8" +} + +func (WebSocketSessionLogoutResponse) LoggedOnApiKeyHeaderLength() uint64 { + return 2 +} diff --git a/v2/sbe/spot_3_1/WebSocketSessionStatusResponse.go b/v2/sbe/spot_3_1/WebSocketSessionStatusResponse.go new file mode 100644 index 00000000..928b7142 --- /dev/null +++ b/v2/sbe/spot_3_1/WebSocketSessionStatusResponse.go @@ -0,0 +1,385 @@ +// Generated SBE (Simple Binary Encoding) message codec + +package sbe + +import ( + "errors" + "fmt" + "io" + "io/ioutil" + "math" + "unicode/utf8" +) + +type WebSocketSessionStatusResponse struct { + AuthorizedSince int64 + ConnectedSince int64 + ReturnRateLimits BoolEnumEnum + ServerTime int64 + UserDataStream BoolEnumEnum + LoggedOnApiKey []uint8 +} + +func (w *WebSocketSessionStatusResponse) Encode(_m *SbeGoMarshaller, _w io.Writer, doRangeCheck bool) error { + if doRangeCheck { + if err := w.RangeCheck(w.SbeSchemaVersion(), w.SbeSchemaVersion()); err != nil { + return err + } + } + if err := _m.WriteInt64(_w, w.AuthorizedSince); err != nil { + return err + } + if err := _m.WriteInt64(_w, w.ConnectedSince); err != nil { + return err + } + if err := w.ReturnRateLimits.Encode(_m, _w); err != nil { + return err + } + if err := _m.WriteInt64(_w, w.ServerTime); err != nil { + return err + } + if err := w.UserDataStream.Encode(_m, _w); err != nil { + return err + } + if err := _m.WriteUint16(_w, uint16(len(w.LoggedOnApiKey))); err != nil { + return err + } + if err := _m.WriteBytes(_w, w.LoggedOnApiKey); err != nil { + return err + } + return nil +} + +func (w *WebSocketSessionStatusResponse) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint16, doRangeCheck bool) error { + if !w.AuthorizedSinceInActingVersion(actingVersion) { + w.AuthorizedSince = w.AuthorizedSinceNullValue() + } else { + if err := _m.ReadInt64(_r, &w.AuthorizedSince); err != nil { + return err + } + } + if !w.ConnectedSinceInActingVersion(actingVersion) { + w.ConnectedSince = w.ConnectedSinceNullValue() + } else { + if err := _m.ReadInt64(_r, &w.ConnectedSince); err != nil { + return err + } + } + if w.ReturnRateLimitsInActingVersion(actingVersion) { + if err := w.ReturnRateLimits.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if !w.ServerTimeInActingVersion(actingVersion) { + w.ServerTime = w.ServerTimeNullValue() + } else { + if err := _m.ReadInt64(_r, &w.ServerTime); err != nil { + return err + } + } + if w.UserDataStreamInActingVersion(actingVersion) { + if err := w.UserDataStream.Decode(_m, _r, actingVersion); err != nil { + return err + } + } + if actingVersion > w.SbeSchemaVersion() && blockLength > w.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-w.SbeBlockLength())) + } + + if w.LoggedOnApiKeyInActingVersion(actingVersion) { + var LoggedOnApiKeyLength uint16 + if err := _m.ReadUint16(_r, &LoggedOnApiKeyLength); err != nil { + return err + } + if cap(w.LoggedOnApiKey) < int(LoggedOnApiKeyLength) { + w.LoggedOnApiKey = make([]uint8, LoggedOnApiKeyLength) + } + w.LoggedOnApiKey = w.LoggedOnApiKey[:LoggedOnApiKeyLength] + if err := _m.ReadBytes(_r, w.LoggedOnApiKey); err != nil { + return err + } + } + if doRangeCheck { + if err := w.RangeCheck(actingVersion, w.SbeSchemaVersion()); err != nil { + return err + } + } + return nil +} + +func (w *WebSocketSessionStatusResponse) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if w.AuthorizedSinceInActingVersion(actingVersion) { + if w.AuthorizedSince != w.AuthorizedSinceNullValue() && (w.AuthorizedSince < w.AuthorizedSinceMinValue() || w.AuthorizedSince > w.AuthorizedSinceMaxValue()) { + return fmt.Errorf("Range check failed on w.AuthorizedSince (%v < %v > %v)", w.AuthorizedSinceMinValue(), w.AuthorizedSince, w.AuthorizedSinceMaxValue()) + } + } + if w.ConnectedSinceInActingVersion(actingVersion) { + if w.ConnectedSince < w.ConnectedSinceMinValue() || w.ConnectedSince > w.ConnectedSinceMaxValue() { + return fmt.Errorf("Range check failed on w.ConnectedSince (%v < %v > %v)", w.ConnectedSinceMinValue(), w.ConnectedSince, w.ConnectedSinceMaxValue()) + } + } + if err := w.ReturnRateLimits.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if w.ServerTimeInActingVersion(actingVersion) { + if w.ServerTime < w.ServerTimeMinValue() || w.ServerTime > w.ServerTimeMaxValue() { + return fmt.Errorf("Range check failed on w.ServerTime (%v < %v > %v)", w.ServerTimeMinValue(), w.ServerTime, w.ServerTimeMaxValue()) + } + } + if err := w.UserDataStream.RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + if !utf8.Valid(w.LoggedOnApiKey[:]) { + return errors.New("w.LoggedOnApiKey failed UTF-8 validation") + } + return nil +} + +func WebSocketSessionStatusResponseInit(w *WebSocketSessionStatusResponse) { + w.AuthorizedSince = math.MinInt64 + return +} + +func (*WebSocketSessionStatusResponse) SbeBlockLength() (blockLength uint16) { + return 26 +} + +func (*WebSocketSessionStatusResponse) SbeTemplateId() (templateId uint16) { + return 52 +} + +func (*WebSocketSessionStatusResponse) SbeSchemaId() (schemaId uint16) { + return 3 +} + +func (*WebSocketSessionStatusResponse) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} + +func (*WebSocketSessionStatusResponse) SbeSemanticType() (semanticType []byte) { + return []byte("") +} + +func (*WebSocketSessionStatusResponse) SbeSemanticVersion() (semanticVersion string) { + return "5.2" +} + +func (*WebSocketSessionStatusResponse) AuthorizedSinceId() uint16 { + return 1 +} + +func (*WebSocketSessionStatusResponse) AuthorizedSinceSinceVersion() uint16 { + return 0 +} + +func (w *WebSocketSessionStatusResponse) AuthorizedSinceInActingVersion(actingVersion uint16) bool { + return actingVersion >= w.AuthorizedSinceSinceVersion() +} + +func (*WebSocketSessionStatusResponse) AuthorizedSinceDeprecated() uint16 { + return 0 +} + +func (*WebSocketSessionStatusResponse) AuthorizedSinceMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*WebSocketSessionStatusResponse) AuthorizedSinceMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*WebSocketSessionStatusResponse) AuthorizedSinceMaxValue() int64 { + return math.MaxInt64 +} + +func (*WebSocketSessionStatusResponse) AuthorizedSinceNullValue() int64 { + return math.MinInt64 +} + +func (*WebSocketSessionStatusResponse) ConnectedSinceId() uint16 { + return 2 +} + +func (*WebSocketSessionStatusResponse) ConnectedSinceSinceVersion() uint16 { + return 0 +} + +func (w *WebSocketSessionStatusResponse) ConnectedSinceInActingVersion(actingVersion uint16) bool { + return actingVersion >= w.ConnectedSinceSinceVersion() +} + +func (*WebSocketSessionStatusResponse) ConnectedSinceDeprecated() uint16 { + return 0 +} + +func (*WebSocketSessionStatusResponse) ConnectedSinceMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*WebSocketSessionStatusResponse) ConnectedSinceMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*WebSocketSessionStatusResponse) ConnectedSinceMaxValue() int64 { + return math.MaxInt64 +} + +func (*WebSocketSessionStatusResponse) ConnectedSinceNullValue() int64 { + return math.MinInt64 +} + +func (*WebSocketSessionStatusResponse) ReturnRateLimitsId() uint16 { + return 3 +} + +func (*WebSocketSessionStatusResponse) ReturnRateLimitsSinceVersion() uint16 { + return 0 +} + +func (w *WebSocketSessionStatusResponse) ReturnRateLimitsInActingVersion(actingVersion uint16) bool { + return actingVersion >= w.ReturnRateLimitsSinceVersion() +} + +func (*WebSocketSessionStatusResponse) ReturnRateLimitsDeprecated() uint16 { + return 0 +} + +func (*WebSocketSessionStatusResponse) ReturnRateLimitsMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*WebSocketSessionStatusResponse) ServerTimeId() uint16 { + return 4 +} + +func (*WebSocketSessionStatusResponse) ServerTimeSinceVersion() uint16 { + return 0 +} + +func (w *WebSocketSessionStatusResponse) ServerTimeInActingVersion(actingVersion uint16) bool { + return actingVersion >= w.ServerTimeSinceVersion() +} + +func (*WebSocketSessionStatusResponse) ServerTimeDeprecated() uint16 { + return 0 +} + +func (*WebSocketSessionStatusResponse) ServerTimeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*WebSocketSessionStatusResponse) ServerTimeMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*WebSocketSessionStatusResponse) ServerTimeMaxValue() int64 { + return math.MaxInt64 +} + +func (*WebSocketSessionStatusResponse) ServerTimeNullValue() int64 { + return math.MinInt64 +} + +func (*WebSocketSessionStatusResponse) UserDataStreamId() uint16 { + return 5 +} + +func (*WebSocketSessionStatusResponse) UserDataStreamSinceVersion() uint16 { + return 0 +} + +func (w *WebSocketSessionStatusResponse) UserDataStreamInActingVersion(actingVersion uint16) bool { + return actingVersion >= w.UserDataStreamSinceVersion() +} + +func (*WebSocketSessionStatusResponse) UserDataStreamDeprecated() uint16 { + return 0 +} + +func (*WebSocketSessionStatusResponse) UserDataStreamMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*WebSocketSessionStatusResponse) LoggedOnApiKeyMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*WebSocketSessionStatusResponse) LoggedOnApiKeySinceVersion() uint16 { + return 0 +} + +func (w *WebSocketSessionStatusResponse) LoggedOnApiKeyInActingVersion(actingVersion uint16) bool { + return actingVersion >= w.LoggedOnApiKeySinceVersion() +} + +func (*WebSocketSessionStatusResponse) LoggedOnApiKeyDeprecated() uint16 { + return 0 +} + +func (WebSocketSessionStatusResponse) LoggedOnApiKeyCharacterEncoding() string { + return "UTF-8" +} + +func (WebSocketSessionStatusResponse) LoggedOnApiKeyHeaderLength() uint64 { + return 2 +} diff --git a/v2/sbe/spot_3_1/WebSocketSessionSubscriptionsResponse.go b/v2/sbe/spot_3_1/WebSocketSessionSubscriptionsResponse.go new file mode 100644 index 00000000..3ff1275f --- /dev/null +++ b/v2/sbe/spot_3_1/WebSocketSessionSubscriptionsResponse.go @@ -0,0 +1,267 @@ +// Generated SBE (Simple Binary Encoding) message codec + +package sbe + +import ( + "fmt" + "io" + "io/ioutil" + "math" +) + +type WebSocketSessionSubscriptionsResponse struct { + Subscriptions []WebSocketSessionSubscriptionsResponseSubscriptions +} +type WebSocketSessionSubscriptionsResponseSubscriptions struct { + SubscriptionId uint16 + ExpirationTime int64 +} + +func (w *WebSocketSessionSubscriptionsResponse) Encode(_m *SbeGoMarshaller, _w io.Writer, doRangeCheck bool) error { + if doRangeCheck { + if err := w.RangeCheck(w.SbeSchemaVersion(), w.SbeSchemaVersion()); err != nil { + return err + } + } + var SubscriptionsBlockLength uint16 = 10 + if err := _m.WriteUint16(_w, SubscriptionsBlockLength); err != nil { + return err + } + var SubscriptionsNumInGroup uint32 = uint32(len(w.Subscriptions)) + if err := _m.WriteUint32(_w, SubscriptionsNumInGroup); err != nil { + return err + } + for i := range w.Subscriptions { + if err := w.Subscriptions[i].Encode(_m, _w); err != nil { + return err + } + } + return nil +} + +func (w *WebSocketSessionSubscriptionsResponse) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint16, doRangeCheck bool) error { + if actingVersion > w.SbeSchemaVersion() && blockLength > w.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-w.SbeBlockLength())) + } + + if w.SubscriptionsInActingVersion(actingVersion) { + var SubscriptionsBlockLength uint16 + if err := _m.ReadUint16(_r, &SubscriptionsBlockLength); err != nil { + return err + } + var SubscriptionsNumInGroup uint32 + if err := _m.ReadUint32(_r, &SubscriptionsNumInGroup); err != nil { + return err + } + if cap(w.Subscriptions) < int(SubscriptionsNumInGroup) { + w.Subscriptions = make([]WebSocketSessionSubscriptionsResponseSubscriptions, SubscriptionsNumInGroup) + } + w.Subscriptions = w.Subscriptions[:SubscriptionsNumInGroup] + for i := range w.Subscriptions { + if err := w.Subscriptions[i].Decode(_m, _r, actingVersion, uint(SubscriptionsBlockLength)); err != nil { + return err + } + } + } + if doRangeCheck { + if err := w.RangeCheck(actingVersion, w.SbeSchemaVersion()); err != nil { + return err + } + } + return nil +} + +func (w *WebSocketSessionSubscriptionsResponse) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + for i := range w.Subscriptions { + if err := w.Subscriptions[i].RangeCheck(actingVersion, schemaVersion); err != nil { + return err + } + } + return nil +} + +func WebSocketSessionSubscriptionsResponseInit(w *WebSocketSessionSubscriptionsResponse) { + return +} + +func (w *WebSocketSessionSubscriptionsResponseSubscriptions) Encode(_m *SbeGoMarshaller, _w io.Writer) error { + if err := _m.WriteUint16(_w, w.SubscriptionId); err != nil { + return err + } + if err := _m.WriteInt64(_w, w.ExpirationTime); err != nil { + return err + } + return nil +} + +func (w *WebSocketSessionSubscriptionsResponseSubscriptions) Decode(_m *SbeGoMarshaller, _r io.Reader, actingVersion uint16, blockLength uint) error { + if !w.SubscriptionIdInActingVersion(actingVersion) { + w.SubscriptionId = w.SubscriptionIdNullValue() + } else { + if err := _m.ReadUint16(_r, &w.SubscriptionId); err != nil { + return err + } + } + if !w.ExpirationTimeInActingVersion(actingVersion) { + w.ExpirationTime = w.ExpirationTimeNullValue() + } else { + if err := _m.ReadInt64(_r, &w.ExpirationTime); err != nil { + return err + } + } + if actingVersion > w.SbeSchemaVersion() && blockLength > w.SbeBlockLength() { + io.CopyN(ioutil.Discard, _r, int64(blockLength-w.SbeBlockLength())) + } + return nil +} + +func (w *WebSocketSessionSubscriptionsResponseSubscriptions) RangeCheck(actingVersion uint16, schemaVersion uint16) error { + if w.SubscriptionIdInActingVersion(actingVersion) { + if w.SubscriptionId < w.SubscriptionIdMinValue() || w.SubscriptionId > w.SubscriptionIdMaxValue() { + return fmt.Errorf("Range check failed on w.SubscriptionId (%v < %v > %v)", w.SubscriptionIdMinValue(), w.SubscriptionId, w.SubscriptionIdMaxValue()) + } + } + if w.ExpirationTimeInActingVersion(actingVersion) { + if w.ExpirationTime != w.ExpirationTimeNullValue() && (w.ExpirationTime < w.ExpirationTimeMinValue() || w.ExpirationTime > w.ExpirationTimeMaxValue()) { + return fmt.Errorf("Range check failed on w.ExpirationTime (%v < %v > %v)", w.ExpirationTimeMinValue(), w.ExpirationTime, w.ExpirationTimeMaxValue()) + } + } + return nil +} + +func WebSocketSessionSubscriptionsResponseSubscriptionsInit(w *WebSocketSessionSubscriptionsResponseSubscriptions) { + w.ExpirationTime = math.MinInt64 + return +} + +func (*WebSocketSessionSubscriptionsResponse) SbeBlockLength() (blockLength uint16) { + return 0 +} + +func (*WebSocketSessionSubscriptionsResponse) SbeTemplateId() (templateId uint16) { + return 54 +} + +func (*WebSocketSessionSubscriptionsResponse) SbeSchemaId() (schemaId uint16) { + return 3 +} + +func (*WebSocketSessionSubscriptionsResponse) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} + +func (*WebSocketSessionSubscriptionsResponse) SbeSemanticType() (semanticType []byte) { + return []byte("") +} + +func (*WebSocketSessionSubscriptionsResponse) SbeSemanticVersion() (semanticVersion string) { + return "5.2" +} + +func (*WebSocketSessionSubscriptionsResponseSubscriptions) SubscriptionIdId() uint16 { + return 1 +} + +func (*WebSocketSessionSubscriptionsResponseSubscriptions) SubscriptionIdSinceVersion() uint16 { + return 0 +} + +func (w *WebSocketSessionSubscriptionsResponseSubscriptions) SubscriptionIdInActingVersion(actingVersion uint16) bool { + return actingVersion >= w.SubscriptionIdSinceVersion() +} + +func (*WebSocketSessionSubscriptionsResponseSubscriptions) SubscriptionIdDeprecated() uint16 { + return 0 +} + +func (*WebSocketSessionSubscriptionsResponseSubscriptions) SubscriptionIdMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "required" + } + return "" +} + +func (*WebSocketSessionSubscriptionsResponseSubscriptions) SubscriptionIdMinValue() uint16 { + return 0 +} + +func (*WebSocketSessionSubscriptionsResponseSubscriptions) SubscriptionIdMaxValue() uint16 { + return math.MaxUint16 - 1 +} + +func (*WebSocketSessionSubscriptionsResponseSubscriptions) SubscriptionIdNullValue() uint16 { + return math.MaxUint16 +} + +func (*WebSocketSessionSubscriptionsResponseSubscriptions) ExpirationTimeId() uint16 { + return 2 +} + +func (*WebSocketSessionSubscriptionsResponseSubscriptions) ExpirationTimeSinceVersion() uint16 { + return 0 +} + +func (w *WebSocketSessionSubscriptionsResponseSubscriptions) ExpirationTimeInActingVersion(actingVersion uint16) bool { + return actingVersion >= w.ExpirationTimeSinceVersion() +} + +func (*WebSocketSessionSubscriptionsResponseSubscriptions) ExpirationTimeDeprecated() uint16 { + return 0 +} + +func (*WebSocketSessionSubscriptionsResponseSubscriptions) ExpirationTimeMetaAttribute(meta int) string { + switch meta { + case 1: + return "" + case 2: + return "" + case 3: + return "" + case 4: + return "optional" + } + return "" +} + +func (*WebSocketSessionSubscriptionsResponseSubscriptions) ExpirationTimeMinValue() int64 { + return math.MinInt64 + 1 +} + +func (*WebSocketSessionSubscriptionsResponseSubscriptions) ExpirationTimeMaxValue() int64 { + return math.MaxInt64 +} + +func (*WebSocketSessionSubscriptionsResponseSubscriptions) ExpirationTimeNullValue() int64 { + return math.MinInt64 +} + +func (*WebSocketSessionSubscriptionsResponse) SubscriptionsId() uint16 { + return 100 +} + +func (*WebSocketSessionSubscriptionsResponse) SubscriptionsSinceVersion() uint16 { + return 0 +} + +func (w *WebSocketSessionSubscriptionsResponse) SubscriptionsInActingVersion(actingVersion uint16) bool { + return actingVersion >= w.SubscriptionsSinceVersion() +} + +func (*WebSocketSessionSubscriptionsResponse) SubscriptionsDeprecated() uint16 { + return 0 +} + +func (*WebSocketSessionSubscriptionsResponseSubscriptions) SbeBlockLength() (blockLength uint) { + return 10 +} + +func (*WebSocketSessionSubscriptionsResponseSubscriptions) SbeSchemaVersion() (schemaVersion uint16) { + return 1 +} From cf4a8dc481030e72cd183e63a1a7f5da76ee73d7 Mon Sep 17 00:00:00 2001 From: Pablo Date: Mon, 10 Nov 2025 06:40:44 +0100 Subject: [PATCH 2/3] feat: add sbe support --- v2/account_service.go | 44 +- v2/depth_service.go | 43 +- v2/kline_service.go | 63 +- v2/market_data_sbe_integration_test.go | 377 +++++++++ v2/order_service.go | 231 ++++-- v2/request.go | 12 + v2/sbe_decoder.go | 882 +++++++++++++++++++++ v2/ticker_service.go | 218 +++-- v2/ticker_service_integration_test.go | 761 ++++++++++++++++++ v2/ticker_service_sbe_test.go | 173 ++++ v2/trade_service.go | 174 ++-- v2/trading_account_sbe_integration_test.go | 509 ++++++++++++ 12 files changed, 3309 insertions(+), 178 deletions(-) create mode 100644 v2/market_data_sbe_integration_test.go create mode 100644 v2/sbe_decoder.go create mode 100644 v2/ticker_service_integration_test.go create mode 100644 v2/ticker_service_sbe_test.go create mode 100644 v2/trading_account_sbe_integration_test.go diff --git a/v2/account_service.go b/v2/account_service.go index daa1acd7..8d3933db 100644 --- a/v2/account_service.go +++ b/v2/account_service.go @@ -12,15 +12,8 @@ type GetAccountService struct { omitZeroBalances *bool } -// OmitZeroBalances sets the omitZeroBalances parameter on the request. -// When set to true, the API will return the non-zero balances of an account. -func (s *GetAccountService) OmitZeroBalances(v bool) *GetAccountService { - s.omitZeroBalances = &v - return s -} - -// Do send request -func (s *GetAccountService) Do(ctx context.Context, opts ...RequestOption) (res *Account, err error) { +// buildRequest creates the API request for GetAccount +func (s *GetAccountService) buildRequest() *request { r := &request{ method: http.MethodGet, endpoint: "/api/v3/account", @@ -29,7 +22,19 @@ func (s *GetAccountService) Do(ctx context.Context, opts ...RequestOption) (res if s.omitZeroBalances != nil { r.setParam("omitZeroBalances", *s.omitZeroBalances) } + return r +} +// OmitZeroBalances sets the omitZeroBalances parameter on the request. +// When set to true, the API will return the non-zero balances of an account. +func (s *GetAccountService) OmitZeroBalances(v bool) *GetAccountService { + s.omitZeroBalances = &v + return s +} + +// Do send request +func (s *GetAccountService) Do(ctx context.Context, opts ...RequestOption) (res *Account, err error) { + r := s.buildRequest() data, err := s.c.callAPI(ctx, r, opts...) if err != nil { return nil, err @@ -42,6 +47,27 @@ func (s *GetAccountService) Do(ctx context.Context, opts ...RequestOption) (res return res, nil } +// DoSBE sends the request with SBE encoding and returns the decoded response +// Template 400 - AccountResponse +func (s *GetAccountService) DoSBE(ctx context.Context, opts ...RequestOption) (res *Account, err error) { + // Add SBE headers + opts = append(opts, WithSBE(3, 1)) + + r := s.buildRequest() + data, err := s.c.callAPI(ctx, r, opts...) + if err != nil { + return nil, err + } + + // Decode SBE response using centralized decoder + res = &Account{} + if err := sbeDecoder.DecodeResponse(data, res); err != nil { + return nil, err + } + + return res, nil +} + // Account define account info type Account struct { MakerCommission int64 `json:"makerCommission"` diff --git a/v2/depth_service.go b/v2/depth_service.go index 8ee4f586..a71d6897 100644 --- a/v2/depth_service.go +++ b/v2/depth_service.go @@ -14,6 +14,19 @@ type DepthService struct { limit *int } +// buildRequest creates the API request for Depth +func (s *DepthService) buildRequest() *request { + r := &request{ + method: http.MethodGet, + endpoint: "/api/v3/depth", + } + r.setParam("symbol", s.symbol) + if s.limit != nil { + r.setParam("limit", *s.limit) + } + return r +} + // Symbol set symbol func (s *DepthService) Symbol(symbol string) *DepthService { s.symbol = symbol @@ -28,14 +41,7 @@ func (s *DepthService) Limit(limit int) *DepthService { // Do send request func (s *DepthService) Do(ctx context.Context, opts ...RequestOption) (res *DepthResponse, err error) { - r := &request{ - method: http.MethodGet, - endpoint: "/api/v3/depth", - } - r.setParam("symbol", s.symbol) - if s.limit != nil { - r.setParam("limit", *s.limit) - } + r := s.buildRequest() data, err := s.c.callAPI(ctx, r, opts...) if err != nil { return nil, err @@ -67,6 +73,27 @@ func (s *DepthService) Do(ctx context.Context, opts ...RequestOption) (res *Dept return res, nil } +// DoSBE sends the request with SBE encoding and returns the decoded response +// Template 200 - DepthResponse +func (s *DepthService) DoSBE(ctx context.Context, opts ...RequestOption) (res *DepthResponse, err error) { + // Add SBE headers + opts = append(opts, WithSBE(3, 1)) + + r := s.buildRequest() + data, err := s.c.callAPI(ctx, r, opts...) + if err != nil { + return nil, err + } + + // Decode SBE response using centralized decoder + res = &DepthResponse{} + if err := sbeDecoder.DecodeResponse(data, res); err != nil { + return nil, err + } + + return res, nil +} + // DepthResponse define depth info with bids and asks type DepthResponse struct { LastUpdateID int64 `json:"lastUpdateId"` diff --git a/v2/kline_service.go b/v2/kline_service.go index 3df7d939..b86ddf29 100644 --- a/v2/kline_service.go +++ b/v2/kline_service.go @@ -17,6 +17,29 @@ type KlinesService struct { timeZone *string // Default: 0 (UTC) } +// buildRequest creates the API request for Klines +func (s *KlinesService) buildRequest() *request { + r := &request{ + method: http.MethodGet, + endpoint: "/api/v3/klines", + } + r.setParam("symbol", s.symbol) + r.setParam("interval", s.interval) + if s.limit != nil { + r.setParam("limit", *s.limit) + } + if s.startTime != nil { + r.setParam("startTime", *s.startTime) + } + if s.endTime != nil { + r.setParam("endTime", *s.endTime) + } + if s.timeZone != nil { + r.setParam("timeZone", *s.timeZone) + } + return r +} + // Symbol set symbol func (s *KlinesService) Symbol(symbol string) *KlinesService { s.symbol = symbol @@ -55,24 +78,7 @@ func (s *KlinesService) TimeZone(timeZone string) *KlinesService { // Do send request func (s *KlinesService) Do(ctx context.Context, opts ...RequestOption) (res []*Kline, err error) { - r := &request{ - method: http.MethodGet, - endpoint: "/api/v3/klines", - } - r.setParam("symbol", s.symbol) - r.setParam("interval", s.interval) - if s.limit != nil { - r.setParam("limit", *s.limit) - } - if s.startTime != nil { - r.setParam("startTime", *s.startTime) - } - if s.endTime != nil { - r.setParam("endTime", *s.endTime) - } - if s.timeZone != nil { - r.setParam("timeZone", *s.timeZone) - } + r := s.buildRequest() data, err := s.c.callAPI(ctx, r, opts...) if err != nil { return []*Kline{}, err @@ -106,6 +112,27 @@ func (s *KlinesService) Do(ctx context.Context, opts ...RequestOption) (res []*K return res, nil } +// DoSBE sends the request with SBE encoding and returns the decoded response +// Template 203 - KlinesResponse +func (s *KlinesService) DoSBE(ctx context.Context, opts ...RequestOption) (res []*Kline, err error) { + // Add SBE headers + opts = append(opts, WithSBE(3, 1)) + + r := s.buildRequest() + data, err := s.c.callAPI(ctx, r, opts...) + if err != nil { + return nil, err + } + + // Decode SBE response using centralized decoder + res = make([]*Kline, 0) + if err := sbeDecoder.DecodeResponse(data, &res); err != nil { + return nil, err + } + + return res, nil +} + // Kline define kline info type Kline struct { OpenTime int64 `json:"openTime"` diff --git a/v2/market_data_sbe_integration_test.go b/v2/market_data_sbe_integration_test.go new file mode 100644 index 00000000..648da3f4 --- /dev/null +++ b/v2/market_data_sbe_integration_test.go @@ -0,0 +1,377 @@ +package binance + +import ( + "context" + "fmt" + "testing" + "time" +) + +// TestMarketDataServiceSBEIntegration tests SBE for market data services (Phase 1) +func TestMarketDataServiceSBEIntegration(t *testing.T) { + suite := SetupTest(t) + + t.Run("Depth_SBE", func(t *testing.T) { + symbol := "BTCUSDT" + limit := 100 + + // JSON version + startJSON := time.Now() + depthJSON, err := suite.client.NewDepthService(). + Symbol(symbol). + Limit(limit). + Do(context.Background()) + jsonElapsed := time.Since(startJSON) + if err != nil { + t.Fatalf("Failed to get depth (JSON): %v", err) + } + + // SBE version + startSBE := time.Now() + depthSBE, err := suite.client.NewDepthService(). + Symbol(symbol). + Limit(limit). + DoSBE(context.Background()) + sbeElapsed := time.Since(startSBE) + if err != nil { + t.Fatalf("Failed to get depth (SBE): %v", err) + } + + // Validate SBE response + if depthSBE.LastUpdateID == 0 { + t.Error("Expected non-zero LastUpdateID") + } + if len(depthSBE.Bids) == 0 { + t.Error("Expected at least one bid") + } + if len(depthSBE.Asks) == 0 { + t.Error("Expected at least one ask") + } + + // Validate bid/ask structure + if depthSBE.Bids[0].Price == "" { + t.Error("Expected non-empty bid price") + } + if depthSBE.Bids[0].Quantity == "" { + t.Error("Expected non-empty bid quantity") + } + if depthSBE.Asks[0].Price == "" { + t.Error("Expected non-empty ask price") + } + if depthSBE.Asks[0].Quantity == "" { + t.Error("Expected non-empty ask quantity") + } + + // Compare results + if len(depthJSON.Bids) != len(depthSBE.Bids) { + t.Logf("Warning: Different number of bids: JSON=%d, SBE=%d", len(depthJSON.Bids), len(depthSBE.Bids)) + } + if len(depthJSON.Asks) != len(depthSBE.Asks) { + t.Logf("Warning: Different number of asks: JSON=%d, SBE=%d", len(depthJSON.Asks), len(depthSBE.Asks)) + } + + fmt.Printf("Depth (%s): LastUpdateID=%d, Bids=%d, Asks=%d [JSON: %v, SBE: %v]\n", + symbol, depthSBE.LastUpdateID, len(depthSBE.Bids), len(depthSBE.Asks), jsonElapsed, sbeElapsed) + fmt.Printf(" Best Bid: %s @ %s\n", depthSBE.Bids[0].Quantity, depthSBE.Bids[0].Price) + fmt.Printf(" Best Ask: %s @ %s\n", depthSBE.Asks[0].Quantity, depthSBE.Asks[0].Price) + }) + + t.Run("RecentTrades_SBE", func(t *testing.T) { + symbol := "ETHUSDT" + limit := 100 + + // JSON version + startJSON := time.Now() + tradesJSON, err := suite.client.NewRecentTradesService(). + Symbol(symbol). + Limit(limit). + Do(context.Background()) + jsonElapsed := time.Since(startJSON) + if err != nil { + t.Fatalf("Failed to get recent trades (JSON): %v", err) + } + + // SBE version + startSBE := time.Now() + tradesSBE, err := suite.client.NewRecentTradesService(). + Symbol(symbol). + Limit(limit). + DoSBE(context.Background()) + sbeElapsed := time.Since(startSBE) + if err != nil { + t.Fatalf("Failed to get recent trades (SBE): %v", err) + } + + // Validate SBE response + if len(tradesSBE) == 0 { + t.Error("Expected at least one trade") + } + + trade := tradesSBE[0] + if trade.ID == 0 { + t.Error("Expected non-zero trade ID") + } + if trade.Price == "" { + t.Error("Expected non-empty price") + } + if trade.Quantity == "" { + t.Error("Expected non-empty quantity") + } + if trade.Time == 0 { + t.Error("Expected non-zero time") + } + + // Compare results + if len(tradesJSON) != len(tradesSBE) { + t.Logf("Warning: Different number of trades: JSON=%d, SBE=%d", len(tradesJSON), len(tradesSBE)) + } + + fmt.Printf("Recent Trades (%s): Count=%d [JSON: %v, SBE: %v]\n", + symbol, len(tradesSBE), jsonElapsed, sbeElapsed) + fmt.Printf(" Latest Trade: %s @ %s [ID: %d, Time: %v]\n", + trade.Quantity, trade.Price, trade.ID, time.UnixMilli(trade.Time)) + }) + + t.Run("AggTrades_SBE", func(t *testing.T) { + symbol := "BNBUSDT" + limit := 100 + + // JSON version + startJSON := time.Now() + aggTradesJSON, err := suite.client.NewAggTradesService(). + Symbol(symbol). + Limit(limit). + Do(context.Background()) + jsonElapsed := time.Since(startJSON) + if err != nil { + t.Fatalf("Failed to get agg trades (JSON): %v", err) + } + + // SBE version + startSBE := time.Now() + aggTradesSBE, err := suite.client.NewAggTradesService(). + Symbol(symbol). + Limit(limit). + DoSBE(context.Background()) + sbeElapsed := time.Since(startSBE) + if err != nil { + t.Fatalf("Failed to get agg trades (SBE): %v", err) + } + + // Validate SBE response + if len(aggTradesSBE) == 0 { + t.Error("Expected at least one aggregated trade") + } + + aggTrade := aggTradesSBE[0] + if aggTrade.AggTradeID == 0 { + t.Error("Expected non-zero agg trade ID") + } + if aggTrade.Price == "" { + t.Error("Expected non-empty price") + } + if aggTrade.Quantity == "" { + t.Error("Expected non-empty quantity") + } + if aggTrade.Timestamp == 0 { + t.Error("Expected non-zero timestamp") + } + + // Compare results + if len(aggTradesJSON) != len(aggTradesSBE) { + t.Logf("Warning: Different number of agg trades: JSON=%d, SBE=%d", len(aggTradesJSON), len(aggTradesSBE)) + } + + fmt.Printf("Agg Trades (%s): Count=%d [JSON: %v, SBE: %v]\n", + symbol, len(aggTradesSBE), jsonElapsed, sbeElapsed) + fmt.Printf(" Latest AggTrade: %s @ %s [ID: %d]\n", + aggTrade.Quantity, aggTrade.Price, aggTrade.AggTradeID) + }) + + t.Run("AggTrades_SBE_WithTimeRange", func(t *testing.T) { + symbol := "ADAUSDT" + endTime := time.Now().UnixMilli() + startTime := endTime - (60 * 60 * 1000) // 1 hour ago + limit := 500 + + aggTrades, err := suite.client.NewAggTradesService(). + Symbol(symbol). + StartTime(startTime). + EndTime(endTime). + Limit(limit). + DoSBE(context.Background()) + if err != nil { + t.Fatalf("Failed to get agg trades with time range (SBE): %v", err) + } + + // Validate response + if len(aggTrades) == 0 { + t.Log("No aggregated trades in the specified time range (this is okay)") + } else { + fmt.Printf("Agg Trades with time range (%s): Count=%d\n", symbol, len(aggTrades)) + } + }) + + t.Run("Klines_SBE", func(t *testing.T) { + symbol := "SOLUSDT" + interval := "1h" + limit := 100 + + // JSON version + startJSON := time.Now() + klinesJSON, err := suite.client.NewKlinesService(). + Symbol(symbol). + Interval(interval). + Limit(limit). + Do(context.Background()) + jsonElapsed := time.Since(startJSON) + if err != nil { + t.Fatalf("Failed to get klines (JSON): %v", err) + } + + // SBE version + startSBE := time.Now() + klinesSBE, err := suite.client.NewKlinesService(). + Symbol(symbol). + Interval(interval). + Limit(limit). + DoSBE(context.Background()) + sbeElapsed := time.Since(startSBE) + if err != nil { + t.Fatalf("Failed to get klines (SBE): %v", err) + } + + // Validate SBE response + if len(klinesSBE) == 0 { + t.Error("Expected at least one kline") + } + + kline := klinesSBE[0] + if kline.OpenTime == 0 { + t.Error("Expected non-zero open time") + } + if kline.Open == "" { + t.Error("Expected non-empty open price") + } + if kline.High == "" { + t.Error("Expected non-empty high price") + } + if kline.Low == "" { + t.Error("Expected non-empty low price") + } + if kline.Close == "" { + t.Error("Expected non-empty close price") + } + if kline.Volume == "" { + t.Error("Expected non-empty volume") + } + + // Compare results + if len(klinesJSON) != len(klinesSBE) { + t.Logf("Warning: Different number of klines: JSON=%d, SBE=%d", len(klinesJSON), len(klinesSBE)) + } + + fmt.Printf("Klines (%s, %s): Count=%d [JSON: %v, SBE: %v]\n", + symbol, interval, len(klinesSBE), jsonElapsed, sbeElapsed) + fmt.Printf(" Latest Candle: O:%s H:%s L:%s C:%s V:%s\n", + kline.Open, kline.High, kline.Low, kline.Close, kline.Volume) + }) + + t.Run("Klines_SBE_WithTimeRange", func(t *testing.T) { + symbol := "BTCUSDT" + interval := "15m" + endTime := time.Now().UnixMilli() + startTime := endTime - (24 * 60 * 60 * 1000) // 24 hours ago + + klines, err := suite.client.NewKlinesService(). + Symbol(symbol). + Interval(interval). + StartTime(startTime). + EndTime(endTime). + DoSBE(context.Background()) + if err != nil { + t.Fatalf("Failed to get klines with time range (SBE): %v", err) + } + + // Validate response + if len(klines) == 0 { + t.Error("Expected at least one kline in 24h period") + } + + fmt.Printf("Klines with time range (%s, %s): Count=%d\n", symbol, interval, len(klines)) + }) + + // Performance comparison test + t.Run("Performance_Comparison_MarketData", func(t *testing.T) { + symbol := "BTCUSDT" + iterations := 10 + + fmt.Printf("\n=== Market Data Performance Comparison (%d iterations) ===\n", iterations) + + // Test Depth + var depthJSONTotal, depthSBETotal time.Duration + for i := 0; i < iterations; i++ { + start := time.Now() + _, err := suite.client.NewDepthService().Symbol(symbol).Limit(100).Do(context.Background()) + if err == nil { + depthJSONTotal += time.Since(start) + } + + start = time.Now() + _, err = suite.client.NewDepthService().Symbol(symbol).Limit(100).DoSBE(context.Background()) + if err == nil { + depthSBETotal += time.Since(start) + } + } + + // Test Recent Trades + var tradesJSONTotal, tradesSBETotal time.Duration + for i := 0; i < iterations; i++ { + start := time.Now() + _, err := suite.client.NewRecentTradesService().Symbol(symbol).Limit(100).Do(context.Background()) + if err == nil { + tradesJSONTotal += time.Since(start) + } + + start = time.Now() + _, err = suite.client.NewRecentTradesService().Symbol(symbol).Limit(100).DoSBE(context.Background()) + if err == nil { + tradesSBETotal += time.Since(start) + } + } + + // Test Klines + var klinesJSONTotal, klinesSBETotal time.Duration + for i := 0; i < iterations; i++ { + start := time.Now() + _, err := suite.client.NewKlinesService().Symbol(symbol).Interval("1h").Limit(100).Do(context.Background()) + if err == nil { + klinesJSONTotal += time.Since(start) + } + + start = time.Now() + _, err = suite.client.NewKlinesService().Symbol(symbol).Interval("1h").Limit(100).DoSBE(context.Background()) + if err == nil { + klinesSBETotal += time.Since(start) + } + } + + // Calculate averages and print results + fmt.Printf("\nDepth Service:\n") + fmt.Printf(" JSON Avg: %v\n", depthJSONTotal/time.Duration(iterations)) + fmt.Printf(" SBE Avg: %v\n", depthSBETotal/time.Duration(iterations)) + fmt.Printf(" Speedup: %.2fx\n", float64(depthJSONTotal)/float64(depthSBETotal)) + + fmt.Printf("\nRecent Trades Service:\n") + fmt.Printf(" JSON Avg: %v\n", tradesJSONTotal/time.Duration(iterations)) + fmt.Printf(" SBE Avg: %v\n", tradesSBETotal/time.Duration(iterations)) + fmt.Printf(" Speedup: %.2fx\n", float64(tradesJSONTotal)/float64(tradesSBETotal)) + + fmt.Printf("\nKlines Service:\n") + fmt.Printf(" JSON Avg: %v\n", klinesJSONTotal/time.Duration(iterations)) + fmt.Printf(" SBE Avg: %v\n", klinesSBETotal/time.Duration(iterations)) + fmt.Printf(" Speedup: %.2fx\n", float64(klinesJSONTotal)/float64(klinesSBETotal)) + + fmt.Printf("\n======================================================\n\n") + }) +} diff --git a/v2/order_service.go b/v2/order_service.go index ceb25566..920d413d 100644 --- a/v2/order_service.go +++ b/v2/order_service.go @@ -484,6 +484,23 @@ type GetOrderService struct { origClientOrderID *string } +// buildRequest creates the API request for GetOrder +func (s *GetOrderService) buildRequest() *request { + r := &request{ + method: http.MethodGet, + endpoint: "/api/v3/order", + secType: secTypeSigned, + } + r.setParam("symbol", s.symbol) + if s.orderID != nil { + r.setParam("orderId", *s.orderID) + } + if s.origClientOrderID != nil { + r.setParam("origClientOrderId", *s.origClientOrderID) + } + return r +} + // Symbol set symbol func (s *GetOrderService) Symbol(symbol string) *GetOrderService { s.symbol = symbol @@ -504,18 +521,7 @@ func (s *GetOrderService) OrigClientOrderID(origClientOrderID string) *GetOrderS // Do send request func (s *GetOrderService) Do(ctx context.Context, opts ...RequestOption) (res *Order, err error) { - r := &request{ - method: http.MethodGet, - endpoint: "/api/v3/order", - secType: secTypeSigned, - } - r.setParam("symbol", s.symbol) - if s.orderID != nil { - r.setParam("orderId", *s.orderID) - } - if s.origClientOrderID != nil { - r.setParam("origClientOrderId", *s.origClientOrderID) - } + r := s.buildRequest() data, err := s.c.callAPI(ctx, r, opts...) if err != nil { return nil, err @@ -561,6 +567,29 @@ type ListOrdersService struct { limit *int } +// buildRequest creates the API request for ListOrders +func (s *ListOrdersService) buildRequest() *request { + r := &request{ + method: http.MethodGet, + endpoint: "/api/v3/allOrders", + secType: secTypeSigned, + } + r.setParam("symbol", s.symbol) + if s.orderID != nil { + r.setParam("orderId", *s.orderID) + } + if s.startTime != nil { + r.setParam("startTime", *s.startTime) + } + if s.endTime != nil { + r.setParam("endTime", *s.endTime) + } + if s.limit != nil { + r.setParam("limit", *s.limit) + } + return r +} + // Symbol set symbol func (s *ListOrdersService) Symbol(symbol string) *ListOrdersService { s.symbol = symbol @@ -593,24 +622,7 @@ func (s *ListOrdersService) Limit(limit int) *ListOrdersService { // Do send request func (s *ListOrdersService) Do(ctx context.Context, opts ...RequestOption) (res []*Order, err error) { - r := &request{ - method: http.MethodGet, - endpoint: "/api/v3/allOrders", - secType: secTypeSigned, - } - r.setParam("symbol", s.symbol) - if s.orderID != nil { - r.setParam("orderId", *s.orderID) - } - if s.startTime != nil { - r.setParam("startTime", *s.startTime) - } - if s.endTime != nil { - r.setParam("endTime", *s.endTime) - } - if s.limit != nil { - r.setParam("limit", *s.limit) - } + r := s.buildRequest() data, err := s.c.callAPI(ctx, r, opts...) if err != nil { return []*Order{}, err @@ -632,6 +644,26 @@ type CancelOrderService struct { newClientOrderID *string } +// buildRequest creates the API request for CancelOrder +func (s *CancelOrderService) buildRequest() *request { + r := &request{ + method: http.MethodDelete, + endpoint: "/api/v3/order", + secType: secTypeSigned, + } + r.setFormParam("symbol", s.symbol) + if s.orderID != nil { + r.setFormParam("orderId", *s.orderID) + } + if s.origClientOrderID != nil { + r.setFormParam("origClientOrderId", *s.origClientOrderID) + } + if s.newClientOrderID != nil { + r.setFormParam("newClientOrderId", *s.newClientOrderID) + } + return r +} + // Symbol set symbol func (s *CancelOrderService) Symbol(symbol string) *CancelOrderService { s.symbol = symbol @@ -658,21 +690,7 @@ func (s *CancelOrderService) NewClientOrderID(newClientOrderID string) *CancelOr // Do send request func (s *CancelOrderService) Do(ctx context.Context, opts ...RequestOption) (res *CancelOrderResponse, err error) { - r := &request{ - method: http.MethodDelete, - endpoint: "/api/v3/order", - secType: secTypeSigned, - } - r.setFormParam("symbol", s.symbol) - if s.orderID != nil { - r.setFormParam("orderId", *s.orderID) - } - if s.origClientOrderID != nil { - r.setFormParam("origClientOrderId", *s.origClientOrderID) - } - if s.newClientOrderID != nil { - r.setFormParam("newClientOrderId", *s.newClientOrderID) - } + r := s.buildRequest() data, err := s.c.callAPI(ctx, r, opts...) if err != nil { return nil, err @@ -753,6 +771,17 @@ type CancelOpenOrdersService struct { symbol string } +// buildRequest creates the API request for CancelOpenOrders +func (s *CancelOpenOrdersService) buildRequest() *request { + r := &request{ + method: http.MethodDelete, + endpoint: "/api/v3/openOrders", + secType: secTypeSigned, + } + r.setParam("symbol", s.symbol) + return r +} + // Symbol set symbol func (s *CancelOpenOrdersService) Symbol(symbol string) *CancelOpenOrdersService { s.symbol = symbol @@ -761,12 +790,7 @@ func (s *CancelOpenOrdersService) Symbol(symbol string) *CancelOpenOrdersService // Do send request func (s *CancelOpenOrdersService) Do(ctx context.Context, opts ...RequestOption) (res *CancelOpenOrdersResponse, err error) { - r := &request{ - method: http.MethodDelete, - endpoint: "/api/v3/openOrders", - secType: secTypeSigned, - } - r.setParam("symbol", s.symbol) + r := s.buildRequest() data, err := s.c.callAPI(ctx, r, opts...) if err != nil { return &CancelOpenOrdersResponse{}, err @@ -1053,3 +1077,108 @@ type CancelReplaceOrderResponse struct { CancelResponse *CancelOrderResponse `json:"cancelResponse,omitempty"` NewOrderResponse *CreateOrderResponse `json:"newOrderResponse,omitempty"` } + +// DoSBE sends the request with SBE encoding and returns the decoded response +// Template 300/301/302 depending on newOrderRespType +func (s *CreateOrderService) DoSBE(ctx context.Context, opts ...RequestOption) (res *CreateOrderResponse, err error) { + // Add SBE headers + opts = append(opts, WithSBE(3, 1)) + + // Use existing createOrder helper + data, err := s.createOrder(ctx, "/api/v3/order", opts...) + if err != nil { + return nil, err + } + + // Decode SBE response using centralized decoder + res = &CreateOrderResponse{} + if err := sbeDecoder.DecodeResponse(data, res); err != nil { + return nil, err + } + + return res, nil +} + +// DoSBE sends the request with SBE encoding and returns the decoded response +// Template 304 - OrderResponse +func (s *GetOrderService) DoSBE(ctx context.Context, opts ...RequestOption) (res *Order, err error) { + // Add SBE headers + opts = append(opts, WithSBE(3, 1)) + + r := s.buildRequest() + data, err := s.c.callAPI(ctx, r, opts...) + if err != nil { + return nil, err + } + + // Decode SBE response using centralized decoder + res = &Order{} + if err := sbeDecoder.DecodeResponse(data, res); err != nil { + return nil, err + } + + return res, nil +} + +// DoSBE sends the request with SBE encoding and returns the decoded response +// Template 305 - CancelOrderResponse +func (s *CancelOrderService) DoSBE(ctx context.Context, opts ...RequestOption) (res *CancelOrderResponse, err error) { + // Add SBE headers + opts = append(opts, WithSBE(3, 1)) + + r := s.buildRequest() + data, err := s.c.callAPI(ctx, r, opts...) + if err != nil { + return nil, err + } + + // Decode SBE response using centralized decoder + res = &CancelOrderResponse{} + if err := sbeDecoder.DecodeResponse(data, res); err != nil { + return nil, err + } + + return res, nil +} + +// DoSBE sends the request with SBE encoding and returns the decoded response +// Template 306 - CancelOpenOrdersResponse (returns array of cancelled orders) +func (s *CancelOpenOrdersService) DoSBE(ctx context.Context, opts ...RequestOption) (res []*CancelOrderResponse, err error) { + // Add SBE headers + opts = append(opts, WithSBE(3, 1)) + + r := s.buildRequest() + data, err := s.c.callAPI(ctx, r, opts...) + if err != nil { + return nil, err + } + + // Decode SBE response using centralized decoder + res = make([]*CancelOrderResponse, 0) + if err := sbeDecoder.DecodeResponse(data, &res); err != nil { + return nil, err + } + + return res, nil +} + +// DoSBE sends the request with SBE encoding and returns the decoded response +// Template 308 - OrdersResponse (list orders) +func (s *ListOrdersService) DoSBE(ctx context.Context, opts ...RequestOption) (res []*Order, err error) { + // Add SBE headers + opts = append(opts, WithSBE(3, 1)) + + r := s.buildRequest() + data, err := s.c.callAPI(ctx, r, opts...) + if err != nil { + return nil, err + } + + // Decode SBE response using centralized decoder + res = make([]*Order, 0) + if err := sbeDecoder.DecodeResponse(data, &res); err != nil { + return nil, err + } + + return res, nil +} diff --git a/v2/request.go b/v2/request.go index 81580a29..12506f8e 100644 --- a/v2/request.go +++ b/v2/request.go @@ -123,3 +123,15 @@ func WithHeaders(header http.Header) RequestOption { r.header = header.Clone() } } + +// WithSBE enables Simple Binary Encoding (SBE) response format +// schemaID and schemaVersion specify the SBE schema to use (e.g., 3, 1) +func WithSBE(schemaID int, schemaVersion int) RequestOption { + return func(r *request) { + if r.header == nil { + r.header = http.Header{} + } + r.header.Set("Accept", "application/sbe") + r.header.Set("X-MBX-SBE", fmt.Sprintf("%d:%d", schemaID, schemaVersion)) + } +} diff --git a/v2/sbe_decoder.go b/v2/sbe_decoder.go new file mode 100644 index 00000000..44dee58f --- /dev/null +++ b/v2/sbe_decoder.go @@ -0,0 +1,882 @@ +package binance + +import ( + "bytes" + "encoding/json" + "fmt" + "math" + + sbe "github.com/adshao/go-binance/v2/sbe/spot_3_1" +) + +// SBEDecoder handles decoding of SBE responses into Go types +type SBEDecoder struct { + marshaller *sbe.SbeGoMarshaller +} + +// NewSBEDecoder creates a new SBE decoder +func NewSBEDecoder() *SBEDecoder { + return &SBEDecoder{ + marshaller: sbe.NewSbeGoMarshaller(), + } +} + +// sbeDecoder is a package-level decoder instance for SBE responses +var sbeDecoder = NewSBEDecoder() + +// DecodeResponse decodes SBE binary data into the target type +// This is the main entry point for all SBE decoding +func (d *SBEDecoder) DecodeResponse(data []byte, target interface{}) error { + reader := bytes.NewReader(data) + + // Decode message header + var header sbe.MessageHeader + if err := header.Decode(d.marshaller, reader, 0); err != nil { + return fmt.Errorf("failed to decode SBE header: %w", err) + } + + // Route to appropriate decoder based on template ID and target type + return d.decodeByTemplateID(header.TemplateId, header.Version, header.BlockLength, reader, target) +} + +// decodeByTemplateID routes to the appropriate SBE message decoder +func (d *SBEDecoder) decodeByTemplateID(templateID uint16, version uint16, blockLength uint16, reader *bytes.Reader, target interface{}) error { + switch templateID { + // Market Data - Order Book & Trades + case 200: // DepthResponse + return d.decodeDepth(version, blockLength, reader, target) + case 201: // TradesResponse + return d.decodeTrades(version, blockLength, reader, target) + case 202: // AggTradesResponse + return d.decodeAggTrades(version, blockLength, reader, target) + case 203: // KlinesResponse + return d.decodeKlines(version, blockLength, reader, target) + case 204: // AveragePriceResponse + return d.decodeAveragePrice(version, blockLength, reader, target) + + // PriceTicker - Symbol and List + case 205: // Ticker24hSymbolFullResponse + return d.decodeTicker24hSymbolFull(version, blockLength, reader, target) + case 206: // Ticker24hFullResponse + return d.decodeTicker24hFullList(version, blockLength, reader, target) + case 209: // PriceTickerSymbolResponse + return d.decodePriceTickerSymbol(version, blockLength, reader, target) + case 210: // PriceTickerResponse + return d.decodePriceTickerList(version, blockLength, reader, target) + + // BookTicker - Symbol and List + case 211: // BookTickerSymbolResponse + return d.decodeBookTickerSymbol(version, blockLength, reader, target) + case 212: // BookTickerResponse + return d.decodeBookTickerList(version, blockLength, reader, target) + + // SymbolTicker - Full and Mini variants + case 213: // TickerSymbolFullResponse + return d.decodeTickerSymbolFull(version, blockLength, reader, target) + case 214: // TickerFullResponse + return d.decodeTickerFullList(version, blockLength, reader, target) + case 215: // TickerSymbolMiniResponse + return d.decodeTickerSymbolMini(version, blockLength, reader, target) + case 216: // TickerMiniResponse + return d.decodeTickerMiniList(version, blockLength, reader, target) + + // Trading - Order Placement (300-302) + case 300: // NewOrderAckResponse + return d.decodeNewOrderAck(version, blockLength, reader, target) + case 301: // NewOrderResultResponse + return d.decodeNewOrderResult(version, blockLength, reader, target) + case 302: // NewOrderFullResponse + return d.decodeNewOrderFull(version, blockLength, reader, target) + + // Trading - Order Management (304-308) + case 304: // OrderResponse + return d.decodeOrder(version, blockLength, reader, target) + case 305: // CancelOrderResponse + return d.decodeCancelOrder(version, blockLength, reader, target) + case 306: // CancelOpenOrdersResponse + return d.decodeCancelOpenOrders(version, blockLength, reader, target) + case 308: // OrdersResponse + return d.decodeOrders(version, blockLength, reader, target) + + // Account (400-401) + case 400: // AccountResponse + return d.decodeAccount(version, blockLength, reader, target) + case 401: // AccountTradesResponse + return d.decodeAccountTrades(version, blockLength, reader, target) + + default: + return fmt.Errorf("unsupported template ID: %d", templateID) + } +} + +// Decoder functions for each template type + +// decodeDepth decodes template 200 - DepthResponse (order book) +func (d *SBEDecoder) decodeDepth(version, blockLength uint16, reader *bytes.Reader, target interface{}) error { + var sbeResp sbe.DepthResponse + if err := sbeResp.Decode(d.marshaller, reader, version, blockLength, false); err != nil { + return err + } + + // Convert to Go Depth response + result := &DepthResponse{ + LastUpdateID: sbeResp.LastUpdateId, + Bids: make([]Bid, len(sbeResp.Bids)), + Asks: make([]Ask, len(sbeResp.Asks)), + } + + for i, bid := range sbeResp.Bids { + result.Bids[i] = Bid{ + Price: convertSBEPrice(bid.Price, sbeResp.PriceExponent), + Quantity: convertSBEPrice(bid.Qty, sbeResp.QtyExponent), + } + } + + for i, ask := range sbeResp.Asks { + result.Asks[i] = Ask{ + Price: convertSBEPrice(ask.Price, sbeResp.PriceExponent), + Quantity: convertSBEPrice(ask.Qty, sbeResp.QtyExponent), + } + } + + return assignTarget(target, result) +} + +// decodeTrades decodes template 201 - TradesResponse (recent trades) +func (d *SBEDecoder) decodeTrades(version, blockLength uint16, reader *bytes.Reader, target interface{}) error { + var sbeResp sbe.TradesResponse + if err := sbeResp.Decode(d.marshaller, reader, version, blockLength, false); err != nil { + return err + } + + result := make([]*Trade, len(sbeResp.Trades)) + for i, trade := range sbeResp.Trades { + result[i] = &Trade{ + ID: trade.Id, + Price: convertSBEPrice(trade.Price, sbeResp.PriceExponent), + Quantity: convertSBEPrice(trade.Qty, sbeResp.QtyExponent), + QuoteQuantity: convertSBEPrice(trade.QuoteQty, sbeResp.QtyExponent), + Time: trade.Time / 1000, // Convert microseconds to milliseconds + IsBuyerMaker: trade.IsBuyerMaker == 1, + IsBestMatch: trade.IsBestMatch == 1, + } + } + + return assignTarget(target, result) +} + +// decodeAggTrades decodes template 202 - AggTradesResponse (aggregated trades) +func (d *SBEDecoder) decodeAggTrades(version, blockLength uint16, reader *bytes.Reader, target interface{}) error { + var sbeResp sbe.AggTradesResponse + if err := sbeResp.Decode(d.marshaller, reader, version, blockLength, false); err != nil { + return err + } + + result := make([]*AggTrade, len(sbeResp.AggTrades)) + for i, trade := range sbeResp.AggTrades { + result[i] = &AggTrade{ + AggTradeID: trade.AggTradeId, + Price: convertSBEPrice(trade.Price, sbeResp.PriceExponent), + Quantity: convertSBEPrice(trade.Qty, sbeResp.QtyExponent), + FirstTradeID: trade.FirstTradeId, + LastTradeID: trade.LastTradeId, + Timestamp: trade.Time / 1000, // Convert microseconds to milliseconds + IsBuyerMaker: trade.IsBuyerMaker == 1, + IsBestPriceMatch: trade.IsBestMatch == 1, + } + } + + return assignTarget(target, result) +} + +// decodeKlines decodes template 203 - KlinesResponse (candlestick data) +func (d *SBEDecoder) decodeKlines(version, blockLength uint16, reader *bytes.Reader, target interface{}) error { + var sbeResp sbe.KlinesResponse + if err := sbeResp.Decode(d.marshaller, reader, version, blockLength, false); err != nil { + return err + } + + result := make([]*Kline, len(sbeResp.Klines)) + for i, kline := range sbeResp.Klines { + result[i] = &Kline{ + OpenTime: kline.OpenTime / 1000, // Convert microseconds to milliseconds + Open: convertSBEPrice(kline.OpenPrice, sbeResp.PriceExponent), + High: convertSBEPrice(kline.HighPrice, sbeResp.PriceExponent), + Low: convertSBEPrice(kline.LowPrice, sbeResp.PriceExponent), + Close: convertSBEPrice(kline.ClosePrice, sbeResp.PriceExponent), + Volume: convertSBEString(kline.Volume[:]), + CloseTime: kline.CloseTime / 1000, // Convert microseconds to milliseconds + QuoteAssetVolume: convertSBEString(kline.QuoteVolume[:]), + TradeNum: kline.NumTrades, + TakerBuyBaseAssetVolume: convertSBEString(kline.TakerBuyBaseVolume[:]), + TakerBuyQuoteAssetVolume: convertSBEString(kline.TakerBuyQuoteVolume[:]), + } + } + + return assignTarget(target, result) +} + +func (d *SBEDecoder) decodeAveragePrice(version, blockLength uint16, reader *bytes.Reader, target interface{}) error { + var sbeResp sbe.AveragePriceResponse + if err := sbeResp.Decode(d.marshaller, reader, version, blockLength, false); err != nil { + return err + } + + result := &AvgPrice{ + Mins: sbeResp.Mins, + Price: convertSBEPrice(sbeResp.Price, sbeResp.PriceExponent), + } + + return assignTarget(target, result) +} + +func (d *SBEDecoder) decodeBookTickerSymbol(version, blockLength uint16, reader *bytes.Reader, target interface{}) error { + var sbeResp sbe.BookTickerSymbolResponse + if err := sbeResp.Decode(d.marshaller, reader, version, blockLength, false); err != nil { + return err + } + + result := []*BookTicker{{ + Symbol: convertSBEString(sbeResp.Symbol[:]), + BidPrice: convertSBEPrice(sbeResp.BidPrice, sbeResp.PriceExponent), + BidQuantity: convertSBEPrice(sbeResp.BidQty, sbeResp.QtyExponent), + AskPrice: convertSBEPrice(sbeResp.AskPrice, sbeResp.PriceExponent), + AskQuantity: convertSBEPrice(sbeResp.AskQty, sbeResp.QtyExponent), + }} + + return assignTarget(target, result) +} + +func (d *SBEDecoder) decodeBookTickerList(version, blockLength uint16, reader *bytes.Reader, target interface{}) error { + var sbeResp sbe.BookTickerResponse + if err := sbeResp.Decode(d.marshaller, reader, version, blockLength, false); err != nil { + return err + } + + result := make([]*BookTicker, len(sbeResp.Tickers)) + for i, ticker := range sbeResp.Tickers { + result[i] = &BookTicker{ + Symbol: convertSBEString(ticker.Symbol[:]), + BidPrice: convertSBEPrice(ticker.BidPrice, ticker.PriceExponent), + BidQuantity: convertSBEPrice(ticker.BidQty, ticker.QtyExponent), + AskPrice: convertSBEPrice(ticker.AskPrice, ticker.PriceExponent), + AskQuantity: convertSBEPrice(ticker.AskQty, ticker.QtyExponent), + } + } + + return assignTarget(target, result) +} + +func (d *SBEDecoder) decodePriceTickerSymbol(version, blockLength uint16, reader *bytes.Reader, target interface{}) error { + var sbeResp sbe.PriceTickerSymbolResponse + if err := sbeResp.Decode(d.marshaller, reader, version, blockLength, false); err != nil { + return err + } + + result := []*SymbolPrice{{ + Symbol: convertSBEString(sbeResp.Symbol[:]), + Price: convertSBEPrice(sbeResp.Price, sbeResp.PriceExponent), + }} + + return assignTarget(target, result) +} + +func (d *SBEDecoder) decodePriceTickerList(version, blockLength uint16, reader *bytes.Reader, target interface{}) error { + var sbeResp sbe.PriceTickerResponse + if err := sbeResp.Decode(d.marshaller, reader, version, blockLength, false); err != nil { + return err + } + + result := make([]*SymbolPrice, len(sbeResp.Tickers)) + for i, ticker := range sbeResp.Tickers { + result[i] = &SymbolPrice{ + Symbol: convertSBEString(ticker.Symbol[:]), + Price: convertSBEPrice(ticker.Price, ticker.PriceExponent), + } + } + + return assignTarget(target, result) +} + +func (d *SBEDecoder) decodeTicker24hSymbolFull(version, blockLength uint16, reader *bytes.Reader, target interface{}) error { + var sbeResp sbe.Ticker24hSymbolFullResponse + if err := sbeResp.Decode(d.marshaller, reader, version, blockLength, false); err != nil { + return err + } + + result := []*PriceChangeStats{{ + Symbol: convertSBEString(sbeResp.Symbol[:]), + PriceChange: convertSBEPrice(sbeResp.PriceChange, sbeResp.PriceExponent), + PriceChangePercent: fmt.Sprintf("%.3f", sbeResp.PriceChangePercent), + WeightedAvgPrice: convertSBEPrice(sbeResp.WeightedAvgPrice, sbeResp.PriceExponent), + PrevClosePrice: convertSBEPrice(sbeResp.PrevClosePrice, sbeResp.PriceExponent), + LastPrice: convertSBEPrice(sbeResp.LastPrice, sbeResp.PriceExponent), + LastQty: convertSBEString(sbeResp.LastQty[:]), + BidPrice: convertSBEPrice(sbeResp.BidPrice, sbeResp.PriceExponent), + BidQty: convertSBEPrice(sbeResp.BidQty, sbeResp.QtyExponent), + AskPrice: convertSBEPrice(sbeResp.AskPrice, sbeResp.PriceExponent), + AskQty: convertSBEPrice(sbeResp.AskQty, sbeResp.QtyExponent), + OpenPrice: convertSBEPrice(sbeResp.OpenPrice, sbeResp.PriceExponent), + HighPrice: convertSBEPrice(sbeResp.HighPrice, sbeResp.PriceExponent), + LowPrice: convertSBEPrice(sbeResp.LowPrice, sbeResp.PriceExponent), + Volume: convertSBEString(sbeResp.Volume[:]), + QuoteVolume: convertSBEString(sbeResp.QuoteVolume[:]), + OpenTime: sbeResp.OpenTime / 1000, + CloseTime: sbeResp.CloseTime / 1000, + FirstID: sbeResp.FirstId, + LastID: sbeResp.LastId, + Count: sbeResp.NumTrades, + }} + + return assignTarget(target, result) +} + +func (d *SBEDecoder) decodeTicker24hFullList(version, blockLength uint16, reader *bytes.Reader, target interface{}) error { + var sbeResp sbe.Ticker24hFullResponse + if err := sbeResp.Decode(d.marshaller, reader, version, blockLength, false); err != nil { + return err + } + + result := make([]*PriceChangeStats, len(sbeResp.Tickers)) + for i, ticker := range sbeResp.Tickers { + result[i] = &PriceChangeStats{ + Symbol: convertSBEString(ticker.Symbol[:]), + PriceChange: convertSBEPrice(ticker.PriceChange, ticker.PriceExponent), + PriceChangePercent: fmt.Sprintf("%.3f", ticker.PriceChangePercent), + WeightedAvgPrice: convertSBEPrice(ticker.WeightedAvgPrice, ticker.PriceExponent), + PrevClosePrice: convertSBEPrice(ticker.PrevClosePrice, ticker.PriceExponent), + LastPrice: convertSBEPrice(ticker.LastPrice, ticker.PriceExponent), + LastQty: convertSBEString(ticker.LastQty[:]), + BidPrice: convertSBEPrice(ticker.BidPrice, ticker.PriceExponent), + BidQty: convertSBEPrice(ticker.BidQty, ticker.QtyExponent), + AskPrice: convertSBEPrice(ticker.AskPrice, ticker.PriceExponent), + AskQty: convertSBEPrice(ticker.AskQty, ticker.QtyExponent), + OpenPrice: convertSBEPrice(ticker.OpenPrice, ticker.PriceExponent), + HighPrice: convertSBEPrice(ticker.HighPrice, ticker.PriceExponent), + LowPrice: convertSBEPrice(ticker.LowPrice, ticker.PriceExponent), + Volume: convertSBEString(ticker.Volume[:]), + QuoteVolume: convertSBEString(ticker.QuoteVolume[:]), + OpenTime: ticker.OpenTime / 1000, + CloseTime: ticker.CloseTime / 1000, + FirstID: ticker.FirstId, + LastID: ticker.LastId, + Count: ticker.NumTrades, + } + } + + return assignTarget(target, result) +} + +func (d *SBEDecoder) decodeTickerSymbolFull(version, blockLength uint16, reader *bytes.Reader, target interface{}) error { + var sbeResp sbe.TickerSymbolFullResponse + if err := sbeResp.Decode(d.marshaller, reader, version, blockLength, false); err != nil { + return err + } + + result := []*SymbolTicker{{ + Symbol: convertSBEString(sbeResp.Symbol[:]), + PriceChange: convertSBEPrice(sbeResp.PriceChange, sbeResp.PriceExponent), + PriceChangePercent: fmt.Sprintf("%.3f", sbeResp.PriceChangePercent), + WeightedAvgPrice: convertSBEPrice(sbeResp.WeightedAvgPrice, sbeResp.PriceExponent), + OpenPrice: convertSBEPrice(sbeResp.OpenPrice, sbeResp.PriceExponent), + HighPrice: convertSBEPrice(sbeResp.HighPrice, sbeResp.PriceExponent), + LowPrice: convertSBEPrice(sbeResp.LowPrice, sbeResp.PriceExponent), + LastPrice: convertSBEPrice(sbeResp.LastPrice, sbeResp.PriceExponent), + Volume: convertSBEString(sbeResp.Volume[:]), + QuoteVolume: convertSBEString(sbeResp.QuoteVolume[:]), + OpenTime: sbeResp.OpenTime / 1000, + CloseTime: sbeResp.CloseTime / 1000, + FirstId: sbeResp.FirstId, + LastId: sbeResp.LastId, + Count: sbeResp.NumTrades, + }} + + return assignTarget(target, result) +} + +func (d *SBEDecoder) decodeTickerFullList(version, blockLength uint16, reader *bytes.Reader, target interface{}) error { + var sbeResp sbe.TickerFullResponse + if err := sbeResp.Decode(d.marshaller, reader, version, blockLength, false); err != nil { + return err + } + + result := make([]*SymbolTicker, len(sbeResp.Tickers)) + for i, ticker := range sbeResp.Tickers { + result[i] = &SymbolTicker{ + Symbol: convertSBEString(ticker.Symbol[:]), + PriceChange: convertSBEPrice(ticker.PriceChange, ticker.PriceExponent), + PriceChangePercent: fmt.Sprintf("%.3f", ticker.PriceChangePercent), + WeightedAvgPrice: convertSBEPrice(ticker.WeightedAvgPrice, ticker.PriceExponent), + OpenPrice: convertSBEPrice(ticker.OpenPrice, ticker.PriceExponent), + HighPrice: convertSBEPrice(ticker.HighPrice, ticker.PriceExponent), + LowPrice: convertSBEPrice(ticker.LowPrice, ticker.PriceExponent), + LastPrice: convertSBEPrice(ticker.LastPrice, ticker.PriceExponent), + Volume: convertSBEString(ticker.Volume[:]), + QuoteVolume: convertSBEString(ticker.QuoteVolume[:]), + OpenTime: ticker.OpenTime / 1000, + CloseTime: ticker.CloseTime / 1000, + FirstId: ticker.FirstId, + LastId: ticker.LastId, + Count: ticker.NumTrades, + } + } + + return assignTarget(target, result) +} + +func (d *SBEDecoder) decodeTickerSymbolMini(version, blockLength uint16, reader *bytes.Reader, target interface{}) error { + var sbeResp sbe.TickerSymbolMiniResponse + if err := sbeResp.Decode(d.marshaller, reader, version, blockLength, false); err != nil { + return err + } + + result := []*SymbolTicker{{ + Symbol: convertSBEString(sbeResp.Symbol[:]), + OpenPrice: convertSBEPrice(sbeResp.OpenPrice, sbeResp.PriceExponent), + HighPrice: convertSBEPrice(sbeResp.HighPrice, sbeResp.PriceExponent), + LowPrice: convertSBEPrice(sbeResp.LowPrice, sbeResp.PriceExponent), + LastPrice: convertSBEPrice(sbeResp.LastPrice, sbeResp.PriceExponent), + Volume: convertSBEString(sbeResp.Volume[:]), + QuoteVolume: convertSBEString(sbeResp.QuoteVolume[:]), + OpenTime: sbeResp.OpenTime / 1000, + CloseTime: sbeResp.CloseTime / 1000, + FirstId: sbeResp.FirstId, + LastId: sbeResp.LastId, + Count: sbeResp.NumTrades, + }} + + return assignTarget(target, result) +} + +func (d *SBEDecoder) decodeTickerMiniList(version, blockLength uint16, reader *bytes.Reader, target interface{}) error { + var sbeResp sbe.TickerMiniResponse + if err := sbeResp.Decode(d.marshaller, reader, version, blockLength, false); err != nil { + return err + } + + result := make([]*SymbolTicker, len(sbeResp.Tickers)) + for i, ticker := range sbeResp.Tickers { + result[i] = &SymbolTicker{ + Symbol: convertSBEString(ticker.Symbol[:]), + OpenPrice: convertSBEPrice(ticker.OpenPrice, ticker.PriceExponent), + HighPrice: convertSBEPrice(ticker.HighPrice, ticker.PriceExponent), + LowPrice: convertSBEPrice(ticker.LowPrice, ticker.PriceExponent), + LastPrice: convertSBEPrice(ticker.LastPrice, ticker.PriceExponent), + Volume: convertSBEString(ticker.Volume[:]), + QuoteVolume: convertSBEString(ticker.QuoteVolume[:]), + OpenTime: ticker.OpenTime / 1000, + CloseTime: ticker.CloseTime / 1000, + FirstId: ticker.FirstId, + LastId: ticker.LastId, + Count: ticker.NumTrades, + } + } + + return assignTarget(target, result) +} + +// Trading Decoders - Order Placement + +// decodeNewOrderAck decodes template 300 - NewOrderAckResponse +func (d *SBEDecoder) decodeNewOrderAck(version, blockLength uint16, reader *bytes.Reader, target interface{}) error { + var sbeResp sbe.NewOrderAckResponse + if err := sbeResp.Decode(d.marshaller, reader, version, blockLength, false); err != nil { + return err + } + + result := &CreateOrderResponse{ + Symbol: convertSBEString(sbeResp.Symbol), + OrderID: sbeResp.OrderId, + ClientOrderID: convertSBEString(sbeResp.ClientOrderId), + TransactTime: sbeResp.TransactTime / 1000, // Convert microseconds to milliseconds + } + + return assignTarget(target, result) +} + +// decodeNewOrderResult decodes template 301 - NewOrderResultResponse +func (d *SBEDecoder) decodeNewOrderResult(version, blockLength uint16, reader *bytes.Reader, target interface{}) error { + var sbeResp sbe.NewOrderResultResponse + if err := sbeResp.Decode(d.marshaller, reader, version, blockLength, false); err != nil { + return err + } + + result := &CreateOrderResponse{ + Symbol: convertSBEString(sbeResp.Symbol), + OrderID: sbeResp.OrderId, + ClientOrderID: convertSBEString(sbeResp.ClientOrderId), + TransactTime: sbeResp.TransactTime / 1000, + Price: convertSBEPrice(sbeResp.Price, sbeResp.PriceExponent), + OrigQuantity: convertSBEPrice(sbeResp.OrigQty, sbeResp.QtyExponent), + ExecutedQuantity: convertSBEPrice(sbeResp.ExecutedQty, sbeResp.QtyExponent), + CummulativeQuoteQuantity: convertSBEPrice(sbeResp.CummulativeQuoteQty, sbeResp.QtyExponent), + Status: OrderStatusType(convertSBEOrderStatus(sbeResp.Status)), + TimeInForce: TimeInForceType(convertSBETimeInForce(sbeResp.TimeInForce)), + Type: OrderType(convertSBEOrderType(sbeResp.OrderType)), + Side: SideType(convertSBEOrderSide(sbeResp.Side)), + SelfTradePreventionMode: SelfTradePreventionMode(convertSBESelfTradePreventionMode(sbeResp.SelfTradePreventionMode)), + } + + return assignTarget(target, result) +} + +// decodeNewOrderFull decodes template 302 - NewOrderFullResponse +func (d *SBEDecoder) decodeNewOrderFull(version, blockLength uint16, reader *bytes.Reader, target interface{}) error { + var sbeResp sbe.NewOrderFullResponse + if err := sbeResp.Decode(d.marshaller, reader, version, blockLength, false); err != nil { + return err + } + + // Convert fills + fills := make([]*Fill, len(sbeResp.Fills)) + for i, fill := range sbeResp.Fills { + fills[i] = &Fill{ + TradeID: fill.TradeId, + Price: convertSBEPrice(fill.Price, sbeResp.PriceExponent), + Quantity: convertSBEPrice(fill.Qty, sbeResp.QtyExponent), + Commission: convertSBEPrice(fill.Commission, fill.CommissionExponent), + CommissionAsset: convertSBEString(fill.CommissionAsset), + } + } + + result := &CreateOrderResponse{ + Symbol: convertSBEString(sbeResp.Symbol), + OrderID: sbeResp.OrderId, + ClientOrderID: convertSBEString(sbeResp.ClientOrderId), + TransactTime: sbeResp.TransactTime / 1000, + Price: convertSBEPrice(sbeResp.Price, sbeResp.PriceExponent), + OrigQuantity: convertSBEPrice(sbeResp.OrigQty, sbeResp.QtyExponent), + ExecutedQuantity: convertSBEPrice(sbeResp.ExecutedQty, sbeResp.QtyExponent), + CummulativeQuoteQuantity: convertSBEPrice(sbeResp.CummulativeQuoteQty, sbeResp.QtyExponent), + Status: OrderStatusType(convertSBEOrderStatus(sbeResp.Status)), + TimeInForce: TimeInForceType(convertSBETimeInForce(sbeResp.TimeInForce)), + Type: OrderType(convertSBEOrderType(sbeResp.OrderType)), + Side: SideType(convertSBEOrderSide(sbeResp.Side)), + Fills: fills, + SelfTradePreventionMode: SelfTradePreventionMode(convertSBESelfTradePreventionMode(sbeResp.SelfTradePreventionMode)), + } + + return assignTarget(target, result) +} + +// Trading Decoders - Order Management + +// decodeOrder decodes template 304 - OrderResponse (query single order) +func (d *SBEDecoder) decodeOrder(version, blockLength uint16, reader *bytes.Reader, target interface{}) error { + var sbeResp sbe.OrderResponse + if err := sbeResp.Decode(d.marshaller, reader, version, blockLength, false); err != nil { + return err + } + + result := &Order{ + Symbol: convertSBEString(sbeResp.Symbol), + OrderID: sbeResp.OrderId, + ClientOrderID: convertSBEString(sbeResp.ClientOrderId), + Price: convertSBEPrice(sbeResp.Price, sbeResp.PriceExponent), + OrigQuantity: convertSBEPrice(sbeResp.OrigQty, sbeResp.QtyExponent), + ExecutedQuantity: convertSBEPrice(sbeResp.ExecutedQty, sbeResp.QtyExponent), + CummulativeQuoteQuantity: convertSBEPrice(sbeResp.CummulativeQuoteQty, sbeResp.QtyExponent), + Status: OrderStatusType(convertSBEOrderStatus(sbeResp.Status)), + TimeInForce: TimeInForceType(convertSBETimeInForce(sbeResp.TimeInForce)), + Type: OrderType(convertSBEOrderType(sbeResp.OrderType)), + Side: SideType(convertSBEOrderSide(sbeResp.Side)), + Time: sbeResp.Time / 1000, + UpdateTime: sbeResp.UpdateTime / 1000, + } + + return assignTarget(target, result) +} + +// decodeCancelOrder decodes template 305 - CancelOrderResponse +func (d *SBEDecoder) decodeCancelOrder(version, blockLength uint16, reader *bytes.Reader, target interface{}) error { + var sbeResp sbe.CancelOrderResponse + if err := sbeResp.Decode(d.marshaller, reader, version, blockLength, false); err != nil { + return err + } + + result := &CancelOrderResponse{ + Symbol: convertSBEString(sbeResp.Symbol), + OrderID: sbeResp.OrderId, + ClientOrderID: convertSBEString(sbeResp.ClientOrderId), + OrigClientOrderID: convertSBEString(sbeResp.OrigClientOrderId), + Price: convertSBEPrice(sbeResp.Price, sbeResp.PriceExponent), + OrigQuantity: convertSBEPrice(sbeResp.OrigQty, sbeResp.QtyExponent), + ExecutedQuantity: convertSBEPrice(sbeResp.ExecutedQty, sbeResp.QtyExponent), + CummulativeQuoteQuantity: convertSBEPrice(sbeResp.CummulativeQuoteQty, sbeResp.QtyExponent), + Status: OrderStatusType(convertSBEOrderStatus(sbeResp.Status)), + TimeInForce: TimeInForceType(convertSBETimeInForce(sbeResp.TimeInForce)), + Type: OrderType(convertSBEOrderType(sbeResp.OrderType)), + Side: SideType(convertSBEOrderSide(sbeResp.Side)), + SelfTradePreventionMode: SelfTradePreventionMode(convertSBESelfTradePreventionMode(sbeResp.SelfTradePreventionMode)), + } + + return assignTarget(target, result) +} + +// decodeCancelOpenOrders decodes template 306 - CancelOpenOrdersResponse +func (d *SBEDecoder) decodeCancelOpenOrders(version, blockLength uint16, reader *bytes.Reader, target interface{}) error { + var sbeResp sbe.CancelOpenOrdersResponse + if err := sbeResp.Decode(d.marshaller, reader, version, blockLength, false); err != nil { + return err + } + + // This returns an array of cancelled orders (each response is JSON encoded) + result := make([]*CancelOrderResponse, len(sbeResp.Responses)) + for i, resp := range sbeResp.Responses { + var cancelResp CancelOrderResponse + if err := json.Unmarshal(resp.Response, &cancelResp); err != nil { + return err + } + result[i] = &cancelResp + } + + return assignTarget(target, result) +} + +// decodeOrders decodes template 308 - OrdersResponse (list orders) +func (d *SBEDecoder) decodeOrders(version, blockLength uint16, reader *bytes.Reader, target interface{}) error { + var sbeResp sbe.OrdersResponse + if err := sbeResp.Decode(d.marshaller, reader, version, blockLength, false); err != nil { + return err + } + + result := make([]*Order, len(sbeResp.Orders)) + for i, order := range sbeResp.Orders { + result[i] = &Order{ + Symbol: convertSBEString(order.Symbol), + OrderID: order.OrderId, + ClientOrderID: convertSBEString(order.ClientOrderId), + Price: convertSBEPrice(order.Price, order.PriceExponent), + OrigQuantity: convertSBEPrice(order.OrigQty, order.QtyExponent), + ExecutedQuantity: convertSBEPrice(order.ExecutedQty, order.QtyExponent), + CummulativeQuoteQuantity: convertSBEPrice(order.CummulativeQuoteQty, order.QtyExponent), + Status: OrderStatusType(convertSBEOrderStatus(order.Status)), + TimeInForce: TimeInForceType(convertSBETimeInForce(order.TimeInForce)), + Type: OrderType(convertSBEOrderType(order.OrderType)), + Side: SideType(convertSBEOrderSide(order.Side)), + Time: order.Time / 1000, + UpdateTime: order.UpdateTime / 1000, + } + } + + return assignTarget(target, result) +} + +// Account Decoders + +// decodeAccount decodes template 400 - AccountResponse +func (d *SBEDecoder) decodeAccount(version, blockLength uint16, reader *bytes.Reader, target interface{}) error { + var sbeResp sbe.AccountResponse + if err := sbeResp.Decode(d.marshaller, reader, version, blockLength, false); err != nil { + return err + } + + // Convert balances + balances := make([]Balance, len(sbeResp.Balances)) + for i, bal := range sbeResp.Balances { + balances[i] = Balance{ + Asset: convertSBEString(bal.Asset), + Free: convertSBEPrice(bal.Free, bal.Exponent), + Locked: convertSBEPrice(bal.Locked, bal.Exponent), + } + } + + // Convert permissions + permissions := make([]string, len(sbeResp.Permissions)) + for i, perm := range sbeResp.Permissions { + permissions[i] = convertSBEString(perm.Permission) + } + + result := &Account{ + MakerCommission: sbeResp.CommissionRateMaker, + TakerCommission: sbeResp.CommissionRateTaker, + BuyerCommission: sbeResp.CommissionRateBuyer, + SellerCommission: sbeResp.CommissionRateSeller, + CommissionRates: CommissionRates{ + Maker: convertSBEPrice(sbeResp.CommissionRateMaker, sbeResp.CommissionExponent), + Taker: convertSBEPrice(sbeResp.CommissionRateTaker, sbeResp.CommissionExponent), + Buyer: convertSBEPrice(sbeResp.CommissionRateBuyer, sbeResp.CommissionExponent), + Seller: convertSBEPrice(sbeResp.CommissionRateSeller, sbeResp.CommissionExponent), + }, + CanTrade: sbeResp.CanTrade == 1, + CanWithdraw: sbeResp.CanWithdraw == 1, + CanDeposit: sbeResp.CanDeposit == 1, + UpdateTime: uint64(sbeResp.UpdateTime / 1000), + AccountType: convertSBEAccountType(sbeResp.AccountType), + Balances: balances, + Permissions: permissions, + UID: sbeResp.Uid, + } + + return assignTarget(target, result) +} + +// decodeAccountTrades decodes template 401 - AccountTradesResponse +func (d *SBEDecoder) decodeAccountTrades(version, blockLength uint16, reader *bytes.Reader, target interface{}) error { + var sbeResp sbe.AccountTradesResponse + if err := sbeResp.Decode(d.marshaller, reader, version, blockLength, false); err != nil { + return err + } + + result := make([]*TradeV3, len(sbeResp.Trades)) + for i, trade := range sbeResp.Trades { + result[i] = &TradeV3{ + ID: trade.Id, + Symbol: convertSBEString(trade.Symbol), + OrderID: trade.OrderId, + OrderListId: trade.OrderListId, + Price: convertSBEPrice(trade.Price, trade.PriceExponent), + Quantity: convertSBEPrice(trade.Qty, trade.QtyExponent), + QuoteQuantity: convertSBEPrice(trade.QuoteQty, trade.QtyExponent), + Commission: convertSBEPrice(trade.Commission, trade.CommissionExponent), + CommissionAsset: convertSBEString(trade.CommissionAsset), + Time: trade.Time / 1000, + IsBuyer: trade.IsBuyer == 1, + IsMaker: trade.IsMaker == 1, + IsBestMatch: trade.IsBestMatch == 1, + } + } + + return assignTarget(target, result) +} + +// Helper functions + +// assignTarget assigns the decoded result to the target interface +func assignTarget(target interface{}, result interface{}) error { + // Use JSON marshaling as a generic way to copy data + // This avoids reflection complexity and type assertions + data, err := json.Marshal(result) + if err != nil { + return fmt.Errorf("failed to marshal result: %w", err) + } + if err := json.Unmarshal(data, target); err != nil { + return fmt.Errorf("failed to unmarshal to target: %w", err) + } + return nil +} + +// convertSBEPrice converts an SBE price (mantissa + exponent) to a string +// SBE encodes decimals as mantissa * 10^exponent +func convertSBEPrice(mantissa int64, exponent int8) string { + if mantissa == math.MinInt64 { + return "" // Null value + } + + value := float64(mantissa) * math.Pow10(int(exponent)) + precision := -int(exponent) + if precision < 0 { + precision = 0 + } + + return fmt.Sprintf("%.*f", precision, value) +} + +// convertSBEString converts a byte array to a string, trimming null bytes +// SBE stores strings as fixed-length byte arrays padded with null bytes +func convertSBEString(data []byte) string { + for i, b := range data { + if b == 0 { + return string(data[:i]) + } + } + return string(data) +} + +// convertSBEOrderStatus converts SBE OrderStatusEnum to string +func convertSBEOrderStatus(status sbe.OrderStatusEnum) string { + switch status { + case sbe.OrderStatus.New: + return "NEW" + case sbe.OrderStatus.PartiallyFilled: + return "PARTIALLY_FILLED" + case sbe.OrderStatus.Filled: + return "FILLED" + case sbe.OrderStatus.Canceled: + return "CANCELED" + case sbe.OrderStatus.PendingCancel: + return "PENDING_CANCEL" + case sbe.OrderStatus.Rejected: + return "REJECTED" + case sbe.OrderStatus.Expired: + return "EXPIRED" + case sbe.OrderStatus.ExpiredInMatch: + return "EXPIRED_IN_MATCH" + default: + return "UNKNOWN" + } +} + +// convertSBETimeInForce converts SBE TimeInForceEnum to string +func convertSBETimeInForce(tif sbe.TimeInForceEnum) string { + switch tif { + case sbe.TimeInForce.Gtc: + return "GTC" + case sbe.TimeInForce.Ioc: + return "IOC" + case sbe.TimeInForce.Fok: + return "FOK" + default: + return "GTC" + } +} + +// convertSBEOrderType converts SBE OrderTypeEnum to string +func convertSBEOrderType(orderType sbe.OrderTypeEnum) string { + switch orderType { + case sbe.OrderType.Market: + return "MARKET" + case sbe.OrderType.Limit: + return "LIMIT" + case sbe.OrderType.StopLoss: + return "STOP_LOSS" + case sbe.OrderType.StopLossLimit: + return "STOP_LOSS_LIMIT" + case sbe.OrderType.TakeProfit: + return "TAKE_PROFIT" + case sbe.OrderType.TakeProfitLimit: + return "TAKE_PROFIT_LIMIT" + case sbe.OrderType.LimitMaker: + return "LIMIT_MAKER" + default: + return "LIMIT" + } +} + +// convertSBEOrderSide converts SBE OrderSideEnum to string +func convertSBEOrderSide(side sbe.OrderSideEnum) string { + switch side { + case sbe.OrderSide.Buy: + return "BUY" + case sbe.OrderSide.Sell: + return "SELL" + default: + return "BUY" + } +} + +// convertSBESelfTradePreventionMode converts SBE SelfTradePreventionModeEnum to string +func convertSBESelfTradePreventionMode(mode sbe.SelfTradePreventionModeEnum) string { + switch mode { + case sbe.SelfTradePreventionMode.None: + return "NONE" + case sbe.SelfTradePreventionMode.ExpireTaker: + return "EXPIRE_TAKER" + case sbe.SelfTradePreventionMode.ExpireMaker: + return "EXPIRE_MAKER" + case sbe.SelfTradePreventionMode.ExpireBoth: + return "EXPIRE_BOTH" + default: + return "NONE" + } +} + +// convertSBEAccountType converts SBE AccountTypeEnum to string +func convertSBEAccountType(accountType sbe.AccountTypeEnum) string { + switch accountType { + case sbe.AccountType.Spot: + return "SPOT" + default: + return "SPOT" + } +} diff --git a/v2/ticker_service.go b/v2/ticker_service.go index bbc55b0e..f8c6fc56 100644 --- a/v2/ticker_service.go +++ b/v2/ticker_service.go @@ -14,6 +14,18 @@ type ListBookTickersService struct { symbol *string } +// buildRequest creates the API request for ListBookTickers +func (s *ListBookTickersService) buildRequest() *request { + r := &request{ + method: http.MethodGet, + endpoint: "/api/v3/ticker/bookTicker", + } + if s.symbol != nil { + r.setParam("symbol", *s.symbol) + } + return r +} + // Symbol set symbol func (s *ListBookTickersService) Symbol(symbol string) *ListBookTickersService { s.symbol = &symbol @@ -22,13 +34,7 @@ func (s *ListBookTickersService) Symbol(symbol string) *ListBookTickersService { // Do send request func (s *ListBookTickersService) Do(ctx context.Context, opts ...RequestOption) (res []*BookTicker, err error) { - r := &request{ - method: http.MethodGet, - endpoint: "/api/v3/ticker/bookTicker", - } - if s.symbol != nil { - r.setParam("symbol", *s.symbol) - } + r := s.buildRequest() data, err := s.c.callAPI(ctx, r, opts...) data = common.ToJSONList(data) if err != nil { @@ -58,14 +64,8 @@ type ListPricesService struct { symbols []string } -// Symbol set symbol -func (s *ListPricesService) Symbol(symbol string) *ListPricesService { - s.symbol = &symbol - return s -} - -// Do send request -func (s *ListPricesService) Do(ctx context.Context, opts ...RequestOption) (res []*SymbolPrice, err error) { +// buildRequest creates the API request for ListPrices +func (s *ListPricesService) buildRequest() *request { r := &request{ method: http.MethodGet, endpoint: "/api/v3/ticker/price", @@ -76,6 +76,18 @@ func (s *ListPricesService) Do(ctx context.Context, opts ...RequestOption) (res s, _ := json.Marshal(s.symbols) r.setParam("symbols", string(s)) } + return r +} + +// Symbol set symbol +func (s *ListPricesService) Symbol(symbol string) *ListPricesService { + s.symbol = &symbol + return s +} + +// Do send request +func (s *ListPricesService) Do(ctx context.Context, opts ...RequestOption) (res []*SymbolPrice, err error) { + r := s.buildRequest() data, err := s.c.callAPI(ctx, r, opts...) if err != nil { return []*SymbolPrice{}, err @@ -102,6 +114,20 @@ type ListPriceChangeStatsService struct { symbols []string } +// buildRequest creates the API request for ListPriceChangeStats +func (s *ListPriceChangeStatsService) buildRequest() *request { + r := &request{ + method: http.MethodGet, + endpoint: "/api/v3/ticker/24hr", + } + if s.symbol != nil { + r.setParam("symbol", *s.symbol) + } else if s.symbols != nil { + r.setParam("symbols", s.symbols) + } + return r +} + // Symbol set symbol func (s *ListPriceChangeStatsService) Symbol(symbol string) *ListPriceChangeStatsService { s.symbol = &symbol @@ -122,17 +148,7 @@ func (s *ListPricesService) Symbols(symbols []string) *ListPricesService { // Do send request func (s *ListPriceChangeStatsService) Do(ctx context.Context, opts ...RequestOption) (res []*PriceChangeStats, err error) { - r := &request{ - method: http.MethodGet, - endpoint: "/api/v3/ticker/24hr", - } - - if s.symbol != nil { - r.setParam("symbol", *s.symbol) - } else if s.symbols != nil { - r.setParam("symbols", s.symbols) - } - + r := s.buildRequest() data, err := s.c.callAPI(ctx, r, opts...) if err != nil { return res, err @@ -177,6 +193,16 @@ type AveragePriceService struct { symbol string } +// buildRequest creates the API request for AveragePrice +func (s *AveragePriceService) buildRequest() *request { + r := &request{ + method: http.MethodGet, + endpoint: "/api/v3/avgPrice", + } + r.setParam("symbol", s.symbol) + return r +} + // Symbol set symbol func (s *AveragePriceService) Symbol(symbol string) *AveragePriceService { s.symbol = symbol @@ -185,11 +211,7 @@ func (s *AveragePriceService) Symbol(symbol string) *AveragePriceService { // Do send request func (s *AveragePriceService) Do(ctx context.Context, opts ...RequestOption) (res *AvgPrice, err error) { - r := &request{ - method: http.MethodGet, - endpoint: "/api/v3/avgPrice", - } - r.setParam("symbol", s.symbol) + r := s.buildRequest() data, err := s.c.callAPI(ctx, r, opts...) if err != nil { return res, err @@ -215,6 +237,24 @@ type ListSymbolTickerService struct { windowSize *string } +// buildRequest creates the API request for ListSymbolTicker +func (s *ListSymbolTickerService) buildRequest() *request { + r := &request{ + method: http.MethodGet, + endpoint: "/api/v3/ticker", + } + if s.symbol != nil { + r.setParam("symbol", *s.symbol) + } else if s.symbols != nil { + s, _ := json.Marshal(s.symbols) + r.setParam("symbols", string(s)) + } + if s.windowSize != nil { + r.setParam("windowSize", *s.windowSize) + } + return r +} + type SymbolTicker struct { Symbol string `json:"symbol"` PriceChange string `json:"priceChange"` @@ -262,21 +302,7 @@ func (s *ListSymbolTickerService) WindowSize(windowSize string) *ListSymbolTicke } func (s *ListSymbolTickerService) Do(ctx context.Context, opts ...RequestOption) (res []*SymbolTicker, err error) { - r := &request{ - method: http.MethodGet, - endpoint: "/api/v3/ticker", - } - if s.symbol != nil { - r.setParam("symbol", *s.symbol) - } else if s.symbols != nil { - s, _ := json.Marshal(s.symbols) - r.setParam("symbols", string(s)) - } - - if s.windowSize != nil { - r.setParam("windowSize", *s.windowSize) - } - + r := s.buildRequest() data, err := s.c.callAPI(ctx, r, opts...) data = common.ToJSONList(data) if err != nil { @@ -289,3 +315,103 @@ func (s *ListSymbolTickerService) Do(ctx context.Context, opts ...RequestOption) } return res, nil } + +// DoSBE sends the request with SBE encoding and returns the decoded response +func (s *ListBookTickersService) DoSBE(ctx context.Context, opts ...RequestOption) (res []*BookTicker, err error) { + // Add SBE headers + opts = append(opts, WithSBE(3, 1)) + + r := s.buildRequest() + data, err := s.c.callAPI(ctx, r, opts...) + if err != nil { + return nil, err + } + + // Decode SBE response using centralized decoder + res = make([]*BookTicker, 0) + if err := sbeDecoder.DecodeResponse(data, &res); err != nil { + return nil, err + } + + return res, nil +} + +// DoSBE sends the request with SBE encoding and returns the decoded response +func (s *ListPricesService) DoSBE(ctx context.Context, opts ...RequestOption) (res []*SymbolPrice, err error) { + // Add SBE headers + opts = append(opts, WithSBE(3, 1)) + + r := s.buildRequest() + data, err := s.c.callAPI(ctx, r, opts...) + if err != nil { + return nil, err + } + + // Decode SBE response using centralized decoder + res = make([]*SymbolPrice, 0) + if err := sbeDecoder.DecodeResponse(data, &res); err != nil { + return nil, err + } + + return res, nil +} + +// DoSBE sends the request with SBE encoding and returns the decoded response +func (s *ListPriceChangeStatsService) DoSBE(ctx context.Context, opts ...RequestOption) (res []*PriceChangeStats, err error) { + // Add SBE headers + opts = append(opts, WithSBE(3, 1)) + + r := s.buildRequest() + data, err := s.c.callAPI(ctx, r, opts...) + if err != nil { + return nil, err + } + + // Decode SBE response using centralized decoder + res = make([]*PriceChangeStats, 0) + if err := sbeDecoder.DecodeResponse(data, &res); err != nil { + return nil, err + } + + return res, nil +} + +// DoSBE sends the request with SBE encoding and returns the decoded response +func (s *AveragePriceService) DoSBE(ctx context.Context, opts ...RequestOption) (res *AvgPrice, err error) { + // Add SBE headers + opts = append(opts, WithSBE(3, 1)) + + r := s.buildRequest() + data, err := s.c.callAPI(ctx, r, opts...) + if err != nil { + return nil, err + } + + // Decode SBE response using centralized decoder + res = &AvgPrice{} + if err := sbeDecoder.DecodeResponse(data, res); err != nil { + return nil, err + } + + return res, nil +} + +// DoSBE sends the request with SBE encoding and returns the decoded response +func (s *ListSymbolTickerService) DoSBE(ctx context.Context, opts ...RequestOption) (res []*SymbolTicker, err error) { + // Add SBE headers + opts = append(opts, WithSBE(3, 1)) + + r := s.buildRequest() + data, err := s.c.callAPI(ctx, r, opts...) + if err != nil { + return nil, err + } + + // Decode SBE response using centralized decoder + res = make([]*SymbolTicker, 0) + if err := sbeDecoder.DecodeResponse(data, &res); err != nil { + return nil, err + } + + return res, nil +} diff --git a/v2/ticker_service_integration_test.go b/v2/ticker_service_integration_test.go new file mode 100644 index 00000000..994d0eaa --- /dev/null +++ b/v2/ticker_service_integration_test.go @@ -0,0 +1,761 @@ +package binance + +import ( + "context" + "fmt" + "testing" + "time" +) + +type tickerServiceIntegrationTestSuite struct { + *baseIntegrationTestSuite +} + +func TestTickerServiceIntegration(t *testing.T) { + base := SetupTest(t) + suite := &tickerServiceIntegrationTestSuite{ + baseIntegrationTestSuite: base, + } + + t.Run("ListBookTickers_All", func(t *testing.T) { + service := suite.client.NewListBookTickersService() + tickers, err := service.Do(context.Background()) + if err != nil { + t.Fatalf("Failed to get book tickers: %v", err) + } + + // Validate returned data + if len(tickers) == 0 { + t.Error("Expected at least one book ticker") + } + + for _, ticker := range tickers { + if ticker.Symbol == "" { + t.Error("Expected non-empty symbol") + } + if ticker.BidPrice == "" { + t.Error("Expected non-empty bid price") + } + if ticker.BidQuantity == "" { + t.Error("Expected non-empty bid quantity") + } + if ticker.AskPrice == "" { + t.Error("Expected non-empty ask price") + } + if ticker.AskQuantity == "" { + t.Error("Expected non-empty ask quantity") + } + } + }) + + t.Run("ListBookTickers_SingleSymbol", func(t *testing.T) { + symbol := "BTCUSDT" + service := suite.client.NewListBookTickersService() + tickers, err := service.Symbol(symbol).Do(context.Background()) + fmt.Printf("tickers: %+v\n", tickers) + if err != nil { + t.Fatalf("Failed to get book ticker for %s: %v", symbol, err) + } + + // Validate returned data + if len(tickers) != 1 { + t.Errorf("Expected exactly 1 ticker, got %d", len(tickers)) + } + + if tickers[0].Symbol != symbol { + t.Errorf("Expected symbol %s, got %s", symbol, tickers[0].Symbol) + } + }) + + t.Run("ListPrices_All", func(t *testing.T) { + service := suite.client.NewListPricesService() + prices, err := service.Do(context.Background()) + if err != nil { + t.Fatalf("Failed to get prices: %v", err) + } + + // Validate returned data + if len(prices) == 0 { + t.Error("Expected at least one price") + } + + for _, price := range prices { + if price.Symbol == "" { + t.Error("Expected non-empty symbol") + } + if price.Price == "" { + t.Error("Expected non-empty price") + } + } + }) + + t.Run("ListPrices_SingleSymbol", func(t *testing.T) { + symbol := "BTCUSDT" + service := suite.client.NewListPricesService() + prices, err := service.Symbol(symbol).Do(context.Background()) + if err != nil { + t.Fatalf("Failed to get price for %s: %v", symbol, err) + } + + // Validate returned data + if len(prices) != 1 { + t.Errorf("Expected exactly 1 price, got %d", len(prices)) + } + + if prices[0].Symbol != symbol { + t.Errorf("Expected symbol %s, got %s", symbol, prices[0].Symbol) + } + }) + + t.Run("ListPrices_MultipleSymbols", func(t *testing.T) { + symbols := []string{"BTCUSDT", "ETHUSDT"} + service := suite.client.NewListPricesService() + prices, err := service.Symbols(symbols).Do(context.Background()) + if err != nil { + t.Fatalf("Failed to get prices for multiple symbols: %v", err) + } + + // Validate returned data + if len(prices) != len(symbols) { + t.Errorf("Expected %d prices, got %d", len(symbols), len(prices)) + } + + // Check that all requested symbols are present + symbolMap := make(map[string]bool) + for _, price := range prices { + symbolMap[price.Symbol] = true + } + + for _, symbol := range symbols { + if !symbolMap[symbol] { + t.Errorf("Expected symbol %s in response", symbol) + } + } + }) + + t.Run("ListPriceChangeStats_All", func(t *testing.T) { + service := suite.client.NewListPriceChangeStatsService() + stats, err := service.Do(context.Background()) + if err != nil { + t.Fatalf("Failed to get price change stats: %v", err) + } + + // Validate returned data + if len(stats) == 0 { + t.Error("Expected at least one price change stat") + } + + for _, stat := range stats { + if stat.Symbol == "" { + t.Error("Expected non-empty symbol") + } + // Other fields can be empty (like zero price change), so just check symbol + } + }) + + t.Run("ListPriceChangeStats_SingleSymbol", func(t *testing.T) { + symbol := "BTCUSDT" + service := suite.client.NewListPriceChangeStatsService() + stats, err := service.Symbol(symbol).Do(context.Background()) + if err != nil { + t.Fatalf("Failed to get price change stats for %s: %v", symbol, err) + } + + // Validate returned data + if len(stats) != 1 { + t.Errorf("Expected exactly 1 stat, got %d", len(stats)) + } + + if stats[0].Symbol != symbol { + t.Errorf("Expected symbol %s, got %s", symbol, stats[0].Symbol) + } + + // Validate required fields are present + if stats[0].OpenTime == 0 { + t.Error("Expected non-zero open time") + } + if stats[0].CloseTime == 0 { + t.Error("Expected non-zero close time") + } + }) + + t.Run("ListPriceChangeStats_MultipleSymbols", func(t *testing.T) { + symbols := []string{"BTCUSDT", "ETHUSDT"} + service := suite.client.NewListPriceChangeStatsService() + stats, err := service.Symbols(symbols).Do(context.Background()) + if err != nil { + t.Fatalf("Failed to get price change stats for multiple symbols: %v", err) + } + + // Validate returned data + if len(stats) != len(symbols) { + t.Errorf("Expected %d stats, got %d", len(symbols), len(stats)) + } + + // Check that all requested symbols are present + symbolMap := make(map[string]bool) + for _, stat := range stats { + symbolMap[stat.Symbol] = true + } + + for _, symbol := range symbols { + if !symbolMap[symbol] { + t.Errorf("Expected symbol %s in response", symbol) + } + } + }) + + t.Run("AveragePrice", func(t *testing.T) { + symbol := "BTCUSDT" + service := suite.client.NewAveragePriceService() + avgPrice, err := service.Symbol(symbol).Do(context.Background()) + if err != nil { + t.Fatalf("Failed to get average price for %s: %v", symbol, err) + } + + // Validate returned data + if avgPrice.Mins == 0 { + t.Error("Expected non-zero mins") + } + if avgPrice.Price == "" { + t.Error("Expected non-empty price") + } + }) + + t.Run("ListSymbolTicker_SingleSymbol", func(t *testing.T) { + symbol := "BTCUSDT" + service := suite.client.NewListSymbolTickerService() + tickers, err := service.Symbol(symbol).Do(context.Background()) + if err != nil { + t.Fatalf("Failed to get symbol ticker for %s: %v", symbol, err) + } + + // Validate returned data + if len(tickers) != 1 { + t.Errorf("Expected exactly 1 ticker, got %d", len(tickers)) + } + + ticker := tickers[0] + if ticker.Symbol != symbol { + t.Errorf("Expected symbol %s, got %s", symbol, ticker.Symbol) + } + if ticker.OpenTime == 0 { + t.Error("Expected non-zero open time") + } + if ticker.CloseTime == 0 { + t.Error("Expected non-zero close time") + } + }) + + t.Run("ListSymbolTicker_WithWindowSize", func(t *testing.T) { + symbol := "BTCUSDT" + windowSize := "1h" + service := suite.client.NewListSymbolTickerService() + tickers, err := service.Symbol(symbol).WindowSize(windowSize).Do(context.Background()) + if err != nil { + t.Fatalf("Failed to get symbol ticker for %s with window size %s: %v", symbol, windowSize, err) + } + + // Validate returned data + if len(tickers) != 1 { + t.Errorf("Expected exactly 1 ticker, got %d", len(tickers)) + } + + ticker := tickers[0] + if ticker.Symbol != symbol { + t.Errorf("Expected symbol %s, got %s", symbol, ticker.Symbol) + } + }) + + t.Run("ListSymbolTicker_MultipleSymbols", func(t *testing.T) { + symbols := []string{"BTCUSDT", "ETHUSDT"} + service := suite.client.NewListSymbolTickerService() + tickers, err := service.Symbols(symbols).Do(context.Background()) + if err != nil { + t.Fatalf("Failed to get symbol tickers for multiple symbols: %v", err) + } + + // Validate returned data + if len(tickers) != len(symbols) { + t.Errorf("Expected %d tickers, got %d", len(symbols), len(tickers)) + } + + // Check that all requested symbols are present + symbolMap := make(map[string]bool) + for _, ticker := range tickers { + symbolMap[ticker.Symbol] = true + } + + for _, symbol := range symbols { + if !symbolMap[symbol] { + t.Errorf("Expected symbol %s in response", symbol) + } + } + }) +} + +// TestTickerServiceSBEIntegration tests SBE (Simple Binary Encoding) functionality +func TestTickerServiceSBEIntegration(t *testing.T) { + base := SetupTest(t) + suite := &tickerServiceIntegrationTestSuite{ + baseIntegrationTestSuite: base, + } + + t.Run("ListBookTickers_SBE_SingleSymbol", func(t *testing.T) { + symbol := "BTCUSDT" + service := suite.client.NewListBookTickersService() + + start := time.Now() + tickers, err := service.Symbol(symbol).DoSBE(context.Background()) + elapsed := time.Since(start) + + if err != nil { + t.Fatalf("Failed to get book ticker (SBE) for %s: %v", symbol, err) + } + + // Validate returned data + if len(tickers) != 1 { + t.Errorf("Expected exactly 1 ticker, got %d", len(tickers)) + } + + if tickers[0].Symbol != symbol { + t.Errorf("Expected symbol %s, got %s", symbol, tickers[0].Symbol) + } + + // Validate fields are populated + if tickers[0].BidPrice == "" { + t.Error("Expected non-empty bid price") + } + if tickers[0].AskPrice == "" { + t.Error("Expected non-empty ask price") + } + + fmt.Printf("SBE Book Ticker: %+v [Duration: %v]\n", tickers[0], elapsed) + }) + + t.Run("ListBookTickers_SBE_All", func(t *testing.T) { + service := suite.client.NewListBookTickersService() + + start := time.Now() + tickers, err := service.DoSBE(context.Background()) + elapsed := time.Since(start) + + if err != nil { + t.Fatalf("Failed to get all book tickers (SBE): %v", err) + } + + // Validate returned data + if len(tickers) == 0 { + t.Error("Expected at least one book ticker") + } + + fmt.Printf("SBE Book Tickers count: %d [Duration: %v]\n", len(tickers), elapsed) + }) + + t.Run("ListPrices_SBE_SingleSymbol", func(t *testing.T) { + symbol := "BTCUSDT" + service := suite.client.NewListPricesService() + + start := time.Now() + prices, err := service.Symbol(symbol).DoSBE(context.Background()) + elapsed := time.Since(start) + + if err != nil { + t.Fatalf("Failed to get price (SBE) for %s: %v", symbol, err) + } + + // Validate returned data + if len(prices) != 1 { + t.Errorf("Expected exactly 1 price, got %d", len(prices)) + } + + if prices[0].Symbol != symbol { + t.Errorf("Expected symbol %s, got %s", symbol, prices[0].Symbol) + } + + if prices[0].Price == "" { + t.Error("Expected non-empty price") + } + + fmt.Printf("SBE Price: %+v [Duration: %v]\n", prices[0], elapsed) + }) + + t.Run("ListPrices_SBE_MultipleSymbols", func(t *testing.T) { + symbols := []string{"BTCUSDT", "ETHUSDT"} + service := suite.client.NewListPricesService() + + start := time.Now() + prices, err := service.Symbols(symbols).DoSBE(context.Background()) + elapsed := time.Since(start) + + if err != nil { + t.Fatalf("Failed to get prices (SBE) for multiple symbols: %v", err) + } + + // Validate returned data + if len(prices) != len(symbols) { + t.Errorf("Expected %d prices, got %d", len(symbols), len(prices)) + } + + // Check that all requested symbols are present + symbolMap := make(map[string]bool) + for _, price := range prices { + symbolMap[price.Symbol] = true + } + + for _, symbol := range symbols { + if !symbolMap[symbol] { + t.Errorf("Expected symbol %s in response", symbol) + } + } + + fmt.Printf("SBE Prices count: %d [Duration: %v]\n", len(prices), elapsed) + }) + + t.Run("ListPriceChangeStats_SBE_SingleSymbol", func(t *testing.T) { + symbol := "BTCUSDT" + service := suite.client.NewListPriceChangeStatsService() + + start := time.Now() + stats, err := service.Symbol(symbol).DoSBE(context.Background()) + elapsed := time.Since(start) + + if err != nil { + t.Fatalf("Failed to get price change stats (SBE) for %s: %v", symbol, err) + } + + // Validate returned data + if len(stats) != 1 { + t.Errorf("Expected exactly 1 stat, got %d", len(stats)) + } + + if stats[0].Symbol != symbol { + t.Errorf("Expected symbol %s, got %s", symbol, stats[0].Symbol) + } + + // Validate required fields are present + if stats[0].OpenTime == 0 { + t.Error("Expected non-zero open time") + } + if stats[0].CloseTime == 0 { + t.Error("Expected non-zero close time") + } + + fmt.Printf("SBE 24h Stats: Symbol=%s, Volume=%s, PriceChange=%s%% [Duration: %v]\n", + stats[0].Symbol, stats[0].Volume, stats[0].PriceChangePercent, elapsed) + }) + + t.Run("ListPriceChangeStats_SBE_MultipleSymbols", func(t *testing.T) { + symbols := []string{"BTCUSDT", "ETHUSDT"} + service := suite.client.NewListPriceChangeStatsService() + + start := time.Now() + stats, err := service.Symbols(symbols).DoSBE(context.Background()) + elapsed := time.Since(start) + + if err != nil { + t.Fatalf("Failed to get price change stats (SBE) for multiple symbols: %v", err) + } + + // Validate returned data + if len(stats) != len(symbols) { + t.Errorf("Expected %d stats, got %d", len(symbols), len(stats)) + } + + // Check that all requested symbols are present + symbolMap := make(map[string]bool) + for _, stat := range stats { + symbolMap[stat.Symbol] = true + } + + for _, symbol := range symbols { + if !symbolMap[symbol] { + t.Errorf("Expected symbol %s in response", symbol) + } + } + + fmt.Printf("SBE 24h Stats count: %d [Duration: %v]\n", len(stats), elapsed) + }) + + t.Run("AveragePrice_SBE", func(t *testing.T) { + symbol := "BTCUSDT" + service := suite.client.NewAveragePriceService() + + start := time.Now() + avgPrice, err := service.Symbol(symbol).DoSBE(context.Background()) + elapsed := time.Since(start) + + if err != nil { + t.Fatalf("Failed to get average price (SBE) for %s: %v", symbol, err) + } + + // Validate returned data + if avgPrice.Mins == 0 { + t.Error("Expected non-zero mins") + } + if avgPrice.Price == "" { + t.Error("Expected non-empty price") + } + + fmt.Printf("SBE Avg Price: Price=%s, Mins=%d [Duration: %v]\n", avgPrice.Price, avgPrice.Mins, elapsed) + }) + + t.Run("ListSymbolTicker_SBE_SingleSymbol", func(t *testing.T) { + symbol := "BTCUSDT" + service := suite.client.NewListSymbolTickerService() + + start := time.Now() + tickers, err := service.Symbol(symbol).DoSBE(context.Background()) + elapsed := time.Since(start) + + if err != nil { + t.Fatalf("Failed to get symbol ticker (SBE) for %s: %v", symbol, err) + } + + // Validate returned data + if len(tickers) != 1 { + t.Errorf("Expected exactly 1 ticker, got %d", len(tickers)) + } + + ticker := tickers[0] + if ticker.Symbol != symbol { + t.Errorf("Expected symbol %s, got %s", symbol, ticker.Symbol) + } + if ticker.OpenTime == 0 { + t.Error("Expected non-zero open time") + } + if ticker.CloseTime == 0 { + t.Error("Expected non-zero close time") + } + + fmt.Printf("SBE Ticker: Symbol=%s, LastPrice=%s, Volume=%s [Duration: %v]\n", + ticker.Symbol, ticker.LastPrice, ticker.Volume, elapsed) + }) + + t.Run("ListSymbolTicker_SBE_WithWindowSize", func(t *testing.T) { + symbol := "BTCUSDT" + windowSize := "1h" + service := suite.client.NewListSymbolTickerService() + + start := time.Now() + tickers, err := service.Symbol(symbol).WindowSize(windowSize).DoSBE(context.Background()) + elapsed := time.Since(start) + + if err != nil { + t.Fatalf("Failed to get symbol ticker (SBE) for %s with window size %s: %v", symbol, windowSize, err) + } + + // Validate returned data + if len(tickers) != 1 { + t.Errorf("Expected exactly 1 ticker, got %d", len(tickers)) + } + + ticker := tickers[0] + if ticker.Symbol != symbol { + t.Errorf("Expected symbol %s, got %s", symbol, ticker.Symbol) + } + + fmt.Printf("SBE Ticker (1h window): Symbol=%s, LastPrice=%s [Duration: %v]\n", + ticker.Symbol, ticker.LastPrice, elapsed) + }) + + t.Run("ListSymbolTicker_SBE_MultipleSymbols", func(t *testing.T) { + symbols := []string{"BTCUSDT", "ETHUSDT"} + service := suite.client.NewListSymbolTickerService() + + start := time.Now() + tickers, err := service.Symbols(symbols).DoSBE(context.Background()) + elapsed := time.Since(start) + + if err != nil { + t.Fatalf("Failed to get symbol tickers (SBE) for multiple symbols: %v", err) + } + + // Validate returned data + if len(tickers) != len(symbols) { + t.Errorf("Expected %d tickers, got %d", len(symbols), len(tickers)) + } + + // Check that all requested symbols are present + symbolMap := make(map[string]bool) + for _, ticker := range tickers { + symbolMap[ticker.Symbol] = true + } + + for _, symbol := range symbols { + if !symbolMap[symbol] { + t.Errorf("Expected symbol %s in response", symbol) + } + } + + fmt.Printf("SBE Tickers count: %d [Duration: %v]\n", len(tickers), elapsed) + }) + + // Comparison test: JSON vs SBE + t.Run("Comparison_JSON_vs_SBE", func(t *testing.T) { + symbol := "BTCUSDT" + + // Get using JSON + startJSON := time.Now() + jsonTickers, err := suite.client.NewListBookTickersService(). + Symbol(symbol). + Do(context.Background()) + jsonElapsed := time.Since(startJSON) + + if err != nil { + t.Fatalf("Failed to get book ticker (JSON): %v", err) + } + + // Get using SBE + startSBE := time.Now() + sbeTickers, err := suite.client.NewListBookTickersService(). + Symbol(symbol). + DoSBE(context.Background()) + sbeElapsed := time.Since(startSBE) + + if err != nil { + t.Fatalf("Failed to get book ticker (SBE): %v", err) + } + + // Compare that both return data for the same symbol + if len(jsonTickers) != len(sbeTickers) { + t.Errorf("Different number of results: JSON=%d, SBE=%d", + len(jsonTickers), len(sbeTickers)) + } + + if jsonTickers[0].Symbol != sbeTickers[0].Symbol { + t.Errorf("Different symbols: JSON=%s, SBE=%s", + jsonTickers[0].Symbol, sbeTickers[0].Symbol) + } + + // Calculate performance difference + speedup := float64(jsonElapsed) / float64(sbeElapsed) + var fasterMsg string + if speedup > 1 { + fasterMsg = fmt.Sprintf("SBE is %.2fx faster", speedup) + } else if speedup < 1 { + fasterMsg = fmt.Sprintf("JSON is %.2fx faster", 1/speedup) + } else { + fasterMsg = "Same speed" + } + + fmt.Printf("\n=== Performance Comparison ===\n") + fmt.Printf("JSON Result: Symbol=%s, BidPrice=%s [Duration: %v]\n", + jsonTickers[0].Symbol, jsonTickers[0].BidPrice, jsonElapsed) + fmt.Printf("SBE Result: Symbol=%s, BidPrice=%s [Duration: %v]\n", + sbeTickers[0].Symbol, sbeTickers[0].BidPrice, sbeElapsed) + fmt.Printf("Performance: %s (diff: %v)\n", fasterMsg, jsonElapsed-sbeElapsed) + fmt.Printf("==============================\n\n") + }) + + // Benchmark test: Run 10 times each to compare performance + t.Run("Benchmark_JSON_vs_SBE_10_Iterations", func(t *testing.T) { + symbol := "BTCUSDT" + iterations := 50 + + fmt.Printf("\n=== Running Benchmark: %d iterations each ===\n", iterations) + + // Benchmark SBE + var sbeTotalTime time.Duration + var sbeMinTime time.Duration = time.Duration(1<<63 - 1) // Max duration + var sbeMaxTime time.Duration + var sbeResults []*BookTicker + for i := 0; i < iterations; i++ { + start := time.Now() + results, err := suite.client.NewListBookTickersService(). + Symbol(symbol). + DoSBE(context.Background()) + elapsed := time.Since(start) + + if err != nil { + t.Fatalf("Failed to get book ticker (SBE) iteration %d: %v", i+1, err) + } + + sbeTotalTime += elapsed + if elapsed < sbeMinTime { + sbeMinTime = elapsed + } + if elapsed > sbeMaxTime { + sbeMaxTime = elapsed + } + if i == 0 { + sbeResults = results + } + fmt.Printf("SBE iteration %d: %v\n", i+1, elapsed) + } + sbeAvgTime := sbeTotalTime / time.Duration(iterations) + + // Benchmark JSON + var jsonTotalTime time.Duration + var jsonMinTime time.Duration = time.Duration(1<<63 - 1) // Max duration + var jsonMaxTime time.Duration + var jsonResults []*BookTicker + for i := 0; i < iterations; i++ { + start := time.Now() + results, err := suite.client.NewListBookTickersService(). + Symbol(symbol). + Do(context.Background()) + elapsed := time.Since(start) + + if err != nil { + t.Fatalf("Failed to get book ticker (JSON) iteration %d: %v", i+1, err) + } + + jsonTotalTime += elapsed + if elapsed < jsonMinTime { + jsonMinTime = elapsed + } + if elapsed > jsonMaxTime { + jsonMaxTime = elapsed + } + if i == 0 { + jsonResults = results + } + fmt.Printf("JSON iteration %d: %v\n", i+1, elapsed) + } + jsonAvgTime := jsonTotalTime / time.Duration(iterations) + + // Validate results match + if len(jsonResults) != len(sbeResults) { + t.Errorf("Different number of results: JSON=%d, SBE=%d", + len(jsonResults), len(sbeResults)) + } + + if jsonResults[0].Symbol != sbeResults[0].Symbol { + t.Errorf("Different symbols: JSON=%s, SBE=%s", + jsonResults[0].Symbol, sbeResults[0].Symbol) + } + + // Calculate performance metrics + speedup := float64(jsonAvgTime) / float64(sbeAvgTime) + var fasterMsg string + if speedup > 1 { + fasterMsg = fmt.Sprintf("SBE is %.2fx faster", speedup) + } else if speedup < 1 { + fasterMsg = fmt.Sprintf("JSON is %.2fx faster", 1/speedup) + } else { + fasterMsg = "Same speed" + } + + // Print summary + fmt.Printf("\n=== Benchmark Results (%d iterations) ===\n", iterations) + fmt.Printf("JSON:\n") + fmt.Printf(" Total time: %v\n", jsonTotalTime) + fmt.Printf(" Average time: %v\n", jsonAvgTime) + fmt.Printf(" Min time: %v\n", jsonMinTime) + fmt.Printf(" Max time: %v\n", jsonMaxTime) + fmt.Printf(" Range: %v\n", jsonMaxTime-jsonMinTime) + fmt.Printf(" Result: Symbol=%s, BidPrice=%s\n", jsonResults[0].Symbol, jsonResults[0].BidPrice) + fmt.Printf("\nSBE:\n") + fmt.Printf(" Total time: %v\n", sbeTotalTime) + fmt.Printf(" Average time: %v\n", sbeAvgTime) + fmt.Printf(" Min time: %v\n", sbeMinTime) + fmt.Printf(" Max time: %v\n", sbeMaxTime) + fmt.Printf(" Range: %v\n", sbeMaxTime-sbeMinTime) + fmt.Printf(" Result: Symbol=%s, BidPrice=%s\n", sbeResults[0].Symbol, sbeResults[0].BidPrice) + fmt.Printf("\nPerformance: %s\n", fasterMsg) + fmt.Printf("Average difference: %v\n", jsonAvgTime-sbeAvgTime) + fmt.Printf("Total time saved: %v\n", jsonTotalTime-sbeTotalTime) + fmt.Printf("========================================\n\n") + }) +} diff --git a/v2/ticker_service_sbe_test.go b/v2/ticker_service_sbe_test.go new file mode 100644 index 00000000..06fcf4b9 --- /dev/null +++ b/v2/ticker_service_sbe_test.go @@ -0,0 +1,173 @@ +package binance + +import ( + "bytes" + "math" + "testing" + + sbe "github.com/adshao/go-binance/v2/sbe/spot_3_1" +) + +func TestConvertSBEPrice(t *testing.T) { + tests := []struct { + name string + mantissa int64 + exponent int8 + expected string + }{ + { + name: "Positive with negative exponent", + mantissa: 123456, + exponent: -2, + expected: "1234.56", + }, + { + name: "Positive with zero exponent", + mantissa: 12345, + exponent: 0, + expected: "12345", + }, + { + name: "Null value", + mantissa: math.MinInt64, + exponent: -2, + expected: "", + }, + { + name: "Large number", + mantissa: 9876543210, + exponent: -8, + expected: "98.76543210", + }, + { + name: "Small number", + mantissa: 1, + exponent: -8, + expected: "0.00000001", + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + result := convertSBEPrice(tt.mantissa, tt.exponent) + if result != tt.expected { + t.Errorf("convertSBEPrice(%d, %d) = %s; want %s", + tt.mantissa, tt.exponent, result, tt.expected) + } + }) + } +} + +func TestConvertSBEString(t *testing.T) { + tests := []struct { + name string + input []byte + expected string + }{ + { + name: "String with null terminator", + input: []byte{'B', 'T', 'C', 0, 0, 0, 0, 0}, + expected: "BTC", + }, + { + name: "Full string without null", + input: []byte{'E', 'T', 'H', 'U', 'S', 'D', 'T'}, + expected: "ETHUSDT", + }, + { + name: "Empty string", + input: []byte{0, 0, 0, 0}, + expected: "", + }, + { + name: "String at start", + input: []byte{'A', 0, 0, 0, 0, 0, 0, 0}, + expected: "A", + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + result := convertSBEString(tt.input) + if result != tt.expected { + t.Errorf("convertSBEString(%v) = %s; want %s", + tt.input, result, tt.expected) + } + }) + } +} + +func TestSBEMessageHeaderDecoding(t *testing.T) { + // Create a mock SBE message header + marshaller := sbe.NewSbeGoMarshaller() + buf := new(bytes.Buffer) + + // Encode a header + header := sbe.MessageHeader{ + BlockLength: 34, + TemplateId: 211, // BookTickerSymbolResponse + SchemaId: 3, + Version: 1, + } + + err := header.Encode(marshaller, buf) + if err != nil { + t.Fatalf("Failed to encode header: %v", err) + } + + // Decode the header + var decodedHeader sbe.MessageHeader + reader := bytes.NewReader(buf.Bytes()) + err = decodedHeader.Decode(marshaller, reader, 0) + if err != nil { + t.Fatalf("Failed to decode header: %v", err) + } + + // Verify decoded values + if decodedHeader.BlockLength != header.BlockLength { + t.Errorf("BlockLength = %d; want %d", decodedHeader.BlockLength, header.BlockLength) + } + if decodedHeader.TemplateId != header.TemplateId { + t.Errorf("TemplateId = %d; want %d", decodedHeader.TemplateId, header.TemplateId) + } + if decodedHeader.SchemaId != header.SchemaId { + t.Errorf("SchemaId = %d; want %d", decodedHeader.SchemaId, header.SchemaId) + } + if decodedHeader.Version != header.Version { + t.Errorf("Version = %d; want %d", decodedHeader.Version, header.Version) + } +} + +func TestWithSBERequestOption(t *testing.T) { + r := &request{} + + // Apply the SBE option + opt := WithSBE(3, 1) + opt(r) + + // Verify headers are set correctly + if r.header == nil { + t.Fatal("Expected headers to be set") + } + + acceptHeader := r.header.Get("Accept") + if acceptHeader != "application/sbe" { + t.Errorf("Accept header = %s; want application/sbe", acceptHeader) + } + + sbeHeader := r.header.Get("X-MBX-SBE") + if sbeHeader != "3:1" { + t.Errorf("X-MBX-SBE header = %s; want 3:1", sbeHeader) + } +} + +// Test the centralized SBE decoder +func TestSBEDecoder(t *testing.T) { + decoder := NewSBEDecoder() + if decoder == nil { + t.Fatal("NewSBEDecoder() returned nil") + } + if decoder.marshaller == nil { + t.Fatal("SBEDecoder marshaller is nil") + } +} diff --git a/v2/trade_service.go b/v2/trade_service.go index 0e975a75..4969decd 100644 --- a/v2/trade_service.go +++ b/v2/trade_service.go @@ -17,6 +17,32 @@ type ListTradesService struct { orderId *int64 } +// buildRequest creates the API request for ListTrades +func (s *ListTradesService) buildRequest() *request { + r := &request{ + method: http.MethodGet, + endpoint: "/api/v3/myTrades", + secType: secTypeSigned, + } + r.setParam("symbol", s.symbol) + if s.limit != nil { + r.setParam("limit", *s.limit) + } + if s.startTime != nil { + r.setParam("startTime", *s.startTime) + } + if s.endTime != nil { + r.setParam("endTime", *s.endTime) + } + if s.fromID != nil { + r.setParam("fromId", *s.fromID) + } + if s.orderId != nil { + r.setParam("orderId", *s.orderId) + } + return r +} + // Symbol set symbol func (s *ListTradesService) Symbol(symbol string) *ListTradesService { s.symbol = symbol @@ -55,27 +81,7 @@ func (s *ListTradesService) OrderId(OrderId int64) *ListTradesService { // Do send request func (s *ListTradesService) Do(ctx context.Context, opts ...RequestOption) (res []*TradeV3, err error) { - r := &request{ - method: http.MethodGet, - endpoint: "/api/v3/myTrades", - secType: secTypeSigned, - } - r.setParam("symbol", s.symbol) - if s.limit != nil { - r.setParam("limit", *s.limit) - } - if s.startTime != nil { - r.setParam("startTime", *s.startTime) - } - if s.endTime != nil { - r.setParam("endTime", *s.endTime) - } - if s.fromID != nil { - r.setParam("fromId", *s.fromID) - } - if s.orderId != nil { - r.setParam("orderId", *s.orderId) - } + r := s.buildRequest() data, err := s.c.callAPI(ctx, r, opts...) if err != nil { return []*TradeV3{}, err @@ -88,6 +94,27 @@ func (s *ListTradesService) Do(ctx context.Context, opts ...RequestOption) (res return res, nil } +// DoSBE sends the request with SBE encoding and returns the decoded response +// Template 401 - AccountTradesResponse (my trades) +func (s *ListTradesService) DoSBE(ctx context.Context, opts ...RequestOption) (res []*TradeV3, err error) { + // Add SBE headers + opts = append(opts, WithSBE(3, 1)) + + r := s.buildRequest() + data, err := s.c.callAPI(ctx, r, opts...) + if err != nil { + return nil, err + } + + // Decode SBE response using centralized decoder + res = make([]*TradeV3, 0) + if err := sbeDecoder.DecodeResponse(data, &res); err != nil { + return nil, err + } + + return res, nil +} + // HistoricalTradesService trades type HistoricalTradesService struct { c *Client @@ -181,6 +208,28 @@ type AggTradesService struct { limit *int } +// buildRequest creates the API request for AggTrades +func (s *AggTradesService) buildRequest() *request { + r := &request{ + method: http.MethodGet, + endpoint: "/api/v3/aggTrades", + } + r.setParam("symbol", s.symbol) + if s.fromID != nil { + r.setParam("fromId", *s.fromID) + } + if s.startTime != nil { + r.setParam("startTime", *s.startTime) + } + if s.endTime != nil { + r.setParam("endTime", *s.endTime) + } + if s.limit != nil { + r.setParam("limit", *s.limit) + } + return r +} + // Symbol set symbol func (s *AggTradesService) Symbol(symbol string) *AggTradesService { s.symbol = symbol @@ -213,23 +262,7 @@ func (s *AggTradesService) Limit(limit int) *AggTradesService { // Do send request func (s *AggTradesService) Do(ctx context.Context, opts ...RequestOption) (res []*AggTrade, err error) { - r := &request{ - method: http.MethodGet, - endpoint: "/api/v3/aggTrades", - } - r.setParam("symbol", s.symbol) - if s.fromID != nil { - r.setParam("fromId", *s.fromID) - } - if s.startTime != nil { - r.setParam("startTime", *s.startTime) - } - if s.endTime != nil { - r.setParam("endTime", *s.endTime) - } - if s.limit != nil { - r.setParam("limit", *s.limit) - } + r := s.buildRequest() data, err := s.c.callAPI(ctx, r, opts...) if err != nil { return []*AggTrade{}, err @@ -242,6 +275,27 @@ func (s *AggTradesService) Do(ctx context.Context, opts ...RequestOption) (res [ return res, nil } +// DoSBE sends the request with SBE encoding and returns the decoded response +// Template 202 - AggTradesResponse +func (s *AggTradesService) DoSBE(ctx context.Context, opts ...RequestOption) (res []*AggTrade, err error) { + // Add SBE headers + opts = append(opts, WithSBE(3, 1)) + + r := s.buildRequest() + data, err := s.c.callAPI(ctx, r, opts...) + if err != nil { + return nil, err + } + + // Decode SBE response using centralized decoder + res = make([]*AggTrade, 0) + if err := sbeDecoder.DecodeResponse(data, &res); err != nil { + return nil, err + } + + return res, nil +} + // AggTrade define aggregate trade info type AggTrade struct { AggTradeID int64 `json:"a"` @@ -261,6 +315,19 @@ type RecentTradesService struct { limit *int } +// buildRequest creates the API request for RecentTrades +func (s *RecentTradesService) buildRequest(endpoint string) *request { + r := &request{ + method: http.MethodGet, + endpoint: endpoint, + } + r.setParam("symbol", s.symbol) + if s.limit != nil { + r.setParam("limit", *s.limit) + } + return r +} + // Symbol set symbol func (s *RecentTradesService) Symbol(symbol string) *RecentTradesService { s.symbol = symbol @@ -275,14 +342,7 @@ func (s *RecentTradesService) Limit(limit int) *RecentTradesService { // Do send request func (s *RecentTradesService) Do(ctx context.Context, opts ...RequestOption) (res []*Trade, err error) { - r := &request{ - method: http.MethodGet, - endpoint: "/api/v1/trades", - } - r.setParam("symbol", s.symbol) - if s.limit != nil { - r.setParam("limit", *s.limit) - } + r := s.buildRequest("/api/v1/trades") data, err := s.c.callAPI(ctx, r, opts...) if err != nil { return []*Trade{}, err @@ -294,3 +354,25 @@ func (s *RecentTradesService) Do(ctx context.Context, opts ...RequestOption) (re } return res, nil } + +// DoSBE sends the request with SBE encoding and returns the decoded response +// Template 201 - TradesResponse +func (s *RecentTradesService) DoSBE(ctx context.Context, opts ...RequestOption) (res []*Trade, err error) { + // Add SBE headers + opts = append(opts, WithSBE(3, 1)) + + // Use v3 endpoint for SBE + r := s.buildRequest("/api/v3/trades") + data, err := s.c.callAPI(ctx, r, opts...) + if err != nil { + return nil, err + } + + // Decode SBE response using centralized decoder + res = make([]*Trade, 0) + if err := sbeDecoder.DecodeResponse(data, &res); err != nil { + return nil, err + } + + return res, nil +} diff --git a/v2/trading_account_sbe_integration_test.go b/v2/trading_account_sbe_integration_test.go new file mode 100644 index 00000000..19d3743c --- /dev/null +++ b/v2/trading_account_sbe_integration_test.go @@ -0,0 +1,509 @@ +package binance + +import ( + "context" + "fmt" + "testing" + "time" +) + +// TestTradingAccountServiceSBEIntegration tests SBE for trading and account services (Phase 2) +// NOTE: These tests require API keys with trading permissions and will place real orders on testnet +func TestTradingAccountServiceSBEIntegration(t *testing.T) { + suite := SetupTest(t) + + // Test symbol with low price for testing (adjust as needed for testnet) + testSymbol := "BTCUSDT" + + t.Run("GetAccount_SBE", func(t *testing.T) { + // JSON version + startJSON := time.Now() + accountJSON, err := suite.client.NewGetAccountService(). + Do(context.Background()) + jsonElapsed := time.Since(startJSON) + if err != nil { + t.Fatalf("Failed to get account (JSON): %v", err) + } + + // SBE version + startSBE := time.Now() + accountSBE, err := suite.client.NewGetAccountService(). + DoSBE(context.Background()) + sbeElapsed := time.Since(startSBE) + if err != nil { + t.Fatalf("Failed to get account (SBE): %v", err) + } + + // Validate SBE response + if accountSBE.AccountType == "" { + t.Error("Expected non-empty account type") + } + if len(accountSBE.Balances) == 0 { + t.Error("Expected at least one balance") + } + if len(accountSBE.Permissions) == 0 { + t.Error("Expected at least one permission") + } + + // Compare results + if accountJSON.AccountType != accountSBE.AccountType { + t.Errorf("Different account types: JSON=%s, SBE=%s", accountJSON.AccountType, accountSBE.AccountType) + } + if len(accountJSON.Balances) != len(accountSBE.Balances) { + t.Logf("Warning: Different number of balances: JSON=%d, SBE=%d", len(accountJSON.Balances), len(accountSBE.Balances)) + } + + fmt.Printf("Account Info [JSON: %v, SBE: %v]\n", jsonElapsed, sbeElapsed) + fmt.Printf(" Account Type: %s\n", accountSBE.AccountType) + fmt.Printf(" Can Trade: %v\n", accountSBE.CanTrade) + fmt.Printf(" Can Withdraw: %v\n", accountSBE.CanWithdraw) + fmt.Printf(" Can Deposit: %v\n", accountSBE.CanDeposit) + fmt.Printf(" Balances: %d\n", len(accountSBE.Balances)) + fmt.Printf(" Permissions: %v\n", accountSBE.Permissions) + + // Show first few non-zero balances + count := 0 + for _, balance := range accountSBE.Balances { + if balance.Free != "0.00000000" || balance.Locked != "0.00000000" { + fmt.Printf(" %s: Free=%s, Locked=%s\n", balance.Asset, balance.Free, balance.Locked) + count++ + if count >= 5 { + break + } + } + } + }) + + t.Run("GetAccount_SBE_OmitZeroBalances", func(t *testing.T) { + account, err := suite.client.NewGetAccountService(). + OmitZeroBalances(true). + DoSBE(context.Background()) + if err != nil { + t.Fatalf("Failed to get account with omitZeroBalances (SBE): %v", err) + } + + // Validate that no balances are zero + for _, balance := range account.Balances { + if balance.Free == "0.00000000" && balance.Locked == "0.00000000" { + t.Errorf("Found zero balance for %s when omitZeroBalances=true", balance.Asset) + } + } + + fmt.Printf("Account (omitZeroBalances=true): %d non-zero balances\n", len(account.Balances)) + }) + + t.Run("ListOrders_SBE", func(t *testing.T) { + // JSON version + startJSON := time.Now() + ordersJSON, err := suite.client.NewListOrdersService(). + Symbol(testSymbol). + Limit(10). + Do(context.Background()) + jsonElapsed := time.Since(startJSON) + if err != nil { + t.Fatalf("Failed to list orders (JSON): %v", err) + } + + // SBE version + startSBE := time.Now() + ordersSBE, err := suite.client.NewListOrdersService(). + Symbol(testSymbol). + Limit(10). + DoSBE(context.Background()) + sbeElapsed := time.Since(startSBE) + if err != nil { + t.Fatalf("Failed to list orders (SBE): %v", err) + } + + // Validate SBE response + if len(ordersSBE) > 0 { + order := ordersSBE[0] + if order.Symbol != testSymbol { + t.Errorf("Expected symbol %s, got %s", testSymbol, order.Symbol) + } + if order.OrderID == 0 { + t.Error("Expected non-zero order ID") + } + if order.Status == "" { + t.Error("Expected non-empty order status") + } + if order.Type == "" { + t.Error("Expected non-empty order type") + } + if order.Side == "" { + t.Error("Expected non-empty order side") + } + + fmt.Printf("Latest Order: ID=%d, %s %s %s @ %s [%s]\n", + order.OrderID, order.Side, order.Type, order.OrigQuantity, order.Price, order.Status) + } + + // Compare results + if len(ordersJSON) != len(ordersSBE) { + t.Logf("Warning: Different number of orders: JSON=%d, SBE=%d", len(ordersJSON), len(ordersSBE)) + } + + fmt.Printf("List Orders (%s): Count=%d [JSON: %v, SBE: %v]\n", + testSymbol, len(ordersSBE), jsonElapsed, sbeElapsed) + }) + + t.Run("ListTrades_SBE", func(t *testing.T) { + // JSON version + startJSON := time.Now() + tradesJSON, err := suite.client.NewListTradesService(). + Symbol(testSymbol). + Limit(10). + Do(context.Background()) + jsonElapsed := time.Since(startJSON) + if err != nil { + t.Fatalf("Failed to list trades (JSON): %v", err) + } + + // SBE version + startSBE := time.Now() + tradesSBE, err := suite.client.NewListTradesService(). + Symbol(testSymbol). + Limit(10). + DoSBE(context.Background()) + sbeElapsed := time.Since(startSBE) + if err != nil { + t.Fatalf("Failed to list trades (SBE): %v", err) + } + + // Validate SBE response + if len(tradesSBE) > 0 { + trade := tradesSBE[0] + if trade.Symbol != testSymbol { + t.Errorf("Expected symbol %s, got %s", testSymbol, trade.Symbol) + } + if trade.ID == 0 { + t.Error("Expected non-zero trade ID") + } + if trade.OrderID == 0 { + t.Error("Expected non-zero order ID") + } + if trade.Price == "" { + t.Error("Expected non-empty price") + } + if trade.Quantity == "" { + t.Error("Expected non-empty quantity") + } + if trade.CommissionAsset == "" { + t.Error("Expected non-empty commission asset") + } + + fmt.Printf("Latest Trade: ID=%d, OrderID=%d, %s @ %s (Commission: %s %s) [Buyer: %v, Maker: %v]\n", + trade.ID, trade.OrderID, trade.Quantity, trade.Price, + trade.Commission, trade.CommissionAsset, trade.IsBuyer, trade.IsMaker) + } + + // Compare results + if len(tradesJSON) != len(tradesSBE) { + t.Logf("Warning: Different number of trades: JSON=%d, SBE=%d", len(tradesJSON), len(tradesSBE)) + } + + fmt.Printf("List My Trades (%s): Count=%d [JSON: %v, SBE: %v]\n", + testSymbol, len(tradesSBE), jsonElapsed, sbeElapsed) + }) + + t.Run("ListTrades_SBE_WithTimeRange", func(t *testing.T) { + endTime := time.Now().UnixMilli() + startTime := endTime - (7 * 24 * 60 * 60 * 1000) // 7 days ago + + trades, err := suite.client.NewListTradesService(). + Symbol(testSymbol). + StartTime(startTime). + EndTime(endTime). + Limit(100). + DoSBE(context.Background()) + if err != nil { + t.Fatalf("Failed to list trades with time range (SBE): %v", err) + } + + fmt.Printf("My Trades (7 days, %s): Count=%d\n", testSymbol, len(trades)) + }) + + // The following tests require placing real orders - only run on testnet + // They are commented out by default to avoid accidental execution on mainnet + t.Run("CreateOrder_GetOrder_CancelOrder_SBE_Flow", func(t *testing.T) { + t.Skip("Skipping order creation tests - requires testnet and manual activation") + + /* + // Step 1: Create a limit order (SBE) + fmt.Println("\n=== Creating Limit Order (SBE) ===") + createOrder, err := suite.client.NewCreateOrderService(). + Symbol(testSymbol). + Side(SideTypeBuy). + Type(OrderTypeLimit). + TimeInForce(TimeInForceTypeGTC). + Quantity("0.001"). // Very small quantity for testing + Price("10000.00"). // Well below market to avoid fill + DoSBE(context.Background()) + if err != nil { + t.Fatalf("Failed to create order (SBE): %v", err) + } + + fmt.Printf("Order Created: ID=%d, Symbol=%s, Status=%s\n", + createOrder.OrderID, createOrder.Symbol, createOrder.Status) + + // Step 2: Query the order (SBE) + fmt.Println("\n=== Querying Order (SBE) ===") + queryOrder, err := suite.client.NewGetOrderService(). + Symbol(testSymbol). + OrderID(createOrder.OrderID). + DoSBE(context.Background()) + if err != nil { + t.Fatalf("Failed to query order (SBE): %v", err) + } + + // Validate query response + if queryOrder.OrderID != createOrder.OrderID { + t.Errorf("Expected order ID %d, got %d", createOrder.OrderID, queryOrder.OrderID) + } + if queryOrder.Symbol != testSymbol { + t.Errorf("Expected symbol %s, got %s", testSymbol, queryOrder.Symbol) + } + + fmt.Printf("Order Queried: ID=%d, Status=%s, Side=%s, Type=%s, Price=%s, Qty=%s\n", + queryOrder.OrderID, queryOrder.Status, queryOrder.Side, queryOrder.Type, + queryOrder.Price, queryOrder.OrigQuantity) + + // Step 3: Cancel the order (SBE) + fmt.Println("\n=== Canceling Order (SBE) ===") + cancelOrder, err := suite.client.NewCancelOrderService(). + Symbol(testSymbol). + OrderID(createOrder.OrderID). + DoSBE(context.Background()) + if err != nil { + t.Fatalf("Failed to cancel order (SBE): %v", err) + } + + // Validate cancel response + if cancelOrder.OrderID != createOrder.OrderID { + t.Errorf("Expected order ID %d, got %d", createOrder.OrderID, cancelOrder.OrderID) + } + + fmt.Printf("Order Canceled: ID=%d, Symbol=%s, Status=%s\n", + cancelOrder.OrderID, cancelOrder.Symbol, cancelOrder.Status) + + // Step 4: Verify order is canceled + fmt.Println("\n=== Verifying Cancellation (SBE) ===") + verifyOrder, err := suite.client.NewGetOrderService(). + Symbol(testSymbol). + OrderID(createOrder.OrderID). + DoSBE(context.Background()) + if err != nil { + t.Fatalf("Failed to verify order (SBE): %v", err) + } + + if verifyOrder.Status != string(OrderStatusTypeCanceled) { + t.Errorf("Expected order status CANCELED, got %s", verifyOrder.Status) + } + + fmt.Printf("Order Verified: ID=%d, Status=%s (successfully canceled)\n", + verifyOrder.OrderID, verifyOrder.Status) + */ + }) + + t.Run("CreateOrder_Types_SBE", func(t *testing.T) { + t.Skip("Skipping order creation tests - requires testnet and manual activation") + + /* + // Test different order response types (ACK, RESULT, FULL) + + // ACK response (template 300) + fmt.Println("\n=== Creating Order with ACK Response (SBE) ===") + ackOrder, err := suite.client.NewCreateOrderService(). + Symbol(testSymbol). + Side(SideTypeBuy). + Type(OrderTypeLimit). + TimeInForce(TimeInForceTypeGTC). + Quantity("0.001"). + Price("10000.00"). + NewOrderRespType(NewOrderRespTypeACK). + DoSBE(context.Background()) + if err != nil { + t.Fatalf("Failed to create order with ACK (SBE): %v", err) + } + fmt.Printf("ACK Order: ID=%d, Status=%s\n", ackOrder.OrderID, ackOrder.Status) + + // Cancel ACK order + _, err = suite.client.NewCancelOrderService(). + Symbol(testSymbol). + OrderID(ackOrder.OrderID). + DoSBE(context.Background()) + if err != nil { + t.Logf("Failed to cancel ACK order: %v", err) + } + + // RESULT response (template 301) + fmt.Println("\n=== Creating Order with RESULT Response (SBE) ===") + resultOrder, err := suite.client.NewCreateOrderService(). + Symbol(testSymbol). + Side(SideTypeBuy). + Type(OrderTypeLimit). + TimeInForce(TimeInForceTypeGTC). + Quantity("0.001"). + Price("10000.00"). + NewOrderRespType(NewOrderRespTypeRESULT). + DoSBE(context.Background()) + if err != nil { + t.Fatalf("Failed to create order with RESULT (SBE): %v", err) + } + fmt.Printf("RESULT Order: ID=%d, Status=%s, ExecutedQty=%s\n", + resultOrder.OrderID, resultOrder.Status, resultOrder.ExecutedQuantity) + + // Cancel RESULT order + _, err = suite.client.NewCancelOrderService(). + Symbol(testSymbol). + OrderID(resultOrder.OrderID). + DoSBE(context.Background()) + if err != nil { + t.Logf("Failed to cancel RESULT order: %v", err) + } + + // FULL response (template 302) - includes fills + fmt.Println("\n=== Creating Order with FULL Response (SBE) ===") + fullOrder, err := suite.client.NewCreateOrderService(). + Symbol(testSymbol). + Side(SideTypeBuy). + Type(OrderTypeLimit). + TimeInForce(TimeInForceTypeGTC). + Quantity("0.001"). + Price("10000.00"). + NewOrderRespType(NewOrderRespTypeFULL). + DoSBE(context.Background()) + if err != nil { + t.Fatalf("Failed to create order with FULL (SBE): %v", err) + } + fmt.Printf("FULL Order: ID=%d, Status=%s, ExecutedQty=%s, Fills=%d\n", + fullOrder.OrderID, fullOrder.Status, fullOrder.ExecutedQuantity, len(fullOrder.Fills)) + + // Cancel FULL order + _, err = suite.client.NewCancelOrderService(). + Symbol(testSymbol). + OrderID(fullOrder.OrderID). + DoSBE(context.Background()) + if err != nil { + t.Logf("Failed to cancel FULL order: %v", err) + } + */ + }) + + t.Run("CancelOpenOrders_SBE", func(t *testing.T) { + t.Skip("Skipping cancel open orders test - requires testnet and manual activation") + + /* + // First, create a few orders + fmt.Println("\n=== Creating Multiple Orders ===") + for i := 0; i < 3; i++ { + _, err := suite.client.NewCreateOrderService(). + Symbol(testSymbol). + Side(SideTypeBuy). + Type(OrderTypeLimit). + TimeInForce(TimeInForceTypeGTC). + Quantity("0.001"). + Price(fmt.Sprintf("1000%d.00", i)). // Different prices + DoSBE(context.Background()) + if err != nil { + t.Logf("Failed to create order %d: %v", i+1, err) + } else { + fmt.Printf("Created order %d\n", i+1) + } + } + + // Cancel all open orders + fmt.Println("\n=== Canceling All Open Orders (SBE) ===") + canceledOrders, err := suite.client.NewCancelOpenOrdersService(). + Symbol(testSymbol). + DoSBE(context.Background()) + if err != nil { + t.Fatalf("Failed to cancel open orders (SBE): %v", err) + } + + fmt.Printf("Canceled %d open orders\n", len(canceledOrders)) + for i, order := range canceledOrders { + fmt.Printf(" Order %d: ID=%d, Status=%s\n", i+1, order.OrderID, order.Status) + } + */ + }) + + // Performance comparison + t.Run("Performance_Comparison_TradingAccount", func(t *testing.T) { + iterations := 5 + + fmt.Printf("\n=== Trading/Account Performance Comparison (%d iterations) ===\n", iterations) + + // Test GetAccount + var accountJSONTotal, accountSBETotal time.Duration + for i := 0; i < iterations; i++ { + start := time.Now() + _, err := suite.client.NewGetAccountService().Do(context.Background()) + if err == nil { + accountJSONTotal += time.Since(start) + } + + start = time.Now() + _, err = suite.client.NewGetAccountService().DoSBE(context.Background()) + if err == nil { + accountSBETotal += time.Since(start) + } + } + + // Test ListOrders + var ordersJSONTotal, ordersSBETotal time.Duration + for i := 0; i < iterations; i++ { + start := time.Now() + _, err := suite.client.NewListOrdersService().Symbol(testSymbol).Limit(10).Do(context.Background()) + if err == nil { + ordersJSONTotal += time.Since(start) + } + + start = time.Now() + _, err = suite.client.NewListOrdersService().Symbol(testSymbol).Limit(10).DoSBE(context.Background()) + if err == nil { + ordersSBETotal += time.Since(start) + } + } + + // Test ListTrades + var tradesJSONTotal, tradesSBETotal time.Duration + for i := 0; i < iterations; i++ { + start := time.Now() + _, err := suite.client.NewListTradesService().Symbol(testSymbol).Limit(10).Do(context.Background()) + if err == nil { + tradesJSONTotal += time.Since(start) + } + + start = time.Now() + _, err = suite.client.NewListTradesService().Symbol(testSymbol).Limit(10).DoSBE(context.Background()) + if err == nil { + tradesSBETotal += time.Since(start) + } + } + + // Calculate averages and print results + fmt.Printf("\nGetAccount Service:\n") + fmt.Printf(" JSON Avg: %v\n", accountJSONTotal/time.Duration(iterations)) + fmt.Printf(" SBE Avg: %v\n", accountSBETotal/time.Duration(iterations)) + if accountSBETotal > 0 { + fmt.Printf(" Speedup: %.2fx\n", float64(accountJSONTotal)/float64(accountSBETotal)) + } + + fmt.Printf("\nListOrders Service:\n") + fmt.Printf(" JSON Avg: %v\n", ordersJSONTotal/time.Duration(iterations)) + fmt.Printf(" SBE Avg: %v\n", ordersSBETotal/time.Duration(iterations)) + if ordersSBETotal > 0 { + fmt.Printf(" Speedup: %.2fx\n", float64(ordersJSONTotal)/float64(ordersSBETotal)) + } + + fmt.Printf("\nListTrades Service:\n") + fmt.Printf(" JSON Avg: %v\n", tradesJSONTotal/time.Duration(iterations)) + fmt.Printf(" SBE Avg: %v\n", tradesSBETotal/time.Duration(iterations)) + if tradesSBETotal > 0 { + fmt.Printf(" Speedup: %.2fx\n", float64(tradesJSONTotal)/float64(tradesSBETotal)) + } + + fmt.Printf("\n======================================================\n\n") + }) +} From b341b64907bc9ffcdd8de121bf530e65fc76718b Mon Sep 17 00:00:00 2001 From: Pablo Criado-Perez Date: Sun, 14 Dec 2025 00:10:28 +0100 Subject: [PATCH 3/3] Update v2/sbe/README.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- v2/sbe/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/v2/sbe/README.md b/v2/sbe/README.md index 20d14c1e..8cf2570d 100644 --- a/v2/sbe/README.md +++ b/v2/sbe/README.md @@ -8,7 +8,7 @@ cd simple-binary-encoding ``` Run following command to generate golang code: ```bash -java --add-opens java.base/jdk.internal.misc=ALL-UNNAMED -Dsbe.generate.ir=true -Dsbe.target.language=Cpp -Dsbe.target.namespace=sbe -Dsbe.output.dir=include/gen -Dsbe.errorLog=yes -jar sbe-all/build/libs/sbe-all-${SBE_TOOL_VERSION}.jar {SBE_SCHEMA}.xml +java --add-opens java.base/jdk.internal.misc=ALL-UNNAMED -Dsbe.generate.ir=true -Dsbe.target.language=Go -Dsbe.target.namespace=sbe -Dsbe.output.dir=include/gen -Dsbe.errorLog=yes -jar sbe-all/build/libs/sbe-all-${SBE_TOOL_VERSION}.jar {SBE_SCHEMA}.xml ```