├── proto ├── OpenOrdersEnd.proto ├── CompletedOrdersEnd.proto ├── OpenOrdersRequest.proto ├── AllOpenOrdersRequest.proto ├── PositionEnd.proto ├── CancelPositions.proto ├── CancelPnL.proto ├── ContractDataEnd.proto ├── IdsRequest.proto ├── PositionsRequest.proto ├── proto.md ├── CancelNewsBulletins.proto ├── CurrentTimeRequest.proto ├── FARequest.proto ├── FamilyCodesRequest.proto ├── NewsProvidersRequest.proto ├── CurrentTime.proto ├── ManagedAccountsRequest.proto ├── NextValidId.proto ├── AutoOpenOrdersRequest.proto ├── CancelMarketData.proto ├── CancelPnLSingle.proto ├── CancelTickByTick.proto ├── CompletedOrdersRequest.proto ├── PositionMultiEnd.proto ├── ScannerParameters.proto ├── ScannerParametersRequest.proto ├── TickSnapshotEnd.proto ├── UserInfoRequest.proto ├── VerifyMessageApi.proto ├── AccountDataEnd.proto ├── AccountSummaryEnd.proto ├── CancelContractData.proto ├── CancelHeadTimestamp.proto ├── CancelHistogramData.proto ├── CancelRealTimeBars.proto ├── CancelWshEventData.proto ├── CancelWshMetaData.proto ├── CurrentTimeInMillisRequest.proto ├── ExecutionDetailsEnd.proto ├── ManagedAccounts.proto ├── MarketDepthExchangesRequest.proto ├── AccountUpdateMultiEnd.proto ├── AccountUpdateTime.proto ├── CancelAccountSummary.proto ├── CancelHistoricalData.proto ├── CancelHistoricalTicks.proto ├── CancelPositionsMulti.proto ├── MarketRuleRequest.proto ├── NewsBulletinsRequest.proto ├── SecDefOptParameterEnd.proto ├── VerifyMessageRequest.proto ├── WshMetaDataRequest.proto ├── CancelFundamentalsData.proto ├── SoftDollarTiersRequest.proto ├── CancelAccountUpdatesMulti.proto ├── CancelCalculateOptionPrice.proto ├── CancelScannerSubscription.proto ├── CurrentTimeInMillis.proto ├── MarketDataTypeRequest.proto ├── QueryDisplayGroupsRequest.proto ├── SetServerLogLevelRequest.proto ├── ReceiveFA.proto ├── ReplaceFAEnd.proto ├── UserInfo.proto ├── CancelCalculateImpliedVolatility.proto ├── FamilyCode.proto ├── FamilyCodes.proto ├── FundamentalsData.proto ├── HeadTimestamp.proto ├── UnsubscribeFromGroupEventsRequest.proto ├── VerifyRequest.proto ├── WshMetaData.proto ├── AccountDataRequest.proto ├── DisplayGroupList.proto ├── HistogramDataEntry.proto ├── HistoricalNewsEnd.proto ├── MarketDataType.proto ├── PriceIncrement.proto ├── TickAttribLast.proto ├── VerifyCompleted.proto ├── WshEventData.proto ├── CancelMarketDepth.proto ├── IneligibilityReason.proto ├── NewsProvider.proto ├── NewsProviders.proto ├── TickAttribBidAsk.proto ├── DisplayGroupUpdated.proto ├── GlobalCancelRequest.proto ├── MatchingSymbolsRequest.proto ├── SmartComponentsRequest.proto ├── StartApiRequest.proto ├── FAReplace.proto ├── OrderBound.proto ├── PnLRequest.proto ├── TickSize.proto ├── UpdateDisplayGroupRequest.proto ├── HistoricalTick.proto ├── SubscribeToGroupEventsRequest.proto ├── TickGeneric.proto ├── TickString.proto ├── SoftDollarTier.proto ├── AccountSummaryRequest.proto ├── ContractDataRequest.proto ├── NewsArticle.proto ├── DeltaNeutralContract.proto ├── CancelOrderRequest.proto ├── HistoricalDataEnd.proto ├── SmartComponent.proto ├── HistoricalSession.proto ├── MarketDepth.proto ├── MarketDepthL2.proto ├── MarketRule.proto ├── PositionsMultiRequest.proto ├── RerouteMarketDataRequest.proto ├── RerouteMarketDepthRequest.proto ├── SmartComponents.proto ├── SoftDollarTiers.proto ├── ContractDescription.proto ├── OrderCancel.proto ├── ScannerData.proto ├── ExecutionRequest.proto ├── HistogramData.proto ├── HistoricalData.proto ├── PnL.proto ├── MarketDepthExchanges.proto ├── SymbolSamples.proto ├── AccountValue.proto ├── PnLSingleRequest.proto ├── AttachedOrders.proto ├── HistoricalDataUpdate.proto ├── NewsBulletin.proto ├── TickReqParams.proto ├── HistoricalTicks.proto ├── AccountSummary.proto ├── ScannerSubscriptionRequest.proto ├── TickPrice.proto ├── AccountUpdatesMultiRequest.proto ├── NewsArticleRequest.proto ├── Position.proto ├── HistoricalTicksLast.proto ├── ExecutionDetails.proto ├── ContractData.proto ├── ErrorMessage.proto ├── HistogramDataRequest.proto ├── HistoricalNews.proto ├── HistoricalTicksBidAsk.proto ├── CompletedOrder.proto ├── FundamentalsDataRequest.proto ├── PnLSingle.proto ├── AccountUpdateMulti.proto ├── DepthMarketDataDescription.proto ├── SecDefOptParamsRequest.proto ├── TickNews.proto ├── HeadTimestampRequest.proto ├── OpenOrder.proto ├── TickByTickRequest.proto ├── MarketDepthRequest.proto ├── PositionMulti.proto ├── HistoricalSchedule.proto ├── MarketDepthData.proto ├── CommissionAndFeesReport.proto ├── PlaceOrderRequest.proto ├── CalculateOptionPriceRequest.proto ├── SecDefOptParameter.proto ├── HistoricalDataBar.proto ├── CalculateImpliedVolatilityRequest.proto ├── HistoricalTickLast.proto ├── OrderAllocation.proto ├── RealTimeBarsRequest.proto ├── HistoricalTickBidAsk.proto ├── MarketDataRequest.proto ├── HistoricalNewsRequest.proto ├── RealTimeBarTick.proto ├── ScannerDataElement.proto ├── ExecutionFilter.proto ├── ComboLeg.proto ├── PortfolioValue.proto ├── WshEventDataRequest.proto ├── TickByTickData.proto ├── HistoricalTicksRequest.proto ├── OrderStatus.proto ├── TickOptionComputation.proto ├── ExerciseOptionsRequest.proto ├── HistoricalDataRequest.proto ├── OrderCondition.proto ├── Execution.proto ├── Contract.proto ├── ScannerSubscription.proto ├── OrderState.proto └── ContractDetails.proto ├── ineligibility_reason.go ├── news_provider.go ├── family_code.go ├── go.mod ├── price_increment.go ├── tick_attrib_last.go ├── histogram_data.go ├── tick_attrib_bid_ask.go ├── tick_attrib.go ├── tag_value.go ├── historical_session.go ├── soft_dollar_tier.go ├── order_cancel.go ├── historical_tick.go ├── .gitignore ├── depth_mkt_data_description.go ├── wsh_event_data.go ├── commission_and_fees_report.go ├── time_condition.go ├── historical_tick_bid_ask.go ├── volume_condition.go ├── contract_condition.go ├── margin_condition.go ├── logger.go ├── execution_condition.go ├── percent_change_condition.go ├── historical_tick_last.go ├── operator_condition.go ├── LICENSE ├── bar.go ├── decimal.go ├── examples └── blocking │ └── blocking.go ├── scanner_subscription_samples.go ├── price_condition.go ├── reader.go ├── execution.go ├── scanner.go ├── account_summary_tags.go ├── contract_test.go ├── go.sum ├── protobuf ├── PositionEnd.pb.go ├── OpenOrdersEnd.pb.go ├── CancelPositions.pb.go ├── PositionsRequest.pb.go ├── OpenOrdersRequest.pb.go ├── CompletedOrdersEnd.pb.go ├── CurrentTimeRequest.pb.go ├── FamilyCodesRequest.pb.go ├── CancelNewsBulletins.pb.go ├── CancelPnL.pb.go ├── AllOpenOrdersRequest.pb.go ├── NewsProvidersRequest.pb.go ├── FARequest.pb.go ├── IdsRequest.pb.go ├── ManagedAccountsRequest.pb.go ├── NextValidId.pb.go ├── CurrentTime.pb.go ├── ScannerParametersRequest.pb.go └── FamilyCodes.pb.go ├── README.md └── order_condition.go /proto/OpenOrdersEnd.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message OpenOrdersEnd { 8 | // empty 9 | } -------------------------------------------------------------------------------- /proto/CompletedOrdersEnd.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message CompletedOrdersEnd { 8 | // empty 9 | } -------------------------------------------------------------------------------- /proto/OpenOrdersRequest.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message OpenOrdersRequest { 8 | // empty 9 | } -------------------------------------------------------------------------------- /proto/AllOpenOrdersRequest.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message AllOpenOrdersRequest { 8 | // empty 9 | } -------------------------------------------------------------------------------- /proto/PositionEnd.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message PositionEnd { 8 | // empty 9 | } 10 | -------------------------------------------------------------------------------- /proto/CancelPositions.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message CancelPositions { 8 | // empty 9 | } 10 | -------------------------------------------------------------------------------- /proto/CancelPnL.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message CancelPnL { 8 | optional int32 reqId = 1; 9 | } 10 | -------------------------------------------------------------------------------- /proto/ContractDataEnd.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message ContractDataEnd { 8 | optional int32 reqId = 1; 9 | } -------------------------------------------------------------------------------- /proto/IdsRequest.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message IdsRequest { 8 | optional int32 numIds = 1; 9 | } 10 | -------------------------------------------------------------------------------- /proto/PositionsRequest.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message PositionsRequest { 8 | // empty 9 | } 10 | -------------------------------------------------------------------------------- /proto/proto.md: -------------------------------------------------------------------------------- 1 | To generate protobuf files run from "ibapi" directory: 2 | 3 | ``` 4 | protoc --proto_path=proto --go_out=protobuf proto/*.proto --experimental_allow_proto3_optional 5 | ``` 6 | -------------------------------------------------------------------------------- /proto/CancelNewsBulletins.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message CancelNewsBulletins { 8 | // empty 9 | } 10 | -------------------------------------------------------------------------------- /proto/CurrentTimeRequest.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message CurrentTimeRequest { 8 | // empty 9 | } 10 | -------------------------------------------------------------------------------- /proto/FARequest.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message FARequest { 8 | optional int32 faDataType = 1; 9 | } 10 | -------------------------------------------------------------------------------- /proto/FamilyCodesRequest.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message FamilyCodesRequest { 8 | // empty 9 | } 10 | -------------------------------------------------------------------------------- /proto/NewsProvidersRequest.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message NewsProvidersRequest { 8 | // empty 9 | } 10 | -------------------------------------------------------------------------------- /proto/CurrentTime.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message CurrentTime { 8 | optional int64 currentTime = 1; 9 | } 10 | -------------------------------------------------------------------------------- /proto/ManagedAccountsRequest.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message ManagedAccountsRequest { 8 | // empty 9 | } 10 | -------------------------------------------------------------------------------- /proto/NextValidId.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message NextValidId { 8 | optional int32 orderId = 1; 9 | } 10 | -------------------------------------------------------------------------------- /proto/AutoOpenOrdersRequest.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message AutoOpenOrdersRequest { 8 | optional bool autoBind = 1; 9 | } -------------------------------------------------------------------------------- /proto/CancelMarketData.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message CancelMarketData { 8 | optional int32 reqId = 1; 9 | } 10 | -------------------------------------------------------------------------------- /proto/CancelPnLSingle.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message CancelPnLSingle { 8 | optional int32 reqId = 1; 9 | } 10 | -------------------------------------------------------------------------------- /proto/CancelTickByTick.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message CancelTickByTick { 8 | optional int32 reqId = 1; 9 | } 10 | -------------------------------------------------------------------------------- /proto/CompletedOrdersRequest.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message CompletedOrdersRequest { 8 | optional bool apiOnly = 1; 9 | } -------------------------------------------------------------------------------- /proto/PositionMultiEnd.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message PositionMultiEnd { 8 | optional int32 reqId = 1; 9 | } 10 | -------------------------------------------------------------------------------- /proto/ScannerParameters.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message ScannerParameters { 8 | optional string xml = 1; 9 | } 10 | -------------------------------------------------------------------------------- /proto/ScannerParametersRequest.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message ScannerParametersRequest { 8 | // empty 9 | } 10 | -------------------------------------------------------------------------------- /proto/TickSnapshotEnd.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message TickSnapshotEnd { 8 | optional int32 reqId = 1; 9 | } 10 | -------------------------------------------------------------------------------- /proto/UserInfoRequest.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message UserInfoRequest { 8 | optional int32 reqId = 1; 9 | } 10 | -------------------------------------------------------------------------------- /proto/VerifyMessageApi.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message VerifyMessageApi { 8 | optional string apiData = 1; 9 | } 10 | -------------------------------------------------------------------------------- /ineligibility_reason.go: -------------------------------------------------------------------------------- 1 | package ibapi 2 | 3 | // IneligibilityReason is a simple struct for ineligibility reason 4 | type IneligibilityReason struct { 5 | ID string 6 | Description string 7 | } 8 | -------------------------------------------------------------------------------- /proto/AccountDataEnd.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message AccountDataEnd { 8 | optional string accountName = 1; 9 | } 10 | -------------------------------------------------------------------------------- /proto/AccountSummaryEnd.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message AccountSummaryEnd { 8 | optional int32 reqId = 1; 9 | } 10 | -------------------------------------------------------------------------------- /proto/CancelContractData.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message CancelContractData { 8 | optional int32 reqId = 1; 9 | } 10 | -------------------------------------------------------------------------------- /proto/CancelHeadTimestamp.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message CancelHeadTimestamp { 8 | optional int32 reqId = 1; 9 | } 10 | -------------------------------------------------------------------------------- /proto/CancelHistogramData.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message CancelHistogramData { 8 | optional int32 reqId = 1; 9 | } 10 | -------------------------------------------------------------------------------- /proto/CancelRealTimeBars.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message CancelRealTimeBars { 8 | optional int32 reqId = 1; 9 | } 10 | -------------------------------------------------------------------------------- /proto/CancelWshEventData.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message CancelWshEventData { 8 | optional int32 reqId = 1; 9 | } 10 | -------------------------------------------------------------------------------- /proto/CancelWshMetaData.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message CancelWshMetaData { 8 | optional int32 reqId = 1; 9 | } 10 | -------------------------------------------------------------------------------- /proto/CurrentTimeInMillisRequest.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message CurrentTimeInMillisRequest { 8 | // empty 9 | } 10 | -------------------------------------------------------------------------------- /proto/ExecutionDetailsEnd.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message ExecutionDetailsEnd { 8 | optional int32 reqId = 1; 9 | } 10 | -------------------------------------------------------------------------------- /proto/ManagedAccounts.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message ManagedAccounts { 8 | optional string accountsList = 1; 9 | } 10 | -------------------------------------------------------------------------------- /proto/MarketDepthExchangesRequest.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message MarketDepthExchangesRequest { 8 | // empty 9 | } 10 | -------------------------------------------------------------------------------- /proto/AccountUpdateMultiEnd.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message AccountUpdateMultiEnd { 8 | optional int32 reqId = 1; 9 | } 10 | -------------------------------------------------------------------------------- /proto/AccountUpdateTime.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message AccountUpdateTime { 8 | optional string timeStamp = 1; 9 | } 10 | -------------------------------------------------------------------------------- /proto/CancelAccountSummary.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message CancelAccountSummary { 8 | optional int32 reqId = 1; 9 | } 10 | -------------------------------------------------------------------------------- /proto/CancelHistoricalData.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message CancelHistoricalData { 8 | optional int32 reqId = 1; 9 | } 10 | -------------------------------------------------------------------------------- /proto/CancelHistoricalTicks.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message CancelHistoricalTicks { 8 | optional int32 reqId = 1; 9 | } 10 | -------------------------------------------------------------------------------- /proto/CancelPositionsMulti.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message CancelPositionsMulti { 8 | optional int32 reqId = 1; 9 | } 10 | -------------------------------------------------------------------------------- /proto/MarketRuleRequest.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message MarketRuleRequest { 8 | optional int32 marketRuleId = 1; 9 | } 10 | -------------------------------------------------------------------------------- /proto/NewsBulletinsRequest.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message NewsBulletinsRequest { 8 | optional bool allMessages = 1; 9 | } 10 | -------------------------------------------------------------------------------- /proto/SecDefOptParameterEnd.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message SecDefOptParameterEnd { 8 | optional int32 reqId = 1; 9 | } 10 | -------------------------------------------------------------------------------- /proto/VerifyMessageRequest.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message VerifyMessageRequest { 8 | optional string apiData = 1; 9 | } 10 | -------------------------------------------------------------------------------- /proto/WshMetaDataRequest.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | 8 | message WshMetaDataRequest { 9 | optional int32 reqId = 1; 10 | } 11 | -------------------------------------------------------------------------------- /proto/CancelFundamentalsData.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message CancelFundamentalsData { 8 | optional int32 reqId = 1; 9 | } 10 | -------------------------------------------------------------------------------- /proto/SoftDollarTiersRequest.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message SoftDollarTiersRequest { 8 | optional int32 reqId = 1; 9 | } 10 | -------------------------------------------------------------------------------- /proto/CancelAccountUpdatesMulti.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message CancelAccountUpdatesMulti { 8 | optional int32 reqId = 1; 9 | } 10 | -------------------------------------------------------------------------------- /proto/CancelCalculateOptionPrice.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message CancelCalculateOptionPrice { 8 | optional int32 reqId = 1; 9 | } 10 | -------------------------------------------------------------------------------- /proto/CancelScannerSubscription.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message CancelScannerSubscription { 8 | optional int32 reqId = 1; 9 | } 10 | -------------------------------------------------------------------------------- /proto/CurrentTimeInMillis.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message CurrentTimeInMillis { 8 | optional int64 currentTimeInMillis = 1; 9 | } 10 | -------------------------------------------------------------------------------- /proto/MarketDataTypeRequest.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message MarketDataTypeRequest { 8 | optional int32 marketDataType = 1; 9 | } 10 | -------------------------------------------------------------------------------- /proto/QueryDisplayGroupsRequest.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message QueryDisplayGroupsRequest { 8 | optional int32 reqId = 1; 9 | } 10 | -------------------------------------------------------------------------------- /proto/SetServerLogLevelRequest.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message SetServerLogLevelRequest { 8 | optional int32 logLevel = 1; 9 | } 10 | -------------------------------------------------------------------------------- /proto/ReceiveFA.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message ReceiveFA { 8 | optional int32 faDataType = 1; 9 | optional string xml = 2; 10 | } 11 | -------------------------------------------------------------------------------- /proto/ReplaceFAEnd.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message ReplaceFAEnd { 8 | optional int32 reqId = 1; 9 | optional string text = 2; 10 | } 11 | -------------------------------------------------------------------------------- /proto/UserInfo.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message UserInfo { 8 | optional int32 reqId = 1; 9 | optional string whiteBrandingId = 2; 10 | } 11 | -------------------------------------------------------------------------------- /proto/CancelCalculateImpliedVolatility.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message CancelCalculateImpliedVolatility { 8 | optional int32 reqId = 1; 9 | } 10 | -------------------------------------------------------------------------------- /proto/FamilyCode.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message FamilyCode { 8 | optional string accountId = 1; 9 | optional string familyCode = 2; 10 | } 11 | -------------------------------------------------------------------------------- /proto/FamilyCodes.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | import "FamilyCode.proto"; 6 | 7 | option go_package = ".;protobuf"; 8 | 9 | message FamilyCodes { 10 | repeated FamilyCode familyCodes = 1; 11 | } 12 | -------------------------------------------------------------------------------- /proto/FundamentalsData.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message FundamentalsData { 8 | optional int32 reqId = 1; 9 | optional string data = 2; 10 | } 11 | -------------------------------------------------------------------------------- /proto/HeadTimestamp.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message HeadTimestamp { 8 | optional int32 reqId = 1; 9 | optional string headTimestamp = 2; 10 | } 11 | -------------------------------------------------------------------------------- /proto/UnsubscribeFromGroupEventsRequest.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message UnsubscribeFromGroupEventsRequest { 8 | optional int32 reqId = 1; 9 | } 10 | -------------------------------------------------------------------------------- /proto/VerifyRequest.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message VerifyRequest { 8 | optional string apiName = 1; 9 | optional string apiVersion = 2; 10 | } 11 | -------------------------------------------------------------------------------- /proto/WshMetaData.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | 8 | message WshMetaData { 9 | optional int32 reqId = 1; 10 | optional string dataJson = 2; 11 | } 12 | -------------------------------------------------------------------------------- /proto/AccountDataRequest.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message AccountDataRequest { 8 | optional bool subscribe = 1; 9 | optional string acctCode = 2; 10 | } 11 | -------------------------------------------------------------------------------- /proto/DisplayGroupList.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message DisplayGroupList { 8 | optional int32 reqId = 1; 9 | optional string groups = 2; 10 | } 11 | -------------------------------------------------------------------------------- /proto/HistogramDataEntry.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message HistogramDataEntry { 8 | optional double price = 1; 9 | optional string size = 2; 10 | } 11 | -------------------------------------------------------------------------------- /proto/HistoricalNewsEnd.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message HistoricalNewsEnd { 8 | optional int32 reqId = 1; 9 | optional bool hasMore = 2; 10 | } 11 | -------------------------------------------------------------------------------- /proto/MarketDataType.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message MarketDataType { 8 | optional int32 reqId = 1; 9 | optional int32 marketDataType = 2; 10 | } 11 | -------------------------------------------------------------------------------- /proto/PriceIncrement.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message PriceIncrement { 8 | optional double lowEdge = 1; 9 | optional double increment = 2; 10 | } 11 | -------------------------------------------------------------------------------- /proto/TickAttribLast.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message TickAttribLast { 8 | optional bool pastLimit = 1; 9 | optional bool unreported = 2; 10 | } 11 | -------------------------------------------------------------------------------- /proto/VerifyCompleted.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message VerifyCompleted { 8 | optional bool isSuccessful = 1; 9 | optional string errorText = 2; 10 | } 11 | -------------------------------------------------------------------------------- /proto/WshEventData.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | 8 | message WshEventData { 9 | optional int32 reqId = 1; 10 | optional string dataJson = 2; 11 | } 12 | -------------------------------------------------------------------------------- /proto/CancelMarketDepth.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message CancelMarketDepth { 8 | optional int32 reqId = 1; 9 | optional bool isSmartDepth = 2; 10 | } 11 | -------------------------------------------------------------------------------- /proto/IneligibilityReason.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message IneligibilityReason { 8 | optional string id = 1; 9 | optional string description = 2; 10 | } 11 | -------------------------------------------------------------------------------- /proto/NewsProvider.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message NewsProvider { 8 | optional string providerCode = 1; 9 | optional string providerName = 2; 10 | } 11 | -------------------------------------------------------------------------------- /proto/NewsProviders.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | import "NewsProvider.proto"; 6 | 7 | option go_package = ".;protobuf"; 8 | 9 | message NewsProviders { 10 | repeated NewsProvider newsProviders = 1; 11 | } 12 | -------------------------------------------------------------------------------- /proto/TickAttribBidAsk.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message TickAttribBidAsk { 8 | optional bool bidPastLow = 1; 9 | optional bool askPastHigh = 2; 10 | } 11 | -------------------------------------------------------------------------------- /proto/DisplayGroupUpdated.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message DisplayGroupUpdated { 8 | optional int32 reqId = 1; 9 | optional string contractInfo = 2; 10 | } 11 | -------------------------------------------------------------------------------- /proto/GlobalCancelRequest.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | import "OrderCancel.proto"; 6 | 7 | option go_package = ".;protobuf"; 8 | 9 | message GlobalCancelRequest { 10 | optional OrderCancel orderCancel = 1; 11 | } -------------------------------------------------------------------------------- /proto/MatchingSymbolsRequest.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message MatchingSymbolsRequest { 8 | optional int32 reqId = 1; 9 | optional string pattern = 2; 10 | } 11 | -------------------------------------------------------------------------------- /proto/SmartComponentsRequest.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message SmartComponentsRequest { 8 | optional int32 reqId = 1; 9 | optional string bboExchange = 2; 10 | } 11 | -------------------------------------------------------------------------------- /proto/StartApiRequest.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message StartApiRequest { 8 | optional int32 clientId = 1; 9 | optional string optionalCapabilities = 2; 10 | } 11 | -------------------------------------------------------------------------------- /proto/FAReplace.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message FAReplace { 8 | optional int32 reqId = 1; 9 | optional int32 faDataType = 2; 10 | optional string xml = 3; 11 | } 12 | -------------------------------------------------------------------------------- /proto/OrderBound.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message OrderBound { 8 | optional int64 permId = 1; 9 | optional int32 clientId = 2; 10 | optional int32 orderId = 3; 11 | } -------------------------------------------------------------------------------- /proto/PnLRequest.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message PnLRequest { 8 | optional int32 reqId = 1; 9 | optional string account = 2; 10 | optional string modelCode = 3; 11 | } 12 | -------------------------------------------------------------------------------- /proto/TickSize.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message TickSize { 8 | optional int32 reqId = 1; 9 | optional int32 tickType = 2; 10 | optional string size = 3; 11 | } 12 | -------------------------------------------------------------------------------- /proto/UpdateDisplayGroupRequest.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message UpdateDisplayGroupRequest { 8 | optional int32 reqId = 1; 9 | optional string contractInfo = 2; 10 | } 11 | -------------------------------------------------------------------------------- /proto/HistoricalTick.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message HistoricalTick { 8 | optional int64 time = 1; 9 | optional double price = 2; 10 | optional string size = 3; 11 | } 12 | -------------------------------------------------------------------------------- /proto/SubscribeToGroupEventsRequest.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message SubscribeToGroupEventsRequest { 8 | optional int32 reqId = 1; 9 | optional int32 groupId = 2; 10 | } 11 | -------------------------------------------------------------------------------- /proto/TickGeneric.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message TickGeneric { 8 | optional int32 reqId = 1; 9 | optional int32 tickType = 2; 10 | optional double value = 3; 11 | } 12 | -------------------------------------------------------------------------------- /proto/TickString.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message TickString { 8 | optional int32 reqId = 1; 9 | optional int32 tickType = 2; 10 | optional string value = 3; 11 | } 12 | -------------------------------------------------------------------------------- /proto/SoftDollarTier.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message SoftDollarTier { 8 | optional string name = 1; 9 | optional string value = 2; 10 | optional string displayName = 3; 11 | } -------------------------------------------------------------------------------- /proto/AccountSummaryRequest.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message AccountSummaryRequest { 8 | optional int32 reqId = 1; 9 | optional string group = 2; 10 | optional string tags = 3; 11 | } 12 | -------------------------------------------------------------------------------- /proto/ContractDataRequest.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | import "Contract.proto"; 6 | 7 | option go_package = ".;protobuf"; 8 | 9 | message ContractDataRequest { 10 | optional int32 reqId = 1; 11 | optional Contract contract = 2; 12 | } -------------------------------------------------------------------------------- /proto/NewsArticle.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message NewsArticle { 8 | optional int32 reqId = 1; 9 | optional int32 articleType = 2; 10 | optional string articleText = 3; 11 | } 12 | -------------------------------------------------------------------------------- /proto/DeltaNeutralContract.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message DeltaNeutralContract { 8 | optional int32 conId = 1; 9 | optional double delta = 2; 10 | optional double price = 3; 11 | } 12 | -------------------------------------------------------------------------------- /proto/CancelOrderRequest.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | import "OrderCancel.proto"; 6 | 7 | option go_package = ".;protobuf"; 8 | 9 | message CancelOrderRequest { 10 | optional int32 orderId = 1; 11 | optional OrderCancel orderCancel = 2; 12 | } -------------------------------------------------------------------------------- /proto/HistoricalDataEnd.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message HistoricalDataEnd { 8 | optional int32 reqId = 1; 9 | optional string startDateStr = 2; 10 | optional string endDateStr = 3; 11 | } 12 | -------------------------------------------------------------------------------- /proto/SmartComponent.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message SmartComponent { 8 | optional int32 bitNumber = 1; 9 | optional string exchange = 2; 10 | optional string exchangeLetter = 3; 11 | } 12 | -------------------------------------------------------------------------------- /proto/HistoricalSession.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message HistoricalSession { 8 | optional string startDateTime = 1; 9 | optional string endDateTime = 2; 10 | optional string refDate = 3; 11 | } 12 | -------------------------------------------------------------------------------- /proto/MarketDepth.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | import "MarketDepthData.proto"; 6 | 7 | option go_package = ".;protobuf"; 8 | 9 | message MarketDepth { 10 | optional int32 reqId = 1; 11 | optional MarketDepthData marketDepthData = 2; 12 | } 13 | -------------------------------------------------------------------------------- /proto/MarketDepthL2.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | import "MarketDepthData.proto"; 6 | 7 | option go_package = ".;protobuf"; 8 | 9 | message MarketDepthL2 { 10 | optional int32 reqId = 1; 11 | optional MarketDepthData marketDepthData = 2; 12 | } 13 | -------------------------------------------------------------------------------- /proto/MarketRule.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | import "PriceIncrement.proto"; 6 | 7 | option go_package = ".;protobuf"; 8 | 9 | message MarketRule { 10 | optional int32 marketRuleId = 1; 11 | repeated PriceIncrement priceIncrements = 2; 12 | } 13 | -------------------------------------------------------------------------------- /proto/PositionsMultiRequest.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message PositionsMultiRequest { 8 | optional int32 reqId = 1; 9 | optional string account = 2; 10 | optional string modelCode = 3; 11 | } 12 | -------------------------------------------------------------------------------- /proto/RerouteMarketDataRequest.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message RerouteMarketDataRequest { 8 | optional int32 reqId = 1; 9 | optional int32 conId = 2; 10 | optional string exchange = 3; 11 | } 12 | -------------------------------------------------------------------------------- /proto/RerouteMarketDepthRequest.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message RerouteMarketDepthRequest { 8 | optional int32 reqId = 1; 9 | optional int32 conId = 2; 10 | optional string exchange = 3; 11 | } 12 | -------------------------------------------------------------------------------- /proto/SmartComponents.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | import "SmartComponent.proto"; 6 | 7 | option go_package = ".;protobuf"; 8 | 9 | message SmartComponents { 10 | optional int32 reqId = 1; 11 | repeated SmartComponent smartComponents = 2; 12 | } 13 | -------------------------------------------------------------------------------- /proto/SoftDollarTiers.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | import "SoftDollarTier.proto"; 6 | 7 | option go_package = ".;protobuf"; 8 | 9 | message SoftDollarTiers { 10 | optional int32 reqId = 1; 11 | repeated SoftDollarTier softDollarTiers = 2; 12 | } 13 | -------------------------------------------------------------------------------- /proto/ContractDescription.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | import "Contract.proto"; 6 | 7 | option go_package = ".;protobuf"; 8 | 9 | message ContractDescription { 10 | optional Contract contract = 1; 11 | repeated string derivativeSecTypes = 2; 12 | } 13 | -------------------------------------------------------------------------------- /proto/OrderCancel.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message OrderCancel { 8 | optional string manualOrderCancelTime = 1; 9 | optional string extOperator = 2; 10 | optional int32 manualOrderIndicator = 3; 11 | } -------------------------------------------------------------------------------- /proto/ScannerData.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | import "ScannerDataElement.proto"; 6 | 7 | option go_package = ".;protobuf"; 8 | 9 | message ScannerData { 10 | optional int32 reqId = 1; 11 | repeated ScannerDataElement scannerDataElement = 2; 12 | } 13 | -------------------------------------------------------------------------------- /proto/ExecutionRequest.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | import "ExecutionFilter.proto"; 6 | 7 | option go_package = ".;protobuf"; 8 | 9 | message ExecutionRequest { 10 | optional int32 reqId = 1; 11 | optional ExecutionFilter executionFilter = 2; 12 | } 13 | -------------------------------------------------------------------------------- /proto/HistogramData.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | import "HistogramDataEntry.proto"; 6 | 7 | option go_package = ".;protobuf"; 8 | 9 | message HistogramData { 10 | optional int32 reqId = 1; 11 | repeated HistogramDataEntry histogramDataEntries = 2; 12 | } 13 | -------------------------------------------------------------------------------- /proto/HistoricalData.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | import "HistoricalDataBar.proto"; 6 | 7 | option go_package = ".;protobuf"; 8 | 9 | message HistoricalData { 10 | optional int32 reqId = 1; 11 | repeated HistoricalDataBar historicalDataBars = 2; 12 | } 13 | -------------------------------------------------------------------------------- /proto/PnL.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message PnL { 8 | optional int32 reqId = 1; 9 | optional double dailyPnL = 2; 10 | optional double unrealizedPnL = 3; 11 | optional double realizedPnL = 4; 12 | } 13 | -------------------------------------------------------------------------------- /proto/MarketDepthExchanges.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | import "DepthMarketDataDescription.proto"; 6 | 7 | option go_package = ".;protobuf"; 8 | 9 | message MarketDepthExchanges { 10 | repeated DepthMarketDataDescription depthMarketDataDescriptions = 1; 11 | } 12 | -------------------------------------------------------------------------------- /proto/SymbolSamples.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | import "ContractDescription.proto"; 6 | 7 | option go_package = ".;protobuf"; 8 | 9 | message SymbolSamples { 10 | optional int32 reqId = 1; 11 | repeated ContractDescription contractDescriptions = 2; 12 | } 13 | -------------------------------------------------------------------------------- /proto/AccountValue.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message AccountValue { 8 | optional string key = 1; 9 | optional string value = 2; 10 | optional string currency = 3; 11 | optional string accountName = 4; 12 | } 13 | -------------------------------------------------------------------------------- /proto/PnLSingleRequest.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message PnLSingleRequest { 8 | optional int32 reqId = 1; 9 | optional string account = 2; 10 | optional string modelCode = 3; 11 | optional int32 conId = 4; 12 | } 13 | -------------------------------------------------------------------------------- /proto/AttachedOrders.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message AttachedOrders { 8 | optional int32 slOrderId = 1; 9 | optional string slOrderType = 2; 10 | optional int32 ptOrderId = 3; 11 | optional string ptOrderType = 4; 12 | } -------------------------------------------------------------------------------- /proto/HistoricalDataUpdate.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | import "HistoricalDataBar.proto"; 6 | 7 | option go_package = ".;protobuf"; 8 | 9 | message HistoricalDataUpdate { 10 | optional int32 reqId = 1; 11 | optional HistoricalDataBar historicalDataBar = 2; 12 | } 13 | 14 | -------------------------------------------------------------------------------- /proto/NewsBulletin.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message NewsBulletin { 8 | optional int32 newsMsgId = 1; 9 | optional int32 newsMsgType = 2; 10 | optional string newsMessage = 3; 11 | optional string originatingExch = 4; 12 | } 13 | -------------------------------------------------------------------------------- /proto/TickReqParams.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message TickReqParams { 8 | optional int32 reqId = 1; 9 | optional string minTick = 2; 10 | optional string bboExchange = 3; 11 | optional int32 snapshotPermissions = 4; 12 | } 13 | -------------------------------------------------------------------------------- /proto/HistoricalTicks.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | import "HistoricalTick.proto"; 6 | 7 | option go_package = ".;protobuf"; 8 | 9 | message HistoricalTicks { 10 | optional int32 reqId = 1; 11 | repeated HistoricalTick historicalTicks = 2; 12 | optional bool isDone = 3; 13 | } 14 | -------------------------------------------------------------------------------- /proto/AccountSummary.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message AccountSummary { 8 | optional int32 reqId = 1; 9 | optional string account = 2; 10 | optional string tag = 3; 11 | optional string value = 4; 12 | optional string currency = 5; 13 | } 14 | -------------------------------------------------------------------------------- /proto/ScannerSubscriptionRequest.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | import "ScannerSubscription.proto"; 6 | 7 | option go_package = ".;protobuf"; 8 | 9 | message ScannerSubscriptionRequest { 10 | optional int32 reqId = 1; 11 | optional ScannerSubscription scannerSubscription = 2; 12 | } 13 | -------------------------------------------------------------------------------- /proto/TickPrice.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message TickPrice { 8 | optional int32 reqId = 1; 9 | optional int32 tickType = 2; 10 | optional double price = 3; 11 | optional string size = 4; 12 | optional int32 attrMask = 5; 13 | } 14 | -------------------------------------------------------------------------------- /proto/AccountUpdatesMultiRequest.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message AccountUpdatesMultiRequest { 8 | optional int32 reqId = 1; 9 | optional string account = 2; 10 | optional string modelCode = 3; 11 | optional bool ledgerAndNLV = 4; 12 | } 13 | -------------------------------------------------------------------------------- /proto/NewsArticleRequest.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message NewsArticleRequest { 8 | optional int32 reqId = 1; 9 | optional string providerCode = 2; 10 | optional string articleId = 3; 11 | map newsArticleOptions = 4; 12 | } 13 | -------------------------------------------------------------------------------- /proto/Position.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | import "Contract.proto"; 6 | 7 | option go_package = ".;protobuf"; 8 | 9 | message Position { 10 | optional string account = 1; 11 | optional Contract contract = 2; 12 | optional string position = 3; 13 | optional double avgCost = 4; 14 | } 15 | -------------------------------------------------------------------------------- /proto/HistoricalTicksLast.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | import "HistoricalTickLast.proto"; 6 | 7 | option go_package = ".;protobuf"; 8 | 9 | message HistoricalTicksLast { 10 | optional int32 reqId = 1; 11 | repeated HistoricalTickLast historicalTicksLast = 2; 12 | optional bool isDone = 3; 13 | } 14 | -------------------------------------------------------------------------------- /proto/ExecutionDetails.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | import "Contract.proto"; 6 | import "Execution.proto"; 7 | 8 | option go_package = ".;protobuf"; 9 | 10 | message ExecutionDetails { 11 | optional int32 reqId = 1; 12 | optional Contract contract = 2; 13 | optional Execution execution = 3; 14 | } 15 | -------------------------------------------------------------------------------- /proto/ContractData.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | import "Contract.proto"; 6 | import "ContractDetails.proto"; 7 | 8 | option go_package = ".;protobuf"; 9 | 10 | message ContractData { 11 | optional int32 reqId = 1; 12 | optional Contract contract = 2; 13 | optional ContractDetails contractDetails = 3; 14 | } -------------------------------------------------------------------------------- /proto/ErrorMessage.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message ErrorMessage { 8 | optional int32 id = 1; 9 | optional int64 errorTime = 2; 10 | optional int32 errorCode = 3; 11 | optional string errorMsg = 4; 12 | optional string advancedOrderRejectJson = 5; 13 | } -------------------------------------------------------------------------------- /proto/HistogramDataRequest.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | import "Contract.proto"; 6 | 7 | option go_package = ".;protobuf"; 8 | 9 | message HistogramDataRequest { 10 | optional int32 reqId = 1; 11 | optional Contract contract = 2; 12 | optional bool useRTH = 3; 13 | optional string timePeriod = 4; 14 | } 15 | -------------------------------------------------------------------------------- /proto/HistoricalNews.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message HistoricalNews { 8 | optional int32 reqId = 1; 9 | optional string time = 2; 10 | optional string providerCode = 3; 11 | optional string articleId = 4; 12 | optional string headline = 5; 13 | } 14 | -------------------------------------------------------------------------------- /proto/HistoricalTicksBidAsk.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | import "HistoricalTickBidAsk.proto"; 6 | 7 | option go_package = ".;protobuf"; 8 | 9 | message HistoricalTicksBidAsk { 10 | optional int32 reqId = 1; 11 | repeated HistoricalTickBidAsk historicalTicksBidAsk = 2; 12 | optional bool isDone = 3; 13 | } 14 | -------------------------------------------------------------------------------- /news_provider.go: -------------------------------------------------------------------------------- 1 | package ibapi 2 | 3 | import "fmt" 4 | 5 | // NewsProvider . 6 | type NewsProvider struct { 7 | Code string 8 | Name string 9 | } 10 | 11 | func NewNewsProvider() NewsProvider { 12 | return NewsProvider{} 13 | } 14 | 15 | func (np NewsProvider) String() string { 16 | return fmt.Sprintf("Code: %s, Name: %s", np.Code, np.Name) 17 | } 18 | -------------------------------------------------------------------------------- /proto/CompletedOrder.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | import "Contract.proto"; 6 | import "Order.proto"; 7 | import "OrderState.proto"; 8 | 9 | option go_package = ".;protobuf"; 10 | 11 | message CompletedOrder { 12 | optional Contract contract = 1; 13 | optional Order order = 2; 14 | optional OrderState orderState = 3; 15 | } -------------------------------------------------------------------------------- /proto/FundamentalsDataRequest.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | import "Contract.proto"; 6 | 7 | option go_package = ".;protobuf"; 8 | 9 | message FundamentalsDataRequest { 10 | optional int32 reqId = 1; 11 | optional Contract contract = 2; 12 | optional string reportType = 3; 13 | map fundamentalsDataOptions = 4; 14 | } 15 | -------------------------------------------------------------------------------- /proto/PnLSingle.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message PnLSingle { 8 | optional int32 reqId = 1; 9 | optional string position = 2; 10 | optional double dailyPnL = 3; 11 | optional double unrealizedPnL = 4; 12 | optional double realizedPnL = 5; 13 | optional double value = 6; 14 | } 15 | -------------------------------------------------------------------------------- /proto/AccountUpdateMulti.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message AccountUpdateMulti { 8 | optional int32 reqId = 1; 9 | optional string account = 2; 10 | optional string modelCode = 3; 11 | optional string key = 4; 12 | optional string value = 5; 13 | optional string currency = 6; 14 | } 15 | -------------------------------------------------------------------------------- /proto/DepthMarketDataDescription.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message DepthMarketDataDescription { 8 | optional string exchange = 1; 9 | optional string secType = 2; 10 | optional string listingExch = 3; 11 | optional string serviceDataType = 4; 12 | optional int32 aggGroup = 5; 13 | } 14 | -------------------------------------------------------------------------------- /proto/SecDefOptParamsRequest.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message SecDefOptParamsRequest { 8 | optional int32 reqId = 1; 9 | optional string underlyingSymbol = 2; 10 | optional string futFopExchange = 3; 11 | optional string underlyingSecType = 4; 12 | optional int32 underlyingConId = 5; 13 | } 14 | -------------------------------------------------------------------------------- /proto/TickNews.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | 8 | message TickNews { 9 | optional int32 reqId = 1; 10 | optional int64 timestamp = 2; 11 | optional string providerCode = 3; 12 | optional string articleId = 4; 13 | optional string headline = 5; 14 | optional string extraData = 6; 15 | } 16 | -------------------------------------------------------------------------------- /family_code.go: -------------------------------------------------------------------------------- 1 | package ibapi 2 | 3 | import "fmt" 4 | 5 | // FamilyCode . 6 | type FamilyCode struct { 7 | AccountID string 8 | FamilyCodeStr string 9 | } 10 | 11 | func NewFamilyCode() FamilyCode { 12 | return FamilyCode{} 13 | } 14 | 15 | func (f FamilyCode) String() string { 16 | return fmt.Sprintf("AccountId: %s, FamilyCodeStr: %s", f.AccountID, f.FamilyCodeStr) 17 | } 18 | -------------------------------------------------------------------------------- /proto/HeadTimestampRequest.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | import "Contract.proto"; 6 | 7 | option go_package = ".;protobuf"; 8 | 9 | message HeadTimestampRequest { 10 | optional int32 reqId = 1; 11 | optional Contract contract = 2; 12 | optional bool useRTH = 3; 13 | optional string whatToShow = 4; 14 | optional int32 formatDate = 5; 15 | } 16 | -------------------------------------------------------------------------------- /proto/OpenOrder.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | import "Contract.proto"; 6 | import "Order.proto"; 7 | import "OrderState.proto"; 8 | 9 | option go_package = ".;protobuf"; 10 | 11 | message OpenOrder { 12 | optional int32 orderId = 1; 13 | optional Contract contract = 2; 14 | optional Order order = 3; 15 | optional OrderState orderState = 4; 16 | } -------------------------------------------------------------------------------- /go.mod: -------------------------------------------------------------------------------- 1 | module github.com/scmhub/ibapi 2 | 3 | go 1.25 4 | 5 | require ( 6 | github.com/robaho/fixed v0.0.0-20251201003256-beee5759f86a 7 | github.com/rs/zerolog v1.34.0 8 | google.golang.org/protobuf v1.36.10 9 | ) 10 | 11 | require ( 12 | github.com/mattn/go-colorable v0.1.14 // indirect 13 | github.com/mattn/go-isatty v0.0.20 // indirect 14 | golang.org/x/sys v0.38.0 // indirect 15 | ) 16 | -------------------------------------------------------------------------------- /price_increment.go: -------------------------------------------------------------------------------- 1 | package ibapi 2 | 3 | import "fmt" 4 | 5 | // PriceIncrement . 6 | type PriceIncrement struct { 7 | LowEdge float64 8 | Increment float64 9 | } 10 | 11 | func NewPriceIncrement() PriceIncrement { 12 | return PriceIncrement{} 13 | } 14 | 15 | func (p PriceIncrement) String() string { 16 | return fmt.Sprintf("LowEdge: %f, Increment: %f", p.LowEdge, p.Increment) 17 | } 18 | -------------------------------------------------------------------------------- /proto/TickByTickRequest.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | import "Contract.proto"; 6 | 7 | 8 | 9 | option go_package = ".;protobuf"; 10 | 11 | message TickByTickRequest { 12 | optional int32 reqId = 1; 13 | optional Contract contract = 2; 14 | optional string tickType = 3; 15 | optional int32 numberOfTicks = 4; 16 | optional bool ignoreSize = 5; 17 | } 18 | -------------------------------------------------------------------------------- /tick_attrib_last.go: -------------------------------------------------------------------------------- 1 | package ibapi 2 | 3 | import "fmt" 4 | 5 | // TickAttribLast . 6 | type TickAttribLast struct { 7 | PastLimit bool 8 | Unreported bool 9 | } 10 | 11 | func NewTickAttribLast() TickAttribLast { 12 | return TickAttribLast{} 13 | } 14 | 15 | func (t TickAttribLast) String() string { 16 | return fmt.Sprintf("PastLimit: %t, Unreported: %t", t.PastLimit, t.Unreported) 17 | } 18 | -------------------------------------------------------------------------------- /proto/MarketDepthRequest.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | import "Contract.proto"; 6 | 7 | option go_package = ".;protobuf"; 8 | 9 | message MarketDepthRequest { 10 | optional int32 reqId = 1; 11 | optional Contract contract = 2; 12 | optional int32 numRows = 3; 13 | optional bool isSmartDepth = 4; 14 | map marketDepthOptions = 5; 15 | } 16 | -------------------------------------------------------------------------------- /histogram_data.go: -------------------------------------------------------------------------------- 1 | package ibapi 2 | 3 | import "fmt" 4 | 5 | // HistogramData . 6 | type HistogramData struct { 7 | Price float64 8 | Size Decimal 9 | } 10 | 11 | func NewHistogramData() HistogramData { 12 | hd := HistogramData{} 13 | hd.Size = UNSET_DECIMAL 14 | return hd 15 | } 16 | 17 | func (hd HistogramData) String() string { 18 | return fmt.Sprintf("Price: %v, Size: %v", hd.Price, hd.Size) 19 | } 20 | -------------------------------------------------------------------------------- /proto/PositionMulti.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | import "Contract.proto"; 6 | 7 | option go_package = ".;protobuf"; 8 | 9 | message PositionMulti { 10 | optional int32 reqId = 1; 11 | optional string account = 2; 12 | optional Contract contract = 3; 13 | optional string position = 4; 14 | optional double avgCost = 5; 15 | optional string modelCode = 6; 16 | } 17 | -------------------------------------------------------------------------------- /proto/HistoricalSchedule.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | import "HistoricalSession.proto"; 6 | 7 | option go_package = ".;protobuf"; 8 | 9 | message HistoricalSchedule { 10 | optional int32 reqId = 1; 11 | optional string startDateTime = 2; 12 | optional string endDateTime = 3; 13 | optional string timeZone = 4; 14 | repeated HistoricalSession historicalSessions = 5; 15 | } 16 | -------------------------------------------------------------------------------- /proto/MarketDepthData.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message MarketDepthData { 8 | optional int32 position = 1; 9 | optional int32 operation = 2; 10 | optional int32 side = 3; 11 | optional double price = 4; 12 | optional string size = 5; 13 | optional string marketMaker = 6; 14 | optional bool isSmartDepth = 7; 15 | } 16 | -------------------------------------------------------------------------------- /tick_attrib_bid_ask.go: -------------------------------------------------------------------------------- 1 | package ibapi 2 | 3 | import "fmt" 4 | 5 | // TickAttribBidAsk . 6 | type TickAttribBidAsk struct { 7 | BidPastLow bool 8 | AskPastHigh bool 9 | } 10 | 11 | func NewTickAttribBidAsk() TickAttribBidAsk { 12 | return TickAttribBidAsk{} 13 | } 14 | 15 | func (t TickAttribBidAsk) String() string { 16 | return fmt.Sprintf("BidPastLow: %t, AskPastHigh: %t", t.BidPastLow, t.AskPastHigh) 17 | } 18 | -------------------------------------------------------------------------------- /proto/CommissionAndFeesReport.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message CommissionAndFeesReport { 8 | optional string execId = 1; 9 | optional double commissionAndFees = 2; 10 | optional string currency = 3; 11 | optional double realizedPNL = 4; 12 | optional double bondYield = 5; 13 | optional string yieldRedemptionDate = 6; 14 | } 15 | -------------------------------------------------------------------------------- /proto/PlaceOrderRequest.proto: -------------------------------------------------------------------------------- 1 | 2 | syntax = "proto3"; 3 | 4 | package protobuf; 5 | 6 | import "Contract.proto"; 7 | import "Order.proto"; 8 | import "AttachedOrders.proto"; 9 | 10 | option go_package = ".;protobuf"; 11 | 12 | message PlaceOrderRequest { 13 | optional int32 orderId = 1; 14 | optional Contract contract = 2; 15 | optional Order order = 3; 16 | optional AttachedOrders attachedOrders = 4; 17 | } -------------------------------------------------------------------------------- /proto/CalculateOptionPriceRequest.proto: -------------------------------------------------------------------------------- 1 | 2 | syntax = "proto3"; 3 | 4 | package protobuf; 5 | 6 | import "Contract.proto"; 7 | 8 | option go_package = ".;protobuf"; 9 | 10 | message CalculateOptionPriceRequest { 11 | optional int32 reqId = 1; 12 | optional Contract contract = 2; 13 | optional double volatility = 3; 14 | optional double underPrice = 4; 15 | map optionPriceOptions = 5; 16 | } 17 | -------------------------------------------------------------------------------- /proto/SecDefOptParameter.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message SecDefOptParameter { 8 | optional int32 reqId = 1; 9 | optional string exchange = 2; 10 | optional int32 underlyingConId = 3; 11 | optional string tradingClass = 4; 12 | optional string multiplier = 5; 13 | repeated string expirations = 6; 14 | repeated double strikes = 7; 15 | } 16 | -------------------------------------------------------------------------------- /proto/HistoricalDataBar.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message HistoricalDataBar { 8 | optional string date = 1; 9 | optional double open = 2; 10 | optional double high = 3; 11 | optional double low = 4; 12 | optional double close = 5; 13 | optional string volume = 6; 14 | optional string WAP = 7; 15 | optional int32 barCount = 8; 16 | } 17 | -------------------------------------------------------------------------------- /tick_attrib.go: -------------------------------------------------------------------------------- 1 | package ibapi 2 | 3 | import "fmt" 4 | 5 | // TickAttrib . 6 | type TickAttrib struct { 7 | CanAutoExecute bool 8 | PastLimit bool 9 | PreOpen bool 10 | } 11 | 12 | func NewTickAttrib() TickAttrib { 13 | return TickAttrib{} 14 | } 15 | 16 | func (t TickAttrib) String() string { 17 | return fmt.Sprintf("CanAutoExecute: %t, PastLimit: %t, PreOpen: %t", t.CanAutoExecute, t.PastLimit, t.PreOpen) 18 | } 19 | -------------------------------------------------------------------------------- /proto/CalculateImpliedVolatilityRequest.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | import "Contract.proto"; 6 | 7 | option go_package = ".;protobuf"; 8 | 9 | message CalculateImpliedVolatilityRequest { 10 | optional int32 reqId = 1; 11 | optional Contract contract = 2; 12 | optional double optionPrice = 3; 13 | optional double underPrice = 4; 14 | map impliedVolatilityOptions = 5; 15 | } 16 | -------------------------------------------------------------------------------- /tag_value.go: -------------------------------------------------------------------------------- 1 | package ibapi 2 | 3 | import "fmt" 4 | 5 | // TagValue maps a tag to a value. Both of them are strings. 6 | // They are used in a slice to convey extra info with the requests. 7 | type TagValue struct { 8 | Tag string 9 | Value string 10 | } 11 | 12 | func NewTagValue() TagValue { 13 | return TagValue{} 14 | } 15 | 16 | func (tv TagValue) String() string { 17 | return fmt.Sprintf("%s=%s;", tv.Tag, tv.Value) 18 | } 19 | -------------------------------------------------------------------------------- /proto/HistoricalTickLast.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | import "TickAttribLast.proto"; 6 | 7 | option go_package = ".;protobuf"; 8 | 9 | message HistoricalTickLast { 10 | optional int64 time = 1; 11 | optional TickAttribLast tickAttribLast = 2; 12 | optional double price = 3; 13 | optional string size = 4; 14 | optional string exchange = 5; 15 | optional string specialConditions = 6; 16 | } 17 | -------------------------------------------------------------------------------- /proto/OrderAllocation.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message OrderAllocation { 8 | optional string account = 1; 9 | optional string position = 2; 10 | optional string positionDesired = 3; 11 | optional string positionAfter = 4; 12 | optional string desiredAllocQty = 5; 13 | optional string allowedAllocQty = 6; 14 | optional bool isMonetary = 7; 15 | } -------------------------------------------------------------------------------- /proto/RealTimeBarsRequest.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | import "Contract.proto"; 6 | 7 | 8 | 9 | option go_package = ".;protobuf"; 10 | 11 | message RealTimeBarsRequest { 12 | optional int32 reqId = 1; 13 | optional Contract contract = 2; 14 | optional int32 barSize = 3; 15 | optional string whatToShow = 4; 16 | optional bool useRTH = 5; 17 | map realTimeBarsOptions = 6; 18 | } 19 | -------------------------------------------------------------------------------- /proto/HistoricalTickBidAsk.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | import "TickAttribBidAsk.proto"; 6 | 7 | option go_package = ".;protobuf"; 8 | 9 | message HistoricalTickBidAsk { 10 | optional int64 time = 1; 11 | optional TickAttribBidAsk tickAttribBidAsk = 2; 12 | optional double priceBid = 3; 13 | optional double priceAsk = 4; 14 | optional string sizeBid = 5; 15 | optional string sizeAsk = 6; 16 | } 17 | -------------------------------------------------------------------------------- /proto/MarketDataRequest.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | import "Contract.proto"; 6 | 7 | option go_package = ".;protobuf"; 8 | 9 | message MarketDataRequest { 10 | optional int32 reqId = 1; 11 | optional Contract contract = 2; 12 | optional string genericTickList = 3; 13 | optional bool snapshot = 4; 14 | optional bool regulatorySnapshot = 5; 15 | map marketDataOptions = 6; 16 | } 17 | -------------------------------------------------------------------------------- /proto/HistoricalNewsRequest.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message HistoricalNewsRequest { 8 | optional int32 reqId = 1; 9 | optional int32 conId = 2; 10 | optional string providerCodes = 3; 11 | optional string startDateTime = 4; 12 | optional string endDateTime = 5; 13 | optional int32 totalResults = 6; 14 | map historicalNewsOptions = 7; 15 | } 16 | -------------------------------------------------------------------------------- /proto/RealTimeBarTick.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message RealTimeBarTick { 8 | optional int32 reqId = 1; 9 | optional int64 time = 2; 10 | optional double open = 3; 11 | optional double high = 4; 12 | optional double low = 5; 13 | optional double close = 6; 14 | optional string volume = 7; 15 | optional string WAP = 8; 16 | optional int32 count = 9; 17 | } 18 | -------------------------------------------------------------------------------- /proto/ScannerDataElement.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | import "Contract.proto"; 6 | 7 | option go_package = ".;protobuf"; 8 | 9 | message ScannerDataElement { 10 | optional int32 rank = 1; 11 | optional Contract contract = 2; 12 | optional string marketName = 3; 13 | optional string distance = 4; 14 | optional string benchmark = 5; 15 | optional string projection = 6; 16 | optional string comboKey = 7; 17 | } 18 | -------------------------------------------------------------------------------- /historical_session.go: -------------------------------------------------------------------------------- 1 | package ibapi 2 | 3 | import "fmt" 4 | 5 | // HistoricalSession . 6 | type HistoricalSession struct { 7 | StartDateTime string 8 | EndDateTime string 9 | RefDate string 10 | } 11 | 12 | func NewHistoricalSession() HistoricalSession { 13 | return HistoricalSession{} 14 | } 15 | 16 | func (h HistoricalSession) String() string { 17 | return fmt.Sprintf("Start: %s, End: %s, Ref Date: %s", h.StartDateTime, h.EndDateTime, h.RefDate) 18 | } 19 | -------------------------------------------------------------------------------- /proto/ExecutionFilter.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message ExecutionFilter { 8 | optional int32 clientId = 1; 9 | optional string acctCode = 2; 10 | optional string time = 3; 11 | optional string symbol = 4; 12 | optional string secType = 5; 13 | optional string exchange = 6; 14 | optional string side = 7; 15 | optional int32 lastNDays = 8; 16 | repeated int32 specificDates = 9; 17 | } 18 | -------------------------------------------------------------------------------- /proto/ComboLeg.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message ComboLeg { 8 | optional int32 conId = 1; 9 | optional int32 ratio = 2; 10 | optional string action = 3; 11 | optional string exchange = 4; 12 | optional int32 openClose = 5; 13 | optional int32 shortSalesSlot = 6; 14 | optional string designatedLocation = 7; 15 | optional int32 exemptCode = 8; 16 | optional double perLegPrice = 9; 17 | } 18 | -------------------------------------------------------------------------------- /soft_dollar_tier.go: -------------------------------------------------------------------------------- 1 | package ibapi 2 | 3 | import "fmt" 4 | 5 | // SoftDollarTier stores the Soft Dollar Tier information. 6 | type SoftDollarTier struct { 7 | Name string 8 | Value string 9 | DisplayName string 10 | } 11 | 12 | func NewSoftDollarTier() SoftDollarTier { 13 | return SoftDollarTier{} 14 | } 15 | 16 | func (s SoftDollarTier) String() string { 17 | return fmt.Sprintf("Name: %s, Value: %s, DisplayName: %s", 18 | s.Name, 19 | s.Value, 20 | s.DisplayName) 21 | } 22 | -------------------------------------------------------------------------------- /proto/PortfolioValue.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | import "Contract.proto"; 6 | 7 | option go_package = ".;protobuf"; 8 | 9 | message PortfolioValue { 10 | optional Contract contract = 1; 11 | optional string position = 2; 12 | optional double marketPrice = 3; 13 | optional double marketValue = 4; 14 | optional double averageCost = 5; 15 | optional double unrealizedPNL = 6; 16 | optional double realizedPNL = 7; 17 | optional string accountName = 8; 18 | } 19 | -------------------------------------------------------------------------------- /proto/WshEventDataRequest.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | 8 | message WshEventDataRequest { 9 | optional int32 reqId = 1; 10 | optional int32 conId = 2; 11 | optional string filter = 3; 12 | optional bool fillWatchlist = 4; 13 | optional bool fillPortfolio = 5; 14 | optional bool fillCompetitors = 6; 15 | optional string startDate = 7; 16 | optional string endDate = 8; 17 | optional int32 totalLimit = 9; 18 | } 19 | -------------------------------------------------------------------------------- /order_cancel.go: -------------------------------------------------------------------------------- 1 | package ibapi 2 | 3 | import "fmt" 4 | 5 | // OrderCancel . 6 | type OrderCancel struct { 7 | ManualOrderCancelTime string 8 | ExtOperator string 9 | ManualOrderIndicator int64 10 | } 11 | 12 | func NewOrderCancel() OrderCancel { 13 | return OrderCancel{ 14 | ManualOrderIndicator: UNSET_INT, 15 | } 16 | } 17 | 18 | func (o OrderCancel) String() string { 19 | return fmt.Sprintf("ManualOrderCancelTime: %s, ManualOrderIndicator: %s", o.ManualOrderCancelTime, IntMaxString(o.ManualOrderIndicator)) 20 | } 21 | -------------------------------------------------------------------------------- /proto/TickByTickData.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | import "HistoricalTickLast.proto"; 6 | import "HistoricalTickBidAsk.proto"; 7 | import "HistoricalTick.proto"; 8 | 9 | 10 | 11 | option go_package = ".;protobuf"; 12 | 13 | message TickByTickData { 14 | optional int32 reqId = 1; 15 | optional int32 tickType = 2; 16 | oneof tick { 17 | HistoricalTickLast historicalTickLast = 3; 18 | HistoricalTickBidAsk historicalTickBidAsk = 4; 19 | HistoricalTick historicalTickMidPoint = 5; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /proto/HistoricalTicksRequest.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | import "Contract.proto"; 6 | 7 | option go_package = ".;protobuf"; 8 | 9 | message HistoricalTicksRequest { 10 | optional int32 reqId = 1; 11 | optional Contract contract = 2; 12 | optional string startDateTime = 3; 13 | optional string endDateTime = 4; 14 | optional int32 numberOfTicks = 5; 15 | optional string whatToShow = 6; 16 | optional bool useRTH = 7; 17 | optional bool ignoreSize = 8; 18 | map miscOptions = 9; 19 | } 20 | -------------------------------------------------------------------------------- /proto/OrderStatus.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message OrderStatus { 8 | optional int32 orderId = 1; 9 | optional string status = 2; 10 | optional string filled = 3; 11 | optional string remaining = 4; 12 | optional double avgFillPrice = 5; 13 | optional int64 permId = 6; 14 | optional int32 parentId = 7; 15 | optional double lastFillPrice = 8; 16 | optional int32 clientId = 9; 17 | optional string whyHeld = 10; 18 | optional double mktCapPrice = 11; 19 | } -------------------------------------------------------------------------------- /historical_tick.go: -------------------------------------------------------------------------------- 1 | package ibapi 2 | 3 | import "fmt" 4 | 5 | // HistoricalTick is the historical tick's description. 6 | // Used when requesting historical tick data with whatToShow = MIDPOINT. 7 | type HistoricalTick struct { 8 | Time int64 9 | Price float64 10 | Size Decimal 11 | } 12 | 13 | func NewHistoricalTick() HistoricalTick { 14 | ht := HistoricalTick{} 15 | ht.Size = UNSET_DECIMAL 16 | return ht 17 | } 18 | 19 | func (h HistoricalTick) String() string { 20 | return fmt.Sprintf("Time: %d, Price: %f, Size: %s", h.Time, h.Price, DecimalMaxString(h.Size)) 21 | } 22 | -------------------------------------------------------------------------------- /proto/TickOptionComputation.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message TickOptionComputation { 8 | optional int32 reqId = 1; 9 | optional int32 tickType = 2; 10 | optional int32 tickAttrib = 3; 11 | optional double impliedVol = 4; 12 | optional double delta = 5; 13 | optional double optPrice = 6; 14 | optional double pvDividend = 7; 15 | optional double gamma = 8; 16 | optional double vega = 9; 17 | optional double theta = 10; 18 | optional double undPrice = 11; 19 | } 20 | -------------------------------------------------------------------------------- /proto/ExerciseOptionsRequest.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | import "Contract.proto"; 6 | 7 | option go_package = ".;protobuf"; 8 | 9 | message ExerciseOptionsRequest { 10 | optional int32 orderId = 1; 11 | optional Contract contract = 2; 12 | optional int32 exerciseAction = 3; 13 | optional int32 exerciseQuantity = 4; 14 | optional string account = 5; 15 | optional bool override = 6; 16 | optional string manualOrderTime = 7; 17 | optional string customerAccount = 8; 18 | optional bool professionalCustomer = 9; 19 | } 20 | -------------------------------------------------------------------------------- /proto/HistoricalDataRequest.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | import "Contract.proto"; 6 | 7 | option go_package = ".;protobuf"; 8 | 9 | message HistoricalDataRequest { 10 | optional int32 reqId = 1; 11 | optional Contract contract = 2; 12 | optional string endDateTime = 3; 13 | optional string barSizeSetting = 4; 14 | optional string duration = 5; 15 | optional bool useRTH = 6; 16 | optional string whatToShow = 7; 17 | optional int32 formatDate = 8; 18 | optional bool keepUpToDate = 9; 19 | map chartOptions = 10; 20 | } 21 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # If you prefer the allow list template instead of the deny list, see community template: 2 | # https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore 3 | # 4 | # Binaries for programs and plugins 5 | *.exe 6 | *.exe~ 7 | *.dll 8 | *.so 9 | *.dylib 10 | 11 | # Test binary, built with `go test -c` 12 | *.test 13 | 14 | # Output of the go coverage tool, specifically when used with LiteIDE 15 | *.out 16 | 17 | # Dependency directories (remove the comment below to include it) 18 | # vendor/ 19 | 20 | # Go workspace file 21 | go.work 22 | go.work.sum 23 | 24 | # env file 25 | .env 26 | -------------------------------------------------------------------------------- /proto/OrderCondition.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message OrderCondition { 8 | optional int32 type = 1; 9 | optional bool isConjunctionConnection = 2; 10 | optional bool isMore = 3; 11 | optional int32 conId = 4; 12 | optional string exchange = 5; 13 | optional string symbol = 6; 14 | optional string secType = 7; 15 | optional int32 percent = 8; 16 | optional double changePercent = 9; 17 | optional double price = 10; 18 | optional int32 triggerMethod = 11; 19 | optional string time = 12; 20 | optional int32 volume = 13; 21 | } -------------------------------------------------------------------------------- /depth_mkt_data_description.go: -------------------------------------------------------------------------------- 1 | package ibapi 2 | 3 | import "fmt" 4 | 5 | // DepthMktDataDescription . 6 | type DepthMktDataDescription struct { 7 | Exchange string 8 | SecType string 9 | ListingExch string 10 | ServiceDataType string 11 | AggGroup int64 12 | } 13 | 14 | func NewDepthMktDataDescription() DepthMktDataDescription { 15 | dmdd := DepthMktDataDescription{} 16 | dmdd.AggGroup = UNSET_INT 17 | return dmdd 18 | } 19 | 20 | // DepthMktDataDescription . 21 | func (d DepthMktDataDescription) String() string { 22 | return fmt.Sprintf("Exchange: %s, SecType: %s, ListingExchange: %s, ServiceDataType: %s, AggGroup: %s", 23 | d.Exchange, d.SecType, d.ListingExch, d.ServiceDataType, IntMaxString(d.AggGroup)) 24 | } 25 | -------------------------------------------------------------------------------- /wsh_event_data.go: -------------------------------------------------------------------------------- 1 | package ibapi 2 | 3 | import "fmt" 4 | 5 | // WshEventData . 6 | type WshEventData struct { 7 | ConID int64 // UNSET_INT 8 | Filter string 9 | FillWatchList bool 10 | FillPortfolio bool 11 | FillCompetitors bool 12 | StartDate string 13 | EndDate string 14 | TotalLimit int64 // UNSET_INT 15 | } 16 | 17 | func NewWshEventData() WshEventData { 18 | wed := WshEventData{} 19 | wed.ConID = UNSET_INT 20 | wed.TotalLimit = UNSET_INT 21 | return wed 22 | } 23 | 24 | func (w WshEventData) String() string { 25 | return fmt.Sprintf("WshEventData. ConId: %s, Filter: %s, Fill Watchlist: %t, Fill Portfolio: %t, Fill Competitors: %t", 26 | IntMaxString(w.ConID), w.Filter, w.FillWatchList, w.FillPortfolio, w.FillCompetitors) 27 | } 28 | -------------------------------------------------------------------------------- /commission_and_fees_report.go: -------------------------------------------------------------------------------- 1 | package ibapi 2 | 3 | import "fmt" 4 | 5 | // CommissionAndFeesReport . 6 | type CommissionAndFeesReport struct { 7 | ExecID string 8 | CommissionAndFees float64 9 | Currency string 10 | RealizedPNL float64 11 | Yield float64 12 | YieldRedemptionDate int64 // YYYYMMDD format 13 | } 14 | 15 | func NewCommissionAndFeesReport() CommissionAndFeesReport { 16 | return CommissionAndFeesReport{} 17 | } 18 | 19 | func (cr CommissionAndFeesReport) String() string { 20 | return fmt.Sprintf("ExecId: %s, CommissionAndFees: %f, Currency: %s, RealizedPnL: %f, Yield: %f, YieldRedemptionDate: %d", 21 | cr.ExecID, 22 | cr.CommissionAndFees, 23 | cr.Currency, 24 | cr.RealizedPNL, 25 | cr.Yield, 26 | cr.YieldRedemptionDate) 27 | } 28 | -------------------------------------------------------------------------------- /time_condition.go: -------------------------------------------------------------------------------- 1 | package ibapi 2 | 3 | import "fmt" 4 | 5 | // var _ OrderCondition = (*TimeCondition)(nil) 6 | // var _ ContractCondition = (*TimeCondition)(nil) 7 | var _ OperatorCondition = (*TimeCondition)(nil) 8 | 9 | type TimeCondition struct { 10 | *operatorCondition 11 | Time string 12 | } 13 | 14 | func newTimeCondition() *TimeCondition { 15 | return &TimeCondition{operatorCondition: newOperatorCondition(TimeOrderCondition)} 16 | } 17 | 18 | func (tc *TimeCondition) decode(msgBuf *MsgBuffer) { 19 | tc.operatorCondition.decode(msgBuf) 20 | tc.Time = msgBuf.decodeString() 21 | } 22 | 23 | func (tc TimeCondition) makeFields() []any { 24 | return append(tc.operatorCondition.makeFields(), tc.Time) 25 | } 26 | 27 | func (tc TimeCondition) String() string { 28 | return fmt.Sprintf("time is %s", tc.operatorCondition.stringWithOperator(tc.Time)) 29 | } 30 | -------------------------------------------------------------------------------- /historical_tick_bid_ask.go: -------------------------------------------------------------------------------- 1 | package ibapi 2 | 3 | import "fmt" 4 | 5 | // HistoricalTickBidAsk is the historical tick's description. 6 | // Used when requesting historical tick data with whatToShow = BID_ASK. 7 | type HistoricalTickBidAsk struct { 8 | Time int64 9 | TickAttribBidAsk TickAttribBidAsk 10 | PriceBid float64 11 | PriceAsk float64 12 | SizeBid Decimal 13 | SizeAsk Decimal 14 | } 15 | 16 | func NewHistoricalTickBidAsk() HistoricalTickBidAsk { 17 | htba := HistoricalTickBidAsk{} 18 | htba.SizeBid = UNSET_DECIMAL 19 | htba.SizeAsk = UNSET_DECIMAL 20 | return htba 21 | } 22 | 23 | func (h HistoricalTickBidAsk) String() string { 24 | return fmt.Sprintf("Time: %d, TickAttriBidAsk: %s, PriceBid: %f, PriceAsk: %f, SizeBid: %s, SizeAsk: %s", 25 | h.Time, h.TickAttribBidAsk, h.PriceBid, h.PriceAsk, DecimalMaxString(h.SizeBid), DecimalMaxString(h.SizeAsk)) 26 | } 27 | -------------------------------------------------------------------------------- /volume_condition.go: -------------------------------------------------------------------------------- 1 | package ibapi 2 | 3 | import ( 4 | "fmt" 5 | "strconv" 6 | ) 7 | 8 | // var _ OrderCondition = (*VolumeCondition)(nil) 9 | var _ ContractCondition = (*VolumeCondition)(nil) 10 | 11 | type VolumeCondition struct { 12 | *contractCondition 13 | Volume int64 14 | } 15 | 16 | func newVolumeCondition() *VolumeCondition { 17 | return &VolumeCondition{contractCondition: newContractCondition(VolumeOrderCondition)} 18 | } 19 | 20 | func (vc *VolumeCondition) decode(msgBuf *MsgBuffer) { 21 | vc.contractCondition.decode(msgBuf) 22 | vc.Volume = msgBuf.decodeInt64() 23 | } 24 | 25 | func (vc VolumeCondition) makeFields() []any { 26 | return append(vc.contractCondition.makeFields(), vc.Volume) 27 | } 28 | 29 | func (vc VolumeCondition) String() string { 30 | volume := strconv.FormatInt(vc.Volume, 10) 31 | return fmt.Sprintf("%s %s", vc.contractCondition, vc.operatorCondition.stringWithOperator(volume)) 32 | } 33 | -------------------------------------------------------------------------------- /contract_condition.go: -------------------------------------------------------------------------------- 1 | package ibapi 2 | 3 | import "fmt" 4 | 5 | type ContractCondition interface { 6 | OperatorCondition 7 | } 8 | 9 | var _ OperatorCondition = (*contractCondition)(nil) 10 | 11 | type contractCondition struct { 12 | *operatorCondition 13 | ConID int64 14 | Exchange string 15 | } 16 | 17 | func newContractCondition(condType OrderConditionType) *contractCondition { 18 | return &contractCondition{operatorCondition: newOperatorCondition(condType)} 19 | } 20 | 21 | func (cc *contractCondition) decode(msgBuf *MsgBuffer) { 22 | cc.operatorCondition.decode(msgBuf) 23 | cc.ConID = msgBuf.decodeInt64() 24 | cc.Exchange = msgBuf.decodeString() 25 | } 26 | 27 | func (cc contractCondition) makeFields() []any { 28 | return append(cc.operatorCondition.makeFields(), cc.ConID, cc.Exchange) 29 | } 30 | 31 | func (cc contractCondition) String() string { 32 | return fmt.Sprintf("%v of %v", cc.TypeName(), cc.ConID) 33 | } 34 | -------------------------------------------------------------------------------- /margin_condition.go: -------------------------------------------------------------------------------- 1 | package ibapi 2 | 3 | import "fmt" 4 | 5 | // var _ OrderCondition = (*MarginCondition)(nil) 6 | // var _ ContractCondition = (*MarginCondition)(nil) 7 | var _ OperatorCondition = (*MarginCondition)(nil) 8 | 9 | type MarginCondition struct { 10 | *operatorCondition 11 | Percent int64 12 | } 13 | 14 | func newMarginCondition() *MarginCondition { 15 | return &MarginCondition{operatorCondition: newOperatorCondition(MarginOrderCondition)} 16 | } 17 | 18 | func (mc *MarginCondition) decode(msgBuf *MsgBuffer) { 19 | mc.operatorCondition.decode(msgBuf) 20 | mc.Percent = msgBuf.decodeInt64() 21 | } 22 | 23 | func (mc MarginCondition) makeFields() []any { 24 | return append(mc.operatorCondition.makeFields(), mc.Percent) 25 | } 26 | 27 | func (mc MarginCondition) String() string { 28 | percent := fmt.Sprintf("%d", mc.Percent) 29 | return fmt.Sprintf("the margin cushion persent %s", mc.operatorCondition.stringWithOperator(percent)) 30 | } 31 | -------------------------------------------------------------------------------- /logger.go: -------------------------------------------------------------------------------- 1 | package ibapi 2 | 3 | import ( 4 | "fmt" 5 | "os" 6 | 7 | "github.com/rs/zerolog" 8 | ) 9 | 10 | var log zerolog.Logger 11 | 12 | const DEFAULT_LEVEL = zerolog.InfoLevel 13 | 14 | func init() { 15 | zerolog.SetGlobalLevel(DEFAULT_LEVEL) 16 | log = zerolog.New(os.Stderr).With().Timestamp().Logger() 17 | } 18 | 19 | // Logger returns the logger. 20 | func Logger() *zerolog.Logger { 21 | return &log 22 | } 23 | 24 | // SetLogger sets the default logger instance. 25 | func SetLogger(l zerolog.Logger) { 26 | log = l 27 | } 28 | 29 | // SetLogLevel sets the loggging level. 30 | func SetLogLevel(logLevel int) { 31 | zerolog.SetGlobalLevel(zerolog.Level(int8(logLevel))) 32 | } 33 | 34 | // SetConsoleWriter will send pretty log to the console. 35 | func SetConsoleWriter() { 36 | output := zerolog.ConsoleWriter{Out: os.Stdout} 37 | output.FormatMessage = func(i any) string { 38 | return fmt.Sprintf("| IB | %s", i) 39 | } 40 | log = log.Output(output) 41 | } 42 | -------------------------------------------------------------------------------- /proto/Execution.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message Execution { 8 | optional int32 orderId = 1; 9 | optional string execId = 2; 10 | optional string time = 3; 11 | optional string acctNumber = 4; 12 | optional string exchange = 5; 13 | optional string side = 6; 14 | optional string shares = 7; 15 | optional double price = 8; 16 | optional int64 permId = 9; 17 | optional int32 clientId = 10; 18 | optional bool isLiquidation = 11; 19 | optional string cumQty = 12; 20 | optional double avgPrice = 13; 21 | optional string orderRef = 14; 22 | optional string evRule = 15; 23 | optional double evMultiplier = 16; 24 | optional string modelCode = 17; 25 | optional int32 lastLiquidity = 18; 26 | optional bool isPriceRevisionPending = 19; 27 | optional string submitter = 20; 28 | optional int32 optExerciseOrLapseType = 21; 29 | } 30 | -------------------------------------------------------------------------------- /execution_condition.go: -------------------------------------------------------------------------------- 1 | package ibapi 2 | 3 | import "fmt" 4 | 5 | var _ OrderCondition = (*ExecutionCondition)(nil) 6 | 7 | type ExecutionCondition struct { 8 | *orderCondition 9 | SecType string 10 | Exchange string 11 | Symbol string 12 | } 13 | 14 | func newExecutionCondition() *ExecutionCondition { 15 | return &ExecutionCondition{orderCondition: newOrderCondition(ExecutionOrderCondition)} 16 | } 17 | 18 | func (ec *ExecutionCondition) decode(msgBuf *MsgBuffer) { 19 | ec.orderCondition.decode(msgBuf) 20 | ec.SecType = msgBuf.decodeString() 21 | ec.Exchange = msgBuf.decodeString() 22 | ec.Symbol = msgBuf.decodeString() 23 | } 24 | 25 | func (ec ExecutionCondition) makeFields() []any { 26 | return append(ec.orderCondition.makeFields(), ec.SecType, ec.Exchange, ec.Symbol) 27 | } 28 | 29 | func (ec ExecutionCondition) String() string { 30 | return fmt.Sprintf("trade occurs for %v symbol on %v exchange for %v security type", ec.Symbol, ec.Exchange, ec.SecType) 31 | } 32 | -------------------------------------------------------------------------------- /percent_change_condition.go: -------------------------------------------------------------------------------- 1 | package ibapi 2 | 3 | import ( 4 | "fmt" 5 | ) 6 | 7 | // var _ OrderCondition = (*PercentChangeCondition)(nil) 8 | var _ ContractCondition = (*PercentChangeCondition)(nil) 9 | 10 | type PercentChangeCondition struct { 11 | *contractCondition 12 | ChangePercent float64 13 | } 14 | 15 | func newPercentChangeCondition() *PercentChangeCondition { 16 | return &PercentChangeCondition{contractCondition: newContractCondition(PercentChangeOrderCondition)} 17 | } 18 | 19 | func (pcc *PercentChangeCondition) decode(msgBuf *MsgBuffer) { 20 | pcc.ChangePercent = msgBuf.decodeFloat64() 21 | } 22 | 23 | func (pcc PercentChangeCondition) makeFields() []any { 24 | return append(pcc.contractCondition.makeFields(), pcc.ChangePercent) 25 | } 26 | 27 | func (pcc PercentChangeCondition) String() string { 28 | volume := fmt.Sprintf("%f", pcc.ChangePercent) 29 | return fmt.Sprintf("%s %s", pcc.contractCondition, pcc.operatorCondition.stringWithOperator(volume)) 30 | } 31 | -------------------------------------------------------------------------------- /historical_tick_last.go: -------------------------------------------------------------------------------- 1 | package ibapi 2 | 3 | import ( 4 | "fmt" 5 | "time" 6 | ) 7 | 8 | // HistoricalTickLast is the historical last tick's description. 9 | // Used when requesting historical tick data with whatToShow = TRADES. 10 | type HistoricalTickLast struct { 11 | Time int64 12 | TickAttribLast TickAttribLast 13 | Price float64 14 | Size Decimal 15 | Exchange string 16 | SpecialConditions string 17 | } 18 | 19 | func NewHistoricalTickLast() HistoricalTickLast { 20 | htl := HistoricalTickLast{} 21 | htl.Size = UNSET_DECIMAL 22 | return htl 23 | } 24 | 25 | func (h HistoricalTickLast) String() string { 26 | return fmt.Sprintf("Time: %d, TickAttribLast: %s, Price: %f, Size: %s, Exchange: %s, SpecialConditions: %s", 27 | h.Time, h.TickAttribLast, h.Price, DecimalMaxString(h.Size), h.Exchange, h.SpecialConditions) 28 | } 29 | 30 | func (h HistoricalTickLast) Timestamp() time.Time { 31 | return time.Unix(h.Time, 0) 32 | } 33 | -------------------------------------------------------------------------------- /operator_condition.go: -------------------------------------------------------------------------------- 1 | package ibapi 2 | 3 | import "fmt" 4 | 5 | // OperatorCondition embeds OrderCondition and requires valueConverter 6 | type OperatorCondition interface { 7 | OrderCondition 8 | } 9 | 10 | var _ OrderCondition = (*operatorCondition)(nil) 11 | 12 | type operatorCondition struct { 13 | *orderCondition 14 | IsMore bool 15 | } 16 | 17 | func newOperatorCondition(orderConditionType OrderConditionType) *operatorCondition { 18 | return &operatorCondition{orderCondition: newOrderCondition(orderConditionType)} 19 | } 20 | 21 | func (oc *operatorCondition) decode(msgBuf *MsgBuffer) { // 2 fields 22 | oc.orderCondition.decode(msgBuf) 23 | oc.IsMore = msgBuf.decodeBool() 24 | } 25 | 26 | func (oc operatorCondition) makeFields() []any { 27 | return append(oc.orderCondition.makeFields(), oc.IsMore) 28 | } 29 | 30 | func (oc operatorCondition) stringWithOperator(value string) string { 31 | if oc.IsMore { 32 | return fmt.Sprintf("is >= %s", value) 33 | } 34 | return fmt.Sprintf("is <= %s", value) 35 | } 36 | -------------------------------------------------------------------------------- /proto/Contract.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | import "ComboLeg.proto"; 6 | import "DeltaNeutralContract.proto"; 7 | 8 | option go_package = ".;protobuf"; 9 | 10 | message Contract { 11 | optional int32 conId = 1; 12 | optional string symbol = 2; 13 | optional string secType = 3; 14 | optional string lastTradeDateOrContractMonth = 4; 15 | optional double strike = 5; 16 | optional string right = 6; 17 | optional double multiplier = 7; 18 | optional string exchange = 8; 19 | optional string primaryExch = 9; 20 | optional string currency = 10; 21 | optional string localSymbol = 11; 22 | optional string tradingClass = 12; 23 | optional string secIdType = 13; 24 | optional string secId = 14; 25 | optional string description = 15; 26 | optional string issuerId = 16; 27 | optional DeltaNeutralContract deltaNeutralContract = 17; 28 | optional bool includeExpired = 18; 29 | optional string comboLegsDescrip = 19; 30 | repeated ComboLeg comboLegs = 20; 31 | optional string lastTradeDate = 21; 32 | } 33 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2025 SCM 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /proto/ScannerSubscription.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | option go_package = ".;protobuf"; 6 | 7 | message ScannerSubscription { 8 | optional int32 numberOfRows = 1; 9 | optional string instrument = 2; 10 | optional string locationCode = 3; 11 | optional string scanCode = 4; 12 | optional double abovePrice = 5; 13 | optional double belowPrice = 6; 14 | optional int64 aboveVolume = 7; 15 | optional double marketCapAbove = 8; 16 | optional double marketCapBelow = 9; 17 | optional string moodyRatingAbove = 10; 18 | optional string moodyRatingBelow = 11; 19 | optional string spRatingAbove = 12; 20 | optional string spRatingBelow = 13; 21 | optional string maturityDateAbove = 14; 22 | optional string maturityDateBelow = 15; 23 | optional double couponRateAbove = 16; 24 | optional double couponRateBelow = 17; 25 | optional bool excludeConvertible = 18; 26 | optional int64 averageOptionVolumeAbove = 19; 27 | optional string scannerSettingPairs = 20; 28 | optional string stockTypeFilter = 21; 29 | map scannerSubscriptionFilterOptions = 22; 30 | map scannerSubscriptionOptions = 23; 31 | } 32 | -------------------------------------------------------------------------------- /bar.go: -------------------------------------------------------------------------------- 1 | package ibapi 2 | 3 | import "fmt" 4 | 5 | // Bar . 6 | type Bar struct { 7 | Date string 8 | Open float64 9 | High float64 10 | Low float64 11 | Close float64 12 | Volume Decimal 13 | Wap Decimal 14 | BarCount int64 15 | } 16 | 17 | func NewBar() Bar { 18 | b := Bar{} 19 | b.Volume = UNSET_DECIMAL 20 | b.Wap = UNSET_DECIMAL 21 | return b 22 | } 23 | 24 | func (b Bar) String() string { 25 | return fmt.Sprintf("Date: %s, Open: %f, High: %f, Low: %f, Close: %f, Volume: %s, WAP: %s, BarCount: %d", 26 | b.Date, b.Open, b.High, b.Low, b.Close, DecimalMaxString(b.Volume), DecimalMaxString(b.Wap), b.BarCount) 27 | } 28 | 29 | // RealTimeBar . 30 | type RealTimeBar struct { 31 | Time int64 32 | EndTime int64 33 | Open float64 34 | High float64 35 | Low float64 36 | Close float64 37 | Volume Decimal 38 | Wap Decimal 39 | Count int64 40 | } 41 | 42 | func NewRealTimeBar() RealTimeBar { 43 | rtb := RealTimeBar{} 44 | rtb.Volume = UNSET_DECIMAL 45 | rtb.Wap = UNSET_DECIMAL 46 | return rtb 47 | } 48 | 49 | func (rb RealTimeBar) String() string { 50 | return fmt.Sprintf("Time: %d, Open: %f, High: %f, Low: %f, Close: %f, Volume: %s, Wap: %s, Count: %d", 51 | rb.Time, rb.Open, rb.High, rb.Low, rb.Close, DecimalMaxString(rb.Volume), DecimalMaxString(rb.Wap), rb.Count) 52 | } 53 | -------------------------------------------------------------------------------- /decimal.go: -------------------------------------------------------------------------------- 1 | package ibapi 2 | 3 | import ( 4 | "errors" 5 | 6 | "github.com/robaho/fixed" 7 | ) 8 | 9 | var UNSET_DECIMAL = Decimal(fixed.NaN) 10 | var ZERO = Decimal(fixed.ZERO) 11 | var ONE = Decimal(fixed.NewF(1)) 12 | 13 | // Decimal implements Fixed from "github.com/robaho/fixed". 14 | type Decimal fixed.Fixed 15 | 16 | func (d Decimal) String() string { 17 | return fixed.Fixed(d).String() 18 | } 19 | 20 | func (d Decimal) Int() int64 { 21 | return fixed.Fixed(d).Int() 22 | } 23 | 24 | func (d Decimal) Float() float64 { 25 | return fixed.Fixed(d).Float() 26 | } 27 | 28 | func (d Decimal) MarshalBinary() ([]byte, error) { 29 | return fixed.Fixed(d).MarshalBinary() 30 | } 31 | 32 | func (d *Decimal) UnmarshalBinary(data []byte) error { 33 | var f fixed.Fixed 34 | err := f.UnmarshalBinary(data) 35 | if err != nil { 36 | return err 37 | } 38 | *d = Decimal(f) 39 | return nil 40 | } 41 | 42 | func StringToDecimal(s string) Decimal { 43 | d, _ := StringToDecimalErr(s) 44 | return d 45 | } 46 | 47 | func StringToDecimalErr(s string) (Decimal, error) { 48 | if s == "" || s == "2147483647" || s == "9223372036854775807" || s == "1.7976931348623157E308" || s == "-9223372036854775808" { 49 | return UNSET_DECIMAL, errors.New("unset decimal") 50 | } 51 | f, err := fixed.NewSErr(s) 52 | if err != nil { 53 | return UNSET_DECIMAL, err 54 | } 55 | return Decimal(f), nil 56 | } 57 | 58 | func DecimalToString(d Decimal) string { 59 | return fixed.Fixed(d).String() 60 | } 61 | -------------------------------------------------------------------------------- /examples/blocking/blocking.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "math/rand" 5 | "time" 6 | 7 | "github.com/scmhub/ibapi" 8 | ) 9 | 10 | const ( 11 | host = "localhost" 12 | port = 7497 13 | ) 14 | 15 | var log = ibapi.Logger() 16 | 17 | var tChan chan int64 18 | 19 | func init() { 20 | tChan = make(chan int64) 21 | } 22 | 23 | // Wrapper 24 | type Wrapper struct { 25 | ibapi.Wrapper 26 | } 27 | 28 | func (w Wrapper) CurrentTime(t int64) { 29 | log.Debug().Time("Server Time", time.Unix(t, 0)).Msg("") 30 | tChan <- t 31 | } 32 | 33 | // IB 34 | type IB struct { 35 | ibapi.EClient 36 | } 37 | 38 | func NewIB() *IB { 39 | return &IB{ 40 | EClient: *ibapi.NewEClient(&Wrapper{}), 41 | } 42 | } 43 | 44 | func (ib *IB) ReqCurrentTime() int64 { 45 | ib.EClient.ReqCurrentTime() 46 | return <-tChan 47 | } 48 | 49 | func main() { 50 | // Set the console writter 51 | ibapi.SetConsoleWriter() 52 | // Set log level 53 | //ibapi.SetLogLevel(int(zerolog.DebugLevel)) 54 | 55 | // Creates IB CLient 56 | ib := NewIB() 57 | 58 | // Client connection 59 | err := ib.Connect(host, port, int64(rand.Intn(1e9))) 60 | if err != nil { 61 | log.Error().Err(err).Msg("Connect") 62 | return 63 | } 64 | defer ib.Disconnect() 65 | // Add a short delay to allow the connection to stabilize 66 | time.Sleep(100 * time.Millisecond) 67 | log.Info().Msg("Waited for connection to stabilize") 68 | 69 | // Request servert current time 70 | t := ib.ReqCurrentTime() 71 | log.Info().Time("current time", time.Unix(t, 0)).Msg("Requested Server Current time") 72 | } 73 | -------------------------------------------------------------------------------- /proto/OrderState.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | import "OrderAllocation.proto"; 6 | 7 | option go_package = ".;protobuf"; 8 | 9 | message OrderState { 10 | optional string status = 1; 11 | optional double initMarginBefore = 2; 12 | optional double maintMarginBefore = 3; 13 | optional double equityWithLoanBefore = 4; 14 | optional double initMarginChange = 5; 15 | optional double maintMarginChange = 6; 16 | optional double equityWithLoanChange = 7; 17 | optional double initMarginAfter = 8; 18 | optional double maintMarginAfter = 9; 19 | optional double equityWithLoanAfter = 10; 20 | 21 | optional double commissionAndFees = 11; 22 | optional double minCommissionAndFees = 12; 23 | optional double maxCommissionAndFees = 13; 24 | optional string commissionAndFeesCurrency = 14; 25 | optional string marginCurrency = 15; 26 | 27 | optional double initMarginBeforeOutsideRTH = 16; 28 | optional double maintMarginBeforeOutsideRTH = 17; 29 | optional double equityWithLoanBeforeOutsideRTH = 18; 30 | optional double initMarginChangeOutsideRTH = 19; 31 | optional double maintMarginChangeOutsideRTH = 20; 32 | optional double equityWithLoanChangeOutsideRTH = 21; 33 | optional double initMarginAfterOutsideRTH = 22; 34 | optional double maintMarginAfterOutsideRTH = 23; 35 | optional double equityWithLoanAfterOutsideRTH = 24; 36 | 37 | optional string suggestedSize = 25; 38 | optional string rejectReason = 26; 39 | repeated OrderAllocation orderAllocations = 27; 40 | optional string warningText = 28; 41 | optional string completedTime = 29; 42 | optional string completedStatus = 30; 43 | } -------------------------------------------------------------------------------- /scanner_subscription_samples.go: -------------------------------------------------------------------------------- 1 | package ibapi 2 | 3 | // HotUSStkByVolume . 4 | // Hot US stocks by volume 5 | func HotUSStkByVolume() *ScannerSubscription { 6 | 7 | scanSub := NewScannerSubscription() 8 | scanSub.Instrument = "STK" 9 | scanSub.LocationCode = "STK.US.MAJOR" 10 | scanSub.ScanCode = "HOT_BY_VOLUME" 11 | 12 | return scanSub 13 | } 14 | 15 | // TopPercentGainersIbis . 16 | // Top % gainers at IBIS 17 | func TopPercentGainersIbis() *ScannerSubscription { 18 | 19 | scanSub := NewScannerSubscription() 20 | scanSub.Instrument = "STOCK.EU" 21 | scanSub.LocationCode = "STK.EU.IBIS" 22 | scanSub.ScanCode = "TOP_PERC_GAIN" 23 | 24 | return scanSub 25 | } 26 | 27 | // MostActiveFutEurex . 28 | // Most active futures at EUREX 29 | func MostActiveFutEurex() *ScannerSubscription { 30 | 31 | scanSub := NewScannerSubscription() 32 | scanSub.Instrument = "FUT.EU" 33 | scanSub.LocationCode = "FUT.EU.EUREX" 34 | scanSub.ScanCode = "MOST_ACTIVE" 35 | 36 | return scanSub 37 | } 38 | 39 | // HighOptVolumePCRatioUSIndexes . 40 | // High option volume P/C ratio US indexes 41 | func HighOptVolumePCRatioUSIndexes() *ScannerSubscription { 42 | 43 | scanSub := NewScannerSubscription() 44 | scanSub.Instrument = "IND.US" 45 | scanSub.LocationCode = "IND.US" 46 | scanSub.ScanCode = "HIGH_OPT_VOLUME_PUT_CALL_RATIO" 47 | 48 | return scanSub 49 | } 50 | 51 | // ComplexOrdersAndTrades . 52 | // Complex orders and trades scan, latest trades 53 | func ComplexOrdersAndTrades() *ScannerSubscription { 54 | 55 | scanSub := NewScannerSubscription() 56 | scanSub.Instrument = "NATCOMB" 57 | scanSub.LocationCode = "NATCOMB.OPT.US" 58 | scanSub.ScanCode = "COMBO_LATEST_TRADE" 59 | 60 | return scanSub 61 | } 62 | -------------------------------------------------------------------------------- /price_condition.go: -------------------------------------------------------------------------------- 1 | package ibapi 2 | 3 | import ( 4 | "fmt" 5 | ) 6 | 7 | // Trigger Methods. 8 | type TriggerMethod int64 9 | 10 | const ( 11 | DefaultTriggerMethod TriggerMethod = 0 12 | DoubleBidAskTriggerMethod TriggerMethod = 1 13 | LastTriggerMethod TriggerMethod = 2 14 | DoubleLastTriggerMethod TriggerMethod = 3 15 | BidAskTriggerMethod TriggerMethod = 4 16 | LastBidAskTriggerMethod TriggerMethod = 7 17 | MidPointTriggerMethod TriggerMethod = 8 18 | ) 19 | 20 | func (tm TriggerMethod) String() string { 21 | switch tm { 22 | case DefaultTriggerMethod: 23 | return "default" 24 | case DoubleBidAskTriggerMethod: 25 | return "Double BidAsk" 26 | case LastTriggerMethod: 27 | return "last" 28 | case DoubleLastTriggerMethod: 29 | return "double Last" 30 | case BidAskTriggerMethod: 31 | return "Bid/ssk" 32 | case LastBidAskTriggerMethod: 33 | return "last of Bid/Ask" 34 | case MidPointTriggerMethod: 35 | return "mid-point" 36 | default: 37 | return fmt.Sprintf("Unknown Trigger Method %d", tm) 38 | } 39 | } 40 | 41 | // var _ OrderCondition = (*PriceCondition)(nil) 42 | var _ ContractCondition = (*PriceCondition)(nil) 43 | 44 | type PriceCondition struct { 45 | *contractCondition 46 | Price float64 47 | TriggerMethod TriggerMethod 48 | } 49 | 50 | func newPriceCondition() *PriceCondition { 51 | return &PriceCondition{contractCondition: newContractCondition(PriceOrderCondition)} 52 | } 53 | 54 | func (pc *PriceCondition) decode(msgBuf *MsgBuffer) { 55 | pc.contractCondition.decode(msgBuf) 56 | pc.Price = msgBuf.decodeFloat64() 57 | pc.TriggerMethod = TriggerMethod(msgBuf.decodeInt64()) 58 | } 59 | 60 | func (pc PriceCondition) makeFields() []any { 61 | return append(pc.contractCondition.makeFields(), pc.Price, pc.TriggerMethod) 62 | } 63 | 64 | func (pc PriceCondition) String() string { 65 | return fmt.Sprintf("%v %v", pc.TriggerMethod, pc.contractCondition) 66 | } 67 | -------------------------------------------------------------------------------- /reader.go: -------------------------------------------------------------------------------- 1 | package ibapi 2 | 3 | import ( 4 | "bufio" 5 | "context" 6 | "slices" 7 | "sync" 8 | ) 9 | 10 | // EReader starts the scan and decode goroutines 11 | func EReader(ctx context.Context, cancel context.CancelFunc, scanner *bufio.Scanner, decoder *EDecoder, wg *sync.WaitGroup) { 12 | 13 | msgChan := make(chan []byte, 300) 14 | 15 | // Decode 16 | wg.Add(1) 17 | go func() { 18 | log.Debug().Msg("decoder started") 19 | defer log.Debug().Msg("decoder ended") 20 | defer wg.Done() 21 | for { 22 | select { 23 | case <-ctx.Done(): 24 | return 25 | case msg, ok := <-msgChan: 26 | if !ok { 27 | return 28 | } 29 | decoder.interpret(msg) // single worker and no go here!! 30 | } 31 | } 32 | }() 33 | 34 | // Scan 35 | wg.Add(1) 36 | go func() { 37 | log.Debug().Msg("scanner started") 38 | defer log.Debug().Msg("scanner ended") 39 | defer wg.Done() 40 | defer close(msgChan) // close the channel so decoder exits 41 | 42 | // for scanner.Scan() { 43 | // msgBytes := make([]byte, len(scanner.Bytes())) 44 | // copy(msgBytes, scanner.Bytes()) 45 | // msgChan <- msgBytes 46 | // if err := scanner.Err(); err != nil { 47 | // log.Error().Err(err).Msg("scanner error") 48 | // break 49 | // } 50 | // } 51 | 52 | for { 53 | select { 54 | case <-ctx.Done(): 55 | // shutdown in flight 56 | return 57 | default: 58 | // block here until there's a token or an error/EOF 59 | if !scanner.Scan() { 60 | // only take action if we weren't already cancelled 61 | if ctx.Err() == nil { 62 | if err := scanner.Err(); err != nil { 63 | log.Error().Err(err).Msg("scanner error, triggering shutdown") 64 | } else { 65 | log.Debug().Msg("scanner reached EOF, triggering shutdown") 66 | } 67 | cancel() 68 | } 69 | return 70 | } 71 | 72 | // successful scan → queue for decode 73 | msgBytes := slices.Clone(scanner.Bytes()) 74 | msgChan <- msgBytes 75 | } 76 | } 77 | }() 78 | } 79 | -------------------------------------------------------------------------------- /execution.go: -------------------------------------------------------------------------------- 1 | package ibapi 2 | 3 | import ( 4 | "fmt" 5 | "strconv" 6 | ) 7 | 8 | // Execution is the information of an order`s execution. 9 | type Execution struct { 10 | ExecID string 11 | Time string 12 | AcctNumber string 13 | Exchange string 14 | Side string 15 | Shares Decimal //UNSET_DECIMAL 16 | Price float64 17 | PermID int64 18 | ClientID int64 19 | OrderID int64 20 | Liquidation int64 21 | CumQty Decimal // UNSET_DECIMAL 22 | AvgPrice float64 23 | OrderRef string 24 | EVRule string 25 | EVMultiplier float64 26 | ModelCode string 27 | LastLiquidity int64 28 | PendingPriceRevision bool 29 | Submitter string 30 | OptExerciseOrLapseType OptionExerciseType 31 | } 32 | 33 | func (e Execution) String() string { 34 | return fmt.Sprintf("ExecId: %s, Time: %s, Account: %s, Exchange: %s, Side: %s, Shares: %s, Price: %s, PermId: %s, ClientId: %s, OrderId: %s, Liquidation: %s, CumQty: %s, AvgPrice: %s, OrderRef: %s, EvRule: %s, EvMultiplier: %s, ModelCode: %s, LastLiquidity: %s, PendingPriceRevision: %s, Submitter: %s, OptionExerciseType: %s", 35 | e.ExecID, e.Time, e.AcctNumber, e.Exchange, e.Side, DecimalMaxString(e.Shares), FloatMaxString(e.Price), LongMaxString(e.PermID), IntMaxString(e.ClientID), IntMaxString(e.OrderID), IntMaxString(e.Liquidation), DecimalMaxString(e.CumQty), FloatMaxString(e.AvgPrice), 36 | e.OrderRef, e.EVRule, FloatMaxString(e.EVMultiplier), e.ModelCode, IntMaxString(e.LastLiquidity), strconv.FormatBool(e.PendingPriceRevision), e.Submitter, e.OptExerciseOrLapseType.String()) 37 | } 38 | 39 | func NewExecution() *Execution { 40 | e := &Execution{} 41 | e.Shares = UNSET_DECIMAL 42 | e.CumQty = UNSET_DECIMAL 43 | e.OptExerciseOrLapseType = OptionExerciseTypeNone 44 | return e 45 | } 46 | 47 | // ExecutionFilter . 48 | type ExecutionFilter struct { 49 | ClientID int64 50 | AcctCode string 51 | Time string 52 | Symbol string 53 | SecType string 54 | Exchange string 55 | Side string 56 | LastNDays int64 57 | SpecificDates []int64 58 | } 59 | 60 | func NewExecutionFilter() *ExecutionFilter { 61 | ef := &ExecutionFilter{} 62 | ef.LastNDays = UNSET_INT 63 | return ef 64 | } 65 | -------------------------------------------------------------------------------- /scanner.go: -------------------------------------------------------------------------------- 1 | package ibapi 2 | 3 | import "fmt" 4 | 5 | const NO_ROW_NUMBER_SPECIFIED int64 = -1 6 | 7 | // ScanData . 8 | type ScanData struct { 9 | Rank int64 10 | ContractDetails *ContractDetails 11 | Distance string 12 | Benchmark string 13 | Projection string 14 | LegsStr string 15 | } 16 | 17 | func (s ScanData) String() string { 18 | return fmt.Sprintf("Rank: %d, Symbol: %s, SecType: %s, Currency: %s, Distance: %s, Benchmark: %s, Projection: %s, Legs String: %s", 19 | s.Rank, s.ContractDetails.Contract.Symbol, s.ContractDetails.Contract.SecType, s.ContractDetails.Contract.Currency, 20 | s.Distance, s.Benchmark, s.Projection, s.LegsStr) 21 | } 22 | 23 | // ScannerSubscription . 24 | type ScannerSubscription struct { 25 | NumberOfRows int64 `default:"NO_ROW_NUMBER_SPECIFIED"` 26 | Instrument string 27 | LocationCode string 28 | ScanCode string 29 | AbovePrice float64 `default:"UNSET_FLOAT"` 30 | BelowPrice float64 `default:"UNSET_FLOAT"` 31 | AboveVolume int64 `default:"UNSET_INT"` 32 | MarketCapAbove float64 `default:"UNSET_FLOAT"` 33 | MarketCapBelow float64 `default:"UNSET_FLOAT"` 34 | MoodyRatingAbove string 35 | MoodyRatingBelow string 36 | SpRatingAbove string 37 | SpRatingBelow string 38 | MaturityDateAbove string 39 | MaturityDateBelow string 40 | CouponRateAbove float64 `default:"UNSET_FLOAT"` 41 | CouponRateBelow float64 `default:"UNSET_FLOAT"` 42 | ExcludeConvertible bool 43 | AverageOptionVolumeAbove int64 `default:"UNSET_INT"` 44 | ScannerSettingPairs string 45 | StockTypeFilter string 46 | } 47 | 48 | func (s ScannerSubscription) String() string { 49 | return fmt.Sprintf("Instrument: %s, LocationCode: %s, ScanCode: %s", s.Instrument, s.LocationCode, s.ScanCode) 50 | } 51 | 52 | // NewScannerSubscription creates a default ScannerSubscription. 53 | func NewScannerSubscription() *ScannerSubscription { 54 | scannerSubscription := &ScannerSubscription{} 55 | 56 | scannerSubscription.NumberOfRows = NO_ROW_NUMBER_SPECIFIED 57 | 58 | scannerSubscription.AbovePrice = UNSET_FLOAT 59 | scannerSubscription.BelowPrice = UNSET_FLOAT 60 | scannerSubscription.AboveVolume = UNSET_INT 61 | scannerSubscription.MarketCapAbove = UNSET_FLOAT 62 | scannerSubscription.MarketCapBelow = UNSET_FLOAT 63 | 64 | scannerSubscription.CouponRateAbove = UNSET_FLOAT 65 | scannerSubscription.CouponRateBelow = UNSET_FLOAT 66 | 67 | scannerSubscription.AverageOptionVolumeAbove = UNSET_INT 68 | 69 | return scannerSubscription 70 | } 71 | -------------------------------------------------------------------------------- /proto/ContractDetails.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package protobuf; 4 | 5 | import "IneligibilityReason.proto"; 6 | 7 | option go_package = ".;protobuf"; 8 | 9 | message ContractDetails { 10 | optional string marketName = 1; 11 | optional string minTick = 2; 12 | optional string orderTypes = 3; 13 | optional string validExchanges = 4; 14 | optional int32 priceMagnifier = 5; 15 | optional int32 underConId = 6; 16 | optional string longName = 7; 17 | optional string contractMonth = 8; 18 | optional string industry = 9; 19 | optional string category = 10; 20 | optional string subcategory = 11; 21 | optional string timeZoneId = 12; 22 | optional string tradingHours = 13; 23 | optional string liquidHours = 14; 24 | optional string evRule = 15; 25 | optional double evMultiplier = 16; 26 | map secIdList = 17; 27 | optional int32 aggGroup = 18; 28 | optional string underSymbol = 19; 29 | optional string underSecType = 20; 30 | optional string marketRuleIds = 21; 31 | optional string realExpirationDate = 22; 32 | optional string stockType = 23; 33 | optional string minSize = 24; 34 | optional string sizeIncrement = 25; 35 | optional string suggestedSizeIncrement = 26; 36 | 37 | // fund fields 38 | optional string fundName = 27; 39 | optional string fundFamily = 28; 40 | optional string fundType = 29; 41 | optional string fundFrontLoad = 30; 42 | optional string fundBackLoad = 31; 43 | optional string fundBackLoadTimeInterval = 32; 44 | optional string fundManagementFee = 33; 45 | optional bool fundClosed = 34; 46 | optional bool fundClosedForNewInvestors = 35; 47 | optional bool fundClosedForNewMoney = 36; 48 | optional string fundNotifyAmount = 37; 49 | optional string fundMinimumInitialPurchase = 38; 50 | optional string fundMinimumSubsequentPurchase = 39; 51 | optional string fundBlueSkyStates = 40; 52 | optional string fundBlueSkyTerritories = 41; 53 | optional string fundDistributionPolicyIndicator = 42; 54 | optional string fundAssetType = 43; 55 | 56 | // bond fields 57 | optional string cusip = 44; 58 | optional string issueDate = 45; 59 | optional string ratings = 46; 60 | optional string bondType = 47; 61 | optional double coupon = 48; 62 | optional string couponType = 49; 63 | optional bool convertible = 50; 64 | optional bool callable = 51; 65 | optional bool puttable = 52; 66 | optional string descAppend = 53; 67 | optional string nextOptionDate = 54; 68 | optional string nextOptionType = 55; 69 | optional bool nextOptionPartial = 56; 70 | optional string bondNotes = 57; 71 | 72 | repeated IneligibilityReason ineligibilityReasonList = 58; 73 | 74 | // event contract fields 75 | optional string eventContract1 = 59; 76 | optional string eventContractDescription1 = 60; 77 | optional string eventContractDescription2 = 61; 78 | 79 | optional string minAlgoSize = 62; 80 | } -------------------------------------------------------------------------------- /account_summary_tags.go: -------------------------------------------------------------------------------- 1 | package ibapi 2 | 3 | import "strings" 4 | 5 | // AccountSummaryTags . 6 | type AccountSummaryTags = string 7 | 8 | const ( 9 | AccountType AccountSummaryTags = "AccountType" 10 | NetLiquidation AccountSummaryTags = "NetLiquidation" 11 | TotalCashValue AccountSummaryTags = "TotalCashValue" 12 | SettledCash AccountSummaryTags = "SettledCash" 13 | AccruedCash AccountSummaryTags = "AccruedCash" 14 | BuyingPower AccountSummaryTags = "BuyingPower" 15 | EquityWithLoanValue AccountSummaryTags = "EquityWithLoanValue" 16 | PreviousEquityWithLoanValue AccountSummaryTags = "PreviousEquityWithLoanValue" 17 | GrossPositionValue AccountSummaryTags = "GrossPositionValue" 18 | ReqTEquity AccountSummaryTags = "ReqTEquity" 19 | ReqTMargin AccountSummaryTags = "ReqTMargin" 20 | SMA AccountSummaryTags = "SMA" 21 | InitMarginReq AccountSummaryTags = "InitMarginReq" 22 | MaintMarginReq AccountSummaryTags = "MaintMarginReq" 23 | AvailableFunds AccountSummaryTags = "AvailableFunds" 24 | ExcessLiquidity AccountSummaryTags = "ExcessLiquidity" 25 | Cushion AccountSummaryTags = "Cushion" 26 | FullInitMarginReq AccountSummaryTags = "FullInitMarginReq" 27 | FullMaintMarginReq AccountSummaryTags = "FullMaintMarginReq" 28 | FullAvailableFunds AccountSummaryTags = "FullAvailableFunds" 29 | FullExcessLiquidity AccountSummaryTags = "FullExcessLiquidity" 30 | LookAheadNextChange AccountSummaryTags = "LookAheadNextChange" 31 | LookAheadInitMarginReq AccountSummaryTags = "LookAheadInitMarginReq" 32 | LookAheadMaintMarginReq AccountSummaryTags = "LookAheadMaintMarginReq" 33 | LookAheadAvailableFunds AccountSummaryTags = "LookAheadAvailableFunds" 34 | LookAheadExcessLiquidity AccountSummaryTags = "LookAheadExcessLiquidity" 35 | HighestSeverity AccountSummaryTags = "HighestSeverity" 36 | DayTradesRemaining AccountSummaryTags = "DayTradesRemaining" 37 | Leverage AccountSummaryTags = "Leverage" 38 | ) 39 | 40 | func GetAllTags() string { 41 | tags := []AccountSummaryTags{ 42 | AccountType, 43 | NetLiquidation, 44 | TotalCashValue, 45 | SettledCash, 46 | AccruedCash, 47 | BuyingPower, 48 | EquityWithLoanValue, 49 | PreviousEquityWithLoanValue, 50 | GrossPositionValue, 51 | ReqTEquity, 52 | ReqTMargin, 53 | SMA, 54 | InitMarginReq, 55 | MaintMarginReq, 56 | AvailableFunds, 57 | ExcessLiquidity, 58 | Cushion, 59 | FullInitMarginReq, 60 | FullMaintMarginReq, 61 | FullAvailableFunds, 62 | FullExcessLiquidity, 63 | LookAheadNextChange, 64 | LookAheadInitMarginReq, 65 | LookAheadMaintMarginReq, 66 | LookAheadAvailableFunds, 67 | LookAheadExcessLiquidity, 68 | HighestSeverity, 69 | DayTradesRemaining, 70 | Leverage, 71 | } 72 | return strings.Join(tags, ",") 73 | } 74 | -------------------------------------------------------------------------------- /contract_test.go: -------------------------------------------------------------------------------- 1 | package ibapi 2 | 3 | import ( 4 | "encoding/json" 5 | "testing" 6 | ) 7 | 8 | func TestContractComplexJSON(t *testing.T) { 9 | // Create a complex contract 10 | contract := NewContract() 11 | contract.Symbol = "SPREAD" 12 | contract.SecType = "BAG" 13 | contract.Currency = "USD" 14 | contract.Exchange = "SMART" 15 | 16 | // Add combo legs 17 | leg1 := NewComboLeg() 18 | leg1.ConID = 12345 19 | leg1.Ratio = 1 20 | leg1.Action = "BUY" 21 | leg1.Exchange = "SMART" 22 | leg1.OpenClose = int64(OPEN_POS) 23 | 24 | leg2 := NewComboLeg() 25 | leg2.ConID = 67890 26 | leg2.Ratio = 1 27 | leg2.Action = "SELL" 28 | leg2.Exchange = "SMART" 29 | leg2.OpenClose = int64(CLOSE_POS) 30 | 31 | contract.ComboLegs = []ComboLeg{leg1, leg2} 32 | 33 | // Add delta neutral contract 34 | contract.DeltaNeutralContract = &DeltaNeutralContract{ 35 | ConID: 11111, 36 | Delta: 0.5, 37 | Price: 150.0, 38 | } 39 | 40 | // Marshal to JSON 41 | data, err := json.Marshal(contract) 42 | if err != nil { 43 | t.Fatalf("Failed to marshal: %v", err) 44 | } 45 | 46 | // Verify JSON structure 47 | var jsonMap map[string]any 48 | if err := json.Unmarshal(data, &jsonMap); err != nil { 49 | t.Fatalf("Failed to parse JSON: %v", err) 50 | } 51 | 52 | // Check combo legs 53 | legs, ok := jsonMap["comboLegs"].([]any) 54 | if !ok || len(legs) != 2 { 55 | t.Error("Expected 2 combo legs in JSON") 56 | } 57 | 58 | // Check delta neutral 59 | delta, ok := jsonMap["deltaNeutralContract"].(map[string]any) 60 | if !ok { 61 | t.Error("Expected deltaNeutralContract in JSON") 62 | } 63 | if delta["conId"].(float64) != 11111 { 64 | t.Errorf("Expected deltaNeutralContract.conId = 11111, got %v", delta["conId"]) 65 | } 66 | 67 | // Unmarshal back to contract 68 | var decoded Contract 69 | if err := json.Unmarshal(data, &decoded); err != nil { 70 | t.Fatalf("Failed to unmarshal: %v", err) 71 | } 72 | // Equal check 73 | if !decoded.Equal(contract) { 74 | t.Errorf("Decoded contract not equal to original:\nOriginal: %+v\nDecoded: %+v", 75 | contract, decoded) 76 | } 77 | // Verify combo legs 78 | if len(decoded.ComboLegs) != 2 { 79 | t.Fatalf("Expected 2 combo legs, got %d", len(decoded.ComboLegs)) 80 | } 81 | if decoded.ComboLegs[0].ConID != 12345 { 82 | t.Errorf("Expected first leg ConID 12345, got %d", decoded.ComboLegs[0].ConID) 83 | } 84 | if decoded.ComboLegs[1].ConID != 67890 { 85 | t.Errorf("Expected second leg ConID 67890, got %d", decoded.ComboLegs[1].ConID) 86 | } 87 | 88 | // Verify delta neutral contract 89 | if decoded.DeltaNeutralContract == nil { 90 | t.Fatal("Expected non-nil DeltaNeutralContract") 91 | } 92 | if decoded.DeltaNeutralContract.ConID != 11111 { 93 | t.Errorf("Expected DeltaNeutralContract.ConID 11111, got %d", 94 | decoded.DeltaNeutralContract.ConID) 95 | } 96 | if decoded.DeltaNeutralContract.Delta != 0.5 { 97 | t.Errorf("Expected DeltaNeutralContract.Delta 0.5, got %f", 98 | decoded.DeltaNeutralContract.Delta) 99 | } 100 | } 101 | -------------------------------------------------------------------------------- /go.sum: -------------------------------------------------------------------------------- 1 | github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= 2 | github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= 3 | github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= 4 | github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= 5 | github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= 6 | github.com/mattn/go-colorable v0.1.14 h1:9A9LHSqF/7dyVVX6g0U9cwm9pG3kP9gSzcuIPHPsaIE= 7 | github.com/mattn/go-colorable v0.1.14/go.mod h1:6LmQG8QLFO4G5z1gPvYEzlUgJ2wF+stgPZH1UqBm1s8= 8 | github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= 9 | github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= 10 | github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= 11 | github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= 12 | github.com/mattn/go-sqlite3 v1.14.22 h1:2gZY6PC6kBnID23Tichd1K+Z0oS6nE/XwU+Vz/5o4kU= 13 | github.com/mattn/go-sqlite3 v1.14.22/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y= 14 | github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= 15 | github.com/robaho/fixed v0.0.0-20250130054609-fd0e46fcd988 h1:aHw3VW2Oe8Q2Icq1eUradihZqn/zBVlNQonXw+swAgM= 16 | github.com/robaho/fixed v0.0.0-20250130054609-fd0e46fcd988/go.mod h1:gOuZr6norIEHlPghhACq3f8PL6ZFF5uJVMOgh2/M7xQ= 17 | github.com/robaho/fixed v0.0.0-20251201003256-beee5759f86a h1:aeGponfnGZvVKhjkKOUv3uW/UcpmgLCp77IaDOvqoFM= 18 | github.com/robaho/fixed v0.0.0-20251201003256-beee5759f86a/go.mod h1:gOuZr6norIEHlPghhACq3f8PL6ZFF5uJVMOgh2/M7xQ= 19 | github.com/rs/xid v1.6.0/go.mod h1:7XoLgs4eV+QndskICGsho+ADou8ySMSjJKDIan90Nz0= 20 | github.com/rs/zerolog v1.34.0 h1:k43nTLIwcTVQAncfCw4KZ2VY6ukYoZaBPNOE8txlOeY= 21 | github.com/rs/zerolog v1.34.0/go.mod h1:bJsvje4Z08ROH4Nhs5iH600c3IkWhwp44iRc54W6wYQ= 22 | github.com/shopspring/decimal v1.4.0 h1:bxl37RwXBklmTi0C79JfXCEBD1cqqHt0bbgBAGFp81k= 23 | github.com/shopspring/decimal v1.4.0/go.mod h1:gawqmDU56v4yIKSwfBSFip1HdCCXN8/+DMd9qYNcwME= 24 | golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 25 | golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 26 | golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 27 | golang.org/x/sys v0.35.0 h1:vz1N37gP5bs89s7He8XuIYXpyY0+QlsKmzipCbUtyxI= 28 | golang.org/x/sys v0.35.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= 29 | golang.org/x/sys v0.37.0 h1:fdNQudmxPjkdUTPnLn5mdQv7Zwvbvpaxqs831goi9kQ= 30 | golang.org/x/sys v0.37.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= 31 | golang.org/x/sys v0.38.0 h1:3yZWxaJjBmCWXqhN1qh02AkOnCQ1poK6oF+a7xWL6Gc= 32 | golang.org/x/sys v0.38.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= 33 | golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= 34 | golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= 35 | google.golang.org/protobuf v1.36.8 h1:xHScyCOEuuwZEc6UtSOvPbAT4zRh0xcNRYekJwfqyMc= 36 | google.golang.org/protobuf v1.36.8/go.mod h1:fuxRtAxBytpl4zzqUh6/eyUujkJdNiuEkXntxiD/uRU= 37 | google.golang.org/protobuf v1.36.10 h1:AYd7cD/uASjIL6Q9LiTjz8JLcrh/88q5UObnmY3aOOE= 38 | google.golang.org/protobuf v1.36.10/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco= 39 | -------------------------------------------------------------------------------- /protobuf/PositionEnd.pb.go: -------------------------------------------------------------------------------- 1 | // Code generated by protoc-gen-go. DO NOT EDIT. 2 | // versions: 3 | // protoc-gen-go v1.36.9 4 | // protoc v3.21.12 5 | // source: PositionEnd.proto 6 | 7 | package protobuf 8 | 9 | import ( 10 | protoreflect "google.golang.org/protobuf/reflect/protoreflect" 11 | protoimpl "google.golang.org/protobuf/runtime/protoimpl" 12 | reflect "reflect" 13 | sync "sync" 14 | unsafe "unsafe" 15 | ) 16 | 17 | const ( 18 | // Verify that this generated code is sufficiently up-to-date. 19 | _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) 20 | // Verify that runtime/protoimpl is sufficiently up-to-date. 21 | _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) 22 | ) 23 | 24 | type PositionEnd struct { 25 | state protoimpl.MessageState `protogen:"open.v1"` 26 | unknownFields protoimpl.UnknownFields 27 | sizeCache protoimpl.SizeCache 28 | } 29 | 30 | func (x *PositionEnd) Reset() { 31 | *x = PositionEnd{} 32 | mi := &file_PositionEnd_proto_msgTypes[0] 33 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 34 | ms.StoreMessageInfo(mi) 35 | } 36 | 37 | func (x *PositionEnd) String() string { 38 | return protoimpl.X.MessageStringOf(x) 39 | } 40 | 41 | func (*PositionEnd) ProtoMessage() {} 42 | 43 | func (x *PositionEnd) ProtoReflect() protoreflect.Message { 44 | mi := &file_PositionEnd_proto_msgTypes[0] 45 | if x != nil { 46 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 47 | if ms.LoadMessageInfo() == nil { 48 | ms.StoreMessageInfo(mi) 49 | } 50 | return ms 51 | } 52 | return mi.MessageOf(x) 53 | } 54 | 55 | // Deprecated: Use PositionEnd.ProtoReflect.Descriptor instead. 56 | func (*PositionEnd) Descriptor() ([]byte, []int) { 57 | return file_PositionEnd_proto_rawDescGZIP(), []int{0} 58 | } 59 | 60 | var File_PositionEnd_proto protoreflect.FileDescriptor 61 | 62 | const file_PositionEnd_proto_rawDesc = "" + 63 | "\n" + 64 | "\x11PositionEnd.proto\x12\bprotobuf\"\r\n" + 65 | "\vPositionEndB\fZ\n" + 66 | ".;protobufb\x06proto3" 67 | 68 | var ( 69 | file_PositionEnd_proto_rawDescOnce sync.Once 70 | file_PositionEnd_proto_rawDescData []byte 71 | ) 72 | 73 | func file_PositionEnd_proto_rawDescGZIP() []byte { 74 | file_PositionEnd_proto_rawDescOnce.Do(func() { 75 | file_PositionEnd_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_PositionEnd_proto_rawDesc), len(file_PositionEnd_proto_rawDesc))) 76 | }) 77 | return file_PositionEnd_proto_rawDescData 78 | } 79 | 80 | var file_PositionEnd_proto_msgTypes = make([]protoimpl.MessageInfo, 1) 81 | var file_PositionEnd_proto_goTypes = []any{ 82 | (*PositionEnd)(nil), // 0: protobuf.PositionEnd 83 | } 84 | var file_PositionEnd_proto_depIdxs = []int32{ 85 | 0, // [0:0] is the sub-list for method output_type 86 | 0, // [0:0] is the sub-list for method input_type 87 | 0, // [0:0] is the sub-list for extension type_name 88 | 0, // [0:0] is the sub-list for extension extendee 89 | 0, // [0:0] is the sub-list for field type_name 90 | } 91 | 92 | func init() { file_PositionEnd_proto_init() } 93 | func file_PositionEnd_proto_init() { 94 | if File_PositionEnd_proto != nil { 95 | return 96 | } 97 | type x struct{} 98 | out := protoimpl.TypeBuilder{ 99 | File: protoimpl.DescBuilder{ 100 | GoPackagePath: reflect.TypeOf(x{}).PkgPath(), 101 | RawDescriptor: unsafe.Slice(unsafe.StringData(file_PositionEnd_proto_rawDesc), len(file_PositionEnd_proto_rawDesc)), 102 | NumEnums: 0, 103 | NumMessages: 1, 104 | NumExtensions: 0, 105 | NumServices: 0, 106 | }, 107 | GoTypes: file_PositionEnd_proto_goTypes, 108 | DependencyIndexes: file_PositionEnd_proto_depIdxs, 109 | MessageInfos: file_PositionEnd_proto_msgTypes, 110 | }.Build() 111 | File_PositionEnd_proto = out.File 112 | file_PositionEnd_proto_goTypes = nil 113 | file_PositionEnd_proto_depIdxs = nil 114 | } 115 | -------------------------------------------------------------------------------- /protobuf/OpenOrdersEnd.pb.go: -------------------------------------------------------------------------------- 1 | // Code generated by protoc-gen-go. DO NOT EDIT. 2 | // versions: 3 | // protoc-gen-go v1.36.9 4 | // protoc v3.21.12 5 | // source: OpenOrdersEnd.proto 6 | 7 | package protobuf 8 | 9 | import ( 10 | protoreflect "google.golang.org/protobuf/reflect/protoreflect" 11 | protoimpl "google.golang.org/protobuf/runtime/protoimpl" 12 | reflect "reflect" 13 | sync "sync" 14 | unsafe "unsafe" 15 | ) 16 | 17 | const ( 18 | // Verify that this generated code is sufficiently up-to-date. 19 | _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) 20 | // Verify that runtime/protoimpl is sufficiently up-to-date. 21 | _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) 22 | ) 23 | 24 | type OpenOrdersEnd struct { 25 | state protoimpl.MessageState `protogen:"open.v1"` 26 | unknownFields protoimpl.UnknownFields 27 | sizeCache protoimpl.SizeCache 28 | } 29 | 30 | func (x *OpenOrdersEnd) Reset() { 31 | *x = OpenOrdersEnd{} 32 | mi := &file_OpenOrdersEnd_proto_msgTypes[0] 33 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 34 | ms.StoreMessageInfo(mi) 35 | } 36 | 37 | func (x *OpenOrdersEnd) String() string { 38 | return protoimpl.X.MessageStringOf(x) 39 | } 40 | 41 | func (*OpenOrdersEnd) ProtoMessage() {} 42 | 43 | func (x *OpenOrdersEnd) ProtoReflect() protoreflect.Message { 44 | mi := &file_OpenOrdersEnd_proto_msgTypes[0] 45 | if x != nil { 46 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 47 | if ms.LoadMessageInfo() == nil { 48 | ms.StoreMessageInfo(mi) 49 | } 50 | return ms 51 | } 52 | return mi.MessageOf(x) 53 | } 54 | 55 | // Deprecated: Use OpenOrdersEnd.ProtoReflect.Descriptor instead. 56 | func (*OpenOrdersEnd) Descriptor() ([]byte, []int) { 57 | return file_OpenOrdersEnd_proto_rawDescGZIP(), []int{0} 58 | } 59 | 60 | var File_OpenOrdersEnd_proto protoreflect.FileDescriptor 61 | 62 | const file_OpenOrdersEnd_proto_rawDesc = "" + 63 | "\n" + 64 | "\x13OpenOrdersEnd.proto\x12\bprotobuf\"\x0f\n" + 65 | "\rOpenOrdersEndB\fZ\n" + 66 | ".;protobufb\x06proto3" 67 | 68 | var ( 69 | file_OpenOrdersEnd_proto_rawDescOnce sync.Once 70 | file_OpenOrdersEnd_proto_rawDescData []byte 71 | ) 72 | 73 | func file_OpenOrdersEnd_proto_rawDescGZIP() []byte { 74 | file_OpenOrdersEnd_proto_rawDescOnce.Do(func() { 75 | file_OpenOrdersEnd_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_OpenOrdersEnd_proto_rawDesc), len(file_OpenOrdersEnd_proto_rawDesc))) 76 | }) 77 | return file_OpenOrdersEnd_proto_rawDescData 78 | } 79 | 80 | var file_OpenOrdersEnd_proto_msgTypes = make([]protoimpl.MessageInfo, 1) 81 | var file_OpenOrdersEnd_proto_goTypes = []any{ 82 | (*OpenOrdersEnd)(nil), // 0: protobuf.OpenOrdersEnd 83 | } 84 | var file_OpenOrdersEnd_proto_depIdxs = []int32{ 85 | 0, // [0:0] is the sub-list for method output_type 86 | 0, // [0:0] is the sub-list for method input_type 87 | 0, // [0:0] is the sub-list for extension type_name 88 | 0, // [0:0] is the sub-list for extension extendee 89 | 0, // [0:0] is the sub-list for field type_name 90 | } 91 | 92 | func init() { file_OpenOrdersEnd_proto_init() } 93 | func file_OpenOrdersEnd_proto_init() { 94 | if File_OpenOrdersEnd_proto != nil { 95 | return 96 | } 97 | type x struct{} 98 | out := protoimpl.TypeBuilder{ 99 | File: protoimpl.DescBuilder{ 100 | GoPackagePath: reflect.TypeOf(x{}).PkgPath(), 101 | RawDescriptor: unsafe.Slice(unsafe.StringData(file_OpenOrdersEnd_proto_rawDesc), len(file_OpenOrdersEnd_proto_rawDesc)), 102 | NumEnums: 0, 103 | NumMessages: 1, 104 | NumExtensions: 0, 105 | NumServices: 0, 106 | }, 107 | GoTypes: file_OpenOrdersEnd_proto_goTypes, 108 | DependencyIndexes: file_OpenOrdersEnd_proto_depIdxs, 109 | MessageInfos: file_OpenOrdersEnd_proto_msgTypes, 110 | }.Build() 111 | File_OpenOrdersEnd_proto = out.File 112 | file_OpenOrdersEnd_proto_goTypes = nil 113 | file_OpenOrdersEnd_proto_depIdxs = nil 114 | } 115 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![Go Report Card](https://goreportcard.com/badge/github.com/scmhub/ibapi)](https://goreportcard.com/report/github.com/scmhub/ibapi) 2 | [![Go Reference](https://pkg.go.dev/badge/github.com/scmhub/ibapi.svg)](https://pkg.go.dev/github.com/scmhub/ibapi) 3 | [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT) 4 | 5 | # Unofficial Golang Interactive Brokers API 6 | 7 | `ibapi` package provides an **unofficial** Golang implementation of the [Interactive Brokers](https://www.interactivebrokers.com/en/home.php) API. It is designed to mirror the official Python or C++ [tws-api](https://github.com/InteractiveBrokers) provided by Interactive Brokers. 8 | **We will do our best to keep it in sync** with the official API releases to ensure compatibility and feature parity, but users should be aware that this is a community-driven project and may lag behind the official versions at times. 9 | 10 | > [!CAUTION] 11 | > Please test extensively in non-production environments before relying on it for live trading. 12 | 13 | ## Getting Started 14 | 15 | ### Prerequisites 16 | 17 | - **Go** version 1.25 18 | - An **Interactive Brokers** account with TWS or IB Gateway installed and running 19 | 20 | ### Installation 21 | 22 | Install the package via `go get`: 23 | 24 | ```bash 25 | go get -u github.com/scmhub/ibapi 26 | ``` 27 | 28 | ## Usage 29 | 30 | Here’s a basic example to connect and place an order using this package: 31 | 32 | ```go 33 | package main 34 | 35 | import ( 36 | "math/rand" 37 | "time" 38 | 39 | "github.com/scmhub/ibapi" 40 | ) 41 | 42 | const ( 43 | IB_HOST = "127.0.0.1" 44 | IB_PORT = 7497 45 | ) 46 | 47 | func main() { 48 | // We set logger for pretty logs to console 49 | log := ibapi.Logger() 50 | ibapi.SetConsoleWriter() 51 | 52 | // New IB CLient 53 | ib := ibapi.NewEClient(nil) 54 | 55 | // Connect client 56 | if err := ib.Connect(IB_HOST, IB_PORT, rand.Int63n(999999)); err != nil { 57 | log.Error().Err(err) 58 | return 59 | } 60 | 61 | // Create and place order 62 | id := 1 63 | eurusd := &ibapi.Contract{Symbol: "EUR", SecType: "CASH", Currency: "USD", Exchange: "IDEALPRO"} 64 | limitOrder := ibapi.LimitOrder("BUY", ibapi.StringToDecimal("20000"), 1.08) 65 | ib.PlaceOrder(id, eurusd, limitOrder) 66 | 67 | time.Sleep(1 * time.Second) 68 | 69 | err := ib.Disconnect() 70 | if err != nil { 71 | log.Error().Err(err).Msg("Disconnect") 72 | } 73 | } 74 | ``` 75 | 76 | For more information on how to use this package, please refer to the [GoDoc](https://pkg.go.dev/github.com/scmhub/ibapi) documentation. 77 | 78 | ## Acknowledgments 79 | 80 | - Some portions of the code were adapted from [hadrianl](https://github.com/hadrianl/ibapi). Thanks to them for their valuable work! 81 | - Decimals are implemented with the [fixed](https://github.com/robaho/fixed) package 82 | 83 | ## Notice of Non-Affiliation and Disclaimer 84 | 85 | > [!CAUTION] 86 | > Users are advised to thoroughly test the software in non-production environments before relying on it for live trading. Features may be incomplete, and bugs may exist. Use at your own risk. 87 | 88 | > [!IMPORTANT] 89 | > This project is **not affiliated** with Interactive Brokers Group, Inc. All references to Interactive Brokers, including trademarks, logos, and brand names, belong to their respective owners. The use of these names is purely for informational purposes and does not imply endorsement by Interactive Brokers. 90 | 91 | > [!IMPORTANT] 92 | > The authors of this package make **no guarantees** regarding the software's reliability, accuracy, or suitability for any particular purpose, including trading or financial decisions. **No liability** will be accepted for any financial losses, damages, or misinterpretations arising from the use of this software. 93 | 94 | ## License 95 | 96 | Distributed under the MIT License. See [LICENSE](./LICENSE) for more information. 97 | 98 | ## Author 99 | 100 | **Philippe Chavanne** - [contact](https://scm.cx/contact) 101 | -------------------------------------------------------------------------------- /protobuf/CancelPositions.pb.go: -------------------------------------------------------------------------------- 1 | // Code generated by protoc-gen-go. DO NOT EDIT. 2 | // versions: 3 | // protoc-gen-go v1.36.9 4 | // protoc v3.21.12 5 | // source: CancelPositions.proto 6 | 7 | package protobuf 8 | 9 | import ( 10 | protoreflect "google.golang.org/protobuf/reflect/protoreflect" 11 | protoimpl "google.golang.org/protobuf/runtime/protoimpl" 12 | reflect "reflect" 13 | sync "sync" 14 | unsafe "unsafe" 15 | ) 16 | 17 | const ( 18 | // Verify that this generated code is sufficiently up-to-date. 19 | _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) 20 | // Verify that runtime/protoimpl is sufficiently up-to-date. 21 | _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) 22 | ) 23 | 24 | type CancelPositions struct { 25 | state protoimpl.MessageState `protogen:"open.v1"` 26 | unknownFields protoimpl.UnknownFields 27 | sizeCache protoimpl.SizeCache 28 | } 29 | 30 | func (x *CancelPositions) Reset() { 31 | *x = CancelPositions{} 32 | mi := &file_CancelPositions_proto_msgTypes[0] 33 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 34 | ms.StoreMessageInfo(mi) 35 | } 36 | 37 | func (x *CancelPositions) String() string { 38 | return protoimpl.X.MessageStringOf(x) 39 | } 40 | 41 | func (*CancelPositions) ProtoMessage() {} 42 | 43 | func (x *CancelPositions) ProtoReflect() protoreflect.Message { 44 | mi := &file_CancelPositions_proto_msgTypes[0] 45 | if x != nil { 46 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 47 | if ms.LoadMessageInfo() == nil { 48 | ms.StoreMessageInfo(mi) 49 | } 50 | return ms 51 | } 52 | return mi.MessageOf(x) 53 | } 54 | 55 | // Deprecated: Use CancelPositions.ProtoReflect.Descriptor instead. 56 | func (*CancelPositions) Descriptor() ([]byte, []int) { 57 | return file_CancelPositions_proto_rawDescGZIP(), []int{0} 58 | } 59 | 60 | var File_CancelPositions_proto protoreflect.FileDescriptor 61 | 62 | const file_CancelPositions_proto_rawDesc = "" + 63 | "\n" + 64 | "\x15CancelPositions.proto\x12\bprotobuf\"\x11\n" + 65 | "\x0fCancelPositionsB\fZ\n" + 66 | ".;protobufb\x06proto3" 67 | 68 | var ( 69 | file_CancelPositions_proto_rawDescOnce sync.Once 70 | file_CancelPositions_proto_rawDescData []byte 71 | ) 72 | 73 | func file_CancelPositions_proto_rawDescGZIP() []byte { 74 | file_CancelPositions_proto_rawDescOnce.Do(func() { 75 | file_CancelPositions_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_CancelPositions_proto_rawDesc), len(file_CancelPositions_proto_rawDesc))) 76 | }) 77 | return file_CancelPositions_proto_rawDescData 78 | } 79 | 80 | var file_CancelPositions_proto_msgTypes = make([]protoimpl.MessageInfo, 1) 81 | var file_CancelPositions_proto_goTypes = []any{ 82 | (*CancelPositions)(nil), // 0: protobuf.CancelPositions 83 | } 84 | var file_CancelPositions_proto_depIdxs = []int32{ 85 | 0, // [0:0] is the sub-list for method output_type 86 | 0, // [0:0] is the sub-list for method input_type 87 | 0, // [0:0] is the sub-list for extension type_name 88 | 0, // [0:0] is the sub-list for extension extendee 89 | 0, // [0:0] is the sub-list for field type_name 90 | } 91 | 92 | func init() { file_CancelPositions_proto_init() } 93 | func file_CancelPositions_proto_init() { 94 | if File_CancelPositions_proto != nil { 95 | return 96 | } 97 | type x struct{} 98 | out := protoimpl.TypeBuilder{ 99 | File: protoimpl.DescBuilder{ 100 | GoPackagePath: reflect.TypeOf(x{}).PkgPath(), 101 | RawDescriptor: unsafe.Slice(unsafe.StringData(file_CancelPositions_proto_rawDesc), len(file_CancelPositions_proto_rawDesc)), 102 | NumEnums: 0, 103 | NumMessages: 1, 104 | NumExtensions: 0, 105 | NumServices: 0, 106 | }, 107 | GoTypes: file_CancelPositions_proto_goTypes, 108 | DependencyIndexes: file_CancelPositions_proto_depIdxs, 109 | MessageInfos: file_CancelPositions_proto_msgTypes, 110 | }.Build() 111 | File_CancelPositions_proto = out.File 112 | file_CancelPositions_proto_goTypes = nil 113 | file_CancelPositions_proto_depIdxs = nil 114 | } 115 | -------------------------------------------------------------------------------- /protobuf/PositionsRequest.pb.go: -------------------------------------------------------------------------------- 1 | // Code generated by protoc-gen-go. DO NOT EDIT. 2 | // versions: 3 | // protoc-gen-go v1.36.9 4 | // protoc v3.21.12 5 | // source: PositionsRequest.proto 6 | 7 | package protobuf 8 | 9 | import ( 10 | protoreflect "google.golang.org/protobuf/reflect/protoreflect" 11 | protoimpl "google.golang.org/protobuf/runtime/protoimpl" 12 | reflect "reflect" 13 | sync "sync" 14 | unsafe "unsafe" 15 | ) 16 | 17 | const ( 18 | // Verify that this generated code is sufficiently up-to-date. 19 | _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) 20 | // Verify that runtime/protoimpl is sufficiently up-to-date. 21 | _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) 22 | ) 23 | 24 | type PositionsRequest struct { 25 | state protoimpl.MessageState `protogen:"open.v1"` 26 | unknownFields protoimpl.UnknownFields 27 | sizeCache protoimpl.SizeCache 28 | } 29 | 30 | func (x *PositionsRequest) Reset() { 31 | *x = PositionsRequest{} 32 | mi := &file_PositionsRequest_proto_msgTypes[0] 33 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 34 | ms.StoreMessageInfo(mi) 35 | } 36 | 37 | func (x *PositionsRequest) String() string { 38 | return protoimpl.X.MessageStringOf(x) 39 | } 40 | 41 | func (*PositionsRequest) ProtoMessage() {} 42 | 43 | func (x *PositionsRequest) ProtoReflect() protoreflect.Message { 44 | mi := &file_PositionsRequest_proto_msgTypes[0] 45 | if x != nil { 46 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 47 | if ms.LoadMessageInfo() == nil { 48 | ms.StoreMessageInfo(mi) 49 | } 50 | return ms 51 | } 52 | return mi.MessageOf(x) 53 | } 54 | 55 | // Deprecated: Use PositionsRequest.ProtoReflect.Descriptor instead. 56 | func (*PositionsRequest) Descriptor() ([]byte, []int) { 57 | return file_PositionsRequest_proto_rawDescGZIP(), []int{0} 58 | } 59 | 60 | var File_PositionsRequest_proto protoreflect.FileDescriptor 61 | 62 | const file_PositionsRequest_proto_rawDesc = "" + 63 | "\n" + 64 | "\x16PositionsRequest.proto\x12\bprotobuf\"\x12\n" + 65 | "\x10PositionsRequestB\fZ\n" + 66 | ".;protobufb\x06proto3" 67 | 68 | var ( 69 | file_PositionsRequest_proto_rawDescOnce sync.Once 70 | file_PositionsRequest_proto_rawDescData []byte 71 | ) 72 | 73 | func file_PositionsRequest_proto_rawDescGZIP() []byte { 74 | file_PositionsRequest_proto_rawDescOnce.Do(func() { 75 | file_PositionsRequest_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_PositionsRequest_proto_rawDesc), len(file_PositionsRequest_proto_rawDesc))) 76 | }) 77 | return file_PositionsRequest_proto_rawDescData 78 | } 79 | 80 | var file_PositionsRequest_proto_msgTypes = make([]protoimpl.MessageInfo, 1) 81 | var file_PositionsRequest_proto_goTypes = []any{ 82 | (*PositionsRequest)(nil), // 0: protobuf.PositionsRequest 83 | } 84 | var file_PositionsRequest_proto_depIdxs = []int32{ 85 | 0, // [0:0] is the sub-list for method output_type 86 | 0, // [0:0] is the sub-list for method input_type 87 | 0, // [0:0] is the sub-list for extension type_name 88 | 0, // [0:0] is the sub-list for extension extendee 89 | 0, // [0:0] is the sub-list for field type_name 90 | } 91 | 92 | func init() { file_PositionsRequest_proto_init() } 93 | func file_PositionsRequest_proto_init() { 94 | if File_PositionsRequest_proto != nil { 95 | return 96 | } 97 | type x struct{} 98 | out := protoimpl.TypeBuilder{ 99 | File: protoimpl.DescBuilder{ 100 | GoPackagePath: reflect.TypeOf(x{}).PkgPath(), 101 | RawDescriptor: unsafe.Slice(unsafe.StringData(file_PositionsRequest_proto_rawDesc), len(file_PositionsRequest_proto_rawDesc)), 102 | NumEnums: 0, 103 | NumMessages: 1, 104 | NumExtensions: 0, 105 | NumServices: 0, 106 | }, 107 | GoTypes: file_PositionsRequest_proto_goTypes, 108 | DependencyIndexes: file_PositionsRequest_proto_depIdxs, 109 | MessageInfos: file_PositionsRequest_proto_msgTypes, 110 | }.Build() 111 | File_PositionsRequest_proto = out.File 112 | file_PositionsRequest_proto_goTypes = nil 113 | file_PositionsRequest_proto_depIdxs = nil 114 | } 115 | -------------------------------------------------------------------------------- /protobuf/OpenOrdersRequest.pb.go: -------------------------------------------------------------------------------- 1 | // Code generated by protoc-gen-go. DO NOT EDIT. 2 | // versions: 3 | // protoc-gen-go v1.36.9 4 | // protoc v3.21.12 5 | // source: OpenOrdersRequest.proto 6 | 7 | package protobuf 8 | 9 | import ( 10 | protoreflect "google.golang.org/protobuf/reflect/protoreflect" 11 | protoimpl "google.golang.org/protobuf/runtime/protoimpl" 12 | reflect "reflect" 13 | sync "sync" 14 | unsafe "unsafe" 15 | ) 16 | 17 | const ( 18 | // Verify that this generated code is sufficiently up-to-date. 19 | _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) 20 | // Verify that runtime/protoimpl is sufficiently up-to-date. 21 | _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) 22 | ) 23 | 24 | type OpenOrdersRequest struct { 25 | state protoimpl.MessageState `protogen:"open.v1"` 26 | unknownFields protoimpl.UnknownFields 27 | sizeCache protoimpl.SizeCache 28 | } 29 | 30 | func (x *OpenOrdersRequest) Reset() { 31 | *x = OpenOrdersRequest{} 32 | mi := &file_OpenOrdersRequest_proto_msgTypes[0] 33 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 34 | ms.StoreMessageInfo(mi) 35 | } 36 | 37 | func (x *OpenOrdersRequest) String() string { 38 | return protoimpl.X.MessageStringOf(x) 39 | } 40 | 41 | func (*OpenOrdersRequest) ProtoMessage() {} 42 | 43 | func (x *OpenOrdersRequest) ProtoReflect() protoreflect.Message { 44 | mi := &file_OpenOrdersRequest_proto_msgTypes[0] 45 | if x != nil { 46 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 47 | if ms.LoadMessageInfo() == nil { 48 | ms.StoreMessageInfo(mi) 49 | } 50 | return ms 51 | } 52 | return mi.MessageOf(x) 53 | } 54 | 55 | // Deprecated: Use OpenOrdersRequest.ProtoReflect.Descriptor instead. 56 | func (*OpenOrdersRequest) Descriptor() ([]byte, []int) { 57 | return file_OpenOrdersRequest_proto_rawDescGZIP(), []int{0} 58 | } 59 | 60 | var File_OpenOrdersRequest_proto protoreflect.FileDescriptor 61 | 62 | const file_OpenOrdersRequest_proto_rawDesc = "" + 63 | "\n" + 64 | "\x17OpenOrdersRequest.proto\x12\bprotobuf\"\x13\n" + 65 | "\x11OpenOrdersRequestB\fZ\n" + 66 | ".;protobufb\x06proto3" 67 | 68 | var ( 69 | file_OpenOrdersRequest_proto_rawDescOnce sync.Once 70 | file_OpenOrdersRequest_proto_rawDescData []byte 71 | ) 72 | 73 | func file_OpenOrdersRequest_proto_rawDescGZIP() []byte { 74 | file_OpenOrdersRequest_proto_rawDescOnce.Do(func() { 75 | file_OpenOrdersRequest_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_OpenOrdersRequest_proto_rawDesc), len(file_OpenOrdersRequest_proto_rawDesc))) 76 | }) 77 | return file_OpenOrdersRequest_proto_rawDescData 78 | } 79 | 80 | var file_OpenOrdersRequest_proto_msgTypes = make([]protoimpl.MessageInfo, 1) 81 | var file_OpenOrdersRequest_proto_goTypes = []any{ 82 | (*OpenOrdersRequest)(nil), // 0: protobuf.OpenOrdersRequest 83 | } 84 | var file_OpenOrdersRequest_proto_depIdxs = []int32{ 85 | 0, // [0:0] is the sub-list for method output_type 86 | 0, // [0:0] is the sub-list for method input_type 87 | 0, // [0:0] is the sub-list for extension type_name 88 | 0, // [0:0] is the sub-list for extension extendee 89 | 0, // [0:0] is the sub-list for field type_name 90 | } 91 | 92 | func init() { file_OpenOrdersRequest_proto_init() } 93 | func file_OpenOrdersRequest_proto_init() { 94 | if File_OpenOrdersRequest_proto != nil { 95 | return 96 | } 97 | type x struct{} 98 | out := protoimpl.TypeBuilder{ 99 | File: protoimpl.DescBuilder{ 100 | GoPackagePath: reflect.TypeOf(x{}).PkgPath(), 101 | RawDescriptor: unsafe.Slice(unsafe.StringData(file_OpenOrdersRequest_proto_rawDesc), len(file_OpenOrdersRequest_proto_rawDesc)), 102 | NumEnums: 0, 103 | NumMessages: 1, 104 | NumExtensions: 0, 105 | NumServices: 0, 106 | }, 107 | GoTypes: file_OpenOrdersRequest_proto_goTypes, 108 | DependencyIndexes: file_OpenOrdersRequest_proto_depIdxs, 109 | MessageInfos: file_OpenOrdersRequest_proto_msgTypes, 110 | }.Build() 111 | File_OpenOrdersRequest_proto = out.File 112 | file_OpenOrdersRequest_proto_goTypes = nil 113 | file_OpenOrdersRequest_proto_depIdxs = nil 114 | } 115 | -------------------------------------------------------------------------------- /protobuf/CompletedOrdersEnd.pb.go: -------------------------------------------------------------------------------- 1 | // Code generated by protoc-gen-go. DO NOT EDIT. 2 | // versions: 3 | // protoc-gen-go v1.36.9 4 | // protoc v3.21.12 5 | // source: CompletedOrdersEnd.proto 6 | 7 | package protobuf 8 | 9 | import ( 10 | protoreflect "google.golang.org/protobuf/reflect/protoreflect" 11 | protoimpl "google.golang.org/protobuf/runtime/protoimpl" 12 | reflect "reflect" 13 | sync "sync" 14 | unsafe "unsafe" 15 | ) 16 | 17 | const ( 18 | // Verify that this generated code is sufficiently up-to-date. 19 | _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) 20 | // Verify that runtime/protoimpl is sufficiently up-to-date. 21 | _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) 22 | ) 23 | 24 | type CompletedOrdersEnd struct { 25 | state protoimpl.MessageState `protogen:"open.v1"` 26 | unknownFields protoimpl.UnknownFields 27 | sizeCache protoimpl.SizeCache 28 | } 29 | 30 | func (x *CompletedOrdersEnd) Reset() { 31 | *x = CompletedOrdersEnd{} 32 | mi := &file_CompletedOrdersEnd_proto_msgTypes[0] 33 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 34 | ms.StoreMessageInfo(mi) 35 | } 36 | 37 | func (x *CompletedOrdersEnd) String() string { 38 | return protoimpl.X.MessageStringOf(x) 39 | } 40 | 41 | func (*CompletedOrdersEnd) ProtoMessage() {} 42 | 43 | func (x *CompletedOrdersEnd) ProtoReflect() protoreflect.Message { 44 | mi := &file_CompletedOrdersEnd_proto_msgTypes[0] 45 | if x != nil { 46 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 47 | if ms.LoadMessageInfo() == nil { 48 | ms.StoreMessageInfo(mi) 49 | } 50 | return ms 51 | } 52 | return mi.MessageOf(x) 53 | } 54 | 55 | // Deprecated: Use CompletedOrdersEnd.ProtoReflect.Descriptor instead. 56 | func (*CompletedOrdersEnd) Descriptor() ([]byte, []int) { 57 | return file_CompletedOrdersEnd_proto_rawDescGZIP(), []int{0} 58 | } 59 | 60 | var File_CompletedOrdersEnd_proto protoreflect.FileDescriptor 61 | 62 | const file_CompletedOrdersEnd_proto_rawDesc = "" + 63 | "\n" + 64 | "\x18CompletedOrdersEnd.proto\x12\bprotobuf\"\x14\n" + 65 | "\x12CompletedOrdersEndB\fZ\n" + 66 | ".;protobufb\x06proto3" 67 | 68 | var ( 69 | file_CompletedOrdersEnd_proto_rawDescOnce sync.Once 70 | file_CompletedOrdersEnd_proto_rawDescData []byte 71 | ) 72 | 73 | func file_CompletedOrdersEnd_proto_rawDescGZIP() []byte { 74 | file_CompletedOrdersEnd_proto_rawDescOnce.Do(func() { 75 | file_CompletedOrdersEnd_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_CompletedOrdersEnd_proto_rawDesc), len(file_CompletedOrdersEnd_proto_rawDesc))) 76 | }) 77 | return file_CompletedOrdersEnd_proto_rawDescData 78 | } 79 | 80 | var file_CompletedOrdersEnd_proto_msgTypes = make([]protoimpl.MessageInfo, 1) 81 | var file_CompletedOrdersEnd_proto_goTypes = []any{ 82 | (*CompletedOrdersEnd)(nil), // 0: protobuf.CompletedOrdersEnd 83 | } 84 | var file_CompletedOrdersEnd_proto_depIdxs = []int32{ 85 | 0, // [0:0] is the sub-list for method output_type 86 | 0, // [0:0] is the sub-list for method input_type 87 | 0, // [0:0] is the sub-list for extension type_name 88 | 0, // [0:0] is the sub-list for extension extendee 89 | 0, // [0:0] is the sub-list for field type_name 90 | } 91 | 92 | func init() { file_CompletedOrdersEnd_proto_init() } 93 | func file_CompletedOrdersEnd_proto_init() { 94 | if File_CompletedOrdersEnd_proto != nil { 95 | return 96 | } 97 | type x struct{} 98 | out := protoimpl.TypeBuilder{ 99 | File: protoimpl.DescBuilder{ 100 | GoPackagePath: reflect.TypeOf(x{}).PkgPath(), 101 | RawDescriptor: unsafe.Slice(unsafe.StringData(file_CompletedOrdersEnd_proto_rawDesc), len(file_CompletedOrdersEnd_proto_rawDesc)), 102 | NumEnums: 0, 103 | NumMessages: 1, 104 | NumExtensions: 0, 105 | NumServices: 0, 106 | }, 107 | GoTypes: file_CompletedOrdersEnd_proto_goTypes, 108 | DependencyIndexes: file_CompletedOrdersEnd_proto_depIdxs, 109 | MessageInfos: file_CompletedOrdersEnd_proto_msgTypes, 110 | }.Build() 111 | File_CompletedOrdersEnd_proto = out.File 112 | file_CompletedOrdersEnd_proto_goTypes = nil 113 | file_CompletedOrdersEnd_proto_depIdxs = nil 114 | } 115 | -------------------------------------------------------------------------------- /protobuf/CurrentTimeRequest.pb.go: -------------------------------------------------------------------------------- 1 | // Code generated by protoc-gen-go. DO NOT EDIT. 2 | // versions: 3 | // protoc-gen-go v1.36.9 4 | // protoc v3.21.12 5 | // source: CurrentTimeRequest.proto 6 | 7 | package protobuf 8 | 9 | import ( 10 | protoreflect "google.golang.org/protobuf/reflect/protoreflect" 11 | protoimpl "google.golang.org/protobuf/runtime/protoimpl" 12 | reflect "reflect" 13 | sync "sync" 14 | unsafe "unsafe" 15 | ) 16 | 17 | const ( 18 | // Verify that this generated code is sufficiently up-to-date. 19 | _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) 20 | // Verify that runtime/protoimpl is sufficiently up-to-date. 21 | _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) 22 | ) 23 | 24 | type CurrentTimeRequest struct { 25 | state protoimpl.MessageState `protogen:"open.v1"` 26 | unknownFields protoimpl.UnknownFields 27 | sizeCache protoimpl.SizeCache 28 | } 29 | 30 | func (x *CurrentTimeRequest) Reset() { 31 | *x = CurrentTimeRequest{} 32 | mi := &file_CurrentTimeRequest_proto_msgTypes[0] 33 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 34 | ms.StoreMessageInfo(mi) 35 | } 36 | 37 | func (x *CurrentTimeRequest) String() string { 38 | return protoimpl.X.MessageStringOf(x) 39 | } 40 | 41 | func (*CurrentTimeRequest) ProtoMessage() {} 42 | 43 | func (x *CurrentTimeRequest) ProtoReflect() protoreflect.Message { 44 | mi := &file_CurrentTimeRequest_proto_msgTypes[0] 45 | if x != nil { 46 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 47 | if ms.LoadMessageInfo() == nil { 48 | ms.StoreMessageInfo(mi) 49 | } 50 | return ms 51 | } 52 | return mi.MessageOf(x) 53 | } 54 | 55 | // Deprecated: Use CurrentTimeRequest.ProtoReflect.Descriptor instead. 56 | func (*CurrentTimeRequest) Descriptor() ([]byte, []int) { 57 | return file_CurrentTimeRequest_proto_rawDescGZIP(), []int{0} 58 | } 59 | 60 | var File_CurrentTimeRequest_proto protoreflect.FileDescriptor 61 | 62 | const file_CurrentTimeRequest_proto_rawDesc = "" + 63 | "\n" + 64 | "\x18CurrentTimeRequest.proto\x12\bprotobuf\"\x14\n" + 65 | "\x12CurrentTimeRequestB\fZ\n" + 66 | ".;protobufb\x06proto3" 67 | 68 | var ( 69 | file_CurrentTimeRequest_proto_rawDescOnce sync.Once 70 | file_CurrentTimeRequest_proto_rawDescData []byte 71 | ) 72 | 73 | func file_CurrentTimeRequest_proto_rawDescGZIP() []byte { 74 | file_CurrentTimeRequest_proto_rawDescOnce.Do(func() { 75 | file_CurrentTimeRequest_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_CurrentTimeRequest_proto_rawDesc), len(file_CurrentTimeRequest_proto_rawDesc))) 76 | }) 77 | return file_CurrentTimeRequest_proto_rawDescData 78 | } 79 | 80 | var file_CurrentTimeRequest_proto_msgTypes = make([]protoimpl.MessageInfo, 1) 81 | var file_CurrentTimeRequest_proto_goTypes = []any{ 82 | (*CurrentTimeRequest)(nil), // 0: protobuf.CurrentTimeRequest 83 | } 84 | var file_CurrentTimeRequest_proto_depIdxs = []int32{ 85 | 0, // [0:0] is the sub-list for method output_type 86 | 0, // [0:0] is the sub-list for method input_type 87 | 0, // [0:0] is the sub-list for extension type_name 88 | 0, // [0:0] is the sub-list for extension extendee 89 | 0, // [0:0] is the sub-list for field type_name 90 | } 91 | 92 | func init() { file_CurrentTimeRequest_proto_init() } 93 | func file_CurrentTimeRequest_proto_init() { 94 | if File_CurrentTimeRequest_proto != nil { 95 | return 96 | } 97 | type x struct{} 98 | out := protoimpl.TypeBuilder{ 99 | File: protoimpl.DescBuilder{ 100 | GoPackagePath: reflect.TypeOf(x{}).PkgPath(), 101 | RawDescriptor: unsafe.Slice(unsafe.StringData(file_CurrentTimeRequest_proto_rawDesc), len(file_CurrentTimeRequest_proto_rawDesc)), 102 | NumEnums: 0, 103 | NumMessages: 1, 104 | NumExtensions: 0, 105 | NumServices: 0, 106 | }, 107 | GoTypes: file_CurrentTimeRequest_proto_goTypes, 108 | DependencyIndexes: file_CurrentTimeRequest_proto_depIdxs, 109 | MessageInfos: file_CurrentTimeRequest_proto_msgTypes, 110 | }.Build() 111 | File_CurrentTimeRequest_proto = out.File 112 | file_CurrentTimeRequest_proto_goTypes = nil 113 | file_CurrentTimeRequest_proto_depIdxs = nil 114 | } 115 | -------------------------------------------------------------------------------- /protobuf/FamilyCodesRequest.pb.go: -------------------------------------------------------------------------------- 1 | // Code generated by protoc-gen-go. DO NOT EDIT. 2 | // versions: 3 | // protoc-gen-go v1.36.9 4 | // protoc v3.21.12 5 | // source: FamilyCodesRequest.proto 6 | 7 | package protobuf 8 | 9 | import ( 10 | protoreflect "google.golang.org/protobuf/reflect/protoreflect" 11 | protoimpl "google.golang.org/protobuf/runtime/protoimpl" 12 | reflect "reflect" 13 | sync "sync" 14 | unsafe "unsafe" 15 | ) 16 | 17 | const ( 18 | // Verify that this generated code is sufficiently up-to-date. 19 | _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) 20 | // Verify that runtime/protoimpl is sufficiently up-to-date. 21 | _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) 22 | ) 23 | 24 | type FamilyCodesRequest struct { 25 | state protoimpl.MessageState `protogen:"open.v1"` 26 | unknownFields protoimpl.UnknownFields 27 | sizeCache protoimpl.SizeCache 28 | } 29 | 30 | func (x *FamilyCodesRequest) Reset() { 31 | *x = FamilyCodesRequest{} 32 | mi := &file_FamilyCodesRequest_proto_msgTypes[0] 33 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 34 | ms.StoreMessageInfo(mi) 35 | } 36 | 37 | func (x *FamilyCodesRequest) String() string { 38 | return protoimpl.X.MessageStringOf(x) 39 | } 40 | 41 | func (*FamilyCodesRequest) ProtoMessage() {} 42 | 43 | func (x *FamilyCodesRequest) ProtoReflect() protoreflect.Message { 44 | mi := &file_FamilyCodesRequest_proto_msgTypes[0] 45 | if x != nil { 46 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 47 | if ms.LoadMessageInfo() == nil { 48 | ms.StoreMessageInfo(mi) 49 | } 50 | return ms 51 | } 52 | return mi.MessageOf(x) 53 | } 54 | 55 | // Deprecated: Use FamilyCodesRequest.ProtoReflect.Descriptor instead. 56 | func (*FamilyCodesRequest) Descriptor() ([]byte, []int) { 57 | return file_FamilyCodesRequest_proto_rawDescGZIP(), []int{0} 58 | } 59 | 60 | var File_FamilyCodesRequest_proto protoreflect.FileDescriptor 61 | 62 | const file_FamilyCodesRequest_proto_rawDesc = "" + 63 | "\n" + 64 | "\x18FamilyCodesRequest.proto\x12\bprotobuf\"\x14\n" + 65 | "\x12FamilyCodesRequestB\fZ\n" + 66 | ".;protobufb\x06proto3" 67 | 68 | var ( 69 | file_FamilyCodesRequest_proto_rawDescOnce sync.Once 70 | file_FamilyCodesRequest_proto_rawDescData []byte 71 | ) 72 | 73 | func file_FamilyCodesRequest_proto_rawDescGZIP() []byte { 74 | file_FamilyCodesRequest_proto_rawDescOnce.Do(func() { 75 | file_FamilyCodesRequest_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_FamilyCodesRequest_proto_rawDesc), len(file_FamilyCodesRequest_proto_rawDesc))) 76 | }) 77 | return file_FamilyCodesRequest_proto_rawDescData 78 | } 79 | 80 | var file_FamilyCodesRequest_proto_msgTypes = make([]protoimpl.MessageInfo, 1) 81 | var file_FamilyCodesRequest_proto_goTypes = []any{ 82 | (*FamilyCodesRequest)(nil), // 0: protobuf.FamilyCodesRequest 83 | } 84 | var file_FamilyCodesRequest_proto_depIdxs = []int32{ 85 | 0, // [0:0] is the sub-list for method output_type 86 | 0, // [0:0] is the sub-list for method input_type 87 | 0, // [0:0] is the sub-list for extension type_name 88 | 0, // [0:0] is the sub-list for extension extendee 89 | 0, // [0:0] is the sub-list for field type_name 90 | } 91 | 92 | func init() { file_FamilyCodesRequest_proto_init() } 93 | func file_FamilyCodesRequest_proto_init() { 94 | if File_FamilyCodesRequest_proto != nil { 95 | return 96 | } 97 | type x struct{} 98 | out := protoimpl.TypeBuilder{ 99 | File: protoimpl.DescBuilder{ 100 | GoPackagePath: reflect.TypeOf(x{}).PkgPath(), 101 | RawDescriptor: unsafe.Slice(unsafe.StringData(file_FamilyCodesRequest_proto_rawDesc), len(file_FamilyCodesRequest_proto_rawDesc)), 102 | NumEnums: 0, 103 | NumMessages: 1, 104 | NumExtensions: 0, 105 | NumServices: 0, 106 | }, 107 | GoTypes: file_FamilyCodesRequest_proto_goTypes, 108 | DependencyIndexes: file_FamilyCodesRequest_proto_depIdxs, 109 | MessageInfos: file_FamilyCodesRequest_proto_msgTypes, 110 | }.Build() 111 | File_FamilyCodesRequest_proto = out.File 112 | file_FamilyCodesRequest_proto_goTypes = nil 113 | file_FamilyCodesRequest_proto_depIdxs = nil 114 | } 115 | -------------------------------------------------------------------------------- /order_condition.go: -------------------------------------------------------------------------------- 1 | package ibapi 2 | 3 | /* 4 | ------------------------------------------------ 5 | ------------------------------------------------ 6 | OrderCondition 7 | ------------------------------------------------ 8 | OperatorCondition 9 | OrderCondition 10 | ------------------------------------------------ 11 | ContractCondition 12 | OperatorCondition 13 | ------------------------------------------------ 14 | ------------------------------------------------ 15 | PriceOrderCondition 16 | ContractCondition 17 | ------------------------------------------------ 18 | TimeOrderCondition 19 | OperatorCondition 20 | ------------------------------------------------ 21 | MarginOrderCondition 22 | OperatorCondition 23 | ------------------------------------------------ 24 | ExecutionOrderCondition 25 | OrderCondition 26 | ------------------------------------------------ 27 | VolumeOrderCondition 28 | ContractCondition 29 | ------------------------------------------------ 30 | PercentChangeOrderCondition 31 | ContractCondition 32 | ------------------------------------------------ 33 | ------------------------------------------------ 34 | */ 35 | 36 | type OrderConditionType = int64 37 | 38 | const ( 39 | PriceOrderCondition OrderConditionType = 1 40 | TimeOrderCondition OrderConditionType = 3 41 | MarginOrderCondition OrderConditionType = 4 42 | ExecutionOrderCondition OrderConditionType = 5 43 | VolumeOrderCondition OrderConditionType = 6 44 | PercentChangeOrderCondition OrderConditionType = 7 45 | ) 46 | 47 | type OrderCondition interface { 48 | Type() OrderConditionType 49 | TypeName() string 50 | IsConjunctionConnection() bool 51 | SetIsConjunctionConnection(bool) 52 | decode(*MsgBuffer) 53 | makeFields() []any 54 | } 55 | 56 | var _ OrderCondition = (*orderCondition)(nil) 57 | 58 | type orderCondition struct { 59 | condType OrderConditionType 60 | isConjunctionConnection bool 61 | } 62 | 63 | func newOrderCondition(condType OrderConditionType) *orderCondition { 64 | return &orderCondition{ 65 | condType: condType, 66 | isConjunctionConnection: true, 67 | } 68 | } 69 | 70 | func (oc orderCondition) Type() OrderConditionType { 71 | return oc.condType 72 | } 73 | 74 | func (oc orderCondition) TypeName() string { 75 | switch oc.condType { 76 | case PriceOrderCondition: 77 | return "Price" 78 | case TimeOrderCondition: 79 | return "Time" 80 | case MarginOrderCondition: 81 | return "Margin" 82 | case ExecutionOrderCondition: 83 | return "Execution" 84 | case VolumeOrderCondition: 85 | return "Volume" 86 | case PercentChangeOrderCondition: 87 | return "PercentChange" 88 | default: 89 | return "Unknown" 90 | } 91 | } 92 | 93 | func (oc *orderCondition) IsConjunctionConnection() bool { 94 | return oc.isConjunctionConnection 95 | } 96 | 97 | func (oc *orderCondition) SetIsConjunctionConnection(isConjunctionConnection bool) { 98 | oc.isConjunctionConnection = isConjunctionConnection 99 | } 100 | 101 | func (oc *orderCondition) decode(msgBuf *MsgBuffer) { 102 | connector := msgBuf.decodeString() 103 | oc.isConjunctionConnection = connector == "a" 104 | } 105 | 106 | func (oc orderCondition) makeFields() []any { 107 | if oc.isConjunctionConnection { 108 | return []any{"a"} 109 | } 110 | return []any{"o"} 111 | } 112 | 113 | func (oc orderCondition) String() string { 114 | if oc.isConjunctionConnection { 115 | return "" 116 | } 117 | return "" 118 | } 119 | 120 | func CreateOrderCondition(condType OrderConditionType) OrderCondition { 121 | var cond OrderCondition 122 | switch condType { 123 | case PriceOrderCondition: 124 | cond = newPriceCondition() 125 | case TimeOrderCondition: 126 | cond = newTimeCondition() 127 | case MarginOrderCondition: 128 | cond = newMarginCondition() 129 | case ExecutionOrderCondition: 130 | cond = newExecutionCondition() 131 | case VolumeOrderCondition: 132 | cond = newVolumeCondition() 133 | case PercentChangeOrderCondition: 134 | cond = newPercentChangeCondition() 135 | default: 136 | log.Panic().Msg("unknown OrderConditionType") 137 | } 138 | return cond 139 | } 140 | -------------------------------------------------------------------------------- /protobuf/CancelNewsBulletins.pb.go: -------------------------------------------------------------------------------- 1 | // Code generated by protoc-gen-go. DO NOT EDIT. 2 | // versions: 3 | // protoc-gen-go v1.36.9 4 | // protoc v3.21.12 5 | // source: CancelNewsBulletins.proto 6 | 7 | package protobuf 8 | 9 | import ( 10 | protoreflect "google.golang.org/protobuf/reflect/protoreflect" 11 | protoimpl "google.golang.org/protobuf/runtime/protoimpl" 12 | reflect "reflect" 13 | sync "sync" 14 | unsafe "unsafe" 15 | ) 16 | 17 | const ( 18 | // Verify that this generated code is sufficiently up-to-date. 19 | _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) 20 | // Verify that runtime/protoimpl is sufficiently up-to-date. 21 | _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) 22 | ) 23 | 24 | type CancelNewsBulletins struct { 25 | state protoimpl.MessageState `protogen:"open.v1"` 26 | unknownFields protoimpl.UnknownFields 27 | sizeCache protoimpl.SizeCache 28 | } 29 | 30 | func (x *CancelNewsBulletins) Reset() { 31 | *x = CancelNewsBulletins{} 32 | mi := &file_CancelNewsBulletins_proto_msgTypes[0] 33 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 34 | ms.StoreMessageInfo(mi) 35 | } 36 | 37 | func (x *CancelNewsBulletins) String() string { 38 | return protoimpl.X.MessageStringOf(x) 39 | } 40 | 41 | func (*CancelNewsBulletins) ProtoMessage() {} 42 | 43 | func (x *CancelNewsBulletins) ProtoReflect() protoreflect.Message { 44 | mi := &file_CancelNewsBulletins_proto_msgTypes[0] 45 | if x != nil { 46 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 47 | if ms.LoadMessageInfo() == nil { 48 | ms.StoreMessageInfo(mi) 49 | } 50 | return ms 51 | } 52 | return mi.MessageOf(x) 53 | } 54 | 55 | // Deprecated: Use CancelNewsBulletins.ProtoReflect.Descriptor instead. 56 | func (*CancelNewsBulletins) Descriptor() ([]byte, []int) { 57 | return file_CancelNewsBulletins_proto_rawDescGZIP(), []int{0} 58 | } 59 | 60 | var File_CancelNewsBulletins_proto protoreflect.FileDescriptor 61 | 62 | const file_CancelNewsBulletins_proto_rawDesc = "" + 63 | "\n" + 64 | "\x19CancelNewsBulletins.proto\x12\bprotobuf\"\x15\n" + 65 | "\x13CancelNewsBulletinsB\fZ\n" + 66 | ".;protobufb\x06proto3" 67 | 68 | var ( 69 | file_CancelNewsBulletins_proto_rawDescOnce sync.Once 70 | file_CancelNewsBulletins_proto_rawDescData []byte 71 | ) 72 | 73 | func file_CancelNewsBulletins_proto_rawDescGZIP() []byte { 74 | file_CancelNewsBulletins_proto_rawDescOnce.Do(func() { 75 | file_CancelNewsBulletins_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_CancelNewsBulletins_proto_rawDesc), len(file_CancelNewsBulletins_proto_rawDesc))) 76 | }) 77 | return file_CancelNewsBulletins_proto_rawDescData 78 | } 79 | 80 | var file_CancelNewsBulletins_proto_msgTypes = make([]protoimpl.MessageInfo, 1) 81 | var file_CancelNewsBulletins_proto_goTypes = []any{ 82 | (*CancelNewsBulletins)(nil), // 0: protobuf.CancelNewsBulletins 83 | } 84 | var file_CancelNewsBulletins_proto_depIdxs = []int32{ 85 | 0, // [0:0] is the sub-list for method output_type 86 | 0, // [0:0] is the sub-list for method input_type 87 | 0, // [0:0] is the sub-list for extension type_name 88 | 0, // [0:0] is the sub-list for extension extendee 89 | 0, // [0:0] is the sub-list for field type_name 90 | } 91 | 92 | func init() { file_CancelNewsBulletins_proto_init() } 93 | func file_CancelNewsBulletins_proto_init() { 94 | if File_CancelNewsBulletins_proto != nil { 95 | return 96 | } 97 | type x struct{} 98 | out := protoimpl.TypeBuilder{ 99 | File: protoimpl.DescBuilder{ 100 | GoPackagePath: reflect.TypeOf(x{}).PkgPath(), 101 | RawDescriptor: unsafe.Slice(unsafe.StringData(file_CancelNewsBulletins_proto_rawDesc), len(file_CancelNewsBulletins_proto_rawDesc)), 102 | NumEnums: 0, 103 | NumMessages: 1, 104 | NumExtensions: 0, 105 | NumServices: 0, 106 | }, 107 | GoTypes: file_CancelNewsBulletins_proto_goTypes, 108 | DependencyIndexes: file_CancelNewsBulletins_proto_depIdxs, 109 | MessageInfos: file_CancelNewsBulletins_proto_msgTypes, 110 | }.Build() 111 | File_CancelNewsBulletins_proto = out.File 112 | file_CancelNewsBulletins_proto_goTypes = nil 113 | file_CancelNewsBulletins_proto_depIdxs = nil 114 | } 115 | -------------------------------------------------------------------------------- /protobuf/CancelPnL.pb.go: -------------------------------------------------------------------------------- 1 | // Code generated by protoc-gen-go. DO NOT EDIT. 2 | // versions: 3 | // protoc-gen-go v1.36.9 4 | // protoc v3.21.12 5 | // source: CancelPnL.proto 6 | 7 | package protobuf 8 | 9 | import ( 10 | protoreflect "google.golang.org/protobuf/reflect/protoreflect" 11 | protoimpl "google.golang.org/protobuf/runtime/protoimpl" 12 | reflect "reflect" 13 | sync "sync" 14 | unsafe "unsafe" 15 | ) 16 | 17 | const ( 18 | // Verify that this generated code is sufficiently up-to-date. 19 | _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) 20 | // Verify that runtime/protoimpl is sufficiently up-to-date. 21 | _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) 22 | ) 23 | 24 | type CancelPnL struct { 25 | state protoimpl.MessageState `protogen:"open.v1"` 26 | ReqId *int32 `protobuf:"varint,1,opt,name=reqId,proto3,oneof" json:"reqId,omitempty"` 27 | unknownFields protoimpl.UnknownFields 28 | sizeCache protoimpl.SizeCache 29 | } 30 | 31 | func (x *CancelPnL) Reset() { 32 | *x = CancelPnL{} 33 | mi := &file_CancelPnL_proto_msgTypes[0] 34 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 35 | ms.StoreMessageInfo(mi) 36 | } 37 | 38 | func (x *CancelPnL) String() string { 39 | return protoimpl.X.MessageStringOf(x) 40 | } 41 | 42 | func (*CancelPnL) ProtoMessage() {} 43 | 44 | func (x *CancelPnL) ProtoReflect() protoreflect.Message { 45 | mi := &file_CancelPnL_proto_msgTypes[0] 46 | if x != nil { 47 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 48 | if ms.LoadMessageInfo() == nil { 49 | ms.StoreMessageInfo(mi) 50 | } 51 | return ms 52 | } 53 | return mi.MessageOf(x) 54 | } 55 | 56 | // Deprecated: Use CancelPnL.ProtoReflect.Descriptor instead. 57 | func (*CancelPnL) Descriptor() ([]byte, []int) { 58 | return file_CancelPnL_proto_rawDescGZIP(), []int{0} 59 | } 60 | 61 | func (x *CancelPnL) GetReqId() int32 { 62 | if x != nil && x.ReqId != nil { 63 | return *x.ReqId 64 | } 65 | return 0 66 | } 67 | 68 | var File_CancelPnL_proto protoreflect.FileDescriptor 69 | 70 | const file_CancelPnL_proto_rawDesc = "" + 71 | "\n" + 72 | "\x0fCancelPnL.proto\x12\bprotobuf\"0\n" + 73 | "\tCancelPnL\x12\x19\n" + 74 | "\x05reqId\x18\x01 \x01(\x05H\x00R\x05reqId\x88\x01\x01B\b\n" + 75 | "\x06_reqIdB\fZ\n" + 76 | ".;protobufb\x06proto3" 77 | 78 | var ( 79 | file_CancelPnL_proto_rawDescOnce sync.Once 80 | file_CancelPnL_proto_rawDescData []byte 81 | ) 82 | 83 | func file_CancelPnL_proto_rawDescGZIP() []byte { 84 | file_CancelPnL_proto_rawDescOnce.Do(func() { 85 | file_CancelPnL_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_CancelPnL_proto_rawDesc), len(file_CancelPnL_proto_rawDesc))) 86 | }) 87 | return file_CancelPnL_proto_rawDescData 88 | } 89 | 90 | var file_CancelPnL_proto_msgTypes = make([]protoimpl.MessageInfo, 1) 91 | var file_CancelPnL_proto_goTypes = []any{ 92 | (*CancelPnL)(nil), // 0: protobuf.CancelPnL 93 | } 94 | var file_CancelPnL_proto_depIdxs = []int32{ 95 | 0, // [0:0] is the sub-list for method output_type 96 | 0, // [0:0] is the sub-list for method input_type 97 | 0, // [0:0] is the sub-list for extension type_name 98 | 0, // [0:0] is the sub-list for extension extendee 99 | 0, // [0:0] is the sub-list for field type_name 100 | } 101 | 102 | func init() { file_CancelPnL_proto_init() } 103 | func file_CancelPnL_proto_init() { 104 | if File_CancelPnL_proto != nil { 105 | return 106 | } 107 | file_CancelPnL_proto_msgTypes[0].OneofWrappers = []any{} 108 | type x struct{} 109 | out := protoimpl.TypeBuilder{ 110 | File: protoimpl.DescBuilder{ 111 | GoPackagePath: reflect.TypeOf(x{}).PkgPath(), 112 | RawDescriptor: unsafe.Slice(unsafe.StringData(file_CancelPnL_proto_rawDesc), len(file_CancelPnL_proto_rawDesc)), 113 | NumEnums: 0, 114 | NumMessages: 1, 115 | NumExtensions: 0, 116 | NumServices: 0, 117 | }, 118 | GoTypes: file_CancelPnL_proto_goTypes, 119 | DependencyIndexes: file_CancelPnL_proto_depIdxs, 120 | MessageInfos: file_CancelPnL_proto_msgTypes, 121 | }.Build() 122 | File_CancelPnL_proto = out.File 123 | file_CancelPnL_proto_goTypes = nil 124 | file_CancelPnL_proto_depIdxs = nil 125 | } 126 | -------------------------------------------------------------------------------- /protobuf/AllOpenOrdersRequest.pb.go: -------------------------------------------------------------------------------- 1 | // Code generated by protoc-gen-go. DO NOT EDIT. 2 | // versions: 3 | // protoc-gen-go v1.36.9 4 | // protoc v3.21.12 5 | // source: AllOpenOrdersRequest.proto 6 | 7 | package protobuf 8 | 9 | import ( 10 | protoreflect "google.golang.org/protobuf/reflect/protoreflect" 11 | protoimpl "google.golang.org/protobuf/runtime/protoimpl" 12 | reflect "reflect" 13 | sync "sync" 14 | unsafe "unsafe" 15 | ) 16 | 17 | const ( 18 | // Verify that this generated code is sufficiently up-to-date. 19 | _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) 20 | // Verify that runtime/protoimpl is sufficiently up-to-date. 21 | _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) 22 | ) 23 | 24 | type AllOpenOrdersRequest struct { 25 | state protoimpl.MessageState `protogen:"open.v1"` 26 | unknownFields protoimpl.UnknownFields 27 | sizeCache protoimpl.SizeCache 28 | } 29 | 30 | func (x *AllOpenOrdersRequest) Reset() { 31 | *x = AllOpenOrdersRequest{} 32 | mi := &file_AllOpenOrdersRequest_proto_msgTypes[0] 33 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 34 | ms.StoreMessageInfo(mi) 35 | } 36 | 37 | func (x *AllOpenOrdersRequest) String() string { 38 | return protoimpl.X.MessageStringOf(x) 39 | } 40 | 41 | func (*AllOpenOrdersRequest) ProtoMessage() {} 42 | 43 | func (x *AllOpenOrdersRequest) ProtoReflect() protoreflect.Message { 44 | mi := &file_AllOpenOrdersRequest_proto_msgTypes[0] 45 | if x != nil { 46 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 47 | if ms.LoadMessageInfo() == nil { 48 | ms.StoreMessageInfo(mi) 49 | } 50 | return ms 51 | } 52 | return mi.MessageOf(x) 53 | } 54 | 55 | // Deprecated: Use AllOpenOrdersRequest.ProtoReflect.Descriptor instead. 56 | func (*AllOpenOrdersRequest) Descriptor() ([]byte, []int) { 57 | return file_AllOpenOrdersRequest_proto_rawDescGZIP(), []int{0} 58 | } 59 | 60 | var File_AllOpenOrdersRequest_proto protoreflect.FileDescriptor 61 | 62 | const file_AllOpenOrdersRequest_proto_rawDesc = "" + 63 | "\n" + 64 | "\x1aAllOpenOrdersRequest.proto\x12\bprotobuf\"\x16\n" + 65 | "\x14AllOpenOrdersRequestB\fZ\n" + 66 | ".;protobufb\x06proto3" 67 | 68 | var ( 69 | file_AllOpenOrdersRequest_proto_rawDescOnce sync.Once 70 | file_AllOpenOrdersRequest_proto_rawDescData []byte 71 | ) 72 | 73 | func file_AllOpenOrdersRequest_proto_rawDescGZIP() []byte { 74 | file_AllOpenOrdersRequest_proto_rawDescOnce.Do(func() { 75 | file_AllOpenOrdersRequest_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_AllOpenOrdersRequest_proto_rawDesc), len(file_AllOpenOrdersRequest_proto_rawDesc))) 76 | }) 77 | return file_AllOpenOrdersRequest_proto_rawDescData 78 | } 79 | 80 | var file_AllOpenOrdersRequest_proto_msgTypes = make([]protoimpl.MessageInfo, 1) 81 | var file_AllOpenOrdersRequest_proto_goTypes = []any{ 82 | (*AllOpenOrdersRequest)(nil), // 0: protobuf.AllOpenOrdersRequest 83 | } 84 | var file_AllOpenOrdersRequest_proto_depIdxs = []int32{ 85 | 0, // [0:0] is the sub-list for method output_type 86 | 0, // [0:0] is the sub-list for method input_type 87 | 0, // [0:0] is the sub-list for extension type_name 88 | 0, // [0:0] is the sub-list for extension extendee 89 | 0, // [0:0] is the sub-list for field type_name 90 | } 91 | 92 | func init() { file_AllOpenOrdersRequest_proto_init() } 93 | func file_AllOpenOrdersRequest_proto_init() { 94 | if File_AllOpenOrdersRequest_proto != nil { 95 | return 96 | } 97 | type x struct{} 98 | out := protoimpl.TypeBuilder{ 99 | File: protoimpl.DescBuilder{ 100 | GoPackagePath: reflect.TypeOf(x{}).PkgPath(), 101 | RawDescriptor: unsafe.Slice(unsafe.StringData(file_AllOpenOrdersRequest_proto_rawDesc), len(file_AllOpenOrdersRequest_proto_rawDesc)), 102 | NumEnums: 0, 103 | NumMessages: 1, 104 | NumExtensions: 0, 105 | NumServices: 0, 106 | }, 107 | GoTypes: file_AllOpenOrdersRequest_proto_goTypes, 108 | DependencyIndexes: file_AllOpenOrdersRequest_proto_depIdxs, 109 | MessageInfos: file_AllOpenOrdersRequest_proto_msgTypes, 110 | }.Build() 111 | File_AllOpenOrdersRequest_proto = out.File 112 | file_AllOpenOrdersRequest_proto_goTypes = nil 113 | file_AllOpenOrdersRequest_proto_depIdxs = nil 114 | } 115 | -------------------------------------------------------------------------------- /protobuf/NewsProvidersRequest.pb.go: -------------------------------------------------------------------------------- 1 | // Code generated by protoc-gen-go. DO NOT EDIT. 2 | // versions: 3 | // protoc-gen-go v1.36.9 4 | // protoc v3.21.12 5 | // source: NewsProvidersRequest.proto 6 | 7 | package protobuf 8 | 9 | import ( 10 | protoreflect "google.golang.org/protobuf/reflect/protoreflect" 11 | protoimpl "google.golang.org/protobuf/runtime/protoimpl" 12 | reflect "reflect" 13 | sync "sync" 14 | unsafe "unsafe" 15 | ) 16 | 17 | const ( 18 | // Verify that this generated code is sufficiently up-to-date. 19 | _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) 20 | // Verify that runtime/protoimpl is sufficiently up-to-date. 21 | _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) 22 | ) 23 | 24 | type NewsProvidersRequest struct { 25 | state protoimpl.MessageState `protogen:"open.v1"` 26 | unknownFields protoimpl.UnknownFields 27 | sizeCache protoimpl.SizeCache 28 | } 29 | 30 | func (x *NewsProvidersRequest) Reset() { 31 | *x = NewsProvidersRequest{} 32 | mi := &file_NewsProvidersRequest_proto_msgTypes[0] 33 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 34 | ms.StoreMessageInfo(mi) 35 | } 36 | 37 | func (x *NewsProvidersRequest) String() string { 38 | return protoimpl.X.MessageStringOf(x) 39 | } 40 | 41 | func (*NewsProvidersRequest) ProtoMessage() {} 42 | 43 | func (x *NewsProvidersRequest) ProtoReflect() protoreflect.Message { 44 | mi := &file_NewsProvidersRequest_proto_msgTypes[0] 45 | if x != nil { 46 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 47 | if ms.LoadMessageInfo() == nil { 48 | ms.StoreMessageInfo(mi) 49 | } 50 | return ms 51 | } 52 | return mi.MessageOf(x) 53 | } 54 | 55 | // Deprecated: Use NewsProvidersRequest.ProtoReflect.Descriptor instead. 56 | func (*NewsProvidersRequest) Descriptor() ([]byte, []int) { 57 | return file_NewsProvidersRequest_proto_rawDescGZIP(), []int{0} 58 | } 59 | 60 | var File_NewsProvidersRequest_proto protoreflect.FileDescriptor 61 | 62 | const file_NewsProvidersRequest_proto_rawDesc = "" + 63 | "\n" + 64 | "\x1aNewsProvidersRequest.proto\x12\bprotobuf\"\x16\n" + 65 | "\x14NewsProvidersRequestB\fZ\n" + 66 | ".;protobufb\x06proto3" 67 | 68 | var ( 69 | file_NewsProvidersRequest_proto_rawDescOnce sync.Once 70 | file_NewsProvidersRequest_proto_rawDescData []byte 71 | ) 72 | 73 | func file_NewsProvidersRequest_proto_rawDescGZIP() []byte { 74 | file_NewsProvidersRequest_proto_rawDescOnce.Do(func() { 75 | file_NewsProvidersRequest_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_NewsProvidersRequest_proto_rawDesc), len(file_NewsProvidersRequest_proto_rawDesc))) 76 | }) 77 | return file_NewsProvidersRequest_proto_rawDescData 78 | } 79 | 80 | var file_NewsProvidersRequest_proto_msgTypes = make([]protoimpl.MessageInfo, 1) 81 | var file_NewsProvidersRequest_proto_goTypes = []any{ 82 | (*NewsProvidersRequest)(nil), // 0: protobuf.NewsProvidersRequest 83 | } 84 | var file_NewsProvidersRequest_proto_depIdxs = []int32{ 85 | 0, // [0:0] is the sub-list for method output_type 86 | 0, // [0:0] is the sub-list for method input_type 87 | 0, // [0:0] is the sub-list for extension type_name 88 | 0, // [0:0] is the sub-list for extension extendee 89 | 0, // [0:0] is the sub-list for field type_name 90 | } 91 | 92 | func init() { file_NewsProvidersRequest_proto_init() } 93 | func file_NewsProvidersRequest_proto_init() { 94 | if File_NewsProvidersRequest_proto != nil { 95 | return 96 | } 97 | type x struct{} 98 | out := protoimpl.TypeBuilder{ 99 | File: protoimpl.DescBuilder{ 100 | GoPackagePath: reflect.TypeOf(x{}).PkgPath(), 101 | RawDescriptor: unsafe.Slice(unsafe.StringData(file_NewsProvidersRequest_proto_rawDesc), len(file_NewsProvidersRequest_proto_rawDesc)), 102 | NumEnums: 0, 103 | NumMessages: 1, 104 | NumExtensions: 0, 105 | NumServices: 0, 106 | }, 107 | GoTypes: file_NewsProvidersRequest_proto_goTypes, 108 | DependencyIndexes: file_NewsProvidersRequest_proto_depIdxs, 109 | MessageInfos: file_NewsProvidersRequest_proto_msgTypes, 110 | }.Build() 111 | File_NewsProvidersRequest_proto = out.File 112 | file_NewsProvidersRequest_proto_goTypes = nil 113 | file_NewsProvidersRequest_proto_depIdxs = nil 114 | } 115 | -------------------------------------------------------------------------------- /protobuf/FARequest.pb.go: -------------------------------------------------------------------------------- 1 | // Code generated by protoc-gen-go. DO NOT EDIT. 2 | // versions: 3 | // protoc-gen-go v1.36.9 4 | // protoc v3.21.12 5 | // source: FARequest.proto 6 | 7 | package protobuf 8 | 9 | import ( 10 | protoreflect "google.golang.org/protobuf/reflect/protoreflect" 11 | protoimpl "google.golang.org/protobuf/runtime/protoimpl" 12 | reflect "reflect" 13 | sync "sync" 14 | unsafe "unsafe" 15 | ) 16 | 17 | const ( 18 | // Verify that this generated code is sufficiently up-to-date. 19 | _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) 20 | // Verify that runtime/protoimpl is sufficiently up-to-date. 21 | _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) 22 | ) 23 | 24 | type FARequest struct { 25 | state protoimpl.MessageState `protogen:"open.v1"` 26 | FaDataType *int32 `protobuf:"varint,1,opt,name=faDataType,proto3,oneof" json:"faDataType,omitempty"` 27 | unknownFields protoimpl.UnknownFields 28 | sizeCache protoimpl.SizeCache 29 | } 30 | 31 | func (x *FARequest) Reset() { 32 | *x = FARequest{} 33 | mi := &file_FARequest_proto_msgTypes[0] 34 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 35 | ms.StoreMessageInfo(mi) 36 | } 37 | 38 | func (x *FARequest) String() string { 39 | return protoimpl.X.MessageStringOf(x) 40 | } 41 | 42 | func (*FARequest) ProtoMessage() {} 43 | 44 | func (x *FARequest) ProtoReflect() protoreflect.Message { 45 | mi := &file_FARequest_proto_msgTypes[0] 46 | if x != nil { 47 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 48 | if ms.LoadMessageInfo() == nil { 49 | ms.StoreMessageInfo(mi) 50 | } 51 | return ms 52 | } 53 | return mi.MessageOf(x) 54 | } 55 | 56 | // Deprecated: Use FARequest.ProtoReflect.Descriptor instead. 57 | func (*FARequest) Descriptor() ([]byte, []int) { 58 | return file_FARequest_proto_rawDescGZIP(), []int{0} 59 | } 60 | 61 | func (x *FARequest) GetFaDataType() int32 { 62 | if x != nil && x.FaDataType != nil { 63 | return *x.FaDataType 64 | } 65 | return 0 66 | } 67 | 68 | var File_FARequest_proto protoreflect.FileDescriptor 69 | 70 | const file_FARequest_proto_rawDesc = "" + 71 | "\n" + 72 | "\x0fFARequest.proto\x12\bprotobuf\"?\n" + 73 | "\tFARequest\x12#\n" + 74 | "\n" + 75 | "faDataType\x18\x01 \x01(\x05H\x00R\n" + 76 | "faDataType\x88\x01\x01B\r\n" + 77 | "\v_faDataTypeB\fZ\n" + 78 | ".;protobufb\x06proto3" 79 | 80 | var ( 81 | file_FARequest_proto_rawDescOnce sync.Once 82 | file_FARequest_proto_rawDescData []byte 83 | ) 84 | 85 | func file_FARequest_proto_rawDescGZIP() []byte { 86 | file_FARequest_proto_rawDescOnce.Do(func() { 87 | file_FARequest_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_FARequest_proto_rawDesc), len(file_FARequest_proto_rawDesc))) 88 | }) 89 | return file_FARequest_proto_rawDescData 90 | } 91 | 92 | var file_FARequest_proto_msgTypes = make([]protoimpl.MessageInfo, 1) 93 | var file_FARequest_proto_goTypes = []any{ 94 | (*FARequest)(nil), // 0: protobuf.FARequest 95 | } 96 | var file_FARequest_proto_depIdxs = []int32{ 97 | 0, // [0:0] is the sub-list for method output_type 98 | 0, // [0:0] is the sub-list for method input_type 99 | 0, // [0:0] is the sub-list for extension type_name 100 | 0, // [0:0] is the sub-list for extension extendee 101 | 0, // [0:0] is the sub-list for field type_name 102 | } 103 | 104 | func init() { file_FARequest_proto_init() } 105 | func file_FARequest_proto_init() { 106 | if File_FARequest_proto != nil { 107 | return 108 | } 109 | file_FARequest_proto_msgTypes[0].OneofWrappers = []any{} 110 | type x struct{} 111 | out := protoimpl.TypeBuilder{ 112 | File: protoimpl.DescBuilder{ 113 | GoPackagePath: reflect.TypeOf(x{}).PkgPath(), 114 | RawDescriptor: unsafe.Slice(unsafe.StringData(file_FARequest_proto_rawDesc), len(file_FARequest_proto_rawDesc)), 115 | NumEnums: 0, 116 | NumMessages: 1, 117 | NumExtensions: 0, 118 | NumServices: 0, 119 | }, 120 | GoTypes: file_FARequest_proto_goTypes, 121 | DependencyIndexes: file_FARequest_proto_depIdxs, 122 | MessageInfos: file_FARequest_proto_msgTypes, 123 | }.Build() 124 | File_FARequest_proto = out.File 125 | file_FARequest_proto_goTypes = nil 126 | file_FARequest_proto_depIdxs = nil 127 | } 128 | -------------------------------------------------------------------------------- /protobuf/IdsRequest.pb.go: -------------------------------------------------------------------------------- 1 | // Code generated by protoc-gen-go. DO NOT EDIT. 2 | // versions: 3 | // protoc-gen-go v1.36.9 4 | // protoc v3.21.12 5 | // source: IdsRequest.proto 6 | 7 | package protobuf 8 | 9 | import ( 10 | protoreflect "google.golang.org/protobuf/reflect/protoreflect" 11 | protoimpl "google.golang.org/protobuf/runtime/protoimpl" 12 | reflect "reflect" 13 | sync "sync" 14 | unsafe "unsafe" 15 | ) 16 | 17 | const ( 18 | // Verify that this generated code is sufficiently up-to-date. 19 | _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) 20 | // Verify that runtime/protoimpl is sufficiently up-to-date. 21 | _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) 22 | ) 23 | 24 | type IdsRequest struct { 25 | state protoimpl.MessageState `protogen:"open.v1"` 26 | NumIds *int32 `protobuf:"varint,1,opt,name=numIds,proto3,oneof" json:"numIds,omitempty"` 27 | unknownFields protoimpl.UnknownFields 28 | sizeCache protoimpl.SizeCache 29 | } 30 | 31 | func (x *IdsRequest) Reset() { 32 | *x = IdsRequest{} 33 | mi := &file_IdsRequest_proto_msgTypes[0] 34 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 35 | ms.StoreMessageInfo(mi) 36 | } 37 | 38 | func (x *IdsRequest) String() string { 39 | return protoimpl.X.MessageStringOf(x) 40 | } 41 | 42 | func (*IdsRequest) ProtoMessage() {} 43 | 44 | func (x *IdsRequest) ProtoReflect() protoreflect.Message { 45 | mi := &file_IdsRequest_proto_msgTypes[0] 46 | if x != nil { 47 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 48 | if ms.LoadMessageInfo() == nil { 49 | ms.StoreMessageInfo(mi) 50 | } 51 | return ms 52 | } 53 | return mi.MessageOf(x) 54 | } 55 | 56 | // Deprecated: Use IdsRequest.ProtoReflect.Descriptor instead. 57 | func (*IdsRequest) Descriptor() ([]byte, []int) { 58 | return file_IdsRequest_proto_rawDescGZIP(), []int{0} 59 | } 60 | 61 | func (x *IdsRequest) GetNumIds() int32 { 62 | if x != nil && x.NumIds != nil { 63 | return *x.NumIds 64 | } 65 | return 0 66 | } 67 | 68 | var File_IdsRequest_proto protoreflect.FileDescriptor 69 | 70 | const file_IdsRequest_proto_rawDesc = "" + 71 | "\n" + 72 | "\x10IdsRequest.proto\x12\bprotobuf\"4\n" + 73 | "\n" + 74 | "IdsRequest\x12\x1b\n" + 75 | "\x06numIds\x18\x01 \x01(\x05H\x00R\x06numIds\x88\x01\x01B\t\n" + 76 | "\a_numIdsB\fZ\n" + 77 | ".;protobufb\x06proto3" 78 | 79 | var ( 80 | file_IdsRequest_proto_rawDescOnce sync.Once 81 | file_IdsRequest_proto_rawDescData []byte 82 | ) 83 | 84 | func file_IdsRequest_proto_rawDescGZIP() []byte { 85 | file_IdsRequest_proto_rawDescOnce.Do(func() { 86 | file_IdsRequest_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_IdsRequest_proto_rawDesc), len(file_IdsRequest_proto_rawDesc))) 87 | }) 88 | return file_IdsRequest_proto_rawDescData 89 | } 90 | 91 | var file_IdsRequest_proto_msgTypes = make([]protoimpl.MessageInfo, 1) 92 | var file_IdsRequest_proto_goTypes = []any{ 93 | (*IdsRequest)(nil), // 0: protobuf.IdsRequest 94 | } 95 | var file_IdsRequest_proto_depIdxs = []int32{ 96 | 0, // [0:0] is the sub-list for method output_type 97 | 0, // [0:0] is the sub-list for method input_type 98 | 0, // [0:0] is the sub-list for extension type_name 99 | 0, // [0:0] is the sub-list for extension extendee 100 | 0, // [0:0] is the sub-list for field type_name 101 | } 102 | 103 | func init() { file_IdsRequest_proto_init() } 104 | func file_IdsRequest_proto_init() { 105 | if File_IdsRequest_proto != nil { 106 | return 107 | } 108 | file_IdsRequest_proto_msgTypes[0].OneofWrappers = []any{} 109 | type x struct{} 110 | out := protoimpl.TypeBuilder{ 111 | File: protoimpl.DescBuilder{ 112 | GoPackagePath: reflect.TypeOf(x{}).PkgPath(), 113 | RawDescriptor: unsafe.Slice(unsafe.StringData(file_IdsRequest_proto_rawDesc), len(file_IdsRequest_proto_rawDesc)), 114 | NumEnums: 0, 115 | NumMessages: 1, 116 | NumExtensions: 0, 117 | NumServices: 0, 118 | }, 119 | GoTypes: file_IdsRequest_proto_goTypes, 120 | DependencyIndexes: file_IdsRequest_proto_depIdxs, 121 | MessageInfos: file_IdsRequest_proto_msgTypes, 122 | }.Build() 123 | File_IdsRequest_proto = out.File 124 | file_IdsRequest_proto_goTypes = nil 125 | file_IdsRequest_proto_depIdxs = nil 126 | } 127 | -------------------------------------------------------------------------------- /protobuf/ManagedAccountsRequest.pb.go: -------------------------------------------------------------------------------- 1 | // Code generated by protoc-gen-go. DO NOT EDIT. 2 | // versions: 3 | // protoc-gen-go v1.36.9 4 | // protoc v3.21.12 5 | // source: ManagedAccountsRequest.proto 6 | 7 | package protobuf 8 | 9 | import ( 10 | protoreflect "google.golang.org/protobuf/reflect/protoreflect" 11 | protoimpl "google.golang.org/protobuf/runtime/protoimpl" 12 | reflect "reflect" 13 | sync "sync" 14 | unsafe "unsafe" 15 | ) 16 | 17 | const ( 18 | // Verify that this generated code is sufficiently up-to-date. 19 | _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) 20 | // Verify that runtime/protoimpl is sufficiently up-to-date. 21 | _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) 22 | ) 23 | 24 | type ManagedAccountsRequest struct { 25 | state protoimpl.MessageState `protogen:"open.v1"` 26 | unknownFields protoimpl.UnknownFields 27 | sizeCache protoimpl.SizeCache 28 | } 29 | 30 | func (x *ManagedAccountsRequest) Reset() { 31 | *x = ManagedAccountsRequest{} 32 | mi := &file_ManagedAccountsRequest_proto_msgTypes[0] 33 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 34 | ms.StoreMessageInfo(mi) 35 | } 36 | 37 | func (x *ManagedAccountsRequest) String() string { 38 | return protoimpl.X.MessageStringOf(x) 39 | } 40 | 41 | func (*ManagedAccountsRequest) ProtoMessage() {} 42 | 43 | func (x *ManagedAccountsRequest) ProtoReflect() protoreflect.Message { 44 | mi := &file_ManagedAccountsRequest_proto_msgTypes[0] 45 | if x != nil { 46 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 47 | if ms.LoadMessageInfo() == nil { 48 | ms.StoreMessageInfo(mi) 49 | } 50 | return ms 51 | } 52 | return mi.MessageOf(x) 53 | } 54 | 55 | // Deprecated: Use ManagedAccountsRequest.ProtoReflect.Descriptor instead. 56 | func (*ManagedAccountsRequest) Descriptor() ([]byte, []int) { 57 | return file_ManagedAccountsRequest_proto_rawDescGZIP(), []int{0} 58 | } 59 | 60 | var File_ManagedAccountsRequest_proto protoreflect.FileDescriptor 61 | 62 | const file_ManagedAccountsRequest_proto_rawDesc = "" + 63 | "\n" + 64 | "\x1cManagedAccountsRequest.proto\x12\bprotobuf\"\x18\n" + 65 | "\x16ManagedAccountsRequestB\fZ\n" + 66 | ".;protobufb\x06proto3" 67 | 68 | var ( 69 | file_ManagedAccountsRequest_proto_rawDescOnce sync.Once 70 | file_ManagedAccountsRequest_proto_rawDescData []byte 71 | ) 72 | 73 | func file_ManagedAccountsRequest_proto_rawDescGZIP() []byte { 74 | file_ManagedAccountsRequest_proto_rawDescOnce.Do(func() { 75 | file_ManagedAccountsRequest_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_ManagedAccountsRequest_proto_rawDesc), len(file_ManagedAccountsRequest_proto_rawDesc))) 76 | }) 77 | return file_ManagedAccountsRequest_proto_rawDescData 78 | } 79 | 80 | var file_ManagedAccountsRequest_proto_msgTypes = make([]protoimpl.MessageInfo, 1) 81 | var file_ManagedAccountsRequest_proto_goTypes = []any{ 82 | (*ManagedAccountsRequest)(nil), // 0: protobuf.ManagedAccountsRequest 83 | } 84 | var file_ManagedAccountsRequest_proto_depIdxs = []int32{ 85 | 0, // [0:0] is the sub-list for method output_type 86 | 0, // [0:0] is the sub-list for method input_type 87 | 0, // [0:0] is the sub-list for extension type_name 88 | 0, // [0:0] is the sub-list for extension extendee 89 | 0, // [0:0] is the sub-list for field type_name 90 | } 91 | 92 | func init() { file_ManagedAccountsRequest_proto_init() } 93 | func file_ManagedAccountsRequest_proto_init() { 94 | if File_ManagedAccountsRequest_proto != nil { 95 | return 96 | } 97 | type x struct{} 98 | out := protoimpl.TypeBuilder{ 99 | File: protoimpl.DescBuilder{ 100 | GoPackagePath: reflect.TypeOf(x{}).PkgPath(), 101 | RawDescriptor: unsafe.Slice(unsafe.StringData(file_ManagedAccountsRequest_proto_rawDesc), len(file_ManagedAccountsRequest_proto_rawDesc)), 102 | NumEnums: 0, 103 | NumMessages: 1, 104 | NumExtensions: 0, 105 | NumServices: 0, 106 | }, 107 | GoTypes: file_ManagedAccountsRequest_proto_goTypes, 108 | DependencyIndexes: file_ManagedAccountsRequest_proto_depIdxs, 109 | MessageInfos: file_ManagedAccountsRequest_proto_msgTypes, 110 | }.Build() 111 | File_ManagedAccountsRequest_proto = out.File 112 | file_ManagedAccountsRequest_proto_goTypes = nil 113 | file_ManagedAccountsRequest_proto_depIdxs = nil 114 | } 115 | -------------------------------------------------------------------------------- /protobuf/NextValidId.pb.go: -------------------------------------------------------------------------------- 1 | // Code generated by protoc-gen-go. DO NOT EDIT. 2 | // versions: 3 | // protoc-gen-go v1.36.9 4 | // protoc v3.21.12 5 | // source: NextValidId.proto 6 | 7 | package protobuf 8 | 9 | import ( 10 | protoreflect "google.golang.org/protobuf/reflect/protoreflect" 11 | protoimpl "google.golang.org/protobuf/runtime/protoimpl" 12 | reflect "reflect" 13 | sync "sync" 14 | unsafe "unsafe" 15 | ) 16 | 17 | const ( 18 | // Verify that this generated code is sufficiently up-to-date. 19 | _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) 20 | // Verify that runtime/protoimpl is sufficiently up-to-date. 21 | _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) 22 | ) 23 | 24 | type NextValidId struct { 25 | state protoimpl.MessageState `protogen:"open.v1"` 26 | OrderId *int32 `protobuf:"varint,1,opt,name=orderId,proto3,oneof" json:"orderId,omitempty"` 27 | unknownFields protoimpl.UnknownFields 28 | sizeCache protoimpl.SizeCache 29 | } 30 | 31 | func (x *NextValidId) Reset() { 32 | *x = NextValidId{} 33 | mi := &file_NextValidId_proto_msgTypes[0] 34 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 35 | ms.StoreMessageInfo(mi) 36 | } 37 | 38 | func (x *NextValidId) String() string { 39 | return protoimpl.X.MessageStringOf(x) 40 | } 41 | 42 | func (*NextValidId) ProtoMessage() {} 43 | 44 | func (x *NextValidId) ProtoReflect() protoreflect.Message { 45 | mi := &file_NextValidId_proto_msgTypes[0] 46 | if x != nil { 47 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 48 | if ms.LoadMessageInfo() == nil { 49 | ms.StoreMessageInfo(mi) 50 | } 51 | return ms 52 | } 53 | return mi.MessageOf(x) 54 | } 55 | 56 | // Deprecated: Use NextValidId.ProtoReflect.Descriptor instead. 57 | func (*NextValidId) Descriptor() ([]byte, []int) { 58 | return file_NextValidId_proto_rawDescGZIP(), []int{0} 59 | } 60 | 61 | func (x *NextValidId) GetOrderId() int32 { 62 | if x != nil && x.OrderId != nil { 63 | return *x.OrderId 64 | } 65 | return 0 66 | } 67 | 68 | var File_NextValidId_proto protoreflect.FileDescriptor 69 | 70 | const file_NextValidId_proto_rawDesc = "" + 71 | "\n" + 72 | "\x11NextValidId.proto\x12\bprotobuf\"8\n" + 73 | "\vNextValidId\x12\x1d\n" + 74 | "\aorderId\x18\x01 \x01(\x05H\x00R\aorderId\x88\x01\x01B\n" + 75 | "\n" + 76 | "\b_orderIdB\fZ\n" + 77 | ".;protobufb\x06proto3" 78 | 79 | var ( 80 | file_NextValidId_proto_rawDescOnce sync.Once 81 | file_NextValidId_proto_rawDescData []byte 82 | ) 83 | 84 | func file_NextValidId_proto_rawDescGZIP() []byte { 85 | file_NextValidId_proto_rawDescOnce.Do(func() { 86 | file_NextValidId_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_NextValidId_proto_rawDesc), len(file_NextValidId_proto_rawDesc))) 87 | }) 88 | return file_NextValidId_proto_rawDescData 89 | } 90 | 91 | var file_NextValidId_proto_msgTypes = make([]protoimpl.MessageInfo, 1) 92 | var file_NextValidId_proto_goTypes = []any{ 93 | (*NextValidId)(nil), // 0: protobuf.NextValidId 94 | } 95 | var file_NextValidId_proto_depIdxs = []int32{ 96 | 0, // [0:0] is the sub-list for method output_type 97 | 0, // [0:0] is the sub-list for method input_type 98 | 0, // [0:0] is the sub-list for extension type_name 99 | 0, // [0:0] is the sub-list for extension extendee 100 | 0, // [0:0] is the sub-list for field type_name 101 | } 102 | 103 | func init() { file_NextValidId_proto_init() } 104 | func file_NextValidId_proto_init() { 105 | if File_NextValidId_proto != nil { 106 | return 107 | } 108 | file_NextValidId_proto_msgTypes[0].OneofWrappers = []any{} 109 | type x struct{} 110 | out := protoimpl.TypeBuilder{ 111 | File: protoimpl.DescBuilder{ 112 | GoPackagePath: reflect.TypeOf(x{}).PkgPath(), 113 | RawDescriptor: unsafe.Slice(unsafe.StringData(file_NextValidId_proto_rawDesc), len(file_NextValidId_proto_rawDesc)), 114 | NumEnums: 0, 115 | NumMessages: 1, 116 | NumExtensions: 0, 117 | NumServices: 0, 118 | }, 119 | GoTypes: file_NextValidId_proto_goTypes, 120 | DependencyIndexes: file_NextValidId_proto_depIdxs, 121 | MessageInfos: file_NextValidId_proto_msgTypes, 122 | }.Build() 123 | File_NextValidId_proto = out.File 124 | file_NextValidId_proto_goTypes = nil 125 | file_NextValidId_proto_depIdxs = nil 126 | } 127 | -------------------------------------------------------------------------------- /protobuf/CurrentTime.pb.go: -------------------------------------------------------------------------------- 1 | // Code generated by protoc-gen-go. DO NOT EDIT. 2 | // versions: 3 | // protoc-gen-go v1.36.9 4 | // protoc v3.21.12 5 | // source: CurrentTime.proto 6 | 7 | package protobuf 8 | 9 | import ( 10 | protoreflect "google.golang.org/protobuf/reflect/protoreflect" 11 | protoimpl "google.golang.org/protobuf/runtime/protoimpl" 12 | reflect "reflect" 13 | sync "sync" 14 | unsafe "unsafe" 15 | ) 16 | 17 | const ( 18 | // Verify that this generated code is sufficiently up-to-date. 19 | _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) 20 | // Verify that runtime/protoimpl is sufficiently up-to-date. 21 | _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) 22 | ) 23 | 24 | type CurrentTime struct { 25 | state protoimpl.MessageState `protogen:"open.v1"` 26 | CurrentTime *int64 `protobuf:"varint,1,opt,name=currentTime,proto3,oneof" json:"currentTime,omitempty"` 27 | unknownFields protoimpl.UnknownFields 28 | sizeCache protoimpl.SizeCache 29 | } 30 | 31 | func (x *CurrentTime) Reset() { 32 | *x = CurrentTime{} 33 | mi := &file_CurrentTime_proto_msgTypes[0] 34 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 35 | ms.StoreMessageInfo(mi) 36 | } 37 | 38 | func (x *CurrentTime) String() string { 39 | return protoimpl.X.MessageStringOf(x) 40 | } 41 | 42 | func (*CurrentTime) ProtoMessage() {} 43 | 44 | func (x *CurrentTime) ProtoReflect() protoreflect.Message { 45 | mi := &file_CurrentTime_proto_msgTypes[0] 46 | if x != nil { 47 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 48 | if ms.LoadMessageInfo() == nil { 49 | ms.StoreMessageInfo(mi) 50 | } 51 | return ms 52 | } 53 | return mi.MessageOf(x) 54 | } 55 | 56 | // Deprecated: Use CurrentTime.ProtoReflect.Descriptor instead. 57 | func (*CurrentTime) Descriptor() ([]byte, []int) { 58 | return file_CurrentTime_proto_rawDescGZIP(), []int{0} 59 | } 60 | 61 | func (x *CurrentTime) GetCurrentTime() int64 { 62 | if x != nil && x.CurrentTime != nil { 63 | return *x.CurrentTime 64 | } 65 | return 0 66 | } 67 | 68 | var File_CurrentTime_proto protoreflect.FileDescriptor 69 | 70 | const file_CurrentTime_proto_rawDesc = "" + 71 | "\n" + 72 | "\x11CurrentTime.proto\x12\bprotobuf\"D\n" + 73 | "\vCurrentTime\x12%\n" + 74 | "\vcurrentTime\x18\x01 \x01(\x03H\x00R\vcurrentTime\x88\x01\x01B\x0e\n" + 75 | "\f_currentTimeB\fZ\n" + 76 | ".;protobufb\x06proto3" 77 | 78 | var ( 79 | file_CurrentTime_proto_rawDescOnce sync.Once 80 | file_CurrentTime_proto_rawDescData []byte 81 | ) 82 | 83 | func file_CurrentTime_proto_rawDescGZIP() []byte { 84 | file_CurrentTime_proto_rawDescOnce.Do(func() { 85 | file_CurrentTime_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_CurrentTime_proto_rawDesc), len(file_CurrentTime_proto_rawDesc))) 86 | }) 87 | return file_CurrentTime_proto_rawDescData 88 | } 89 | 90 | var file_CurrentTime_proto_msgTypes = make([]protoimpl.MessageInfo, 1) 91 | var file_CurrentTime_proto_goTypes = []any{ 92 | (*CurrentTime)(nil), // 0: protobuf.CurrentTime 93 | } 94 | var file_CurrentTime_proto_depIdxs = []int32{ 95 | 0, // [0:0] is the sub-list for method output_type 96 | 0, // [0:0] is the sub-list for method input_type 97 | 0, // [0:0] is the sub-list for extension type_name 98 | 0, // [0:0] is the sub-list for extension extendee 99 | 0, // [0:0] is the sub-list for field type_name 100 | } 101 | 102 | func init() { file_CurrentTime_proto_init() } 103 | func file_CurrentTime_proto_init() { 104 | if File_CurrentTime_proto != nil { 105 | return 106 | } 107 | file_CurrentTime_proto_msgTypes[0].OneofWrappers = []any{} 108 | type x struct{} 109 | out := protoimpl.TypeBuilder{ 110 | File: protoimpl.DescBuilder{ 111 | GoPackagePath: reflect.TypeOf(x{}).PkgPath(), 112 | RawDescriptor: unsafe.Slice(unsafe.StringData(file_CurrentTime_proto_rawDesc), len(file_CurrentTime_proto_rawDesc)), 113 | NumEnums: 0, 114 | NumMessages: 1, 115 | NumExtensions: 0, 116 | NumServices: 0, 117 | }, 118 | GoTypes: file_CurrentTime_proto_goTypes, 119 | DependencyIndexes: file_CurrentTime_proto_depIdxs, 120 | MessageInfos: file_CurrentTime_proto_msgTypes, 121 | }.Build() 122 | File_CurrentTime_proto = out.File 123 | file_CurrentTime_proto_goTypes = nil 124 | file_CurrentTime_proto_depIdxs = nil 125 | } 126 | -------------------------------------------------------------------------------- /protobuf/ScannerParametersRequest.pb.go: -------------------------------------------------------------------------------- 1 | // Code generated by protoc-gen-go. DO NOT EDIT. 2 | // versions: 3 | // protoc-gen-go v1.36.9 4 | // protoc v3.21.12 5 | // source: ScannerParametersRequest.proto 6 | 7 | package protobuf 8 | 9 | import ( 10 | protoreflect "google.golang.org/protobuf/reflect/protoreflect" 11 | protoimpl "google.golang.org/protobuf/runtime/protoimpl" 12 | reflect "reflect" 13 | sync "sync" 14 | unsafe "unsafe" 15 | ) 16 | 17 | const ( 18 | // Verify that this generated code is sufficiently up-to-date. 19 | _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) 20 | // Verify that runtime/protoimpl is sufficiently up-to-date. 21 | _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) 22 | ) 23 | 24 | type ScannerParametersRequest struct { 25 | state protoimpl.MessageState `protogen:"open.v1"` 26 | unknownFields protoimpl.UnknownFields 27 | sizeCache protoimpl.SizeCache 28 | } 29 | 30 | func (x *ScannerParametersRequest) Reset() { 31 | *x = ScannerParametersRequest{} 32 | mi := &file_ScannerParametersRequest_proto_msgTypes[0] 33 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 34 | ms.StoreMessageInfo(mi) 35 | } 36 | 37 | func (x *ScannerParametersRequest) String() string { 38 | return protoimpl.X.MessageStringOf(x) 39 | } 40 | 41 | func (*ScannerParametersRequest) ProtoMessage() {} 42 | 43 | func (x *ScannerParametersRequest) ProtoReflect() protoreflect.Message { 44 | mi := &file_ScannerParametersRequest_proto_msgTypes[0] 45 | if x != nil { 46 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 47 | if ms.LoadMessageInfo() == nil { 48 | ms.StoreMessageInfo(mi) 49 | } 50 | return ms 51 | } 52 | return mi.MessageOf(x) 53 | } 54 | 55 | // Deprecated: Use ScannerParametersRequest.ProtoReflect.Descriptor instead. 56 | func (*ScannerParametersRequest) Descriptor() ([]byte, []int) { 57 | return file_ScannerParametersRequest_proto_rawDescGZIP(), []int{0} 58 | } 59 | 60 | var File_ScannerParametersRequest_proto protoreflect.FileDescriptor 61 | 62 | const file_ScannerParametersRequest_proto_rawDesc = "" + 63 | "\n" + 64 | "\x1eScannerParametersRequest.proto\x12\bprotobuf\"\x1a\n" + 65 | "\x18ScannerParametersRequestB\fZ\n" + 66 | ".;protobufb\x06proto3" 67 | 68 | var ( 69 | file_ScannerParametersRequest_proto_rawDescOnce sync.Once 70 | file_ScannerParametersRequest_proto_rawDescData []byte 71 | ) 72 | 73 | func file_ScannerParametersRequest_proto_rawDescGZIP() []byte { 74 | file_ScannerParametersRequest_proto_rawDescOnce.Do(func() { 75 | file_ScannerParametersRequest_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_ScannerParametersRequest_proto_rawDesc), len(file_ScannerParametersRequest_proto_rawDesc))) 76 | }) 77 | return file_ScannerParametersRequest_proto_rawDescData 78 | } 79 | 80 | var file_ScannerParametersRequest_proto_msgTypes = make([]protoimpl.MessageInfo, 1) 81 | var file_ScannerParametersRequest_proto_goTypes = []any{ 82 | (*ScannerParametersRequest)(nil), // 0: protobuf.ScannerParametersRequest 83 | } 84 | var file_ScannerParametersRequest_proto_depIdxs = []int32{ 85 | 0, // [0:0] is the sub-list for method output_type 86 | 0, // [0:0] is the sub-list for method input_type 87 | 0, // [0:0] is the sub-list for extension type_name 88 | 0, // [0:0] is the sub-list for extension extendee 89 | 0, // [0:0] is the sub-list for field type_name 90 | } 91 | 92 | func init() { file_ScannerParametersRequest_proto_init() } 93 | func file_ScannerParametersRequest_proto_init() { 94 | if File_ScannerParametersRequest_proto != nil { 95 | return 96 | } 97 | type x struct{} 98 | out := protoimpl.TypeBuilder{ 99 | File: protoimpl.DescBuilder{ 100 | GoPackagePath: reflect.TypeOf(x{}).PkgPath(), 101 | RawDescriptor: unsafe.Slice(unsafe.StringData(file_ScannerParametersRequest_proto_rawDesc), len(file_ScannerParametersRequest_proto_rawDesc)), 102 | NumEnums: 0, 103 | NumMessages: 1, 104 | NumExtensions: 0, 105 | NumServices: 0, 106 | }, 107 | GoTypes: file_ScannerParametersRequest_proto_goTypes, 108 | DependencyIndexes: file_ScannerParametersRequest_proto_depIdxs, 109 | MessageInfos: file_ScannerParametersRequest_proto_msgTypes, 110 | }.Build() 111 | File_ScannerParametersRequest_proto = out.File 112 | file_ScannerParametersRequest_proto_goTypes = nil 113 | file_ScannerParametersRequest_proto_depIdxs = nil 114 | } 115 | -------------------------------------------------------------------------------- /protobuf/FamilyCodes.pb.go: -------------------------------------------------------------------------------- 1 | // Code generated by protoc-gen-go. DO NOT EDIT. 2 | // versions: 3 | // protoc-gen-go v1.36.9 4 | // protoc v3.21.12 5 | // source: FamilyCodes.proto 6 | 7 | package protobuf 8 | 9 | import ( 10 | protoreflect "google.golang.org/protobuf/reflect/protoreflect" 11 | protoimpl "google.golang.org/protobuf/runtime/protoimpl" 12 | reflect "reflect" 13 | sync "sync" 14 | unsafe "unsafe" 15 | ) 16 | 17 | const ( 18 | // Verify that this generated code is sufficiently up-to-date. 19 | _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) 20 | // Verify that runtime/protoimpl is sufficiently up-to-date. 21 | _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) 22 | ) 23 | 24 | type FamilyCodes struct { 25 | state protoimpl.MessageState `protogen:"open.v1"` 26 | FamilyCodes []*FamilyCode `protobuf:"bytes,1,rep,name=familyCodes,proto3" json:"familyCodes,omitempty"` 27 | unknownFields protoimpl.UnknownFields 28 | sizeCache protoimpl.SizeCache 29 | } 30 | 31 | func (x *FamilyCodes) Reset() { 32 | *x = FamilyCodes{} 33 | mi := &file_FamilyCodes_proto_msgTypes[0] 34 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 35 | ms.StoreMessageInfo(mi) 36 | } 37 | 38 | func (x *FamilyCodes) String() string { 39 | return protoimpl.X.MessageStringOf(x) 40 | } 41 | 42 | func (*FamilyCodes) ProtoMessage() {} 43 | 44 | func (x *FamilyCodes) ProtoReflect() protoreflect.Message { 45 | mi := &file_FamilyCodes_proto_msgTypes[0] 46 | if x != nil { 47 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 48 | if ms.LoadMessageInfo() == nil { 49 | ms.StoreMessageInfo(mi) 50 | } 51 | return ms 52 | } 53 | return mi.MessageOf(x) 54 | } 55 | 56 | // Deprecated: Use FamilyCodes.ProtoReflect.Descriptor instead. 57 | func (*FamilyCodes) Descriptor() ([]byte, []int) { 58 | return file_FamilyCodes_proto_rawDescGZIP(), []int{0} 59 | } 60 | 61 | func (x *FamilyCodes) GetFamilyCodes() []*FamilyCode { 62 | if x != nil { 63 | return x.FamilyCodes 64 | } 65 | return nil 66 | } 67 | 68 | var File_FamilyCodes_proto protoreflect.FileDescriptor 69 | 70 | const file_FamilyCodes_proto_rawDesc = "" + 71 | "\n" + 72 | "\x11FamilyCodes.proto\x12\bprotobuf\x1a\x10FamilyCode.proto\"E\n" + 73 | "\vFamilyCodes\x126\n" + 74 | "\vfamilyCodes\x18\x01 \x03(\v2\x14.protobuf.FamilyCodeR\vfamilyCodesB\fZ\n" + 75 | ".;protobufb\x06proto3" 76 | 77 | var ( 78 | file_FamilyCodes_proto_rawDescOnce sync.Once 79 | file_FamilyCodes_proto_rawDescData []byte 80 | ) 81 | 82 | func file_FamilyCodes_proto_rawDescGZIP() []byte { 83 | file_FamilyCodes_proto_rawDescOnce.Do(func() { 84 | file_FamilyCodes_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_FamilyCodes_proto_rawDesc), len(file_FamilyCodes_proto_rawDesc))) 85 | }) 86 | return file_FamilyCodes_proto_rawDescData 87 | } 88 | 89 | var file_FamilyCodes_proto_msgTypes = make([]protoimpl.MessageInfo, 1) 90 | var file_FamilyCodes_proto_goTypes = []any{ 91 | (*FamilyCodes)(nil), // 0: protobuf.FamilyCodes 92 | (*FamilyCode)(nil), // 1: protobuf.FamilyCode 93 | } 94 | var file_FamilyCodes_proto_depIdxs = []int32{ 95 | 1, // 0: protobuf.FamilyCodes.familyCodes:type_name -> protobuf.FamilyCode 96 | 1, // [1:1] is the sub-list for method output_type 97 | 1, // [1:1] is the sub-list for method input_type 98 | 1, // [1:1] is the sub-list for extension type_name 99 | 1, // [1:1] is the sub-list for extension extendee 100 | 0, // [0:1] is the sub-list for field type_name 101 | } 102 | 103 | func init() { file_FamilyCodes_proto_init() } 104 | func file_FamilyCodes_proto_init() { 105 | if File_FamilyCodes_proto != nil { 106 | return 107 | } 108 | file_FamilyCode_proto_init() 109 | type x struct{} 110 | out := protoimpl.TypeBuilder{ 111 | File: protoimpl.DescBuilder{ 112 | GoPackagePath: reflect.TypeOf(x{}).PkgPath(), 113 | RawDescriptor: unsafe.Slice(unsafe.StringData(file_FamilyCodes_proto_rawDesc), len(file_FamilyCodes_proto_rawDesc)), 114 | NumEnums: 0, 115 | NumMessages: 1, 116 | NumExtensions: 0, 117 | NumServices: 0, 118 | }, 119 | GoTypes: file_FamilyCodes_proto_goTypes, 120 | DependencyIndexes: file_FamilyCodes_proto_depIdxs, 121 | MessageInfos: file_FamilyCodes_proto_msgTypes, 122 | }.Build() 123 | File_FamilyCodes_proto = out.File 124 | file_FamilyCodes_proto_goTypes = nil 125 | file_FamilyCodes_proto_depIdxs = nil 126 | } 127 | --------------------------------------------------------------------------------