From 4cd646e3465785ef839485098fb9383a19d37ec0 Mon Sep 17 00:00:00 2001 From: Yo-An Lin Date: Fri, 8 Apr 2022 19:21:57 +0800 Subject: [PATCH] feature: basic grpc server (#514) --- Makefile | 33 +- doc/topics/grpc.md | 48 ++ go.mod | 10 +- go.sum | 39 +- pkg/cmd/run.go | 37 +- pkg/grpc/server.go | 88 +++ pkg/pb/bbgo.pb.go | 1288 +++++++++++++++++++++------------- pkg/pb/bbgo.proto | 322 ++++----- pkg/pb/bbgo_grpc.pb.go | 512 ++++++++++++++ python/bbgo/bbgo_pb2.py | 31 +- python/bbgo/bbgo_pb2_grpc.py | 300 ++++---- 11 files changed, 1897 insertions(+), 811 deletions(-) create mode 100644 doc/topics/grpc.md create mode 100644 pkg/grpc/server.go create mode 100644 pkg/pb/bbgo_grpc.pb.go diff --git a/Makefile b/Makefile index 1d09e4b04..01f276416 100644 --- a/Makefile +++ b/Makefile @@ -108,8 +108,6 @@ bbgo-slim-dnum-darwin-amd64: $(BIN_DIR) bbgo-slim-dnum-darwin: bbgo-slim-dnum-darwin-amd64 bbgo-slim-dnum-darwin-arm64 -clean: - rm -rf $(BUILD_DIR) $(DIST_DIR) $(FRONTEND_EXPORT_DIR) $(OSX_APP_CONTENTS_DIR): mkdir -p $@ @@ -235,10 +233,31 @@ embed: pkg/server/assets.go static: frontend/out/index.html pkg/server/assets.go -.PHONY: bbgo bbgo-slim-darwin bbgo-slim-darwin-amd64 bbgo-slim-darwin-arm64 bbgo-darwin version dist pack migrations static embed desktop .FORCE -protobuf: - protoc -I=$(PWD)/pkg/pb --go_out=$(PWD)/pkg/pb $(PWD)/pkg/pb/bbgo.proto +PROTOS := \ + $(wildcard pkg/pb/*.proto) -protobuf-py: - python -m grpc_tools.protoc -I$(PWD)/pkg/pb --python_out=$(PWD)/python/bbgo --grpc_python_out=$(PWD)/python/bbgo $(PWD)/pkg/pb/bbgo.proto +GRPC_GO_DEPS := $(subst .proto,.pb.go,$(PROTOS)) + +%.pb.go: %.proto .FORCE + protoc --go-grpc_out=. --go-grpc_opt=paths=source_relative --go_out=paths=source_relative:. --proto_path=. $< + +grpc-go: $(GRPC_GO_DEPS) + +grpc: grpc-go grpc-py + +install-grpc-tools: + go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.26 + go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.1 + pip install grpcio-tools + +grpc-py: + python -m grpc_tools.protoc -I$(PWD)/pkg/pb \ + --python_out=$(PWD)/python/bbgo \ + --grpc_python_out=$(PWD)/python/bbgo \ + $(PWD)/pkg/pb/bbgo.proto + +clean: + rm -rf $(BUILD_DIR) $(DIST_DIR) $(FRONTEND_EXPORT_DIR) $(GRPC_GO_DEPS) pkg/pb/*.pb.go + +.PHONY: bbgo bbgo-slim-darwin bbgo-slim-darwin-amd64 bbgo-slim-darwin-arm64 bbgo-darwin version dist pack migrations static embed desktop grpc grpc-go grpc-py .FORCE diff --git a/doc/topics/grpc.md b/doc/topics/grpc.md new file mode 100644 index 000000000..2a1328f3c --- /dev/null +++ b/doc/topics/grpc.md @@ -0,0 +1,48 @@ +# GRPC server + +## Integrating GRPC services + +### Install Evans + +```shell +brew install evans +``` + +Start your bbgo with gRPC server option: + +```shell +go run ./cmd/bbgo run --config grid_kucoin.yaml --debug --enable-grpc +``` + +The gRPC server port is located at 6688, you can use evans to connect to the gRPC server: + +```shell +evans --host localhost --port 6688 -r repl +``` + +```shell +bbgo@localhost:6688> package bbgo +bbgo@localhost:6688> show service +bbgo@localhost:6688> show message +``` + +You can use evans to get the description of a message: + +```shell +bbgo@localhost:6688> desc QueryKLinesRequest ++-----------+-------------+----------+ +| FIELD | TYPE | REPEATED | ++-----------+-------------+----------+ +| exchange | TYPE_STRING | false | +| interval | TYPE_STRING | false | +| limit | TYPE_INT64 | false | +| symbol | TYPE_STRING | false | +| timestamp | TYPE_INT64 | false | ++-----------+-------------+----------+ +``` + + + + + + diff --git a/go.mod b/go.mod index 7ae7ef8c4..66f994f20 100644 --- a/go.mod +++ b/go.mod @@ -40,7 +40,8 @@ require ( go.uber.org/multierr v1.7.0 golang.org/x/time v0.0.0-20201208040808-7e3f01d25324 gonum.org/v1/gonum v0.8.1 - google.golang.org/protobuf v1.27.1 + google.golang.org/grpc v1.45.0 + google.golang.org/protobuf v1.28.0 gopkg.in/tucnak/telebot.v2 v2.5.0 gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b ) @@ -101,11 +102,12 @@ require ( go.opentelemetry.io/otel/trace v0.19.0 // indirect go.uber.org/atomic v1.9.0 // indirect golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad // indirect - golang.org/x/net v0.0.0-20211205041911-012df41ee64c // indirect - golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e // indirect - golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 // indirect + golang.org/x/net v0.0.0-20220403103023-749bd193bc2b // indirect + golang.org/x/sys v0.0.0-20220406163625-3f8b81556e12 // indirect + golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect golang.org/x/text v0.3.7 // indirect golang.org/x/tools v0.1.9 // indirect + google.golang.org/genproto v0.0.0-20220405205423-9d709892a2bf // indirect gopkg.in/ini.v1 v1.62.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect nhooyr.io/websocket v1.8.7 // indirect diff --git a/go.sum b/go.sum index 59b7688d3..f4e0811c1 100644 --- a/go.sum +++ b/go.sum @@ -45,6 +45,7 @@ github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuy github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= +github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= @@ -75,6 +76,11 @@ github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5P github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= +github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= +github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cockroachdb/apd v1.1.0 h1:3LFP3629v+1aKXU5Q37mxmRxX/pIu1nijXydLShEq5I= github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMeY4+DwBQ= github.com/codingconcepts/env v0.0.0-20200821220118-a8fbf8d84482 h1:5/aEFreBh9hH/0G+33xtczJCvMaulqsm9nDuu2BZUEo= @@ -98,6 +104,8 @@ github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8 github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= +github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= +github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/fastly/go-utils v0.0.0-20180712184237-d95a45783239 h1:Ghm4eQYC0nEPnSJdVkTrXpu9KtoVCSo1hg7mtI7G9KU= github.com/fastly/go-utils v0.0.0-20180712184237-d95a45783239/go.mod h1:Gdwt2ce0yfBxPvZrHkprdPPTTS3N5rwmLE8T22KBXlw= @@ -211,6 +219,7 @@ github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= +github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= @@ -223,6 +232,7 @@ github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/ad github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= +github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= @@ -397,6 +407,7 @@ github.com/rifflock/lfshook v0.0.0-20180920164130-b9218ef580f5/go.mod h1:GEXHk5H github.com/robfig/cron/v3 v3.0.0 h1:kQ6Cb7aHOHTSzNVNEhmp8EcWKLb4CbiMW9h9VyIhO4E= github.com/robfig/cron/v3 v3.0.0/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= +github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/russross/blackfriday/v2 v2.0.1 h1:lPqVAte+HuHNfhJ/0LC98ESWRz8afy9tM/0RK8m9o+Q= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= @@ -489,6 +500,7 @@ go.opentelemetry.io/otel/oteltest v0.19.0 h1:YVfA0ByROYqTwOxqHVZYZExzEpfZor+MU1r go.opentelemetry.io/otel/oteltest v0.19.0/go.mod h1:tI4yxwh8U21v7JD6R3BcA/2+RBoTKFexE/PJ/nSO7IA= go.opentelemetry.io/otel/trace v0.19.0 h1:1ucYlenXIDA1OlHVLDZKX0ObXV5RLaq06DtUKz5e5zc= go.opentelemetry.io/otel/trace v0.19.0/go.mod h1:4IXiNextNOpPnRlI4ryK69mn5iC84bjBWZQA5DXz/qg= +go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/atomic v1.9.0 h1:ECmE8Bn/WFTYwEW/bpKD3M8VtR/zQVbavAoalC1PYyE= @@ -579,10 +591,11 @@ golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81R golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211205041911-012df41ee64c h1:7SfqwP5fxEtl/P02w5IhKc86ziJ+A25yFrkVgoy2FT8= -golang.org/x/net v0.0.0-20211205041911-012df41ee64c/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20220403103023-749bd193bc2b h1:vI32FkLJNAWtGD4BwkThwEy6XS7ZLLMHkSkYfF8M0W0= +golang.org/x/net v0.0.0-20220403103023-749bd193bc2b/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -645,20 +658,26 @@ golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e h1:fLOSk5Q00efkSvAm+4xcoXD+RRmLmmulPn5I3Y9F2EM= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220406163625-3f8b81556e12 h1:QyVthZKMsyaQwBTJE04jdNN0Pp5Fn9Qga0mrgxyERQM= +golang.org/x/sys v0.0.0-20220406163625-3f8b81556e12/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= -golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 h1:v+OssWQX+hTHEmOBgwxdZxK4zHq3yOs8F9J7mk0PY8E= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 h1:JGgROgKl9N8DuW20oFS5gxc+lE67/N3FcwmBPMe7ArY= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= @@ -772,12 +791,15 @@ google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfG google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20220405205423-9d709892a2bf h1:JTjwKJX9erVpsw17w+OIPP7iAgEkN/r8urhWSunEDTs= +google.golang.org/genproto v0.0.0-20220405205423-9d709892a2bf/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= @@ -790,6 +812,10 @@ google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKa google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= +google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.45.0 h1:NEpgUqV3Z+ZjkqMsxMg11IaDrXY4RY6CQukSGK0uI1M= +google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -802,8 +828,8 @@ google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGj google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= -google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw= +google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -824,6 +850,7 @@ gopkg.in/tucnak/telebot.v2 v2.5.0/go.mod h1:BgaIIx50PSRS9pG59JH+geT82cfvoJU/IaI5 gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/pkg/cmd/run.go b/pkg/cmd/run.go index c5bafcfa0..47e42ce17 100644 --- a/pkg/cmd/run.go +++ b/pkg/cmd/run.go @@ -17,6 +17,7 @@ import ( "github.com/c9s/bbgo/pkg/bbgo" "github.com/c9s/bbgo/pkg/cmd/cmdutil" + "github.com/c9s/bbgo/pkg/grpc" "github.com/c9s/bbgo/pkg/server" ) @@ -28,8 +29,12 @@ func init() { RunCmd.Flags().String("totp-account-name", "", "") RunCmd.Flags().Bool("enable-webserver", false, "enable webserver") RunCmd.Flags().Bool("enable-web-server", false, "legacy option, this is renamed to --enable-webserver") - RunCmd.Flags().String("cpu-profile", "", "cpu profile") RunCmd.Flags().String("webserver-bind", ":8080", "webserver binding") + + RunCmd.Flags().Bool("enable-grpc", false, "enable grpc server") + RunCmd.Flags().String("grpc-bind", ":6688", "grpc server binding") + + RunCmd.Flags().String("cpu-profile", "", "cpu profile") RunCmd.Flags().Bool("setup", false, "use setup mode") RootCmd.AddCommand(RunCmd) } @@ -40,7 +45,7 @@ var RunCmd = &cobra.Command{ // SilenceUsage is an option to silence usage when an error occurs. SilenceUsage: true, - RunE: run, + RunE: run, } func runSetup(baseCtx context.Context, userConfig *bbgo.Config, enableApiServer bool) error { @@ -144,6 +149,19 @@ func runConfig(basectx context.Context, cmd *cobra.Command, userConfig *bbgo.Con enableWebServer = true } + enableGrpc, err := cmd.Flags().GetBool("enable-grpc") + if err != nil { + return err + } + + grpcBind, err := cmd.Flags().GetString("grpc-bind") + if err != nil { + return err + } + + _ = grpcBind + _ = enableGrpc + ctx, cancelTrading := context.WithCancel(basectx) defer cancelTrading() @@ -184,7 +202,20 @@ func runConfig(basectx context.Context, cmd *cobra.Command, userConfig *bbgo.Con } if err := s.Run(ctx, webServerBind); err != nil { - log.WithError(err).Errorf("server error") + log.WithError(err).Errorf("http server bind error") + } + }() + } + + if enableGrpc { + go func() { + s := &grpc.Server{ + Config: userConfig, + Environ: environ, + Trader: trader, + } + if err := s.ListenAndServe(grpcBind); err != nil { + log.WithError(err).Errorf("grpc server bind error") } }() } diff --git a/pkg/grpc/server.go b/pkg/grpc/server.go new file mode 100644 index 000000000..02ca3f314 --- /dev/null +++ b/pkg/grpc/server.go @@ -0,0 +1,88 @@ +package grpc + +import ( + "context" + "net" + + "github.com/pkg/errors" + "google.golang.org/grpc" + "google.golang.org/grpc/reflection" + + "github.com/c9s/bbgo/pkg/bbgo" + "github.com/c9s/bbgo/pkg/pb" + "github.com/c9s/bbgo/pkg/types" +) + +type Server struct { + Config *bbgo.Config + Environ *bbgo.Environment + Trader *bbgo.Trader + + pb.UnimplementedMarketDataServiceServer +} + +func (s *Server) Subscribe(request *pb.SubscribeRequest, server pb.MarketDataService_SubscribeServer) error { + panic("implement me") + return nil +} + +func (s *Server) QueryKLines(ctx context.Context, request *pb.QueryKLinesRequest) (*pb.QueryKLinesResponse, error) { + exchangeName, err := types.ValidExchangeName(request.Exchange) + if err != nil { + return nil, err + } + + for _, session := range s.Environ.Sessions() { + if session.ExchangeName == exchangeName { + response := &pb.QueryKLinesResponse{ + Klines: nil, + Error: nil, + } + + options := types.KLineQueryOptions{ + Limit: int(request.Limit), + } + + klines, err := session.Exchange.QueryKLines(ctx, request.Symbol, types.Interval(request.Interval), options) + if err != nil { + return nil, err + } + + for _, kline := range klines { + response.Klines = append(response.Klines, &pb.KLine{ + Exchange: kline.Exchange.String(), + Symbol: kline.Symbol, + Timestamp: kline.StartTime.Unix(), + Open: kline.Open.Float64(), + High: kline.High.Float64(), + Low: kline.Low.Float64(), + Close: kline.Close.Float64(), + Volume: kline.Volume.Float64(), + QuoteVolume: kline.QuoteVolume.Float64(), + }) + } + + return response, nil + } + } + + return nil, nil +} + +func (s *Server) ListenAndServe(bind string) error { + conn, err := net.Listen("tcp", bind) + if err != nil { + return errors.Wrapf(err, "failed to bind network at %s", bind) + } + + var grpcServer = grpc.NewServer() + pb.RegisterMarketDataServiceServer(grpcServer, s) + + reflection.Register(grpcServer) + + if err := grpcServer.Serve(conn); err != nil { + return errors.Wrap(err, "failed to serve grpc connections") + } + + return nil +} diff --git a/pkg/pb/bbgo.pb.go b/pkg/pb/bbgo.pb.go index 2e8ae9e26..8445b5850 100644 --- a/pkg/pb/bbgo.pb.go +++ b/pkg/pb/bbgo.pb.go @@ -1,8 +1,8 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 -// protoc v3.19.4 -// source: bbgo.proto +// protoc-gen-go v1.26.0 +// protoc v3.19.3 +// source: pkg/pb/bbgo.proto package pb @@ -20,6 +20,241 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +type Event int32 + +const ( + Event_UNKNOWN Event = 0 + Event_SUBSCRIBED Event = 1 + Event_UNSUBSCRIBED Event = 2 + Event_SNAPSHOT Event = 3 + Event_UPDATE Event = 4 + Event_AUTHENTICATED Event = 5 + Event_ORDER_SNAPSHOT Event = 6 + Event_ORDER_UPDATE Event = 7 + Event_TRADE_SNAPSHOT Event = 8 + Event_TRADE_UPDATE Event = 9 + Event_ACCOUNT_SNAPSHOT Event = 10 + Event_ACCOUNT_UPDATE Event = 11 + Event_ERROR Event = 99 +) + +// Enum value maps for Event. +var ( + Event_name = map[int32]string{ + 0: "UNKNOWN", + 1: "SUBSCRIBED", + 2: "UNSUBSCRIBED", + 3: "SNAPSHOT", + 4: "UPDATE", + 5: "AUTHENTICATED", + 6: "ORDER_SNAPSHOT", + 7: "ORDER_UPDATE", + 8: "TRADE_SNAPSHOT", + 9: "TRADE_UPDATE", + 10: "ACCOUNT_SNAPSHOT", + 11: "ACCOUNT_UPDATE", + 99: "ERROR", + } + Event_value = map[string]int32{ + "UNKNOWN": 0, + "SUBSCRIBED": 1, + "UNSUBSCRIBED": 2, + "SNAPSHOT": 3, + "UPDATE": 4, + "AUTHENTICATED": 5, + "ORDER_SNAPSHOT": 6, + "ORDER_UPDATE": 7, + "TRADE_SNAPSHOT": 8, + "TRADE_UPDATE": 9, + "ACCOUNT_SNAPSHOT": 10, + "ACCOUNT_UPDATE": 11, + "ERROR": 99, + } +) + +func (x Event) Enum() *Event { + p := new(Event) + *p = x + return p +} + +func (x Event) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Event) Descriptor() protoreflect.EnumDescriptor { + return file_pkg_pb_bbgo_proto_enumTypes[0].Descriptor() +} + +func (Event) Type() protoreflect.EnumType { + return &file_pkg_pb_bbgo_proto_enumTypes[0] +} + +func (x Event) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Event.Descriptor instead. +func (Event) EnumDescriptor() ([]byte, []int) { + return file_pkg_pb_bbgo_proto_rawDescGZIP(), []int{0} +} + +type Channel int32 + +const ( + Channel_BOOK Channel = 0 + Channel_TRADE Channel = 1 + Channel_TICKER Channel = 2 + Channel_USER Channel = 3 +) + +// Enum value maps for Channel. +var ( + Channel_name = map[int32]string{ + 0: "BOOK", + 1: "TRADE", + 2: "TICKER", + 3: "USER", + } + Channel_value = map[string]int32{ + "BOOK": 0, + "TRADE": 1, + "TICKER": 2, + "USER": 3, + } +) + +func (x Channel) Enum() *Channel { + p := new(Channel) + *p = x + return p +} + +func (x Channel) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Channel) Descriptor() protoreflect.EnumDescriptor { + return file_pkg_pb_bbgo_proto_enumTypes[1].Descriptor() +} + +func (Channel) Type() protoreflect.EnumType { + return &file_pkg_pb_bbgo_proto_enumTypes[1] +} + +func (x Channel) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Channel.Descriptor instead. +func (Channel) EnumDescriptor() ([]byte, []int) { + return file_pkg_pb_bbgo_proto_rawDescGZIP(), []int{1} +} + +type Side int32 + +const ( + Side_BUY Side = 0 + Side_SELL Side = 1 +) + +// Enum value maps for Side. +var ( + Side_name = map[int32]string{ + 0: "BUY", + 1: "SELL", + } + Side_value = map[string]int32{ + "BUY": 0, + "SELL": 1, + } +) + +func (x Side) Enum() *Side { + p := new(Side) + *p = x + return p +} + +func (x Side) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Side) Descriptor() protoreflect.EnumDescriptor { + return file_pkg_pb_bbgo_proto_enumTypes[2].Descriptor() +} + +func (Side) Type() protoreflect.EnumType { + return &file_pkg_pb_bbgo_proto_enumTypes[2] +} + +func (x Side) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Side.Descriptor instead. +func (Side) EnumDescriptor() ([]byte, []int) { + return file_pkg_pb_bbgo_proto_rawDescGZIP(), []int{2} +} + +type OrderType int32 + +const ( + OrderType_MARKET OrderType = 0 + OrderType_LIMIT OrderType = 1 + OrderType_STOP_MARKET OrderType = 2 + OrderType_STOP_LIMIT OrderType = 3 + OrderType_POST_ONLY OrderType = 4 + OrderType_IOC_LIMIT OrderType = 5 +) + +// Enum value maps for OrderType. +var ( + OrderType_name = map[int32]string{ + 0: "MARKET", + 1: "LIMIT", + 2: "STOP_MARKET", + 3: "STOP_LIMIT", + 4: "POST_ONLY", + 5: "IOC_LIMIT", + } + OrderType_value = map[string]int32{ + "MARKET": 0, + "LIMIT": 1, + "STOP_MARKET": 2, + "STOP_LIMIT": 3, + "POST_ONLY": 4, + "IOC_LIMIT": 5, + } +) + +func (x OrderType) Enum() *OrderType { + p := new(OrderType) + *p = x + return p +} + +func (x OrderType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (OrderType) Descriptor() protoreflect.EnumDescriptor { + return file_pkg_pb_bbgo_proto_enumTypes[3].Descriptor() +} + +func (OrderType) Type() protoreflect.EnumType { + return &file_pkg_pb_bbgo_proto_enumTypes[3] +} + +func (x OrderType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use OrderType.Descriptor instead. +func (OrderType) EnumDescriptor() ([]byte, []int) { + return file_pkg_pb_bbgo_proto_rawDescGZIP(), []int{3} +} + type Empty struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -29,7 +264,7 @@ type Empty struct { func (x *Empty) Reset() { *x = Empty{} if protoimpl.UnsafeEnabled { - mi := &file_bbgo_proto_msgTypes[0] + mi := &file_pkg_pb_bbgo_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -42,7 +277,7 @@ func (x *Empty) String() string { func (*Empty) ProtoMessage() {} func (x *Empty) ProtoReflect() protoreflect.Message { - mi := &file_bbgo_proto_msgTypes[0] + mi := &file_pkg_pb_bbgo_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -55,7 +290,7 @@ func (x *Empty) ProtoReflect() protoreflect.Message { // Deprecated: Use Empty.ProtoReflect.Descriptor instead. func (*Empty) Descriptor() ([]byte, []int) { - return file_bbgo_proto_rawDescGZIP(), []int{0} + return file_pkg_pb_bbgo_proto_rawDescGZIP(), []int{0} } type Error struct { @@ -70,7 +305,7 @@ type Error struct { func (x *Error) Reset() { *x = Error{} if protoimpl.UnsafeEnabled { - mi := &file_bbgo_proto_msgTypes[1] + mi := &file_pkg_pb_bbgo_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -83,7 +318,7 @@ func (x *Error) String() string { func (*Error) ProtoMessage() {} func (x *Error) ProtoReflect() protoreflect.Message { - mi := &file_bbgo_proto_msgTypes[1] + mi := &file_pkg_pb_bbgo_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -96,7 +331,7 @@ func (x *Error) ProtoReflect() protoreflect.Message { // Deprecated: Use Error.ProtoReflect.Descriptor instead. func (*Error) Descriptor() ([]byte, []int) { - return file_bbgo_proto_rawDescGZIP(), []int{1} + return file_pkg_pb_bbgo_proto_rawDescGZIP(), []int{1} } func (x *Error) GetErrorCode() int64 { @@ -124,7 +359,7 @@ type SubscribeRequest struct { func (x *SubscribeRequest) Reset() { *x = SubscribeRequest{} if protoimpl.UnsafeEnabled { - mi := &file_bbgo_proto_msgTypes[2] + mi := &file_pkg_pb_bbgo_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -137,7 +372,7 @@ func (x *SubscribeRequest) String() string { func (*SubscribeRequest) ProtoMessage() {} func (x *SubscribeRequest) ProtoReflect() protoreflect.Message { - mi := &file_bbgo_proto_msgTypes[2] + mi := &file_pkg_pb_bbgo_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -150,7 +385,7 @@ func (x *SubscribeRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use SubscribeRequest.ProtoReflect.Descriptor instead. func (*SubscribeRequest) Descriptor() ([]byte, []int) { - return file_bbgo_proto_rawDescGZIP(), []int{2} + return file_pkg_pb_bbgo_proto_rawDescGZIP(), []int{2} } func (x *SubscribeRequest) GetSubscriptions() []*Subscription { @@ -165,16 +400,16 @@ type Subscription struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Exchange string `protobuf:"bytes,1,opt,name=exchange,proto3" json:"exchange,omitempty"` - Channel string `protobuf:"bytes,2,opt,name=channel,proto3" json:"channel,omitempty"` // book, trade, ticker - Symbol string `protobuf:"bytes,3,opt,name=symbol,proto3" json:"symbol,omitempty"` - Depth int64 `protobuf:"varint,4,opt,name=depth,proto3" json:"depth,omitempty"` + Exchange string `protobuf:"bytes,1,opt,name=exchange,proto3" json:"exchange,omitempty"` + Channel Channel `protobuf:"varint,2,opt,name=channel,proto3,enum=bbgo.Channel" json:"channel,omitempty"` // book, trade, ticker + Symbol string `protobuf:"bytes,3,opt,name=symbol,proto3" json:"symbol,omitempty"` + Depth int64 `protobuf:"varint,4,opt,name=depth,proto3" json:"depth,omitempty"` } func (x *Subscription) Reset() { *x = Subscription{} if protoimpl.UnsafeEnabled { - mi := &file_bbgo_proto_msgTypes[3] + mi := &file_pkg_pb_bbgo_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -187,7 +422,7 @@ func (x *Subscription) String() string { func (*Subscription) ProtoMessage() {} func (x *Subscription) ProtoReflect() protoreflect.Message { - mi := &file_bbgo_proto_msgTypes[3] + mi := &file_pkg_pb_bbgo_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -200,7 +435,7 @@ func (x *Subscription) ProtoReflect() protoreflect.Message { // Deprecated: Use Subscription.ProtoReflect.Descriptor instead. func (*Subscription) Descriptor() ([]byte, []int) { - return file_bbgo_proto_rawDescGZIP(), []int{3} + return file_pkg_pb_bbgo_proto_rawDescGZIP(), []int{3} } func (x *Subscription) GetExchange() string { @@ -210,11 +445,11 @@ func (x *Subscription) GetExchange() string { return "" } -func (x *Subscription) GetChannel() string { +func (x *Subscription) GetChannel() Channel { if x != nil { return x.Channel } - return "" + return Channel_BOOK } func (x *Subscription) GetSymbol() string { @@ -238,8 +473,8 @@ type SubscribeResponse struct { Exchange string `protobuf:"bytes,1,opt,name=exchange,proto3" json:"exchange,omitempty"` Symbol string `protobuf:"bytes,2,opt,name=symbol,proto3" json:"symbol,omitempty"` - Channel string `protobuf:"bytes,3,opt,name=channel,proto3" json:"channel,omitempty"` // book, trade, ticker, user - Event string `protobuf:"bytes,4,opt,name=event,proto3" json:"event,omitempty"` // snapshot, update, order_snapshot, ... + Channel Channel `protobuf:"varint,3,opt,name=channel,proto3,enum=bbgo.Channel" json:"channel,omitempty"` // book, trade, ticker, user + Event Event `protobuf:"varint,4,opt,name=event,proto3,enum=bbgo.Event" json:"event,omitempty"` // snapshot, update, order_snapshot, ... Depth *Depth `protobuf:"bytes,5,opt,name=depth,proto3" json:"depth,omitempty"` Trades []*Trade `protobuf:"bytes,6,rep,name=trades,proto3" json:"trades,omitempty"` Ticker *Ticker `protobuf:"bytes,7,opt,name=ticker,proto3" json:"ticker,omitempty"` @@ -252,7 +487,7 @@ type SubscribeResponse struct { func (x *SubscribeResponse) Reset() { *x = SubscribeResponse{} if protoimpl.UnsafeEnabled { - mi := &file_bbgo_proto_msgTypes[4] + mi := &file_pkg_pb_bbgo_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -265,7 +500,7 @@ func (x *SubscribeResponse) String() string { func (*SubscribeResponse) ProtoMessage() {} func (x *SubscribeResponse) ProtoReflect() protoreflect.Message { - mi := &file_bbgo_proto_msgTypes[4] + mi := &file_pkg_pb_bbgo_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -278,7 +513,7 @@ func (x *SubscribeResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use SubscribeResponse.ProtoReflect.Descriptor instead. func (*SubscribeResponse) Descriptor() ([]byte, []int) { - return file_bbgo_proto_rawDescGZIP(), []int{4} + return file_pkg_pb_bbgo_proto_rawDescGZIP(), []int{4} } func (x *SubscribeResponse) GetExchange() string { @@ -295,18 +530,18 @@ func (x *SubscribeResponse) GetSymbol() string { return "" } -func (x *SubscribeResponse) GetChannel() string { +func (x *SubscribeResponse) GetChannel() Channel { if x != nil { return x.Channel } - return "" + return Channel_BOOK } -func (x *SubscribeResponse) GetEvent() string { +func (x *SubscribeResponse) GetEvent() Event { if x != nil { return x.Event } - return "" + return Event_UNKNOWN } func (x *SubscribeResponse) GetDepth() *Depth { @@ -372,7 +607,7 @@ type Depth struct { func (x *Depth) Reset() { *x = Depth{} if protoimpl.UnsafeEnabled { - mi := &file_bbgo_proto_msgTypes[5] + mi := &file_pkg_pb_bbgo_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -385,7 +620,7 @@ func (x *Depth) String() string { func (*Depth) ProtoMessage() {} func (x *Depth) ProtoReflect() protoreflect.Message { - mi := &file_bbgo_proto_msgTypes[5] + mi := &file_pkg_pb_bbgo_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -398,7 +633,7 @@ func (x *Depth) ProtoReflect() protoreflect.Message { // Deprecated: Use Depth.ProtoReflect.Descriptor instead. func (*Depth) Descriptor() ([]byte, []int) { - return file_bbgo_proto_rawDescGZIP(), []int{5} + return file_pkg_pb_bbgo_proto_rawDescGZIP(), []int{5} } func (x *Depth) GetExchange() string { @@ -441,7 +676,7 @@ type PriceVolume struct { func (x *PriceVolume) Reset() { *x = PriceVolume{} if protoimpl.UnsafeEnabled { - mi := &file_bbgo_proto_msgTypes[6] + mi := &file_pkg_pb_bbgo_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -454,7 +689,7 @@ func (x *PriceVolume) String() string { func (*PriceVolume) ProtoMessage() {} func (x *PriceVolume) ProtoReflect() protoreflect.Message { - mi := &file_bbgo_proto_msgTypes[6] + mi := &file_pkg_pb_bbgo_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -467,7 +702,7 @@ func (x *PriceVolume) ProtoReflect() protoreflect.Message { // Deprecated: Use PriceVolume.ProtoReflect.Descriptor instead. func (*PriceVolume) Descriptor() ([]byte, []int) { - return file_bbgo_proto_rawDescGZIP(), []int{6} + return file_pkg_pb_bbgo_proto_rawDescGZIP(), []int{6} } func (x *PriceVolume) GetPrice() int64 { @@ -497,7 +732,7 @@ type Trade struct { Price float64 `protobuf:"fixed64,4,opt,name=price,proto3" json:"price,omitempty"` Volume float64 `protobuf:"fixed64,5,opt,name=volume,proto3" json:"volume,omitempty"` CreatedAt int64 `protobuf:"varint,6,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` - Side string `protobuf:"bytes,7,opt,name=side,proto3" json:"side,omitempty"` + Side Side `protobuf:"varint,7,opt,name=side,proto3,enum=bbgo.Side" json:"side,omitempty"` Fee float64 `protobuf:"fixed64,8,opt,name=fee,proto3" json:"fee,omitempty"` FeeCurrency string `protobuf:"bytes,9,opt,name=fee_currency,json=feeCurrency,proto3" json:"fee_currency,omitempty"` Maker bool `protobuf:"varint,10,opt,name=maker,proto3" json:"maker,omitempty"` @@ -507,7 +742,7 @@ type Trade struct { func (x *Trade) Reset() { *x = Trade{} if protoimpl.UnsafeEnabled { - mi := &file_bbgo_proto_msgTypes[7] + mi := &file_pkg_pb_bbgo_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -520,7 +755,7 @@ func (x *Trade) String() string { func (*Trade) ProtoMessage() {} func (x *Trade) ProtoReflect() protoreflect.Message { - mi := &file_bbgo_proto_msgTypes[7] + mi := &file_pkg_pb_bbgo_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -533,7 +768,7 @@ func (x *Trade) ProtoReflect() protoreflect.Message { // Deprecated: Use Trade.ProtoReflect.Descriptor instead. func (*Trade) Descriptor() ([]byte, []int) { - return file_bbgo_proto_rawDescGZIP(), []int{7} + return file_pkg_pb_bbgo_proto_rawDescGZIP(), []int{7} } func (x *Trade) GetExchange() string { @@ -578,11 +813,11 @@ func (x *Trade) GetCreatedAt() int64 { return 0 } -func (x *Trade) GetSide() string { +func (x *Trade) GetSide() Side { if x != nil { return x.Side } - return "" + return Side_BUY } func (x *Trade) GetFee() float64 { @@ -631,7 +866,7 @@ type Ticker struct { func (x *Ticker) Reset() { *x = Ticker{} if protoimpl.UnsafeEnabled { - mi := &file_bbgo_proto_msgTypes[8] + mi := &file_pkg_pb_bbgo_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -644,7 +879,7 @@ func (x *Ticker) String() string { func (*Ticker) ProtoMessage() {} func (x *Ticker) ProtoReflect() protoreflect.Message { - mi := &file_bbgo_proto_msgTypes[8] + mi := &file_pkg_pb_bbgo_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -657,7 +892,7 @@ func (x *Ticker) ProtoReflect() protoreflect.Message { // Deprecated: Use Ticker.ProtoReflect.Descriptor instead. func (*Ticker) Descriptor() ([]byte, []int) { - return file_bbgo_proto_rawDescGZIP(), []int{8} + return file_pkg_pb_bbgo_proto_rawDescGZIP(), []int{8} } func (x *Ticker) GetExchange() string { @@ -715,27 +950,27 @@ type Order struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Exchange string `protobuf:"bytes,1,opt,name=exchange,proto3" json:"exchange,omitempty"` - Symbol string `protobuf:"bytes,2,opt,name=symbol,proto3" json:"symbol,omitempty"` - Id string `protobuf:"bytes,3,opt,name=id,proto3" json:"id,omitempty"` - Side string `protobuf:"bytes,4,opt,name=side,proto3" json:"side,omitempty"` - OrderType string `protobuf:"bytes,5,opt,name=order_type,json=orderType,proto3" json:"order_type,omitempty"` - Price float64 `protobuf:"fixed64,6,opt,name=price,proto3" json:"price,omitempty"` - StopPrice float64 `protobuf:"fixed64,7,opt,name=stop_price,json=stopPrice,proto3" json:"stop_price,omitempty"` - AvgPrice float64 `protobuf:"fixed64,8,opt,name=avg_price,json=avgPrice,proto3" json:"avg_price,omitempty"` - Status string `protobuf:"bytes,9,opt,name=status,proto3" json:"status,omitempty"` - CreatedAt int64 `protobuf:"varint,10,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` - Quantity float64 `protobuf:"fixed64,11,opt,name=quantity,proto3" json:"quantity,omitempty"` - ExecutedVolume float64 `protobuf:"fixed64,12,opt,name=executed_volume,json=executedVolume,proto3" json:"executed_volume,omitempty"` - TradesCount int64 `protobuf:"varint,13,opt,name=trades_count,json=tradesCount,proto3" json:"trades_count,omitempty"` - ClientOrderId string `protobuf:"bytes,14,opt,name=client_order_id,json=clientOrderId,proto3" json:"client_order_id,omitempty"` - GroupId int64 `protobuf:"varint,15,opt,name=group_id,json=groupId,proto3" json:"group_id,omitempty"` + Exchange string `protobuf:"bytes,1,opt,name=exchange,proto3" json:"exchange,omitempty"` + Symbol string `protobuf:"bytes,2,opt,name=symbol,proto3" json:"symbol,omitempty"` + Id string `protobuf:"bytes,3,opt,name=id,proto3" json:"id,omitempty"` + Side Side `protobuf:"varint,4,opt,name=side,proto3,enum=bbgo.Side" json:"side,omitempty"` + OrderType OrderType `protobuf:"varint,5,opt,name=order_type,json=orderType,proto3,enum=bbgo.OrderType" json:"order_type,omitempty"` + Price float64 `protobuf:"fixed64,6,opt,name=price,proto3" json:"price,omitempty"` + StopPrice float64 `protobuf:"fixed64,7,opt,name=stop_price,json=stopPrice,proto3" json:"stop_price,omitempty"` + AvgPrice float64 `protobuf:"fixed64,8,opt,name=avg_price,json=avgPrice,proto3" json:"avg_price,omitempty"` + Status string `protobuf:"bytes,9,opt,name=status,proto3" json:"status,omitempty"` + CreatedAt int64 `protobuf:"varint,10,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` + Quantity float64 `protobuf:"fixed64,11,opt,name=quantity,proto3" json:"quantity,omitempty"` + ExecutedVolume float64 `protobuf:"fixed64,12,opt,name=executed_volume,json=executedVolume,proto3" json:"executed_volume,omitempty"` + TradesCount int64 `protobuf:"varint,13,opt,name=trades_count,json=tradesCount,proto3" json:"trades_count,omitempty"` + ClientOrderId string `protobuf:"bytes,14,opt,name=client_order_id,json=clientOrderId,proto3" json:"client_order_id,omitempty"` + GroupId int64 `protobuf:"varint,15,opt,name=group_id,json=groupId,proto3" json:"group_id,omitempty"` } func (x *Order) Reset() { *x = Order{} if protoimpl.UnsafeEnabled { - mi := &file_bbgo_proto_msgTypes[9] + mi := &file_pkg_pb_bbgo_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -748,7 +983,7 @@ func (x *Order) String() string { func (*Order) ProtoMessage() {} func (x *Order) ProtoReflect() protoreflect.Message { - mi := &file_bbgo_proto_msgTypes[9] + mi := &file_pkg_pb_bbgo_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -761,7 +996,7 @@ func (x *Order) ProtoReflect() protoreflect.Message { // Deprecated: Use Order.ProtoReflect.Descriptor instead. func (*Order) Descriptor() ([]byte, []int) { - return file_bbgo_proto_rawDescGZIP(), []int{9} + return file_pkg_pb_bbgo_proto_rawDescGZIP(), []int{9} } func (x *Order) GetExchange() string { @@ -785,18 +1020,18 @@ func (x *Order) GetId() string { return "" } -func (x *Order) GetSide() string { +func (x *Order) GetSide() Side { if x != nil { return x.Side } - return "" + return Side_BUY } -func (x *Order) GetOrderType() string { +func (x *Order) GetOrderType() OrderType { if x != nil { return x.OrderType } - return "" + return OrderType_MARKET } func (x *Order) GetPrice() float64 { @@ -874,21 +1109,21 @@ type SubmitOrder struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Exchange string `protobuf:"bytes,1,opt,name=exchange,proto3" json:"exchange,omitempty"` - Symbol string `protobuf:"bytes,2,opt,name=symbol,proto3" json:"symbol,omitempty"` - Side string `protobuf:"bytes,3,opt,name=side,proto3" json:"side,omitempty"` - Quantity float64 `protobuf:"fixed64,4,opt,name=quantity,proto3" json:"quantity,omitempty"` - Price float64 `protobuf:"fixed64,5,opt,name=price,proto3" json:"price,omitempty"` - StopPrice float64 `protobuf:"fixed64,6,opt,name=stop_price,json=stopPrice,proto3" json:"stop_price,omitempty"` - OrderType string `protobuf:"bytes,7,opt,name=order_type,json=orderType,proto3" json:"order_type,omitempty"` - ClientOrderId string `protobuf:"bytes,8,opt,name=client_order_id,json=clientOrderId,proto3" json:"client_order_id,omitempty"` - GroupId int64 `protobuf:"varint,9,opt,name=group_id,json=groupId,proto3" json:"group_id,omitempty"` + Exchange string `protobuf:"bytes,1,opt,name=exchange,proto3" json:"exchange,omitempty"` + Symbol string `protobuf:"bytes,2,opt,name=symbol,proto3" json:"symbol,omitempty"` + Side Side `protobuf:"varint,3,opt,name=side,proto3,enum=bbgo.Side" json:"side,omitempty"` + Quantity float64 `protobuf:"fixed64,4,opt,name=quantity,proto3" json:"quantity,omitempty"` + Price float64 `protobuf:"fixed64,5,opt,name=price,proto3" json:"price,omitempty"` + StopPrice float64 `protobuf:"fixed64,6,opt,name=stop_price,json=stopPrice,proto3" json:"stop_price,omitempty"` + OrderType OrderType `protobuf:"varint,7,opt,name=order_type,json=orderType,proto3,enum=bbgo.OrderType" json:"order_type,omitempty"` + ClientOrderId string `protobuf:"bytes,8,opt,name=client_order_id,json=clientOrderId,proto3" json:"client_order_id,omitempty"` + GroupId int64 `protobuf:"varint,9,opt,name=group_id,json=groupId,proto3" json:"group_id,omitempty"` } func (x *SubmitOrder) Reset() { *x = SubmitOrder{} if protoimpl.UnsafeEnabled { - mi := &file_bbgo_proto_msgTypes[10] + mi := &file_pkg_pb_bbgo_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -901,7 +1136,7 @@ func (x *SubmitOrder) String() string { func (*SubmitOrder) ProtoMessage() {} func (x *SubmitOrder) ProtoReflect() protoreflect.Message { - mi := &file_bbgo_proto_msgTypes[10] + mi := &file_pkg_pb_bbgo_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -914,7 +1149,7 @@ func (x *SubmitOrder) ProtoReflect() protoreflect.Message { // Deprecated: Use SubmitOrder.ProtoReflect.Descriptor instead. func (*SubmitOrder) Descriptor() ([]byte, []int) { - return file_bbgo_proto_rawDescGZIP(), []int{10} + return file_pkg_pb_bbgo_proto_rawDescGZIP(), []int{10} } func (x *SubmitOrder) GetExchange() string { @@ -931,11 +1166,11 @@ func (x *SubmitOrder) GetSymbol() string { return "" } -func (x *SubmitOrder) GetSide() string { +func (x *SubmitOrder) GetSide() Side { if x != nil { return x.Side } - return "" + return Side_BUY } func (x *SubmitOrder) GetQuantity() float64 { @@ -959,11 +1194,11 @@ func (x *SubmitOrder) GetStopPrice() float64 { return 0 } -func (x *SubmitOrder) GetOrderType() string { +func (x *SubmitOrder) GetOrderType() OrderType { if x != nil { return x.OrderType } - return "" + return OrderType_MARKET } func (x *SubmitOrder) GetClientOrderId() string { @@ -995,7 +1230,7 @@ type Balance struct { func (x *Balance) Reset() { *x = Balance{} if protoimpl.UnsafeEnabled { - mi := &file_bbgo_proto_msgTypes[11] + mi := &file_pkg_pb_bbgo_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1008,7 +1243,7 @@ func (x *Balance) String() string { func (*Balance) ProtoMessage() {} func (x *Balance) ProtoReflect() protoreflect.Message { - mi := &file_bbgo_proto_msgTypes[11] + mi := &file_pkg_pb_bbgo_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1021,7 +1256,7 @@ func (x *Balance) ProtoReflect() protoreflect.Message { // Deprecated: Use Balance.ProtoReflect.Descriptor instead. func (*Balance) Descriptor() ([]byte, []int) { - return file_bbgo_proto_rawDescGZIP(), []int{11} + return file_pkg_pb_bbgo_proto_rawDescGZIP(), []int{11} } func (x *Balance) GetExchange() string { @@ -1063,7 +1298,7 @@ type SubmitOrderRequest struct { func (x *SubmitOrderRequest) Reset() { *x = SubmitOrderRequest{} if protoimpl.UnsafeEnabled { - mi := &file_bbgo_proto_msgTypes[12] + mi := &file_pkg_pb_bbgo_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1076,7 +1311,7 @@ func (x *SubmitOrderRequest) String() string { func (*SubmitOrderRequest) ProtoMessage() {} func (x *SubmitOrderRequest) ProtoReflect() protoreflect.Message { - mi := &file_bbgo_proto_msgTypes[12] + mi := &file_pkg_pb_bbgo_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1089,7 +1324,7 @@ func (x *SubmitOrderRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use SubmitOrderRequest.ProtoReflect.Descriptor instead. func (*SubmitOrderRequest) Descriptor() ([]byte, []int) { - return file_bbgo_proto_rawDescGZIP(), []int{12} + return file_pkg_pb_bbgo_proto_rawDescGZIP(), []int{12} } func (x *SubmitOrderRequest) GetSubmitOrder() *SubmitOrder { @@ -1111,7 +1346,7 @@ type SubmitOrderResponse struct { func (x *SubmitOrderResponse) Reset() { *x = SubmitOrderResponse{} if protoimpl.UnsafeEnabled { - mi := &file_bbgo_proto_msgTypes[13] + mi := &file_pkg_pb_bbgo_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1124,7 +1359,7 @@ func (x *SubmitOrderResponse) String() string { func (*SubmitOrderResponse) ProtoMessage() {} func (x *SubmitOrderResponse) ProtoReflect() protoreflect.Message { - mi := &file_bbgo_proto_msgTypes[13] + mi := &file_pkg_pb_bbgo_proto_msgTypes[13] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1137,7 +1372,7 @@ func (x *SubmitOrderResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use SubmitOrderResponse.ProtoReflect.Descriptor instead. func (*SubmitOrderResponse) Descriptor() ([]byte, []int) { - return file_bbgo_proto_rawDescGZIP(), []int{13} + return file_pkg_pb_bbgo_proto_rawDescGZIP(), []int{13} } func (x *SubmitOrderResponse) GetOrder() *Order { @@ -1167,7 +1402,7 @@ type CancelOrderRequest struct { func (x *CancelOrderRequest) Reset() { *x = CancelOrderRequest{} if protoimpl.UnsafeEnabled { - mi := &file_bbgo_proto_msgTypes[14] + mi := &file_pkg_pb_bbgo_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1180,7 +1415,7 @@ func (x *CancelOrderRequest) String() string { func (*CancelOrderRequest) ProtoMessage() {} func (x *CancelOrderRequest) ProtoReflect() protoreflect.Message { - mi := &file_bbgo_proto_msgTypes[14] + mi := &file_pkg_pb_bbgo_proto_msgTypes[14] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1193,7 +1428,7 @@ func (x *CancelOrderRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use CancelOrderRequest.ProtoReflect.Descriptor instead. func (*CancelOrderRequest) Descriptor() ([]byte, []int) { - return file_bbgo_proto_rawDescGZIP(), []int{14} + return file_pkg_pb_bbgo_proto_rawDescGZIP(), []int{14} } func (x *CancelOrderRequest) GetExchange() string { @@ -1229,7 +1464,7 @@ type CancelOrderResponse struct { func (x *CancelOrderResponse) Reset() { *x = CancelOrderResponse{} if protoimpl.UnsafeEnabled { - mi := &file_bbgo_proto_msgTypes[15] + mi := &file_pkg_pb_bbgo_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1242,7 +1477,7 @@ func (x *CancelOrderResponse) String() string { func (*CancelOrderResponse) ProtoMessage() {} func (x *CancelOrderResponse) ProtoReflect() protoreflect.Message { - mi := &file_bbgo_proto_msgTypes[15] + mi := &file_pkg_pb_bbgo_proto_msgTypes[15] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1255,7 +1490,7 @@ func (x *CancelOrderResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use CancelOrderResponse.ProtoReflect.Descriptor instead. func (*CancelOrderResponse) Descriptor() ([]byte, []int) { - return file_bbgo_proto_rawDescGZIP(), []int{15} + return file_pkg_pb_bbgo_proto_rawDescGZIP(), []int{15} } func (x *CancelOrderResponse) GetOrder() *Order { @@ -1285,7 +1520,7 @@ type QueryOrderRequest struct { func (x *QueryOrderRequest) Reset() { *x = QueryOrderRequest{} if protoimpl.UnsafeEnabled { - mi := &file_bbgo_proto_msgTypes[16] + mi := &file_pkg_pb_bbgo_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1298,7 +1533,7 @@ func (x *QueryOrderRequest) String() string { func (*QueryOrderRequest) ProtoMessage() {} func (x *QueryOrderRequest) ProtoReflect() protoreflect.Message { - mi := &file_bbgo_proto_msgTypes[16] + mi := &file_pkg_pb_bbgo_proto_msgTypes[16] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1311,7 +1546,7 @@ func (x *QueryOrderRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use QueryOrderRequest.ProtoReflect.Descriptor instead. func (*QueryOrderRequest) Descriptor() ([]byte, []int) { - return file_bbgo_proto_rawDescGZIP(), []int{16} + return file_pkg_pb_bbgo_proto_rawDescGZIP(), []int{16} } func (x *QueryOrderRequest) GetExchange() string { @@ -1347,7 +1582,7 @@ type QueryOrderResponse struct { func (x *QueryOrderResponse) Reset() { *x = QueryOrderResponse{} if protoimpl.UnsafeEnabled { - mi := &file_bbgo_proto_msgTypes[17] + mi := &file_pkg_pb_bbgo_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1360,7 +1595,7 @@ func (x *QueryOrderResponse) String() string { func (*QueryOrderResponse) ProtoMessage() {} func (x *QueryOrderResponse) ProtoReflect() protoreflect.Message { - mi := &file_bbgo_proto_msgTypes[17] + mi := &file_pkg_pb_bbgo_proto_msgTypes[17] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1373,7 +1608,7 @@ func (x *QueryOrderResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use QueryOrderResponse.ProtoReflect.Descriptor instead. func (*QueryOrderResponse) Descriptor() ([]byte, []int) { - return file_bbgo_proto_rawDescGZIP(), []int{17} + return file_pkg_pb_bbgo_proto_rawDescGZIP(), []int{17} } func (x *QueryOrderResponse) GetOrder() *Order { @@ -1409,7 +1644,7 @@ type QueryOrdersRequest struct { func (x *QueryOrdersRequest) Reset() { *x = QueryOrdersRequest{} if protoimpl.UnsafeEnabled { - mi := &file_bbgo_proto_msgTypes[18] + mi := &file_pkg_pb_bbgo_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1422,7 +1657,7 @@ func (x *QueryOrdersRequest) String() string { func (*QueryOrdersRequest) ProtoMessage() {} func (x *QueryOrdersRequest) ProtoReflect() protoreflect.Message { - mi := &file_bbgo_proto_msgTypes[18] + mi := &file_pkg_pb_bbgo_proto_msgTypes[18] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1435,7 +1670,7 @@ func (x *QueryOrdersRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use QueryOrdersRequest.ProtoReflect.Descriptor instead. func (*QueryOrdersRequest) Descriptor() ([]byte, []int) { - return file_bbgo_proto_rawDescGZIP(), []int{18} + return file_pkg_pb_bbgo_proto_rawDescGZIP(), []int{18} } func (x *QueryOrdersRequest) GetExchange() string { @@ -1513,7 +1748,7 @@ type QueryOrdersResponse struct { func (x *QueryOrdersResponse) Reset() { *x = QueryOrdersResponse{} if protoimpl.UnsafeEnabled { - mi := &file_bbgo_proto_msgTypes[19] + mi := &file_pkg_pb_bbgo_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1526,7 +1761,7 @@ func (x *QueryOrdersResponse) String() string { func (*QueryOrdersResponse) ProtoMessage() {} func (x *QueryOrdersResponse) ProtoReflect() protoreflect.Message { - mi := &file_bbgo_proto_msgTypes[19] + mi := &file_pkg_pb_bbgo_proto_msgTypes[19] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1539,7 +1774,7 @@ func (x *QueryOrdersResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use QueryOrdersResponse.ProtoReflect.Descriptor instead. func (*QueryOrdersResponse) Descriptor() ([]byte, []int) { - return file_bbgo_proto_rawDescGZIP(), []int{19} + return file_pkg_pb_bbgo_proto_rawDescGZIP(), []int{19} } func (x *QueryOrdersResponse) GetOrders() []*Order { @@ -1576,7 +1811,7 @@ type QueryTradesRequest struct { func (x *QueryTradesRequest) Reset() { *x = QueryTradesRequest{} if protoimpl.UnsafeEnabled { - mi := &file_bbgo_proto_msgTypes[20] + mi := &file_pkg_pb_bbgo_proto_msgTypes[20] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1589,7 +1824,7 @@ func (x *QueryTradesRequest) String() string { func (*QueryTradesRequest) ProtoMessage() {} func (x *QueryTradesRequest) ProtoReflect() protoreflect.Message { - mi := &file_bbgo_proto_msgTypes[20] + mi := &file_pkg_pb_bbgo_proto_msgTypes[20] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1602,7 +1837,7 @@ func (x *QueryTradesRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use QueryTradesRequest.ProtoReflect.Descriptor instead. func (*QueryTradesRequest) Descriptor() ([]byte, []int) { - return file_bbgo_proto_rawDescGZIP(), []int{20} + return file_pkg_pb_bbgo_proto_rawDescGZIP(), []int{20} } func (x *QueryTradesRequest) GetExchange() string { @@ -1687,7 +1922,7 @@ type QueryTradesResponse struct { func (x *QueryTradesResponse) Reset() { *x = QueryTradesResponse{} if protoimpl.UnsafeEnabled { - mi := &file_bbgo_proto_msgTypes[21] + mi := &file_pkg_pb_bbgo_proto_msgTypes[21] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1700,7 +1935,7 @@ func (x *QueryTradesResponse) String() string { func (*QueryTradesResponse) ProtoMessage() {} func (x *QueryTradesResponse) ProtoReflect() protoreflect.Message { - mi := &file_bbgo_proto_msgTypes[21] + mi := &file_pkg_pb_bbgo_proto_msgTypes[21] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1713,7 +1948,7 @@ func (x *QueryTradesResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use QueryTradesResponse.ProtoReflect.Descriptor instead. func (*QueryTradesResponse) Descriptor() ([]byte, []int) { - return file_bbgo_proto_rawDescGZIP(), []int{21} + return file_pkg_pb_bbgo_proto_rawDescGZIP(), []int{21} } func (x *QueryTradesResponse) GetTrades() []*Trade { @@ -1737,15 +1972,15 @@ type QueryKLinesRequest struct { Exchange string `protobuf:"bytes,1,opt,name=exchange,proto3" json:"exchange,omitempty"` Symbol string `protobuf:"bytes,2,opt,name=symbol,proto3" json:"symbol,omitempty"` - Limit int64 `protobuf:"varint,3,opt,name=limit,proto3" json:"limit,omitempty"` - Interval int64 `protobuf:"varint,4,opt,name=interval,proto3" json:"interval,omitempty"` // time period of K line in minute - Timestamp int64 `protobuf:"varint,5,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + Interval string `protobuf:"bytes,3,opt,name=interval,proto3" json:"interval,omitempty"` // time period of K line in minute + Timestamp int64 `protobuf:"varint,4,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + Limit int64 `protobuf:"varint,5,opt,name=limit,proto3" json:"limit,omitempty"` } func (x *QueryKLinesRequest) Reset() { *x = QueryKLinesRequest{} if protoimpl.UnsafeEnabled { - mi := &file_bbgo_proto_msgTypes[22] + mi := &file_pkg_pb_bbgo_proto_msgTypes[22] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1758,7 +1993,7 @@ func (x *QueryKLinesRequest) String() string { func (*QueryKLinesRequest) ProtoMessage() {} func (x *QueryKLinesRequest) ProtoReflect() protoreflect.Message { - mi := &file_bbgo_proto_msgTypes[22] + mi := &file_pkg_pb_bbgo_proto_msgTypes[22] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1771,7 +2006,7 @@ func (x *QueryKLinesRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use QueryKLinesRequest.ProtoReflect.Descriptor instead. func (*QueryKLinesRequest) Descriptor() ([]byte, []int) { - return file_bbgo_proto_rawDescGZIP(), []int{22} + return file_pkg_pb_bbgo_proto_rawDescGZIP(), []int{22} } func (x *QueryKLinesRequest) GetExchange() string { @@ -1788,18 +2023,11 @@ func (x *QueryKLinesRequest) GetSymbol() string { return "" } -func (x *QueryKLinesRequest) GetLimit() int64 { - if x != nil { - return x.Limit - } - return 0 -} - -func (x *QueryKLinesRequest) GetInterval() int64 { +func (x *QueryKLinesRequest) GetInterval() string { if x != nil { return x.Interval } - return 0 + return "" } func (x *QueryKLinesRequest) GetTimestamp() int64 { @@ -1809,6 +2037,13 @@ func (x *QueryKLinesRequest) GetTimestamp() int64 { return 0 } +func (x *QueryKLinesRequest) GetLimit() int64 { + if x != nil { + return x.Limit + } + return 0 +} + type QueryKLinesResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -1821,7 +2056,7 @@ type QueryKLinesResponse struct { func (x *QueryKLinesResponse) Reset() { *x = QueryKLinesResponse{} if protoimpl.UnsafeEnabled { - mi := &file_bbgo_proto_msgTypes[23] + mi := &file_pkg_pb_bbgo_proto_msgTypes[23] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1834,7 +2069,7 @@ func (x *QueryKLinesResponse) String() string { func (*QueryKLinesResponse) ProtoMessage() {} func (x *QueryKLinesResponse) ProtoReflect() protoreflect.Message { - mi := &file_bbgo_proto_msgTypes[23] + mi := &file_pkg_pb_bbgo_proto_msgTypes[23] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1847,7 +2082,7 @@ func (x *QueryKLinesResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use QueryKLinesResponse.ProtoReflect.Descriptor instead. func (*QueryKLinesResponse) Descriptor() ([]byte, []int) { - return file_bbgo_proto_rawDescGZIP(), []int{23} + return file_pkg_pb_bbgo_proto_rawDescGZIP(), []int{23} } func (x *QueryKLinesResponse) GetKlines() []*KLine { @@ -1883,7 +2118,7 @@ type KLine struct { func (x *KLine) Reset() { *x = KLine{} if protoimpl.UnsafeEnabled { - mi := &file_bbgo_proto_msgTypes[24] + mi := &file_pkg_pb_bbgo_proto_msgTypes[24] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1896,7 +2131,7 @@ func (x *KLine) String() string { func (*KLine) ProtoMessage() {} func (x *KLine) ProtoReflect() protoreflect.Message { - mi := &file_bbgo_proto_msgTypes[24] + mi := &file_pkg_pb_bbgo_proto_msgTypes[24] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1909,7 +2144,7 @@ func (x *KLine) ProtoReflect() protoreflect.Message { // Deprecated: Use KLine.ProtoReflect.Descriptor instead. func (*KLine) Descriptor() ([]byte, []int) { - return file_bbgo_proto_rawDescGZIP(), []int{24} + return file_pkg_pb_bbgo_proto_rawDescGZIP(), []int{24} } func (x *KLine) GetExchange() string { @@ -1975,98 +2210,105 @@ func (x *KLine) GetQuoteVolume() float64 { return 0 } -var File_bbgo_proto protoreflect.FileDescriptor +var File_pkg_pb_bbgo_proto protoreflect.FileDescriptor -var file_bbgo_proto_rawDesc = []byte{ - 0x0a, 0x0a, 0x62, 0x62, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, - 0x22, 0x07, 0x0a, 0x05, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x4b, 0x0a, 0x05, 0x45, 0x72, 0x72, - 0x6f, 0x72, 0x12, 0x1d, 0x0a, 0x0a, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x63, 0x6f, 0x64, 0x65, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, - 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, - 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x4d, - 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x4a, 0x0a, 0x10, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, - 0x69, 0x62, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x36, 0x0a, 0x0d, 0x73, 0x75, - 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x62, 0x2e, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x52, 0x0d, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x22, 0x72, 0x0a, 0x0c, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x18, - 0x0a, 0x07, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x07, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x79, 0x6d, 0x62, - 0x6f, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, - 0x12, 0x14, 0x0a, 0x05, 0x64, 0x65, 0x70, 0x74, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, - 0x05, 0x64, 0x65, 0x70, 0x74, 0x68, 0x22, 0xf1, 0x02, 0x0a, 0x11, 0x53, 0x75, 0x62, 0x73, 0x63, - 0x72, 0x69, 0x62, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1a, 0x0a, 0x08, - 0x65, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, - 0x65, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x79, 0x6d, 0x62, - 0x6f, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, - 0x12, 0x18, 0x0a, 0x07, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x07, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x76, - 0x65, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x76, 0x65, 0x6e, 0x74, - 0x12, 0x1f, 0x0a, 0x05, 0x64, 0x65, 0x70, 0x74, 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x09, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x70, 0x74, 0x68, 0x52, 0x05, 0x64, 0x65, 0x70, 0x74, - 0x68, 0x12, 0x21, 0x0a, 0x06, 0x74, 0x72, 0x61, 0x64, 0x65, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x09, 0x2e, 0x70, 0x62, 0x2e, 0x54, 0x72, 0x61, 0x64, 0x65, 0x52, 0x06, 0x74, 0x72, - 0x61, 0x64, 0x65, 0x73, 0x12, 0x22, 0x0a, 0x06, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x72, 0x18, 0x07, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x70, 0x62, 0x2e, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x72, - 0x52, 0x06, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x72, 0x12, 0x21, 0x0a, 0x06, 0x6f, 0x72, 0x64, 0x65, - 0x72, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x70, 0x62, 0x2e, 0x4f, 0x72, - 0x64, 0x65, 0x72, 0x52, 0x06, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x73, 0x12, 0x27, 0x0a, 0x08, 0x62, - 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0b, 0x2e, - 0x70, 0x62, 0x2e, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x08, 0x62, 0x61, 0x6c, 0x61, - 0x6e, 0x63, 0x65, 0x73, 0x12, 0x23, 0x0a, 0x0d, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, - 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0c, 0x73, 0x75, 0x62, - 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x64, 0x41, 0x74, 0x12, 0x1f, 0x0a, 0x05, 0x65, 0x72, 0x72, - 0x6f, 0x72, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x70, 0x62, 0x2e, 0x45, 0x72, - 0x72, 0x6f, 0x72, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22, 0x85, 0x01, 0x0a, 0x05, 0x44, - 0x65, 0x70, 0x74, 0x68, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, - 0x12, 0x16, 0x0a, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x12, 0x23, 0x0a, 0x04, 0x61, 0x73, 0x6b, 0x73, - 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x70, 0x62, 0x2e, 0x50, 0x72, 0x69, 0x63, - 0x65, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x52, 0x04, 0x61, 0x73, 0x6b, 0x73, 0x12, 0x23, 0x0a, - 0x04, 0x62, 0x69, 0x64, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x70, 0x62, - 0x2e, 0x50, 0x72, 0x69, 0x63, 0x65, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x52, 0x04, 0x62, 0x69, - 0x64, 0x73, 0x22, 0x3b, 0x0a, 0x0b, 0x50, 0x72, 0x69, 0x63, 0x65, 0x56, 0x6f, 0x6c, 0x75, 0x6d, - 0x65, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, - 0x52, 0x05, 0x70, 0x72, 0x69, 0x63, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x76, 0x6f, 0x6c, 0x75, 0x6d, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x22, - 0x8d, 0x02, 0x0a, 0x05, 0x54, 0x72, 0x61, 0x64, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x78, 0x63, - 0x68, 0x61, 0x6e, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x78, 0x63, - 0x68, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x12, 0x0e, 0x0a, - 0x02, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x14, 0x0a, - 0x05, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x01, 0x52, 0x05, 0x70, 0x72, - 0x69, 0x63, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x18, 0x05, 0x20, - 0x01, 0x28, 0x01, 0x52, 0x06, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x63, - 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, - 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, - 0x64, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x73, 0x69, 0x64, 0x65, 0x12, 0x10, - 0x0a, 0x03, 0x66, 0x65, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x01, 0x52, 0x03, 0x66, 0x65, 0x65, - 0x12, 0x21, 0x0a, 0x0c, 0x66, 0x65, 0x65, 0x5f, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, - 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x66, 0x65, 0x65, 0x43, 0x75, 0x72, 0x72, 0x65, - 0x6e, 0x63, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x6d, 0x61, 0x6b, 0x65, 0x72, 0x18, 0x0a, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x05, 0x6d, 0x61, 0x6b, 0x65, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x72, 0x65, - 0x6e, 0x64, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x72, 0x65, 0x6e, 0x64, 0x22, - 0xa4, 0x01, 0x0a, 0x06, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x78, - 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x78, - 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x12, 0x12, - 0x0a, 0x04, 0x6f, 0x70, 0x65, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x01, 0x52, 0x04, 0x6f, 0x70, - 0x65, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x69, 0x67, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x01, - 0x52, 0x04, 0x68, 0x69, 0x67, 0x68, 0x12, 0x10, 0x0a, 0x03, 0x6c, 0x6f, 0x77, 0x18, 0x05, 0x20, - 0x01, 0x28, 0x01, 0x52, 0x03, 0x6c, 0x6f, 0x77, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6c, 0x6f, 0x73, - 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x01, 0x52, 0x05, 0x63, 0x6c, 0x6f, 0x73, 0x65, 0x12, 0x16, - 0x0a, 0x06, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x01, 0x52, 0x06, - 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x22, 0xb2, 0x03, 0x0a, 0x05, 0x4f, 0x72, 0x64, 0x65, 0x72, +var file_pkg_pb_bbgo_proto_rawDesc = []byte{ + 0x0a, 0x11, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x62, 0x2f, 0x62, 0x62, 0x67, 0x6f, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x12, 0x04, 0x62, 0x62, 0x67, 0x6f, 0x22, 0x07, 0x0a, 0x05, 0x45, 0x6d, 0x70, + 0x74, 0x79, 0x22, 0x4b, 0x0a, 0x05, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x1d, 0x0a, 0x0a, 0x65, + 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x09, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x65, 0x72, + 0x72, 0x6f, 0x72, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0c, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, + 0x4c, 0x0a, 0x10, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x38, 0x0a, 0x0d, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x62, 0x62, 0x67, + 0x6f, 0x2e, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0d, + 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x81, 0x01, + 0x0a, 0x0c, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1a, + 0x0a, 0x08, 0x65, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x08, 0x65, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x27, 0x0a, 0x07, 0x63, 0x68, + 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0d, 0x2e, 0x62, 0x62, + 0x67, 0x6f, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x52, 0x07, 0x63, 0x68, 0x61, 0x6e, + 0x6e, 0x65, 0x6c, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x64, + 0x65, 0x70, 0x74, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x64, 0x65, 0x70, 0x74, + 0x68, 0x22, 0x99, 0x03, 0x0a, 0x11, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x78, 0x63, 0x68, 0x61, + 0x6e, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x78, 0x63, 0x68, 0x61, + 0x6e, 0x67, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x12, 0x27, 0x0a, 0x07, 0x63, + 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0d, 0x2e, 0x62, + 0x62, 0x67, 0x6f, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x52, 0x07, 0x63, 0x68, 0x61, + 0x6e, 0x6e, 0x65, 0x6c, 0x12, 0x21, 0x0a, 0x05, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x0e, 0x32, 0x0b, 0x2e, 0x62, 0x62, 0x67, 0x6f, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, + 0x52, 0x05, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x21, 0x0a, 0x05, 0x64, 0x65, 0x70, 0x74, 0x68, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x62, 0x62, 0x67, 0x6f, 0x2e, 0x44, 0x65, + 0x70, 0x74, 0x68, 0x52, 0x05, 0x64, 0x65, 0x70, 0x74, 0x68, 0x12, 0x23, 0x0a, 0x06, 0x74, 0x72, + 0x61, 0x64, 0x65, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x62, 0x62, 0x67, + 0x6f, 0x2e, 0x54, 0x72, 0x61, 0x64, 0x65, 0x52, 0x06, 0x74, 0x72, 0x61, 0x64, 0x65, 0x73, 0x12, + 0x24, 0x0a, 0x06, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x0c, 0x2e, 0x62, 0x62, 0x67, 0x6f, 0x2e, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x72, 0x52, 0x06, 0x74, + 0x69, 0x63, 0x6b, 0x65, 0x72, 0x12, 0x23, 0x0a, 0x06, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x73, 0x18, + 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x62, 0x62, 0x67, 0x6f, 0x2e, 0x4f, 0x72, 0x64, + 0x65, 0x72, 0x52, 0x06, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x73, 0x12, 0x29, 0x0a, 0x08, 0x62, 0x61, + 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x62, + 0x62, 0x67, 0x6f, 0x2e, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x08, 0x62, 0x61, 0x6c, + 0x61, 0x6e, 0x63, 0x65, 0x73, 0x12, 0x23, 0x0a, 0x0d, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, + 0x62, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0c, 0x73, 0x75, + 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x64, 0x41, 0x74, 0x12, 0x21, 0x0a, 0x05, 0x65, 0x72, + 0x72, 0x6f, 0x72, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x62, 0x62, 0x67, 0x6f, + 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22, 0x89, 0x01, + 0x0a, 0x05, 0x44, 0x65, 0x70, 0x74, 0x68, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x78, 0x63, 0x68, 0x61, + 0x6e, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x78, 0x63, 0x68, 0x61, + 0x6e, 0x67, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x12, 0x25, 0x0a, 0x04, 0x61, + 0x73, 0x6b, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x62, 0x62, 0x67, 0x6f, + 0x2e, 0x50, 0x72, 0x69, 0x63, 0x65, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x52, 0x04, 0x61, 0x73, + 0x6b, 0x73, 0x12, 0x25, 0x0a, 0x04, 0x62, 0x69, 0x64, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x11, 0x2e, 0x62, 0x62, 0x67, 0x6f, 0x2e, 0x50, 0x72, 0x69, 0x63, 0x65, 0x56, 0x6f, 0x6c, + 0x75, 0x6d, 0x65, 0x52, 0x04, 0x62, 0x69, 0x64, 0x73, 0x22, 0x3b, 0x0a, 0x0b, 0x50, 0x72, 0x69, + 0x63, 0x65, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x72, 0x69, 0x63, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x70, 0x72, 0x69, 0x63, 0x65, 0x12, 0x16, + 0x0a, 0x06, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, + 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x22, 0x99, 0x02, 0x0a, 0x05, 0x54, 0x72, 0x61, 0x64, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x64, 0x65, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x04, 0x73, 0x69, 0x64, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x6f, 0x72, 0x64, 0x65, - 0x72, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6f, 0x72, + 0x52, 0x02, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x01, 0x52, 0x05, 0x70, 0x72, 0x69, 0x63, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x76, 0x6f, + 0x6c, 0x75, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x01, 0x52, 0x06, 0x76, 0x6f, 0x6c, 0x75, + 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, + 0x74, 0x12, 0x1e, 0x0a, 0x04, 0x73, 0x69, 0x64, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0e, 0x32, + 0x0a, 0x2e, 0x62, 0x62, 0x67, 0x6f, 0x2e, 0x53, 0x69, 0x64, 0x65, 0x52, 0x04, 0x73, 0x69, 0x64, + 0x65, 0x12, 0x10, 0x0a, 0x03, 0x66, 0x65, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x01, 0x52, 0x03, + 0x66, 0x65, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x66, 0x65, 0x65, 0x5f, 0x63, 0x75, 0x72, 0x72, 0x65, + 0x6e, 0x63, 0x79, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x66, 0x65, 0x65, 0x43, 0x75, + 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x6d, 0x61, 0x6b, 0x65, 0x72, 0x18, + 0x0a, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x6d, 0x61, 0x6b, 0x65, 0x72, 0x12, 0x14, 0x0a, 0x05, + 0x74, 0x72, 0x65, 0x6e, 0x64, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x72, 0x65, + 0x6e, 0x64, 0x22, 0xa4, 0x01, 0x0a, 0x06, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x72, 0x12, 0x1a, 0x0a, + 0x08, 0x65, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x08, 0x65, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x79, 0x6d, + 0x62, 0x6f, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, + 0x6c, 0x12, 0x12, 0x0a, 0x04, 0x6f, 0x70, 0x65, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x01, 0x52, + 0x04, 0x6f, 0x70, 0x65, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x69, 0x67, 0x68, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x01, 0x52, 0x04, 0x68, 0x69, 0x67, 0x68, 0x12, 0x10, 0x0a, 0x03, 0x6c, 0x6f, 0x77, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x01, 0x52, 0x03, 0x6c, 0x6f, 0x77, 0x12, 0x14, 0x0a, 0x05, 0x63, + 0x6c, 0x6f, 0x73, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x01, 0x52, 0x05, 0x63, 0x6c, 0x6f, 0x73, + 0x65, 0x12, 0x16, 0x0a, 0x06, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, + 0x01, 0x52, 0x06, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x22, 0xcf, 0x03, 0x0a, 0x05, 0x4f, 0x72, + 0x64, 0x65, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x12, + 0x16, 0x0a, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1e, 0x0a, 0x04, 0x73, 0x69, 0x64, 0x65, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0a, 0x2e, 0x62, 0x62, 0x67, 0x6f, 0x2e, 0x53, 0x69, 0x64, + 0x65, 0x52, 0x04, 0x73, 0x69, 0x64, 0x65, 0x12, 0x2e, 0x0a, 0x0a, 0x6f, 0x72, 0x64, 0x65, 0x72, + 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0f, 0x2e, 0x62, 0x62, + 0x67, 0x6f, 0x2e, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x52, 0x09, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x01, 0x52, 0x05, 0x70, 0x72, 0x69, 0x63, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x74, 0x6f, 0x70, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, @@ -2086,268 +2328,315 @@ var file_bbgo_proto_rawDesc = []byte{ 0x6e, 0x74, 0x5f, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x49, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x0f, 0x20, 0x01, - 0x28, 0x03, 0x52, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x22, 0x88, 0x02, 0x0a, 0x0b, + 0x28, 0x03, 0x52, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x22, 0xa5, 0x02, 0x0a, 0x0b, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x12, - 0x12, 0x0a, 0x04, 0x73, 0x69, 0x64, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x73, - 0x69, 0x64, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x71, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x01, 0x52, 0x08, 0x71, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, - 0x14, 0x0a, 0x05, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x01, 0x52, 0x05, - 0x70, 0x72, 0x69, 0x63, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x74, 0x6f, 0x70, 0x5f, 0x70, 0x72, - 0x69, 0x63, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x01, 0x52, 0x09, 0x73, 0x74, 0x6f, 0x70, 0x50, - 0x72, 0x69, 0x63, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x5f, 0x74, 0x79, - 0x70, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x54, - 0x79, 0x70, 0x65, 0x12, 0x26, 0x0a, 0x0f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x6f, 0x72, - 0x64, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x63, 0x6c, - 0x69, 0x65, 0x6e, 0x74, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x49, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x67, - 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x67, - 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x22, 0x77, 0x0a, 0x07, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, - 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x1a, 0x0a, - 0x08, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x08, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x76, 0x61, - 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x01, 0x52, 0x09, 0x61, 0x76, - 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6c, 0x6f, 0x63, 0x6b, 0x65, - 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x01, 0x52, 0x06, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x22, - 0x48, 0x0a, 0x12, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x32, 0x0a, 0x0c, 0x73, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x5f, - 0x6f, 0x72, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x70, 0x62, - 0x2e, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x0b, 0x73, 0x75, - 0x62, 0x6d, 0x69, 0x74, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x22, 0x57, 0x0a, 0x13, 0x53, 0x75, 0x62, - 0x6d, 0x69, 0x74, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x1f, 0x0a, 0x05, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x09, 0x2e, 0x70, 0x62, 0x2e, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x05, 0x6f, 0x72, 0x64, 0x65, - 0x72, 0x12, 0x1f, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x09, 0x2e, 0x70, 0x62, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x05, 0x65, 0x72, 0x72, - 0x6f, 0x72, 0x22, 0x68, 0x0a, 0x12, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x4f, 0x72, 0x64, 0x65, - 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x78, 0x63, 0x68, - 0x61, 0x6e, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x78, 0x63, 0x68, - 0x61, 0x6e, 0x67, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x02, 0x69, 0x64, 0x12, 0x26, 0x0a, 0x0f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x6f, - 0x72, 0x64, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x63, - 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x49, 0x64, 0x22, 0x57, 0x0a, 0x13, - 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x1f, 0x0a, 0x05, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x70, 0x62, 0x2e, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x05, 0x6f, - 0x72, 0x64, 0x65, 0x72, 0x12, 0x1f, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x70, 0x62, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x05, - 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22, 0x67, 0x0a, 0x11, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4f, 0x72, - 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x78, - 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x78, - 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x26, 0x0a, 0x0f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, - 0x5f, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0d, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x49, 0x64, 0x22, 0x56, - 0x0a, 0x12, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1f, 0x0a, 0x05, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x70, 0x62, 0x2e, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x05, - 0x6f, 0x72, 0x64, 0x65, 0x72, 0x12, 0x1f, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x70, 0x62, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, - 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22, 0xf6, 0x01, 0x0a, 0x12, 0x51, 0x75, 0x65, 0x72, 0x79, - 0x4f, 0x72, 0x64, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, - 0x08, 0x65, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x08, 0x65, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x79, 0x6d, - 0x62, 0x6f, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, - 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, - 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x6f, 0x72, 0x64, 0x65, 0x72, - 0x5f, 0x62, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6f, 0x72, 0x64, 0x65, 0x72, - 0x42, 0x79, 0x12, 0x19, 0x0a, 0x08, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x05, - 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x12, 0x1e, 0x0a, - 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, - 0x08, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, - 0x04, 0x70, 0x61, 0x67, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x70, 0x61, 0x67, - 0x65, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, - 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, - 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x22, - 0x59, 0x0a, 0x13, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x73, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x21, 0x0a, 0x06, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x73, - 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x70, 0x62, 0x2e, 0x4f, 0x72, 0x64, 0x65, - 0x72, 0x52, 0x06, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x73, 0x12, 0x1f, 0x0a, 0x05, 0x65, 0x72, 0x72, - 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x70, 0x62, 0x2e, 0x45, 0x72, - 0x72, 0x6f, 0x72, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22, 0x87, 0x02, 0x0a, 0x12, 0x51, - 0x75, 0x65, 0x72, 0x79, 0x54, 0x72, 0x61, 0x64, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x1e, 0x0a, 0x04, 0x73, 0x69, 0x64, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0a, 0x2e, + 0x62, 0x62, 0x67, 0x6f, 0x2e, 0x53, 0x69, 0x64, 0x65, 0x52, 0x04, 0x73, 0x69, 0x64, 0x65, 0x12, + 0x1a, 0x0a, 0x08, 0x71, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x01, 0x52, 0x08, 0x71, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x70, + 0x72, 0x69, 0x63, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x01, 0x52, 0x05, 0x70, 0x72, 0x69, 0x63, + 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x74, 0x6f, 0x70, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x01, 0x52, 0x09, 0x73, 0x74, 0x6f, 0x70, 0x50, 0x72, 0x69, 0x63, 0x65, + 0x12, 0x2e, 0x0a, 0x0a, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x07, + 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0f, 0x2e, 0x62, 0x62, 0x67, 0x6f, 0x2e, 0x4f, 0x72, 0x64, 0x65, + 0x72, 0x54, 0x79, 0x70, 0x65, 0x52, 0x09, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, + 0x12, 0x26, 0x0a, 0x0f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x6f, 0x72, 0x64, 0x65, 0x72, + 0x5f, 0x69, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x63, 0x6c, 0x69, 0x65, 0x6e, + 0x74, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x49, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x67, 0x72, 0x6f, 0x75, + 0x70, 0x5f, 0x69, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x67, 0x72, 0x6f, 0x75, + 0x70, 0x49, 0x64, 0x22, 0x77, 0x0a, 0x07, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x1a, + 0x0a, 0x08, 0x65, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x08, 0x65, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x75, + 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x75, + 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, + 0x62, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x01, 0x52, 0x09, 0x61, 0x76, 0x61, 0x69, 0x6c, + 0x61, 0x62, 0x6c, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x01, 0x52, 0x06, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x22, 0x4a, 0x0a, 0x12, + 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x34, 0x0a, 0x0c, 0x73, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x5f, 0x6f, 0x72, 0x64, + 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x62, 0x62, 0x67, 0x6f, 0x2e, + 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x0b, 0x73, 0x75, 0x62, + 0x6d, 0x69, 0x74, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x22, 0x5b, 0x0a, 0x13, 0x53, 0x75, 0x62, 0x6d, + 0x69, 0x74, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x21, 0x0a, 0x05, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, + 0x2e, 0x62, 0x62, 0x67, 0x6f, 0x2e, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x05, 0x6f, 0x72, 0x64, + 0x65, 0x72, 0x12, 0x21, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x0b, 0x2e, 0x62, 0x62, 0x67, 0x6f, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x05, + 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22, 0x68, 0x0a, 0x12, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x4f, + 0x72, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x65, + 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, + 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x26, 0x0a, 0x0f, 0x63, 0x6c, 0x69, 0x65, 0x6e, + 0x74, 0x5f, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0d, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x49, 0x64, 0x22, + 0x5b, 0x0a, 0x13, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x21, 0x0a, 0x05, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x62, 0x62, 0x67, 0x6f, 0x2e, 0x4f, 0x72, 0x64, + 0x65, 0x72, 0x52, 0x05, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x12, 0x21, 0x0a, 0x05, 0x65, 0x72, 0x72, + 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x62, 0x62, 0x67, 0x6f, 0x2e, + 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22, 0x67, 0x0a, 0x11, + 0x51, 0x75, 0x65, 0x72, 0x79, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x16, 0x0a, - 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, - 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, - 0x6d, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, - 0x61, 0x6d, 0x70, 0x12, 0x12, 0x0a, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x03, 0x52, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x12, 0x0e, 0x0a, 0x02, 0x74, 0x6f, 0x18, 0x05, 0x20, - 0x01, 0x28, 0x03, 0x52, 0x02, 0x74, 0x6f, 0x12, 0x19, 0x0a, 0x08, 0x6f, 0x72, 0x64, 0x65, 0x72, - 0x5f, 0x62, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6f, 0x72, 0x64, 0x65, 0x72, - 0x42, 0x79, 0x12, 0x1e, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x67, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, - 0x52, 0x04, 0x70, 0x61, 0x67, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, - 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x16, 0x0a, 0x06, - 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x6f, 0x66, - 0x66, 0x73, 0x65, 0x74, 0x22, 0x59, 0x0a, 0x13, 0x51, 0x75, 0x65, 0x72, 0x79, 0x54, 0x72, 0x61, - 0x64, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x21, 0x0a, 0x06, 0x74, - 0x72, 0x61, 0x64, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x70, 0x62, - 0x2e, 0x54, 0x72, 0x61, 0x64, 0x65, 0x52, 0x06, 0x74, 0x72, 0x61, 0x64, 0x65, 0x73, 0x12, 0x1f, - 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x09, 0x2e, - 0x70, 0x62, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22, - 0x98, 0x01, 0x0a, 0x12, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4b, 0x4c, 0x69, 0x6e, 0x65, 0x73, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x78, 0x63, 0x68, 0x61, 0x6e, + 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x0e, 0x0a, + 0x02, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x26, 0x0a, + 0x0f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x5f, 0x69, 0x64, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4f, 0x72, + 0x64, 0x65, 0x72, 0x49, 0x64, 0x22, 0x5a, 0x0a, 0x12, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4f, 0x72, + 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x21, 0x0a, 0x05, 0x6f, + 0x72, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x62, 0x62, 0x67, + 0x6f, 0x2e, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x05, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x12, 0x21, + 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, + 0x62, 0x62, 0x67, 0x6f, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, + 0x72, 0x22, 0xf6, 0x01, 0x0a, 0x12, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4f, 0x72, 0x64, 0x65, 0x72, + 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x78, 0x63, 0x68, + 0x61, 0x6e, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x78, 0x63, 0x68, + 0x61, 0x6e, 0x67, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x12, 0x14, 0x0a, 0x05, + 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x73, 0x74, 0x61, + 0x74, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x5f, 0x62, 0x79, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x42, 0x79, 0x12, 0x19, 0x0a, + 0x08, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, + 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x70, 0x61, + 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x67, 0x65, + 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x70, 0x61, 0x67, 0x65, 0x12, 0x14, 0x0a, 0x05, + 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x6c, 0x69, 0x6d, + 0x69, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x09, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x22, 0x5d, 0x0a, 0x13, 0x51, 0x75, + 0x65, 0x72, 0x79, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x23, 0x0a, 0x06, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x0b, 0x2e, 0x62, 0x62, 0x67, 0x6f, 0x2e, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x06, + 0x6f, 0x72, 0x64, 0x65, 0x72, 0x73, 0x12, 0x21, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x62, 0x62, 0x67, 0x6f, 0x2e, 0x45, 0x72, 0x72, + 0x6f, 0x72, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22, 0x87, 0x02, 0x0a, 0x12, 0x51, 0x75, + 0x65, 0x72, 0x79, 0x54, 0x72, 0x61, 0x64, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x08, 0x65, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x16, 0x0a, 0x06, + 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x79, + 0x6d, 0x62, 0x6f, 0x6c, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, + 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, + 0x6d, 0x70, 0x12, 0x12, 0x0a, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x12, 0x0e, 0x0a, 0x02, 0x74, 0x6f, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x02, 0x74, 0x6f, 0x12, 0x19, 0x0a, 0x08, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x5f, + 0x62, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x42, + 0x79, 0x12, 0x1e, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, + 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x67, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x04, 0x70, 0x61, 0x67, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x09, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x6f, + 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x6f, 0x66, 0x66, + 0x73, 0x65, 0x74, 0x22, 0x5d, 0x0a, 0x13, 0x51, 0x75, 0x65, 0x72, 0x79, 0x54, 0x72, 0x61, 0x64, + 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x23, 0x0a, 0x06, 0x74, 0x72, + 0x61, 0x64, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x62, 0x62, 0x67, + 0x6f, 0x2e, 0x54, 0x72, 0x61, 0x64, 0x65, 0x52, 0x06, 0x74, 0x72, 0x61, 0x64, 0x65, 0x73, 0x12, + 0x21, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, + 0x2e, 0x62, 0x62, 0x67, 0x6f, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x05, 0x65, 0x72, 0x72, + 0x6f, 0x72, 0x22, 0x98, 0x01, 0x0a, 0x12, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4b, 0x4c, 0x69, 0x6e, + 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x78, 0x63, + 0x68, 0x61, 0x6e, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x78, 0x63, + 0x68, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x12, 0x1a, 0x0a, + 0x08, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x08, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, + 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, + 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x22, 0x5d, 0x0a, + 0x13, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4b, 0x4c, 0x69, 0x6e, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x23, 0x0a, 0x06, 0x6b, 0x6c, 0x69, 0x6e, 0x65, 0x73, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x62, 0x62, 0x67, 0x6f, 0x2e, 0x4b, 0x4c, 0x69, 0x6e, + 0x65, 0x52, 0x06, 0x6b, 0x6c, 0x69, 0x6e, 0x65, 0x73, 0x12, 0x21, 0x0a, 0x05, 0x65, 0x72, 0x72, + 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x62, 0x62, 0x67, 0x6f, 0x2e, + 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22, 0xe4, 0x01, 0x0a, + 0x05, 0x4b, 0x4c, 0x69, 0x6e, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, - 0x6d, 0x69, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, - 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x03, 0x52, 0x08, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x12, 0x1c, 0x0a, 0x09, - 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, - 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x22, 0x59, 0x0a, 0x13, 0x51, 0x75, - 0x65, 0x72, 0x79, 0x4b, 0x4c, 0x69, 0x6e, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x21, 0x0a, 0x06, 0x6b, 0x6c, 0x69, 0x6e, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x09, 0x2e, 0x70, 0x62, 0x2e, 0x4b, 0x4c, 0x69, 0x6e, 0x65, 0x52, 0x06, 0x6b, 0x6c, - 0x69, 0x6e, 0x65, 0x73, 0x12, 0x1f, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x70, 0x62, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x05, - 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22, 0xe4, 0x01, 0x0a, 0x05, 0x4b, 0x4c, 0x69, 0x6e, 0x65, 0x12, - 0x1a, 0x0a, 0x08, 0x65, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x08, 0x65, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, - 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x79, 0x6d, - 0x62, 0x6f, 0x6c, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, - 0x70, 0x12, 0x12, 0x0a, 0x04, 0x6f, 0x70, 0x65, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x01, 0x52, - 0x04, 0x6f, 0x70, 0x65, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x69, 0x67, 0x68, 0x18, 0x05, 0x20, - 0x01, 0x28, 0x01, 0x52, 0x04, 0x68, 0x69, 0x67, 0x68, 0x12, 0x10, 0x0a, 0x03, 0x6c, 0x6f, 0x77, - 0x18, 0x06, 0x20, 0x01, 0x28, 0x01, 0x52, 0x03, 0x6c, 0x6f, 0x77, 0x12, 0x14, 0x0a, 0x05, 0x63, - 0x6c, 0x6f, 0x73, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x01, 0x52, 0x05, 0x63, 0x6c, 0x6f, 0x73, - 0x65, 0x12, 0x16, 0x0a, 0x06, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, - 0x01, 0x52, 0x06, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x71, 0x75, 0x6f, - 0x74, 0x65, 0x5f, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x01, 0x52, - 0x0b, 0x71, 0x75, 0x6f, 0x74, 0x65, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x32, 0x86, 0x04, 0x0a, - 0x04, 0x42, 0x42, 0x47, 0x4f, 0x12, 0x3b, 0x0a, 0x08, 0x53, 0x75, 0x62, 0x63, 0x72, 0x69, 0x62, - 0x65, 0x12, 0x14, 0x2e, 0x70, 0x62, 0x2e, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x70, 0x62, 0x2e, 0x53, 0x75, 0x62, - 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, - 0x30, 0x01, 0x12, 0x38, 0x0a, 0x10, 0x53, 0x75, 0x62, 0x63, 0x72, 0x69, 0x62, 0x65, 0x55, 0x73, - 0x65, 0x72, 0x44, 0x61, 0x74, 0x61, 0x12, 0x09, 0x2e, 0x70, 0x62, 0x2e, 0x45, 0x6d, 0x70, 0x74, - 0x79, 0x1a, 0x15, 0x2e, 0x70, 0x62, 0x2e, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x30, 0x01, 0x12, 0x40, 0x0a, 0x0b, - 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x12, 0x16, 0x2e, 0x70, 0x62, - 0x2e, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x4f, - 0x72, 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x40, - 0x0a, 0x0b, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x12, 0x16, 0x2e, - 0x70, 0x62, 0x2e, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x61, 0x6e, 0x63, 0x65, - 0x6c, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, - 0x12, 0x3d, 0x0a, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x12, 0x15, - 0x2e, 0x70, 0x62, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x70, 0x62, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, - 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, - 0x40, 0x0a, 0x0b, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x73, 0x12, 0x16, - 0x2e, 0x70, 0x62, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x73, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x51, 0x75, 0x65, 0x72, - 0x79, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x00, 0x12, 0x40, 0x0a, 0x0b, 0x51, 0x75, 0x65, 0x72, 0x79, 0x54, 0x72, 0x61, 0x64, 0x65, 0x73, - 0x12, 0x16, 0x2e, 0x70, 0x62, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x54, 0x72, 0x61, 0x64, 0x65, - 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x51, 0x75, - 0x65, 0x72, 0x79, 0x54, 0x72, 0x61, 0x64, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x00, 0x12, 0x40, 0x0a, 0x0b, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4b, 0x4c, 0x69, 0x6e, - 0x65, 0x73, 0x12, 0x16, 0x2e, 0x70, 0x62, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4b, 0x4c, 0x69, - 0x6e, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x70, 0x62, 0x2e, - 0x51, 0x75, 0x65, 0x72, 0x79, 0x4b, 0x4c, 0x69, 0x6e, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x07, 0x5a, 0x05, 0x2e, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x28, 0x09, 0x52, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, + 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, + 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x12, 0x0a, 0x04, 0x6f, 0x70, 0x65, 0x6e, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x01, 0x52, 0x04, 0x6f, 0x70, 0x65, 0x6e, 0x12, 0x12, 0x0a, 0x04, + 0x68, 0x69, 0x67, 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, 0x01, 0x52, 0x04, 0x68, 0x69, 0x67, 0x68, + 0x12, 0x10, 0x0a, 0x03, 0x6c, 0x6f, 0x77, 0x18, 0x06, 0x20, 0x01, 0x28, 0x01, 0x52, 0x03, 0x6c, + 0x6f, 0x77, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6c, 0x6f, 0x73, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, + 0x01, 0x52, 0x05, 0x63, 0x6c, 0x6f, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x76, 0x6f, 0x6c, 0x75, + 0x6d, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x01, 0x52, 0x06, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, + 0x12, 0x21, 0x0a, 0x0c, 0x71, 0x75, 0x6f, 0x74, 0x65, 0x5f, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, + 0x18, 0x09, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0b, 0x71, 0x75, 0x6f, 0x74, 0x65, 0x56, 0x6f, 0x6c, + 0x75, 0x6d, 0x65, 0x2a, 0xe4, 0x01, 0x0a, 0x05, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x0b, 0x0a, + 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x0e, 0x0a, 0x0a, 0x53, 0x55, + 0x42, 0x53, 0x43, 0x52, 0x49, 0x42, 0x45, 0x44, 0x10, 0x01, 0x12, 0x10, 0x0a, 0x0c, 0x55, 0x4e, + 0x53, 0x55, 0x42, 0x53, 0x43, 0x52, 0x49, 0x42, 0x45, 0x44, 0x10, 0x02, 0x12, 0x0c, 0x0a, 0x08, + 0x53, 0x4e, 0x41, 0x50, 0x53, 0x48, 0x4f, 0x54, 0x10, 0x03, 0x12, 0x0a, 0x0a, 0x06, 0x55, 0x50, + 0x44, 0x41, 0x54, 0x45, 0x10, 0x04, 0x12, 0x11, 0x0a, 0x0d, 0x41, 0x55, 0x54, 0x48, 0x45, 0x4e, + 0x54, 0x49, 0x43, 0x41, 0x54, 0x45, 0x44, 0x10, 0x05, 0x12, 0x12, 0x0a, 0x0e, 0x4f, 0x52, 0x44, + 0x45, 0x52, 0x5f, 0x53, 0x4e, 0x41, 0x50, 0x53, 0x48, 0x4f, 0x54, 0x10, 0x06, 0x12, 0x10, 0x0a, + 0x0c, 0x4f, 0x52, 0x44, 0x45, 0x52, 0x5f, 0x55, 0x50, 0x44, 0x41, 0x54, 0x45, 0x10, 0x07, 0x12, + 0x12, 0x0a, 0x0e, 0x54, 0x52, 0x41, 0x44, 0x45, 0x5f, 0x53, 0x4e, 0x41, 0x50, 0x53, 0x48, 0x4f, + 0x54, 0x10, 0x08, 0x12, 0x10, 0x0a, 0x0c, 0x54, 0x52, 0x41, 0x44, 0x45, 0x5f, 0x55, 0x50, 0x44, + 0x41, 0x54, 0x45, 0x10, 0x09, 0x12, 0x14, 0x0a, 0x10, 0x41, 0x43, 0x43, 0x4f, 0x55, 0x4e, 0x54, + 0x5f, 0x53, 0x4e, 0x41, 0x50, 0x53, 0x48, 0x4f, 0x54, 0x10, 0x0a, 0x12, 0x12, 0x0a, 0x0e, 0x41, + 0x43, 0x43, 0x4f, 0x55, 0x4e, 0x54, 0x5f, 0x55, 0x50, 0x44, 0x41, 0x54, 0x45, 0x10, 0x0b, 0x12, + 0x09, 0x0a, 0x05, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, 0x63, 0x2a, 0x34, 0x0a, 0x07, 0x43, 0x68, + 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x12, 0x08, 0x0a, 0x04, 0x42, 0x4f, 0x4f, 0x4b, 0x10, 0x00, 0x12, + 0x09, 0x0a, 0x05, 0x54, 0x52, 0x41, 0x44, 0x45, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x54, 0x49, + 0x43, 0x4b, 0x45, 0x52, 0x10, 0x02, 0x12, 0x08, 0x0a, 0x04, 0x55, 0x53, 0x45, 0x52, 0x10, 0x03, + 0x2a, 0x19, 0x0a, 0x04, 0x53, 0x69, 0x64, 0x65, 0x12, 0x07, 0x0a, 0x03, 0x42, 0x55, 0x59, 0x10, + 0x00, 0x12, 0x08, 0x0a, 0x04, 0x53, 0x45, 0x4c, 0x4c, 0x10, 0x01, 0x2a, 0x61, 0x0a, 0x09, 0x4f, + 0x72, 0x64, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0a, 0x0a, 0x06, 0x4d, 0x41, 0x52, 0x4b, + 0x45, 0x54, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x4c, 0x49, 0x4d, 0x49, 0x54, 0x10, 0x01, 0x12, + 0x0f, 0x0a, 0x0b, 0x53, 0x54, 0x4f, 0x50, 0x5f, 0x4d, 0x41, 0x52, 0x4b, 0x45, 0x54, 0x10, 0x02, + 0x12, 0x0e, 0x0a, 0x0a, 0x53, 0x54, 0x4f, 0x50, 0x5f, 0x4c, 0x49, 0x4d, 0x49, 0x54, 0x10, 0x03, + 0x12, 0x0d, 0x0a, 0x09, 0x50, 0x4f, 0x53, 0x54, 0x5f, 0x4f, 0x4e, 0x4c, 0x59, 0x10, 0x04, 0x12, + 0x0d, 0x0a, 0x09, 0x49, 0x4f, 0x43, 0x5f, 0x4c, 0x49, 0x4d, 0x49, 0x54, 0x10, 0x05, 0x32, 0x9b, + 0x01, 0x0a, 0x11, 0x4d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x44, 0x61, 0x74, 0x61, 0x53, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x12, 0x40, 0x0a, 0x09, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, + 0x65, 0x12, 0x16, 0x2e, 0x62, 0x62, 0x67, 0x6f, 0x2e, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, + 0x62, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x62, 0x62, 0x67, 0x6f, + 0x2e, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x00, 0x30, 0x01, 0x12, 0x44, 0x0a, 0x0b, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4b, + 0x4c, 0x69, 0x6e, 0x65, 0x73, 0x12, 0x18, 0x2e, 0x62, 0x62, 0x67, 0x6f, 0x2e, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x4b, 0x4c, 0x69, 0x6e, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x19, 0x2e, 0x62, 0x62, 0x67, 0x6f, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4b, 0x4c, 0x69, 0x6e, + 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x32, 0x50, 0x0a, 0x0f, + 0x55, 0x73, 0x65, 0x72, 0x44, 0x61, 0x74, 0x61, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, + 0x3d, 0x0a, 0x11, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x55, 0x73, 0x65, 0x72, + 0x44, 0x61, 0x74, 0x61, 0x12, 0x0b, 0x2e, 0x62, 0x62, 0x67, 0x6f, 0x2e, 0x45, 0x6d, 0x70, 0x74, + 0x79, 0x1a, 0x17, 0x2e, 0x62, 0x62, 0x67, 0x6f, 0x2e, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, + 0x62, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x30, 0x01, 0x32, 0xeb, + 0x02, 0x0a, 0x0e, 0x54, 0x72, 0x61, 0x64, 0x69, 0x6e, 0x67, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x12, 0x44, 0x0a, 0x0b, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x4f, 0x72, 0x64, 0x65, 0x72, + 0x12, 0x18, 0x2e, 0x62, 0x62, 0x67, 0x6f, 0x2e, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x4f, 0x72, + 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x62, 0x62, 0x67, + 0x6f, 0x2e, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x44, 0x0a, 0x0b, 0x43, 0x61, 0x6e, 0x63, 0x65, + 0x6c, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x12, 0x18, 0x2e, 0x62, 0x62, 0x67, 0x6f, 0x2e, 0x43, 0x61, + 0x6e, 0x63, 0x65, 0x6c, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x19, 0x2e, 0x62, 0x62, 0x67, 0x6f, 0x2e, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x4f, 0x72, + 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x41, 0x0a, + 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x12, 0x17, 0x2e, 0x62, 0x62, + 0x67, 0x6f, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x62, 0x62, 0x67, 0x6f, 0x2e, 0x51, 0x75, 0x65, 0x72, + 0x79, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, + 0x12, 0x44, 0x0a, 0x0b, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x73, 0x12, + 0x18, 0x2e, 0x62, 0x62, 0x67, 0x6f, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4f, 0x72, 0x64, 0x65, + 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x62, 0x62, 0x67, 0x6f, + 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x44, 0x0a, 0x0b, 0x51, 0x75, 0x65, 0x72, 0x79, 0x54, + 0x72, 0x61, 0x64, 0x65, 0x73, 0x12, 0x18, 0x2e, 0x62, 0x62, 0x67, 0x6f, 0x2e, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x54, 0x72, 0x61, 0x64, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x19, 0x2e, 0x62, 0x62, 0x67, 0x6f, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x54, 0x72, 0x61, 0x64, + 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x07, 0x5a, 0x05, + 0x2e, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( - file_bbgo_proto_rawDescOnce sync.Once - file_bbgo_proto_rawDescData = file_bbgo_proto_rawDesc + file_pkg_pb_bbgo_proto_rawDescOnce sync.Once + file_pkg_pb_bbgo_proto_rawDescData = file_pkg_pb_bbgo_proto_rawDesc ) -func file_bbgo_proto_rawDescGZIP() []byte { - file_bbgo_proto_rawDescOnce.Do(func() { - file_bbgo_proto_rawDescData = protoimpl.X.CompressGZIP(file_bbgo_proto_rawDescData) +func file_pkg_pb_bbgo_proto_rawDescGZIP() []byte { + file_pkg_pb_bbgo_proto_rawDescOnce.Do(func() { + file_pkg_pb_bbgo_proto_rawDescData = protoimpl.X.CompressGZIP(file_pkg_pb_bbgo_proto_rawDescData) }) - return file_bbgo_proto_rawDescData + return file_pkg_pb_bbgo_proto_rawDescData } -var file_bbgo_proto_msgTypes = make([]protoimpl.MessageInfo, 25) -var file_bbgo_proto_goTypes = []interface{}{ - (*Empty)(nil), // 0: pb.Empty - (*Error)(nil), // 1: pb.Error - (*SubscribeRequest)(nil), // 2: pb.SubscribeRequest - (*Subscription)(nil), // 3: pb.Subscription - (*SubscribeResponse)(nil), // 4: pb.SubscribeResponse - (*Depth)(nil), // 5: pb.Depth - (*PriceVolume)(nil), // 6: pb.PriceVolume - (*Trade)(nil), // 7: pb.Trade - (*Ticker)(nil), // 8: pb.Ticker - (*Order)(nil), // 9: pb.Order - (*SubmitOrder)(nil), // 10: pb.SubmitOrder - (*Balance)(nil), // 11: pb.Balance - (*SubmitOrderRequest)(nil), // 12: pb.SubmitOrderRequest - (*SubmitOrderResponse)(nil), // 13: pb.SubmitOrderResponse - (*CancelOrderRequest)(nil), // 14: pb.CancelOrderRequest - (*CancelOrderResponse)(nil), // 15: pb.CancelOrderResponse - (*QueryOrderRequest)(nil), // 16: pb.QueryOrderRequest - (*QueryOrderResponse)(nil), // 17: pb.QueryOrderResponse - (*QueryOrdersRequest)(nil), // 18: pb.QueryOrdersRequest - (*QueryOrdersResponse)(nil), // 19: pb.QueryOrdersResponse - (*QueryTradesRequest)(nil), // 20: pb.QueryTradesRequest - (*QueryTradesResponse)(nil), // 21: pb.QueryTradesResponse - (*QueryKLinesRequest)(nil), // 22: pb.QueryKLinesRequest - (*QueryKLinesResponse)(nil), // 23: pb.QueryKLinesResponse - (*KLine)(nil), // 24: pb.KLine +var file_pkg_pb_bbgo_proto_enumTypes = make([]protoimpl.EnumInfo, 4) +var file_pkg_pb_bbgo_proto_msgTypes = make([]protoimpl.MessageInfo, 25) +var file_pkg_pb_bbgo_proto_goTypes = []interface{}{ + (Event)(0), // 0: bbgo.Event + (Channel)(0), // 1: bbgo.Channel + (Side)(0), // 2: bbgo.Side + (OrderType)(0), // 3: bbgo.OrderType + (*Empty)(nil), // 4: bbgo.Empty + (*Error)(nil), // 5: bbgo.Error + (*SubscribeRequest)(nil), // 6: bbgo.SubscribeRequest + (*Subscription)(nil), // 7: bbgo.Subscription + (*SubscribeResponse)(nil), // 8: bbgo.SubscribeResponse + (*Depth)(nil), // 9: bbgo.Depth + (*PriceVolume)(nil), // 10: bbgo.PriceVolume + (*Trade)(nil), // 11: bbgo.Trade + (*Ticker)(nil), // 12: bbgo.Ticker + (*Order)(nil), // 13: bbgo.Order + (*SubmitOrder)(nil), // 14: bbgo.SubmitOrder + (*Balance)(nil), // 15: bbgo.Balance + (*SubmitOrderRequest)(nil), // 16: bbgo.SubmitOrderRequest + (*SubmitOrderResponse)(nil), // 17: bbgo.SubmitOrderResponse + (*CancelOrderRequest)(nil), // 18: bbgo.CancelOrderRequest + (*CancelOrderResponse)(nil), // 19: bbgo.CancelOrderResponse + (*QueryOrderRequest)(nil), // 20: bbgo.QueryOrderRequest + (*QueryOrderResponse)(nil), // 21: bbgo.QueryOrderResponse + (*QueryOrdersRequest)(nil), // 22: bbgo.QueryOrdersRequest + (*QueryOrdersResponse)(nil), // 23: bbgo.QueryOrdersResponse + (*QueryTradesRequest)(nil), // 24: bbgo.QueryTradesRequest + (*QueryTradesResponse)(nil), // 25: bbgo.QueryTradesResponse + (*QueryKLinesRequest)(nil), // 26: bbgo.QueryKLinesRequest + (*QueryKLinesResponse)(nil), // 27: bbgo.QueryKLinesResponse + (*KLine)(nil), // 28: bbgo.KLine } -var file_bbgo_proto_depIdxs = []int32{ - 3, // 0: pb.SubscribeRequest.subscriptions:type_name -> pb.Subscription - 5, // 1: pb.SubscribeResponse.depth:type_name -> pb.Depth - 7, // 2: pb.SubscribeResponse.trades:type_name -> pb.Trade - 8, // 3: pb.SubscribeResponse.ticker:type_name -> pb.Ticker - 9, // 4: pb.SubscribeResponse.orders:type_name -> pb.Order - 11, // 5: pb.SubscribeResponse.balances:type_name -> pb.Balance - 1, // 6: pb.SubscribeResponse.error:type_name -> pb.Error - 6, // 7: pb.Depth.asks:type_name -> pb.PriceVolume - 6, // 8: pb.Depth.bids:type_name -> pb.PriceVolume - 10, // 9: pb.SubmitOrderRequest.submit_order:type_name -> pb.SubmitOrder - 9, // 10: pb.SubmitOrderResponse.order:type_name -> pb.Order - 1, // 11: pb.SubmitOrderResponse.error:type_name -> pb.Error - 9, // 12: pb.CancelOrderResponse.order:type_name -> pb.Order - 1, // 13: pb.CancelOrderResponse.error:type_name -> pb.Error - 9, // 14: pb.QueryOrderResponse.order:type_name -> pb.Order - 1, // 15: pb.QueryOrderResponse.error:type_name -> pb.Error - 9, // 16: pb.QueryOrdersResponse.orders:type_name -> pb.Order - 1, // 17: pb.QueryOrdersResponse.error:type_name -> pb.Error - 7, // 18: pb.QueryTradesResponse.trades:type_name -> pb.Trade - 1, // 19: pb.QueryTradesResponse.error:type_name -> pb.Error - 24, // 20: pb.QueryKLinesResponse.klines:type_name -> pb.KLine - 1, // 21: pb.QueryKLinesResponse.error:type_name -> pb.Error - 2, // 22: pb.BBGO.Subcribe:input_type -> pb.SubscribeRequest - 0, // 23: pb.BBGO.SubcribeUserData:input_type -> pb.Empty - 12, // 24: pb.BBGO.SubmitOrder:input_type -> pb.SubmitOrderRequest - 14, // 25: pb.BBGO.CancelOrder:input_type -> pb.CancelOrderRequest - 16, // 26: pb.BBGO.QueryOrder:input_type -> pb.QueryOrderRequest - 18, // 27: pb.BBGO.QueryOrders:input_type -> pb.QueryOrdersRequest - 20, // 28: pb.BBGO.QueryTrades:input_type -> pb.QueryTradesRequest - 22, // 29: pb.BBGO.QueryKLines:input_type -> pb.QueryKLinesRequest - 4, // 30: pb.BBGO.Subcribe:output_type -> pb.SubscribeResponse - 4, // 31: pb.BBGO.SubcribeUserData:output_type -> pb.SubscribeResponse - 13, // 32: pb.BBGO.SubmitOrder:output_type -> pb.SubmitOrderResponse - 15, // 33: pb.BBGO.CancelOrder:output_type -> pb.CancelOrderResponse - 17, // 34: pb.BBGO.QueryOrder:output_type -> pb.QueryOrderResponse - 19, // 35: pb.BBGO.QueryOrders:output_type -> pb.QueryOrdersResponse - 21, // 36: pb.BBGO.QueryTrades:output_type -> pb.QueryTradesResponse - 23, // 37: pb.BBGO.QueryKLines:output_type -> pb.QueryKLinesResponse - 30, // [30:38] is the sub-list for method output_type - 22, // [22:30] is the sub-list for method input_type - 22, // [22:22] is the sub-list for extension type_name - 22, // [22:22] is the sub-list for extension extendee - 0, // [0:22] is the sub-list for field type_name +var file_pkg_pb_bbgo_proto_depIdxs = []int32{ + 7, // 0: bbgo.SubscribeRequest.subscriptions:type_name -> bbgo.Subscription + 1, // 1: bbgo.Subscription.channel:type_name -> bbgo.Channel + 1, // 2: bbgo.SubscribeResponse.channel:type_name -> bbgo.Channel + 0, // 3: bbgo.SubscribeResponse.event:type_name -> bbgo.Event + 9, // 4: bbgo.SubscribeResponse.depth:type_name -> bbgo.Depth + 11, // 5: bbgo.SubscribeResponse.trades:type_name -> bbgo.Trade + 12, // 6: bbgo.SubscribeResponse.ticker:type_name -> bbgo.Ticker + 13, // 7: bbgo.SubscribeResponse.orders:type_name -> bbgo.Order + 15, // 8: bbgo.SubscribeResponse.balances:type_name -> bbgo.Balance + 5, // 9: bbgo.SubscribeResponse.error:type_name -> bbgo.Error + 10, // 10: bbgo.Depth.asks:type_name -> bbgo.PriceVolume + 10, // 11: bbgo.Depth.bids:type_name -> bbgo.PriceVolume + 2, // 12: bbgo.Trade.side:type_name -> bbgo.Side + 2, // 13: bbgo.Order.side:type_name -> bbgo.Side + 3, // 14: bbgo.Order.order_type:type_name -> bbgo.OrderType + 2, // 15: bbgo.SubmitOrder.side:type_name -> bbgo.Side + 3, // 16: bbgo.SubmitOrder.order_type:type_name -> bbgo.OrderType + 14, // 17: bbgo.SubmitOrderRequest.submit_order:type_name -> bbgo.SubmitOrder + 13, // 18: bbgo.SubmitOrderResponse.order:type_name -> bbgo.Order + 5, // 19: bbgo.SubmitOrderResponse.error:type_name -> bbgo.Error + 13, // 20: bbgo.CancelOrderResponse.order:type_name -> bbgo.Order + 5, // 21: bbgo.CancelOrderResponse.error:type_name -> bbgo.Error + 13, // 22: bbgo.QueryOrderResponse.order:type_name -> bbgo.Order + 5, // 23: bbgo.QueryOrderResponse.error:type_name -> bbgo.Error + 13, // 24: bbgo.QueryOrdersResponse.orders:type_name -> bbgo.Order + 5, // 25: bbgo.QueryOrdersResponse.error:type_name -> bbgo.Error + 11, // 26: bbgo.QueryTradesResponse.trades:type_name -> bbgo.Trade + 5, // 27: bbgo.QueryTradesResponse.error:type_name -> bbgo.Error + 28, // 28: bbgo.QueryKLinesResponse.klines:type_name -> bbgo.KLine + 5, // 29: bbgo.QueryKLinesResponse.error:type_name -> bbgo.Error + 6, // 30: bbgo.MarketDataService.Subscribe:input_type -> bbgo.SubscribeRequest + 26, // 31: bbgo.MarketDataService.QueryKLines:input_type -> bbgo.QueryKLinesRequest + 4, // 32: bbgo.UserDataService.SubscribeUserData:input_type -> bbgo.Empty + 16, // 33: bbgo.TradingService.SubmitOrder:input_type -> bbgo.SubmitOrderRequest + 18, // 34: bbgo.TradingService.CancelOrder:input_type -> bbgo.CancelOrderRequest + 20, // 35: bbgo.TradingService.QueryOrder:input_type -> bbgo.QueryOrderRequest + 22, // 36: bbgo.TradingService.QueryOrders:input_type -> bbgo.QueryOrdersRequest + 24, // 37: bbgo.TradingService.QueryTrades:input_type -> bbgo.QueryTradesRequest + 8, // 38: bbgo.MarketDataService.Subscribe:output_type -> bbgo.SubscribeResponse + 27, // 39: bbgo.MarketDataService.QueryKLines:output_type -> bbgo.QueryKLinesResponse + 8, // 40: bbgo.UserDataService.SubscribeUserData:output_type -> bbgo.SubscribeResponse + 17, // 41: bbgo.TradingService.SubmitOrder:output_type -> bbgo.SubmitOrderResponse + 19, // 42: bbgo.TradingService.CancelOrder:output_type -> bbgo.CancelOrderResponse + 21, // 43: bbgo.TradingService.QueryOrder:output_type -> bbgo.QueryOrderResponse + 23, // 44: bbgo.TradingService.QueryOrders:output_type -> bbgo.QueryOrdersResponse + 25, // 45: bbgo.TradingService.QueryTrades:output_type -> bbgo.QueryTradesResponse + 38, // [38:46] is the sub-list for method output_type + 30, // [30:38] is the sub-list for method input_type + 30, // [30:30] is the sub-list for extension type_name + 30, // [30:30] is the sub-list for extension extendee + 0, // [0:30] is the sub-list for field type_name } -func init() { file_bbgo_proto_init() } -func file_bbgo_proto_init() { - if File_bbgo_proto != nil { +func init() { file_pkg_pb_bbgo_proto_init() } +func file_pkg_pb_bbgo_proto_init() { + if File_pkg_pb_bbgo_proto != nil { return } if !protoimpl.UnsafeEnabled { - file_bbgo_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_pkg_pb_bbgo_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Empty); i { case 0: return &v.state @@ -2359,7 +2648,7 @@ func file_bbgo_proto_init() { return nil } } - file_bbgo_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + file_pkg_pb_bbgo_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Error); i { case 0: return &v.state @@ -2371,7 +2660,7 @@ func file_bbgo_proto_init() { return nil } } - file_bbgo_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + file_pkg_pb_bbgo_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*SubscribeRequest); i { case 0: return &v.state @@ -2383,7 +2672,7 @@ func file_bbgo_proto_init() { return nil } } - file_bbgo_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + file_pkg_pb_bbgo_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Subscription); i { case 0: return &v.state @@ -2395,7 +2684,7 @@ func file_bbgo_proto_init() { return nil } } - file_bbgo_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + file_pkg_pb_bbgo_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*SubscribeResponse); i { case 0: return &v.state @@ -2407,7 +2696,7 @@ func file_bbgo_proto_init() { return nil } } - file_bbgo_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + file_pkg_pb_bbgo_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Depth); i { case 0: return &v.state @@ -2419,7 +2708,7 @@ func file_bbgo_proto_init() { return nil } } - file_bbgo_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + file_pkg_pb_bbgo_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*PriceVolume); i { case 0: return &v.state @@ -2431,7 +2720,7 @@ func file_bbgo_proto_init() { return nil } } - file_bbgo_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + file_pkg_pb_bbgo_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Trade); i { case 0: return &v.state @@ -2443,7 +2732,7 @@ func file_bbgo_proto_init() { return nil } } - file_bbgo_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + file_pkg_pb_bbgo_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Ticker); i { case 0: return &v.state @@ -2455,7 +2744,7 @@ func file_bbgo_proto_init() { return nil } } - file_bbgo_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + file_pkg_pb_bbgo_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Order); i { case 0: return &v.state @@ -2467,7 +2756,7 @@ func file_bbgo_proto_init() { return nil } } - file_bbgo_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + file_pkg_pb_bbgo_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*SubmitOrder); i { case 0: return &v.state @@ -2479,7 +2768,7 @@ func file_bbgo_proto_init() { return nil } } - file_bbgo_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + file_pkg_pb_bbgo_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Balance); i { case 0: return &v.state @@ -2491,7 +2780,7 @@ func file_bbgo_proto_init() { return nil } } - file_bbgo_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + file_pkg_pb_bbgo_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*SubmitOrderRequest); i { case 0: return &v.state @@ -2503,7 +2792,7 @@ func file_bbgo_proto_init() { return nil } } - file_bbgo_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + file_pkg_pb_bbgo_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*SubmitOrderResponse); i { case 0: return &v.state @@ -2515,7 +2804,7 @@ func file_bbgo_proto_init() { return nil } } - file_bbgo_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + file_pkg_pb_bbgo_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CancelOrderRequest); i { case 0: return &v.state @@ -2527,7 +2816,7 @@ func file_bbgo_proto_init() { return nil } } - file_bbgo_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + file_pkg_pb_bbgo_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CancelOrderResponse); i { case 0: return &v.state @@ -2539,7 +2828,7 @@ func file_bbgo_proto_init() { return nil } } - file_bbgo_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + file_pkg_pb_bbgo_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*QueryOrderRequest); i { case 0: return &v.state @@ -2551,7 +2840,7 @@ func file_bbgo_proto_init() { return nil } } - file_bbgo_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + file_pkg_pb_bbgo_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*QueryOrderResponse); i { case 0: return &v.state @@ -2563,7 +2852,7 @@ func file_bbgo_proto_init() { return nil } } - file_bbgo_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + file_pkg_pb_bbgo_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*QueryOrdersRequest); i { case 0: return &v.state @@ -2575,7 +2864,7 @@ func file_bbgo_proto_init() { return nil } } - file_bbgo_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + file_pkg_pb_bbgo_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*QueryOrdersResponse); i { case 0: return &v.state @@ -2587,7 +2876,7 @@ func file_bbgo_proto_init() { return nil } } - file_bbgo_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { + file_pkg_pb_bbgo_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*QueryTradesRequest); i { case 0: return &v.state @@ -2599,7 +2888,7 @@ func file_bbgo_proto_init() { return nil } } - file_bbgo_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { + file_pkg_pb_bbgo_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*QueryTradesResponse); i { case 0: return &v.state @@ -2611,7 +2900,7 @@ func file_bbgo_proto_init() { return nil } } - file_bbgo_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { + file_pkg_pb_bbgo_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*QueryKLinesRequest); i { case 0: return &v.state @@ -2623,7 +2912,7 @@ func file_bbgo_proto_init() { return nil } } - file_bbgo_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { + file_pkg_pb_bbgo_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*QueryKLinesResponse); i { case 0: return &v.state @@ -2635,7 +2924,7 @@ func file_bbgo_proto_init() { return nil } } - file_bbgo_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { + file_pkg_pb_bbgo_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*KLine); i { case 0: return &v.state @@ -2652,18 +2941,19 @@ func file_bbgo_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_bbgo_proto_rawDesc, - NumEnums: 0, + RawDescriptor: file_pkg_pb_bbgo_proto_rawDesc, + NumEnums: 4, NumMessages: 25, NumExtensions: 0, - NumServices: 1, + NumServices: 3, }, - GoTypes: file_bbgo_proto_goTypes, - DependencyIndexes: file_bbgo_proto_depIdxs, - MessageInfos: file_bbgo_proto_msgTypes, + GoTypes: file_pkg_pb_bbgo_proto_goTypes, + DependencyIndexes: file_pkg_pb_bbgo_proto_depIdxs, + EnumInfos: file_pkg_pb_bbgo_proto_enumTypes, + MessageInfos: file_pkg_pb_bbgo_proto_msgTypes, }.Build() - File_bbgo_proto = out.File - file_bbgo_proto_rawDesc = nil - file_bbgo_proto_goTypes = nil - file_bbgo_proto_depIdxs = nil + File_pkg_pb_bbgo_proto = out.File + file_pkg_pb_bbgo_proto_rawDesc = nil + file_pkg_pb_bbgo_proto_goTypes = nil + file_pkg_pb_bbgo_proto_depIdxs = nil } diff --git a/pkg/pb/bbgo.proto b/pkg/pb/bbgo.proto index 1bc699fc1..7c336a685 100644 --- a/pkg/pb/bbgo.proto +++ b/pkg/pb/bbgo.proto @@ -1,256 +1,262 @@ syntax = "proto3"; -package pb; +package bbgo; option go_package = "../pb"; -service BBGO { - // should support streaming - rpc Subcribe(SubscribeRequest) returns (stream SubscribeResponse) {} - rpc SubcribeUserData(Empty) returns (stream SubscribeResponse) {} +service MarketDataService { + rpc Subscribe(SubscribeRequest) returns (stream SubscribeResponse) {} + rpc QueryKLines(QueryKLinesRequest) returns (QueryKLinesResponse) {} +} - // request-response - rpc SubmitOrder(SubmitOrderRequest) returns (SubmitOrderResponse) {} - rpc CancelOrder(CancelOrderRequest) returns (CancelOrderResponse) {} - rpc QueryOrder(QueryOrderRequest) returns (QueryOrderResponse) {} - rpc QueryOrders(QueryOrdersRequest) returns (QueryOrdersResponse) {} - rpc QueryTrades(QueryTradesRequest) returns (QueryTradesResponse) {} - rpc QueryKLines(QueryKLinesRequest) returns (QueryKLinesResponse) {} +service UserDataService { + // should support streaming + rpc SubscribeUserData(Empty) returns (stream SubscribeResponse) {} +} + +service TradingService { + // request-response + rpc SubmitOrder(SubmitOrderRequest) returns (SubmitOrderResponse) {} + rpc CancelOrder(CancelOrderRequest) returns (CancelOrderResponse) {} + rpc QueryOrder(QueryOrderRequest) returns (QueryOrderResponse) {} + rpc QueryOrders(QueryOrdersRequest) returns (QueryOrdersResponse) {} + rpc QueryTrades(QueryTradesRequest) returns (QueryTradesResponse) {} } enum Event { - ERROR = 0; - SUBSCRIBED = 1; - UNSUBSCRIBED = 2; - SNAPSHOT = 3; - UPDATE = 4; - AUTHENTICATED = 5; - ORDER_SNAPSHOT = 6; - ORDER_UPDATE = 7; - TRADE_SNAPSHOT = 8; - TRADE_UPDATE = 9; - ACCOUNT_SNAPSHOT = 10; - ACCOUNT_UPDATE = 11; + UNKNOWN = 0; + SUBSCRIBED = 1; + UNSUBSCRIBED = 2; + SNAPSHOT = 3; + UPDATE = 4; + AUTHENTICATED = 5; + ORDER_SNAPSHOT = 6; + ORDER_UPDATE = 7; + TRADE_SNAPSHOT = 8; + TRADE_UPDATE = 9; + ACCOUNT_SNAPSHOT = 10; + ACCOUNT_UPDATE = 11; + ERROR = 99; } enum Channel { - BOOK = 0; - TRADE = 1; - TICKER = 2; - USER = 3; + BOOK = 0; + TRADE = 1; + TICKER = 2; + USER = 3; } enum Side { - BUY = 0; - SELL = 1; + BUY = 0; + SELL = 1; } enum OrderType { - MARKET = 0; - LIMIT = 1; - STOP_MARKET = 2; - STOP_LIMIT = 3; - POST_ONLY = 4; - IOC_LIMIT = 5; + MARKET = 0; + LIMIT = 1; + STOP_MARKET = 2; + STOP_LIMIT = 3; + POST_ONLY = 4; + IOC_LIMIT = 5; } message Empty {} message Error { - int64 error_code = 1; - string error_message = 2; + int64 error_code = 1; + string error_message = 2; } message SubscribeRequest { - repeated Subscription subscriptions = 1; + repeated Subscription subscriptions = 1; } message Subscription { - string exchange = 1; - Channel channel = 2; // book, trade, ticker - string symbol = 3; - int64 depth = 4; + string exchange = 1; + Channel channel = 2; // book, trade, ticker + string symbol = 3; + int64 depth = 4; } message SubscribeResponse { - string exchange = 1; - string symbol = 2; - Channel channel = 3; // book, trade, ticker, user - Event event = 4; // snapshot, update, order_snapshot, ... - Depth depth = 5; - repeated Trade trades = 6; - Ticker ticker = 7; - repeated Order orders = 8; - repeated Balance balances = 9; - int64 subscribed_at = 10; - Error error = 11; + string exchange = 1; + string symbol = 2; + Channel channel = 3; // book, trade, ticker, user + Event event = 4; // snapshot, update, order_snapshot, ... + Depth depth = 5; + repeated Trade trades = 6; + Ticker ticker = 7; + repeated Order orders = 8; + repeated Balance balances = 9; + int64 subscribed_at = 10; + Error error = 11; } message Depth { - string exchange = 1; - string symbol = 2; - repeated PriceVolume asks = 3; - repeated PriceVolume bids = 4; + string exchange = 1; + string symbol = 2; + repeated PriceVolume asks = 3; + repeated PriceVolume bids = 4; } message PriceVolume { - int64 price = 1; - int64 volume = 2; + int64 price = 1; + int64 volume = 2; } // https://maicoin.github.io/max-websocket-docs/#/private_channels?id=trade-response // https://maicoin.github.io/max-websocket-docs/#/public_trade?id=success-response message Trade { - string exchange = 1; - string symbol = 2; - string id = 3; - double price = 4; - double volume = 5; - int64 created_at = 6; - Side side = 7; - double fee = 8; - string fee_currency = 9; - bool maker = 10; - string trend = 11; + string exchange = 1; + string symbol = 2; + string id = 3; + double price = 4; + double volume = 5; + int64 created_at = 6; + Side side = 7; + double fee = 8; + string fee_currency = 9; + bool maker = 10; + string trend = 11; } // https://maicoin.github.io/max-websocket-docs/#/public_ticker?id=success-response message Ticker { - string exchange = 1; - string symbol = 2; - double open = 3; - double high = 4; - double low = 5; - double close = 6; - double volume = 7; + string exchange = 1; + string symbol = 2; + double open = 3; + double high = 4; + double low = 5; + double close = 6; + double volume = 7; } // https://maicoin.github.io/max-websocket-docs/#/private_channels?id=snapshot message Order { - string exchange = 1; - string symbol = 2; - string id = 3; - Side side = 4; - OrderType order_type = 5; - double price = 6; - double stop_price = 7; - double avg_price = 8; - string status = 9; - int64 created_at = 10; - double quantity = 11; - double executed_volume = 12; - int64 trades_count = 13; - string client_order_id = 14; - int64 group_id = 15; + string exchange = 1; + string symbol = 2; + string id = 3; + Side side = 4; + OrderType order_type = 5; + double price = 6; + double stop_price = 7; + double avg_price = 8; + string status = 9; + int64 created_at = 10; + double quantity = 11; + double executed_volume = 12; + int64 trades_count = 13; + string client_order_id = 14; + int64 group_id = 15; } message SubmitOrder { - string exchange = 1; - string symbol = 2; - Side side = 3; - double quantity = 4; - double price = 5; - double stop_price = 6; - OrderType order_type = 7; - string client_order_id = 8; - int64 group_id = 9; + string exchange = 1; + string symbol = 2; + Side side = 3; + double quantity = 4; + double price = 5; + double stop_price = 6; + OrderType order_type = 7; + string client_order_id = 8; + int64 group_id = 9; } // https://maicoin.github.io/max-websocket-docs/#/private_channels?id=account-response message Balance { - string exchange = 1; - string currency = 2; - double available = 3; - double locked = 4; + string exchange = 1; + string currency = 2; + double available = 3; + double locked = 4; } message SubmitOrderRequest { - SubmitOrder submit_order = 1; + SubmitOrder submit_order = 1; } message SubmitOrderResponse { - Order order = 1; - Error error = 2; + Order order = 1; + Error error = 2; } message CancelOrderRequest { - string exchange = 1; - string id = 2; - string client_order_id = 3; + string exchange = 1; + string id = 2; + string client_order_id = 3; } message CancelOrderResponse { - Order order = 1; - Error error = 2; + Order order = 1; + Error error = 2; } message QueryOrderRequest { - string exchange = 1; - string id = 2; - string client_order_id = 3; + string exchange = 1; + string id = 2; + string client_order_id = 3; } message QueryOrderResponse { - Order order = 1; - Error error = 2; + Order order = 1; + Error error = 2; } message QueryOrdersRequest { - string exchange = 1; - string symbol = 2; - repeated string state = 3; - string order_by = 4; - int64 group_id = 5; - bool pagination = 6; - int64 page = 7; - int64 limit = 8; - int64 offset = 9; + string exchange = 1; + string symbol = 2; + repeated string state = 3; + string order_by = 4; + int64 group_id = 5; + bool pagination = 6; + int64 page = 7; + int64 limit = 8; + int64 offset = 9; } message QueryOrdersResponse { - repeated Order orders = 1; - Error error = 2; + repeated Order orders = 1; + Error error = 2; } message QueryTradesRequest { - string exchange = 1; - string symbol = 2; - int64 timestamp = 3; - int64 from = 4; - int64 to = 5; - string order_by = 6; - bool pagination = 7; - int64 page = 8; - int64 limit = 9; - int64 offset = 10; + string exchange = 1; + string symbol = 2; + int64 timestamp = 3; + int64 from = 4; + int64 to = 5; + string order_by = 6; + bool pagination = 7; + int64 page = 8; + int64 limit = 9; + int64 offset = 10; } message QueryTradesResponse { - repeated Trade trades = 1; - Error error = 2; + repeated Trade trades = 1; + Error error = 2; } message QueryKLinesRequest { - string exchange = 1; - string symbol = 2; - int64 limit = 3; - int64 interval = 4; // time period of K line in minute - int64 timestamp = 5; + string exchange = 1; + string symbol = 2; + string interval = 3; // time period of K line in minute + int64 timestamp = 4; + int64 limit = 5; } message QueryKLinesResponse { - repeated KLine klines = 1; - Error error = 2; + repeated KLine klines = 1; + Error error = 2; } message KLine { - string exchange = 1; - string symbol = 2; - int64 timestamp = 3; - double open = 4; - double high = 5; - double low = 6; - double close = 7; - double volume = 8; - double quote_volume = 9; + string exchange = 1; + string symbol = 2; + int64 timestamp = 3; + double open = 4; + double high = 5; + double low = 6; + double close = 7; + double volume = 8; + double quote_volume = 9; } diff --git a/pkg/pb/bbgo_grpc.pb.go b/pkg/pb/bbgo_grpc.pb.go new file mode 100644 index 000000000..672faf628 --- /dev/null +++ b/pkg/pb/bbgo_grpc.pb.go @@ -0,0 +1,512 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. + +package pb + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// MarketDataServiceClient is the client API for MarketDataService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type MarketDataServiceClient interface { + Subscribe(ctx context.Context, in *SubscribeRequest, opts ...grpc.CallOption) (MarketDataService_SubscribeClient, error) + QueryKLines(ctx context.Context, in *QueryKLinesRequest, opts ...grpc.CallOption) (*QueryKLinesResponse, error) +} + +type marketDataServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewMarketDataServiceClient(cc grpc.ClientConnInterface) MarketDataServiceClient { + return &marketDataServiceClient{cc} +} + +func (c *marketDataServiceClient) Subscribe(ctx context.Context, in *SubscribeRequest, opts ...grpc.CallOption) (MarketDataService_SubscribeClient, error) { + stream, err := c.cc.NewStream(ctx, &MarketDataService_ServiceDesc.Streams[0], "/bbgo.MarketDataService/Subscribe", opts...) + if err != nil { + return nil, err + } + x := &marketDataServiceSubscribeClient{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +type MarketDataService_SubscribeClient interface { + Recv() (*SubscribeResponse, error) + grpc.ClientStream +} + +type marketDataServiceSubscribeClient struct { + grpc.ClientStream +} + +func (x *marketDataServiceSubscribeClient) Recv() (*SubscribeResponse, error) { + m := new(SubscribeResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *marketDataServiceClient) QueryKLines(ctx context.Context, in *QueryKLinesRequest, opts ...grpc.CallOption) (*QueryKLinesResponse, error) { + out := new(QueryKLinesResponse) + err := c.cc.Invoke(ctx, "/bbgo.MarketDataService/QueryKLines", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MarketDataServiceServer is the server API for MarketDataService service. +// All implementations must embed UnimplementedMarketDataServiceServer +// for forward compatibility +type MarketDataServiceServer interface { + Subscribe(*SubscribeRequest, MarketDataService_SubscribeServer) error + QueryKLines(context.Context, *QueryKLinesRequest) (*QueryKLinesResponse, error) + mustEmbedUnimplementedMarketDataServiceServer() +} + +// UnimplementedMarketDataServiceServer must be embedded to have forward compatible implementations. +type UnimplementedMarketDataServiceServer struct { +} + +func (UnimplementedMarketDataServiceServer) Subscribe(*SubscribeRequest, MarketDataService_SubscribeServer) error { + return status.Errorf(codes.Unimplemented, "method Subscribe not implemented") +} +func (UnimplementedMarketDataServiceServer) QueryKLines(context.Context, *QueryKLinesRequest) (*QueryKLinesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method QueryKLines not implemented") +} +func (UnimplementedMarketDataServiceServer) mustEmbedUnimplementedMarketDataServiceServer() {} + +// UnsafeMarketDataServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to MarketDataServiceServer will +// result in compilation errors. +type UnsafeMarketDataServiceServer interface { + mustEmbedUnimplementedMarketDataServiceServer() +} + +func RegisterMarketDataServiceServer(s grpc.ServiceRegistrar, srv MarketDataServiceServer) { + s.RegisterService(&MarketDataService_ServiceDesc, srv) +} + +func _MarketDataService_Subscribe_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(SubscribeRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(MarketDataServiceServer).Subscribe(m, &marketDataServiceSubscribeServer{stream}) +} + +type MarketDataService_SubscribeServer interface { + Send(*SubscribeResponse) error + grpc.ServerStream +} + +type marketDataServiceSubscribeServer struct { + grpc.ServerStream +} + +func (x *marketDataServiceSubscribeServer) Send(m *SubscribeResponse) error { + return x.ServerStream.SendMsg(m) +} + +func _MarketDataService_QueryKLines_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryKLinesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MarketDataServiceServer).QueryKLines(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/bbgo.MarketDataService/QueryKLines", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MarketDataServiceServer).QueryKLines(ctx, req.(*QueryKLinesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// MarketDataService_ServiceDesc is the grpc.ServiceDesc for MarketDataService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var MarketDataService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "bbgo.MarketDataService", + HandlerType: (*MarketDataServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "QueryKLines", + Handler: _MarketDataService_QueryKLines_Handler, + }, + }, + Streams: []grpc.StreamDesc{ + { + StreamName: "Subscribe", + Handler: _MarketDataService_Subscribe_Handler, + ServerStreams: true, + }, + }, + Metadata: "pkg/pb/bbgo.proto", +} + +// UserDataServiceClient is the client API for UserDataService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type UserDataServiceClient interface { + // should support streaming + SubscribeUserData(ctx context.Context, in *Empty, opts ...grpc.CallOption) (UserDataService_SubscribeUserDataClient, error) +} + +type userDataServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewUserDataServiceClient(cc grpc.ClientConnInterface) UserDataServiceClient { + return &userDataServiceClient{cc} +} + +func (c *userDataServiceClient) SubscribeUserData(ctx context.Context, in *Empty, opts ...grpc.CallOption) (UserDataService_SubscribeUserDataClient, error) { + stream, err := c.cc.NewStream(ctx, &UserDataService_ServiceDesc.Streams[0], "/bbgo.UserDataService/SubscribeUserData", opts...) + if err != nil { + return nil, err + } + x := &userDataServiceSubscribeUserDataClient{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +type UserDataService_SubscribeUserDataClient interface { + Recv() (*SubscribeResponse, error) + grpc.ClientStream +} + +type userDataServiceSubscribeUserDataClient struct { + grpc.ClientStream +} + +func (x *userDataServiceSubscribeUserDataClient) Recv() (*SubscribeResponse, error) { + m := new(SubscribeResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +// UserDataServiceServer is the server API for UserDataService service. +// All implementations must embed UnimplementedUserDataServiceServer +// for forward compatibility +type UserDataServiceServer interface { + // should support streaming + SubscribeUserData(*Empty, UserDataService_SubscribeUserDataServer) error + mustEmbedUnimplementedUserDataServiceServer() +} + +// UnimplementedUserDataServiceServer must be embedded to have forward compatible implementations. +type UnimplementedUserDataServiceServer struct { +} + +func (UnimplementedUserDataServiceServer) SubscribeUserData(*Empty, UserDataService_SubscribeUserDataServer) error { + return status.Errorf(codes.Unimplemented, "method SubscribeUserData not implemented") +} +func (UnimplementedUserDataServiceServer) mustEmbedUnimplementedUserDataServiceServer() {} + +// UnsafeUserDataServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to UserDataServiceServer will +// result in compilation errors. +type UnsafeUserDataServiceServer interface { + mustEmbedUnimplementedUserDataServiceServer() +} + +func RegisterUserDataServiceServer(s grpc.ServiceRegistrar, srv UserDataServiceServer) { + s.RegisterService(&UserDataService_ServiceDesc, srv) +} + +func _UserDataService_SubscribeUserData_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(Empty) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(UserDataServiceServer).SubscribeUserData(m, &userDataServiceSubscribeUserDataServer{stream}) +} + +type UserDataService_SubscribeUserDataServer interface { + Send(*SubscribeResponse) error + grpc.ServerStream +} + +type userDataServiceSubscribeUserDataServer struct { + grpc.ServerStream +} + +func (x *userDataServiceSubscribeUserDataServer) Send(m *SubscribeResponse) error { + return x.ServerStream.SendMsg(m) +} + +// UserDataService_ServiceDesc is the grpc.ServiceDesc for UserDataService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var UserDataService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "bbgo.UserDataService", + HandlerType: (*UserDataServiceServer)(nil), + Methods: []grpc.MethodDesc{}, + Streams: []grpc.StreamDesc{ + { + StreamName: "SubscribeUserData", + Handler: _UserDataService_SubscribeUserData_Handler, + ServerStreams: true, + }, + }, + Metadata: "pkg/pb/bbgo.proto", +} + +// TradingServiceClient is the client API for TradingService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type TradingServiceClient interface { + // request-response + SubmitOrder(ctx context.Context, in *SubmitOrderRequest, opts ...grpc.CallOption) (*SubmitOrderResponse, error) + CancelOrder(ctx context.Context, in *CancelOrderRequest, opts ...grpc.CallOption) (*CancelOrderResponse, error) + QueryOrder(ctx context.Context, in *QueryOrderRequest, opts ...grpc.CallOption) (*QueryOrderResponse, error) + QueryOrders(ctx context.Context, in *QueryOrdersRequest, opts ...grpc.CallOption) (*QueryOrdersResponse, error) + QueryTrades(ctx context.Context, in *QueryTradesRequest, opts ...grpc.CallOption) (*QueryTradesResponse, error) +} + +type tradingServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewTradingServiceClient(cc grpc.ClientConnInterface) TradingServiceClient { + return &tradingServiceClient{cc} +} + +func (c *tradingServiceClient) SubmitOrder(ctx context.Context, in *SubmitOrderRequest, opts ...grpc.CallOption) (*SubmitOrderResponse, error) { + out := new(SubmitOrderResponse) + err := c.cc.Invoke(ctx, "/bbgo.TradingService/SubmitOrder", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *tradingServiceClient) CancelOrder(ctx context.Context, in *CancelOrderRequest, opts ...grpc.CallOption) (*CancelOrderResponse, error) { + out := new(CancelOrderResponse) + err := c.cc.Invoke(ctx, "/bbgo.TradingService/CancelOrder", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *tradingServiceClient) QueryOrder(ctx context.Context, in *QueryOrderRequest, opts ...grpc.CallOption) (*QueryOrderResponse, error) { + out := new(QueryOrderResponse) + err := c.cc.Invoke(ctx, "/bbgo.TradingService/QueryOrder", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *tradingServiceClient) QueryOrders(ctx context.Context, in *QueryOrdersRequest, opts ...grpc.CallOption) (*QueryOrdersResponse, error) { + out := new(QueryOrdersResponse) + err := c.cc.Invoke(ctx, "/bbgo.TradingService/QueryOrders", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *tradingServiceClient) QueryTrades(ctx context.Context, in *QueryTradesRequest, opts ...grpc.CallOption) (*QueryTradesResponse, error) { + out := new(QueryTradesResponse) + err := c.cc.Invoke(ctx, "/bbgo.TradingService/QueryTrades", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// TradingServiceServer is the server API for TradingService service. +// All implementations must embed UnimplementedTradingServiceServer +// for forward compatibility +type TradingServiceServer interface { + // request-response + SubmitOrder(context.Context, *SubmitOrderRequest) (*SubmitOrderResponse, error) + CancelOrder(context.Context, *CancelOrderRequest) (*CancelOrderResponse, error) + QueryOrder(context.Context, *QueryOrderRequest) (*QueryOrderResponse, error) + QueryOrders(context.Context, *QueryOrdersRequest) (*QueryOrdersResponse, error) + QueryTrades(context.Context, *QueryTradesRequest) (*QueryTradesResponse, error) + mustEmbedUnimplementedTradingServiceServer() +} + +// UnimplementedTradingServiceServer must be embedded to have forward compatible implementations. +type UnimplementedTradingServiceServer struct { +} + +func (UnimplementedTradingServiceServer) SubmitOrder(context.Context, *SubmitOrderRequest) (*SubmitOrderResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SubmitOrder not implemented") +} +func (UnimplementedTradingServiceServer) CancelOrder(context.Context, *CancelOrderRequest) (*CancelOrderResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CancelOrder not implemented") +} +func (UnimplementedTradingServiceServer) QueryOrder(context.Context, *QueryOrderRequest) (*QueryOrderResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method QueryOrder not implemented") +} +func (UnimplementedTradingServiceServer) QueryOrders(context.Context, *QueryOrdersRequest) (*QueryOrdersResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method QueryOrders not implemented") +} +func (UnimplementedTradingServiceServer) QueryTrades(context.Context, *QueryTradesRequest) (*QueryTradesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method QueryTrades not implemented") +} +func (UnimplementedTradingServiceServer) mustEmbedUnimplementedTradingServiceServer() {} + +// UnsafeTradingServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to TradingServiceServer will +// result in compilation errors. +type UnsafeTradingServiceServer interface { + mustEmbedUnimplementedTradingServiceServer() +} + +func RegisterTradingServiceServer(s grpc.ServiceRegistrar, srv TradingServiceServer) { + s.RegisterService(&TradingService_ServiceDesc, srv) +} + +func _TradingService_SubmitOrder_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SubmitOrderRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TradingServiceServer).SubmitOrder(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/bbgo.TradingService/SubmitOrder", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TradingServiceServer).SubmitOrder(ctx, req.(*SubmitOrderRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _TradingService_CancelOrder_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CancelOrderRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TradingServiceServer).CancelOrder(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/bbgo.TradingService/CancelOrder", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TradingServiceServer).CancelOrder(ctx, req.(*CancelOrderRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _TradingService_QueryOrder_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryOrderRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TradingServiceServer).QueryOrder(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/bbgo.TradingService/QueryOrder", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TradingServiceServer).QueryOrder(ctx, req.(*QueryOrderRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _TradingService_QueryOrders_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryOrdersRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TradingServiceServer).QueryOrders(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/bbgo.TradingService/QueryOrders", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TradingServiceServer).QueryOrders(ctx, req.(*QueryOrdersRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _TradingService_QueryTrades_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryTradesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TradingServiceServer).QueryTrades(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/bbgo.TradingService/QueryTrades", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TradingServiceServer).QueryTrades(ctx, req.(*QueryTradesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// TradingService_ServiceDesc is the grpc.ServiceDesc for TradingService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var TradingService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "bbgo.TradingService", + HandlerType: (*TradingServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "SubmitOrder", + Handler: _TradingService_SubmitOrder_Handler, + }, + { + MethodName: "CancelOrder", + Handler: _TradingService_CancelOrder_Handler, + }, + { + MethodName: "QueryOrder", + Handler: _TradingService_QueryOrder_Handler, + }, + { + MethodName: "QueryOrders", + Handler: _TradingService_QueryOrders_Handler, + }, + { + MethodName: "QueryTrades", + Handler: _TradingService_QueryTrades_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "pkg/pb/bbgo.proto", +} diff --git a/python/bbgo/bbgo_pb2.py b/python/bbgo/bbgo_pb2.py index f73d9b446..68febf381 100644 --- a/python/bbgo/bbgo_pb2.py +++ b/python/bbgo/bbgo_pb2.py @@ -15,7 +15,7 @@ _sym_db = _symbol_database.Default() -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\nbbgo.proto\x12\x02pb\"\x07\n\x05\x45mpty\"2\n\x05\x45rror\x12\x12\n\nerror_code\x18\x01 \x01(\x03\x12\x15\n\rerror_message\x18\x02 \x01(\t\";\n\x10SubscribeRequest\x12\'\n\rsubscriptions\x18\x01 \x03(\x0b\x32\x10.pb.Subscription\"]\n\x0cSubscription\x12\x10\n\x08\x65xchange\x18\x01 \x01(\t\x12\x1c\n\x07\x63hannel\x18\x02 \x01(\x0e\x32\x0b.pb.Channel\x12\x0e\n\x06symbol\x18\x03 \x01(\t\x12\r\n\x05\x64\x65pth\x18\x04 \x01(\x03\"\xa9\x02\n\x11SubscribeResponse\x12\x10\n\x08\x65xchange\x18\x01 \x01(\t\x12\x0e\n\x06symbol\x18\x02 \x01(\t\x12\x1c\n\x07\x63hannel\x18\x03 \x01(\x0e\x32\x0b.pb.Channel\x12\x18\n\x05\x65vent\x18\x04 \x01(\x0e\x32\t.pb.Event\x12\x18\n\x05\x64\x65pth\x18\x05 \x01(\x0b\x32\t.pb.Depth\x12\x19\n\x06trades\x18\x06 \x03(\x0b\x32\t.pb.Trade\x12\x1a\n\x06ticker\x18\x07 \x01(\x0b\x32\n.pb.Ticker\x12\x19\n\x06orders\x18\x08 \x03(\x0b\x32\t.pb.Order\x12\x1d\n\x08\x62\x61lances\x18\t \x03(\x0b\x32\x0b.pb.Balance\x12\x15\n\rsubscribed_at\x18\n \x01(\x03\x12\x18\n\x05\x65rror\x18\x0b \x01(\x0b\x32\t.pb.Error\"g\n\x05\x44\x65pth\x12\x10\n\x08\x65xchange\x18\x01 \x01(\t\x12\x0e\n\x06symbol\x18\x02 \x01(\t\x12\x1d\n\x04\x61sks\x18\x03 \x03(\x0b\x32\x0f.pb.PriceVolume\x12\x1d\n\x04\x62ids\x18\x04 \x03(\x0b\x32\x0f.pb.PriceVolume\",\n\x0bPriceVolume\x12\r\n\x05price\x18\x01 \x01(\x03\x12\x0e\n\x06volume\x18\x02 \x01(\x03\"\xc1\x01\n\x05Trade\x12\x10\n\x08\x65xchange\x18\x01 \x01(\t\x12\x0e\n\x06symbol\x18\x02 \x01(\t\x12\n\n\x02id\x18\x03 \x01(\t\x12\r\n\x05price\x18\x04 \x01(\x01\x12\x0e\n\x06volume\x18\x05 \x01(\x01\x12\x12\n\ncreated_at\x18\x06 \x01(\x03\x12\x16\n\x04side\x18\x07 \x01(\x0e\x32\x08.pb.Side\x12\x0b\n\x03\x66\x65\x65\x18\x08 \x01(\x01\x12\x14\n\x0c\x66\x65\x65_currency\x18\t \x01(\t\x12\r\n\x05maker\x18\n \x01(\x08\x12\r\n\x05trend\x18\x0b \x01(\t\"r\n\x06Ticker\x12\x10\n\x08\x65xchange\x18\x01 \x01(\t\x12\x0e\n\x06symbol\x18\x02 \x01(\t\x12\x0c\n\x04open\x18\x03 \x01(\x01\x12\x0c\n\x04high\x18\x04 \x01(\x01\x12\x0b\n\x03low\x18\x05 \x01(\x01\x12\r\n\x05\x63lose\x18\x06 \x01(\x01\x12\x0e\n\x06volume\x18\x07 \x01(\x01\"\xb6\x02\n\x05Order\x12\x10\n\x08\x65xchange\x18\x01 \x01(\t\x12\x0e\n\x06symbol\x18\x02 \x01(\t\x12\n\n\x02id\x18\x03 \x01(\t\x12\x16\n\x04side\x18\x04 \x01(\x0e\x32\x08.pb.Side\x12!\n\norder_type\x18\x05 \x01(\x0e\x32\r.pb.OrderType\x12\r\n\x05price\x18\x06 \x01(\x01\x12\x12\n\nstop_price\x18\x07 \x01(\x01\x12\x11\n\tavg_price\x18\x08 \x01(\x01\x12\x0e\n\x06status\x18\t \x01(\t\x12\x12\n\ncreated_at\x18\n \x01(\x03\x12\x10\n\x08quantity\x18\x0b \x01(\x01\x12\x17\n\x0f\x65xecuted_volume\x18\x0c \x01(\x01\x12\x14\n\x0ctrades_count\x18\r \x01(\x03\x12\x17\n\x0f\x63lient_order_id\x18\x0e \x01(\t\x12\x10\n\x08group_id\x18\x0f \x01(\x03\"\xca\x01\n\x0bSubmitOrder\x12\x10\n\x08\x65xchange\x18\x01 \x01(\t\x12\x0e\n\x06symbol\x18\x02 \x01(\t\x12\x16\n\x04side\x18\x03 \x01(\x0e\x32\x08.pb.Side\x12\x10\n\x08quantity\x18\x04 \x01(\x01\x12\r\n\x05price\x18\x05 \x01(\x01\x12\x12\n\nstop_price\x18\x06 \x01(\x01\x12!\n\norder_type\x18\x07 \x01(\x0e\x32\r.pb.OrderType\x12\x17\n\x0f\x63lient_order_id\x18\x08 \x01(\t\x12\x10\n\x08group_id\x18\t \x01(\x03\"P\n\x07\x42\x61lance\x12\x10\n\x08\x65xchange\x18\x01 \x01(\t\x12\x10\n\x08\x63urrency\x18\x02 \x01(\t\x12\x11\n\tavailable\x18\x03 \x01(\x01\x12\x0e\n\x06locked\x18\x04 \x01(\x01\";\n\x12SubmitOrderRequest\x12%\n\x0csubmit_order\x18\x01 \x01(\x0b\x32\x0f.pb.SubmitOrder\"I\n\x13SubmitOrderResponse\x12\x18\n\x05order\x18\x01 \x01(\x0b\x32\t.pb.Order\x12\x18\n\x05\x65rror\x18\x02 \x01(\x0b\x32\t.pb.Error\"K\n\x12\x43\x61ncelOrderRequest\x12\x10\n\x08\x65xchange\x18\x01 \x01(\t\x12\n\n\x02id\x18\x02 \x01(\t\x12\x17\n\x0f\x63lient_order_id\x18\x03 \x01(\t\"I\n\x13\x43\x61ncelOrderResponse\x12\x18\n\x05order\x18\x01 \x01(\x0b\x32\t.pb.Order\x12\x18\n\x05\x65rror\x18\x02 \x01(\x0b\x32\t.pb.Error\"J\n\x11QueryOrderRequest\x12\x10\n\x08\x65xchange\x18\x01 \x01(\t\x12\n\n\x02id\x18\x02 \x01(\t\x12\x17\n\x0f\x63lient_order_id\x18\x03 \x01(\t\"H\n\x12QueryOrderResponse\x12\x18\n\x05order\x18\x01 \x01(\x0b\x32\t.pb.Order\x12\x18\n\x05\x65rror\x18\x02 \x01(\x0b\x32\t.pb.Error\"\xaa\x01\n\x12QueryOrdersRequest\x12\x10\n\x08\x65xchange\x18\x01 \x01(\t\x12\x0e\n\x06symbol\x18\x02 \x01(\t\x12\r\n\x05state\x18\x03 \x03(\t\x12\x10\n\x08order_by\x18\x04 \x01(\t\x12\x10\n\x08group_id\x18\x05 \x01(\x03\x12\x12\n\npagination\x18\x06 \x01(\x08\x12\x0c\n\x04page\x18\x07 \x01(\x03\x12\r\n\x05limit\x18\x08 \x01(\x03\x12\x0e\n\x06offset\x18\t \x01(\x03\"J\n\x13QueryOrdersResponse\x12\x19\n\x06orders\x18\x01 \x03(\x0b\x32\t.pb.Order\x12\x18\n\x05\x65rror\x18\x02 \x01(\x0b\x32\t.pb.Error\"\xb6\x01\n\x12QueryTradesRequest\x12\x10\n\x08\x65xchange\x18\x01 \x01(\t\x12\x0e\n\x06symbol\x18\x02 \x01(\t\x12\x11\n\ttimestamp\x18\x03 \x01(\x03\x12\x0c\n\x04\x66rom\x18\x04 \x01(\x03\x12\n\n\x02to\x18\x05 \x01(\x03\x12\x10\n\x08order_by\x18\x06 \x01(\t\x12\x12\n\npagination\x18\x07 \x01(\x08\x12\x0c\n\x04page\x18\x08 \x01(\x03\x12\r\n\x05limit\x18\t \x01(\x03\x12\x0e\n\x06offset\x18\n \x01(\x03\"J\n\x13QueryTradesResponse\x12\x19\n\x06trades\x18\x01 \x03(\x0b\x32\t.pb.Trade\x12\x18\n\x05\x65rror\x18\x02 \x01(\x0b\x32\t.pb.Error\"j\n\x12QueryKLinesRequest\x12\x10\n\x08\x65xchange\x18\x01 \x01(\t\x12\x0e\n\x06symbol\x18\x02 \x01(\t\x12\r\n\x05limit\x18\x03 \x01(\x03\x12\x10\n\x08interval\x18\x04 \x01(\x03\x12\x11\n\ttimestamp\x18\x05 \x01(\x03\"J\n\x13QueryKLinesResponse\x12\x19\n\x06klines\x18\x01 \x03(\x0b\x32\t.pb.KLine\x12\x18\n\x05\x65rror\x18\x02 \x01(\x0b\x32\t.pb.Error\"\x9a\x01\n\x05KLine\x12\x10\n\x08\x65xchange\x18\x01 \x01(\t\x12\x0e\n\x06symbol\x18\x02 \x01(\t\x12\x11\n\ttimestamp\x18\x03 \x01(\x03\x12\x0c\n\x04open\x18\x04 \x01(\x01\x12\x0c\n\x04high\x18\x05 \x01(\x01\x12\x0b\n\x03low\x18\x06 \x01(\x01\x12\r\n\x05\x63lose\x18\x07 \x01(\x01\x12\x0e\n\x06volume\x18\x08 \x01(\x01\x12\x14\n\x0cquote_volume\x18\t \x01(\x01*\xd7\x01\n\x05\x45vent\x12\t\n\x05\x45RROR\x10\x00\x12\x0e\n\nSUBSCRIBED\x10\x01\x12\x10\n\x0cUNSUBSCRIBED\x10\x02\x12\x0c\n\x08SNAPSHOT\x10\x03\x12\n\n\x06UPDATE\x10\x04\x12\x11\n\rAUTHENTICATED\x10\x05\x12\x12\n\x0eORDER_SNAPSHOT\x10\x06\x12\x10\n\x0cORDER_UPDATE\x10\x07\x12\x12\n\x0eTRADE_SNAPSHOT\x10\x08\x12\x10\n\x0cTRADE_UPDATE\x10\t\x12\x14\n\x10\x41\x43\x43OUNT_SNAPSHOT\x10\n\x12\x12\n\x0e\x41\x43\x43OUNT_UPDATE\x10\x0b*4\n\x07\x43hannel\x12\x08\n\x04\x42OOK\x10\x00\x12\t\n\x05TRADE\x10\x01\x12\n\n\x06TICKER\x10\x02\x12\x08\n\x04USER\x10\x03*\x19\n\x04Side\x12\x07\n\x03\x42UY\x10\x00\x12\x08\n\x04SELL\x10\x01*a\n\tOrderType\x12\n\n\x06MARKET\x10\x00\x12\t\n\x05LIMIT\x10\x01\x12\x0f\n\x0bSTOP_MARKET\x10\x02\x12\x0e\n\nSTOP_LIMIT\x10\x03\x12\r\n\tPOST_ONLY\x10\x04\x12\r\n\tIOC_LIMIT\x10\x05\x32\x86\x04\n\x04\x42\x42GO\x12;\n\x08Subcribe\x12\x14.pb.SubscribeRequest\x1a\x15.pb.SubscribeResponse\"\x00\x30\x01\x12\x38\n\x10SubcribeUserData\x12\t.pb.Empty\x1a\x15.pb.SubscribeResponse\"\x00\x30\x01\x12@\n\x0bSubmitOrder\x12\x16.pb.SubmitOrderRequest\x1a\x17.pb.SubmitOrderResponse\"\x00\x12@\n\x0b\x43\x61ncelOrder\x12\x16.pb.CancelOrderRequest\x1a\x17.pb.CancelOrderResponse\"\x00\x12=\n\nQueryOrder\x12\x15.pb.QueryOrderRequest\x1a\x16.pb.QueryOrderResponse\"\x00\x12@\n\x0bQueryOrders\x12\x16.pb.QueryOrdersRequest\x1a\x17.pb.QueryOrdersResponse\"\x00\x12@\n\x0bQueryTrades\x12\x16.pb.QueryTradesRequest\x1a\x17.pb.QueryTradesResponse\"\x00\x12@\n\x0bQueryKLines\x12\x16.pb.QueryKLinesRequest\x1a\x17.pb.QueryKLinesResponse\"\x00\x42\x07Z\x05../pbb\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\nbbgo.proto\x12\x02pb\"\x07\n\x05\x45mpty\"2\n\x05\x45rror\x12\x12\n\nerror_code\x18\x01 \x01(\x03\x12\x15\n\rerror_message\x18\x02 \x01(\t\";\n\x10SubscribeRequest\x12\'\n\rsubscriptions\x18\x01 \x03(\x0b\x32\x10.pb.Subscription\"]\n\x0cSubscription\x12\x10\n\x08\x65xchange\x18\x01 \x01(\t\x12\x1c\n\x07\x63hannel\x18\x02 \x01(\x0e\x32\x0b.pb.Channel\x12\x0e\n\x06symbol\x18\x03 \x01(\t\x12\r\n\x05\x64\x65pth\x18\x04 \x01(\x03\"\xa9\x02\n\x11SubscribeResponse\x12\x10\n\x08\x65xchange\x18\x01 \x01(\t\x12\x0e\n\x06symbol\x18\x02 \x01(\t\x12\x1c\n\x07\x63hannel\x18\x03 \x01(\x0e\x32\x0b.pb.Channel\x12\x18\n\x05\x65vent\x18\x04 \x01(\x0e\x32\t.pb.Event\x12\x18\n\x05\x64\x65pth\x18\x05 \x01(\x0b\x32\t.pb.Depth\x12\x19\n\x06trades\x18\x06 \x03(\x0b\x32\t.pb.Trade\x12\x1a\n\x06ticker\x18\x07 \x01(\x0b\x32\n.pb.Ticker\x12\x19\n\x06orders\x18\x08 \x03(\x0b\x32\t.pb.Order\x12\x1d\n\x08\x62\x61lances\x18\t \x03(\x0b\x32\x0b.pb.Balance\x12\x15\n\rsubscribed_at\x18\n \x01(\x03\x12\x18\n\x05\x65rror\x18\x0b \x01(\x0b\x32\t.pb.Error\"g\n\x05\x44\x65pth\x12\x10\n\x08\x65xchange\x18\x01 \x01(\t\x12\x0e\n\x06symbol\x18\x02 \x01(\t\x12\x1d\n\x04\x61sks\x18\x03 \x03(\x0b\x32\x0f.pb.PriceVolume\x12\x1d\n\x04\x62ids\x18\x04 \x03(\x0b\x32\x0f.pb.PriceVolume\",\n\x0bPriceVolume\x12\r\n\x05price\x18\x01 \x01(\x03\x12\x0e\n\x06volume\x18\x02 \x01(\x03\"\xc1\x01\n\x05Trade\x12\x10\n\x08\x65xchange\x18\x01 \x01(\t\x12\x0e\n\x06symbol\x18\x02 \x01(\t\x12\n\n\x02id\x18\x03 \x01(\t\x12\r\n\x05price\x18\x04 \x01(\x01\x12\x0e\n\x06volume\x18\x05 \x01(\x01\x12\x12\n\ncreated_at\x18\x06 \x01(\x03\x12\x16\n\x04side\x18\x07 \x01(\x0e\x32\x08.pb.Side\x12\x0b\n\x03\x66\x65\x65\x18\x08 \x01(\x01\x12\x14\n\x0c\x66\x65\x65_currency\x18\t \x01(\t\x12\r\n\x05maker\x18\n \x01(\x08\x12\r\n\x05trend\x18\x0b \x01(\t\"r\n\x06Ticker\x12\x10\n\x08\x65xchange\x18\x01 \x01(\t\x12\x0e\n\x06symbol\x18\x02 \x01(\t\x12\x0c\n\x04open\x18\x03 \x01(\x01\x12\x0c\n\x04high\x18\x04 \x01(\x01\x12\x0b\n\x03low\x18\x05 \x01(\x01\x12\r\n\x05\x63lose\x18\x06 \x01(\x01\x12\x0e\n\x06volume\x18\x07 \x01(\x01\"\xb6\x02\n\x05Order\x12\x10\n\x08\x65xchange\x18\x01 \x01(\t\x12\x0e\n\x06symbol\x18\x02 \x01(\t\x12\n\n\x02id\x18\x03 \x01(\t\x12\x16\n\x04side\x18\x04 \x01(\x0e\x32\x08.pb.Side\x12!\n\norder_type\x18\x05 \x01(\x0e\x32\r.pb.OrderType\x12\r\n\x05price\x18\x06 \x01(\x01\x12\x12\n\nstop_price\x18\x07 \x01(\x01\x12\x11\n\tavg_price\x18\x08 \x01(\x01\x12\x0e\n\x06status\x18\t \x01(\t\x12\x12\n\ncreated_at\x18\n \x01(\x03\x12\x10\n\x08quantity\x18\x0b \x01(\x01\x12\x17\n\x0f\x65xecuted_volume\x18\x0c \x01(\x01\x12\x14\n\x0ctrades_count\x18\r \x01(\x03\x12\x17\n\x0f\x63lient_order_id\x18\x0e \x01(\t\x12\x10\n\x08group_id\x18\x0f \x01(\x03\"\xca\x01\n\x0bSubmitOrder\x12\x10\n\x08\x65xchange\x18\x01 \x01(\t\x12\x0e\n\x06symbol\x18\x02 \x01(\t\x12\x16\n\x04side\x18\x03 \x01(\x0e\x32\x08.pb.Side\x12\x10\n\x08quantity\x18\x04 \x01(\x01\x12\r\n\x05price\x18\x05 \x01(\x01\x12\x12\n\nstop_price\x18\x06 \x01(\x01\x12!\n\norder_type\x18\x07 \x01(\x0e\x32\r.pb.OrderType\x12\x17\n\x0f\x63lient_order_id\x18\x08 \x01(\t\x12\x10\n\x08group_id\x18\t \x01(\x03\"P\n\x07\x42\x61lance\x12\x10\n\x08\x65xchange\x18\x01 \x01(\t\x12\x10\n\x08\x63urrency\x18\x02 \x01(\t\x12\x11\n\tavailable\x18\x03 \x01(\x01\x12\x0e\n\x06locked\x18\x04 \x01(\x01\";\n\x12SubmitOrderRequest\x12%\n\x0csubmit_order\x18\x01 \x01(\x0b\x32\x0f.pb.SubmitOrder\"I\n\x13SubmitOrderResponse\x12\x18\n\x05order\x18\x01 \x01(\x0b\x32\t.pb.Order\x12\x18\n\x05\x65rror\x18\x02 \x01(\x0b\x32\t.pb.Error\"K\n\x12\x43\x61ncelOrderRequest\x12\x10\n\x08\x65xchange\x18\x01 \x01(\t\x12\n\n\x02id\x18\x02 \x01(\t\x12\x17\n\x0f\x63lient_order_id\x18\x03 \x01(\t\"I\n\x13\x43\x61ncelOrderResponse\x12\x18\n\x05order\x18\x01 \x01(\x0b\x32\t.pb.Order\x12\x18\n\x05\x65rror\x18\x02 \x01(\x0b\x32\t.pb.Error\"J\n\x11QueryOrderRequest\x12\x10\n\x08\x65xchange\x18\x01 \x01(\t\x12\n\n\x02id\x18\x02 \x01(\t\x12\x17\n\x0f\x63lient_order_id\x18\x03 \x01(\t\"H\n\x12QueryOrderResponse\x12\x18\n\x05order\x18\x01 \x01(\x0b\x32\t.pb.Order\x12\x18\n\x05\x65rror\x18\x02 \x01(\x0b\x32\t.pb.Error\"\xaa\x01\n\x12QueryOrdersRequest\x12\x10\n\x08\x65xchange\x18\x01 \x01(\t\x12\x0e\n\x06symbol\x18\x02 \x01(\t\x12\r\n\x05state\x18\x03 \x03(\t\x12\x10\n\x08order_by\x18\x04 \x01(\t\x12\x10\n\x08group_id\x18\x05 \x01(\x03\x12\x12\n\npagination\x18\x06 \x01(\x08\x12\x0c\n\x04page\x18\x07 \x01(\x03\x12\r\n\x05limit\x18\x08 \x01(\x03\x12\x0e\n\x06offset\x18\t \x01(\x03\"J\n\x13QueryOrdersResponse\x12\x19\n\x06orders\x18\x01 \x03(\x0b\x32\t.pb.Order\x12\x18\n\x05\x65rror\x18\x02 \x01(\x0b\x32\t.pb.Error\"\xb6\x01\n\x12QueryTradesRequest\x12\x10\n\x08\x65xchange\x18\x01 \x01(\t\x12\x0e\n\x06symbol\x18\x02 \x01(\t\x12\x11\n\ttimestamp\x18\x03 \x01(\x03\x12\x0c\n\x04\x66rom\x18\x04 \x01(\x03\x12\n\n\x02to\x18\x05 \x01(\x03\x12\x10\n\x08order_by\x18\x06 \x01(\t\x12\x12\n\npagination\x18\x07 \x01(\x08\x12\x0c\n\x04page\x18\x08 \x01(\x03\x12\r\n\x05limit\x18\t \x01(\x03\x12\x0e\n\x06offset\x18\n \x01(\x03\"J\n\x13QueryTradesResponse\x12\x19\n\x06trades\x18\x01 \x03(\x0b\x32\t.pb.Trade\x12\x18\n\x05\x65rror\x18\x02 \x01(\x0b\x32\t.pb.Error\"j\n\x12QueryKLinesRequest\x12\x10\n\x08\x65xchange\x18\x01 \x01(\t\x12\x0e\n\x06symbol\x18\x02 \x01(\t\x12\x10\n\x08interval\x18\x03 \x01(\t\x12\x11\n\ttimestamp\x18\x04 \x01(\x03\x12\r\n\x05limit\x18\x05 \x01(\x03\"J\n\x13QueryKLinesResponse\x12\x19\n\x06klines\x18\x01 \x03(\x0b\x32\t.pb.KLine\x12\x18\n\x05\x65rror\x18\x02 \x01(\x0b\x32\t.pb.Error\"\x9a\x01\n\x05KLine\x12\x10\n\x08\x65xchange\x18\x01 \x01(\t\x12\x0e\n\x06symbol\x18\x02 \x01(\t\x12\x11\n\ttimestamp\x18\x03 \x01(\x03\x12\x0c\n\x04open\x18\x04 \x01(\x01\x12\x0c\n\x04high\x18\x05 \x01(\x01\x12\x0b\n\x03low\x18\x06 \x01(\x01\x12\r\n\x05\x63lose\x18\x07 \x01(\x01\x12\x0e\n\x06volume\x18\x08 \x01(\x01\x12\x14\n\x0cquote_volume\x18\t \x01(\x01*\xe4\x01\n\x05\x45vent\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x0e\n\nSUBSCRIBED\x10\x01\x12\x10\n\x0cUNSUBSCRIBED\x10\x02\x12\x0c\n\x08SNAPSHOT\x10\x03\x12\n\n\x06UPDATE\x10\x04\x12\x11\n\rAUTHENTICATED\x10\x05\x12\x12\n\x0eORDER_SNAPSHOT\x10\x06\x12\x10\n\x0cORDER_UPDATE\x10\x07\x12\x12\n\x0eTRADE_SNAPSHOT\x10\x08\x12\x10\n\x0cTRADE_UPDATE\x10\t\x12\x14\n\x10\x41\x43\x43OUNT_SNAPSHOT\x10\n\x12\x12\n\x0e\x41\x43\x43OUNT_UPDATE\x10\x0b\x12\t\n\x05\x45RROR\x10\x63*4\n\x07\x43hannel\x12\x08\n\x04\x42OOK\x10\x00\x12\t\n\x05TRADE\x10\x01\x12\n\n\x06TICKER\x10\x02\x12\x08\n\x04USER\x10\x03*\x19\n\x04Side\x12\x07\n\x03\x42UY\x10\x00\x12\x08\n\x04SELL\x10\x01*a\n\tOrderType\x12\n\n\x06MARKET\x10\x00\x12\t\n\x05LIMIT\x10\x01\x12\x0f\n\x0bSTOP_MARKET\x10\x02\x12\x0e\n\nSTOP_LIMIT\x10\x03\x12\r\n\tPOST_ONLY\x10\x04\x12\r\n\tIOC_LIMIT\x10\x05\x32\x93\x01\n\x11MarketDataService\x12<\n\tSubscribe\x12\x14.pb.SubscribeRequest\x1a\x15.pb.SubscribeResponse\"\x00\x30\x01\x12@\n\x0bQueryKLines\x12\x16.pb.QueryKLinesRequest\x1a\x17.pb.QueryKLinesResponse\"\x00\x32L\n\x0fUserDataService\x12\x39\n\x11SubscribeUserData\x12\t.pb.Empty\x1a\x15.pb.SubscribeResponse\"\x00\x30\x01\x32\xd7\x02\n\x0eTradingService\x12@\n\x0bSubmitOrder\x12\x16.pb.SubmitOrderRequest\x1a\x17.pb.SubmitOrderResponse\"\x00\x12@\n\x0b\x43\x61ncelOrder\x12\x16.pb.CancelOrderRequest\x1a\x17.pb.CancelOrderResponse\"\x00\x12=\n\nQueryOrder\x12\x15.pb.QueryOrderRequest\x1a\x16.pb.QueryOrderResponse\"\x00\x12@\n\x0bQueryOrders\x12\x16.pb.QueryOrdersRequest\x1a\x17.pb.QueryOrdersResponse\"\x00\x12@\n\x0bQueryTrades\x12\x16.pb.QueryTradesRequest\x1a\x17.pb.QueryTradesResponse\"\x00\x42\x07Z\x05../pbb\x06proto3') _EVENT = DESCRIPTOR.enum_types_by_name['Event'] Event = enum_type_wrapper.EnumTypeWrapper(_EVENT) @@ -25,7 +25,7 @@ _SIDE = DESCRIPTOR.enum_types_by_name['Side'] Side = enum_type_wrapper.EnumTypeWrapper(_SIDE) _ORDERTYPE = DESCRIPTOR.enum_types_by_name['OrderType'] OrderType = enum_type_wrapper.EnumTypeWrapper(_ORDERTYPE) -ERROR = 0 +UNKNOWN = 0 SUBSCRIBED = 1 UNSUBSCRIBED = 2 SNAPSHOT = 3 @@ -37,6 +37,7 @@ TRADE_SNAPSHOT = 8 TRADE_UPDATE = 9 ACCOUNT_SNAPSHOT = 10 ACCOUNT_UPDATE = 11 +ERROR = 99 BOOK = 0 TRADE = 1 TICKER = 2 @@ -251,19 +252,21 @@ KLine = _reflection.GeneratedProtocolMessageType('KLine', (_message.Message,), { }) _sym_db.RegisterMessage(KLine) -_BBGO = DESCRIPTOR.services_by_name['BBGO'] +_MARKETDATASERVICE = DESCRIPTOR.services_by_name['MarketDataService'] +_USERDATASERVICE = DESCRIPTOR.services_by_name['UserDataService'] +_TRADINGSERVICE = DESCRIPTOR.services_by_name['TradingService'] if _descriptor._USE_C_DESCRIPTORS == False: DESCRIPTOR._options = None DESCRIPTOR._serialized_options = b'Z\005../pb' _EVENT._serialized_start=2888 - _EVENT._serialized_end=3103 - _CHANNEL._serialized_start=3105 - _CHANNEL._serialized_end=3157 - _SIDE._serialized_start=3159 - _SIDE._serialized_end=3184 - _ORDERTYPE._serialized_start=3186 - _ORDERTYPE._serialized_end=3283 + _EVENT._serialized_end=3116 + _CHANNEL._serialized_start=3118 + _CHANNEL._serialized_end=3170 + _SIDE._serialized_start=3172 + _SIDE._serialized_end=3197 + _ORDERTYPE._serialized_start=3199 + _ORDERTYPE._serialized_end=3296 _EMPTY._serialized_start=18 _EMPTY._serialized_end=25 _ERROR._serialized_start=27 @@ -314,6 +317,10 @@ if _descriptor._USE_C_DESCRIPTORS == False: _QUERYKLINESRESPONSE._serialized_end=2728 _KLINE._serialized_start=2731 _KLINE._serialized_end=2885 - _BBGO._serialized_start=3286 - _BBGO._serialized_end=3804 + _MARKETDATASERVICE._serialized_start=3299 + _MARKETDATASERVICE._serialized_end=3446 + _USERDATASERVICE._serialized_start=3448 + _USERDATASERVICE._serialized_end=3524 + _TRADINGSERVICE._serialized_start=3527 + _TRADINGSERVICE._serialized_end=3870 # @@protoc_insertion_point(module_scope) diff --git a/python/bbgo/bbgo_pb2_grpc.py b/python/bbgo/bbgo_pb2_grpc.py index d5943acfc..6849ad40e 100644 --- a/python/bbgo/bbgo_pb2_grpc.py +++ b/python/bbgo/bbgo_pb2_grpc.py @@ -2,10 +2,10 @@ """Client and server classes corresponding to protobuf-defined services.""" import grpc -from . import bbgo_pb2 as bbgo__pb2 +import bbgo_pb2 as bbgo__pb2 -class BBGOStub(object): +class MarketDataServiceStub(object): """Missing associated documentation comment in .proto file.""" def __init__(self, channel): @@ -14,63 +14,191 @@ class BBGOStub(object): Args: channel: A grpc.Channel. """ - self.Subcribe = channel.unary_stream( - '/pb.BBGO/Subcribe', + self.Subscribe = channel.unary_stream( + '/pb.MarketDataService/Subscribe', request_serializer=bbgo__pb2.SubscribeRequest.SerializeToString, response_deserializer=bbgo__pb2.SubscribeResponse.FromString, ) - self.SubcribeUserData = channel.unary_stream( - '/pb.BBGO/SubcribeUserData', - request_serializer=bbgo__pb2.Empty.SerializeToString, - response_deserializer=bbgo__pb2.SubscribeResponse.FromString, - ) - self.SubmitOrder = channel.unary_unary( - '/pb.BBGO/SubmitOrder', - request_serializer=bbgo__pb2.SubmitOrderRequest.SerializeToString, - response_deserializer=bbgo__pb2.SubmitOrderResponse.FromString, - ) - self.CancelOrder = channel.unary_unary( - '/pb.BBGO/CancelOrder', - request_serializer=bbgo__pb2.CancelOrderRequest.SerializeToString, - response_deserializer=bbgo__pb2.CancelOrderResponse.FromString, - ) - self.QueryOrder = channel.unary_unary( - '/pb.BBGO/QueryOrder', - request_serializer=bbgo__pb2.QueryOrderRequest.SerializeToString, - response_deserializer=bbgo__pb2.QueryOrderResponse.FromString, - ) - self.QueryOrders = channel.unary_unary( - '/pb.BBGO/QueryOrders', - request_serializer=bbgo__pb2.QueryOrdersRequest.SerializeToString, - response_deserializer=bbgo__pb2.QueryOrdersResponse.FromString, - ) - self.QueryTrades = channel.unary_unary( - '/pb.BBGO/QueryTrades', - request_serializer=bbgo__pb2.QueryTradesRequest.SerializeToString, - response_deserializer=bbgo__pb2.QueryTradesResponse.FromString, - ) self.QueryKLines = channel.unary_unary( - '/pb.BBGO/QueryKLines', + '/pb.MarketDataService/QueryKLines', request_serializer=bbgo__pb2.QueryKLinesRequest.SerializeToString, response_deserializer=bbgo__pb2.QueryKLinesResponse.FromString, ) -class BBGOServicer(object): +class MarketDataServiceServicer(object): """Missing associated documentation comment in .proto file.""" - def Subcribe(self, request, context): + def Subscribe(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def QueryKLines(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + +def add_MarketDataServiceServicer_to_server(servicer, server): + rpc_method_handlers = { + 'Subscribe': grpc.unary_stream_rpc_method_handler( + servicer.Subscribe, + request_deserializer=bbgo__pb2.SubscribeRequest.FromString, + response_serializer=bbgo__pb2.SubscribeResponse.SerializeToString, + ), + 'QueryKLines': grpc.unary_unary_rpc_method_handler( + servicer.QueryKLines, + request_deserializer=bbgo__pb2.QueryKLinesRequest.FromString, + response_serializer=bbgo__pb2.QueryKLinesResponse.SerializeToString, + ), + } + generic_handler = grpc.method_handlers_generic_handler( + 'pb.MarketDataService', rpc_method_handlers) + server.add_generic_rpc_handlers((generic_handler,)) + + + # This class is part of an EXPERIMENTAL API. +class MarketDataService(object): + """Missing associated documentation comment in .proto file.""" + + @staticmethod + def Subscribe(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_stream(request, target, '/pb.MarketDataService/Subscribe', + bbgo__pb2.SubscribeRequest.SerializeToString, + bbgo__pb2.SubscribeResponse.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + + @staticmethod + def QueryKLines(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/pb.MarketDataService/QueryKLines', + bbgo__pb2.QueryKLinesRequest.SerializeToString, + bbgo__pb2.QueryKLinesResponse.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + + +class UserDataServiceStub(object): + """Missing associated documentation comment in .proto file.""" + + def __init__(self, channel): + """Constructor. + + Args: + channel: A grpc.Channel. + """ + self.SubscribeUserData = channel.unary_stream( + '/pb.UserDataService/SubscribeUserData', + request_serializer=bbgo__pb2.Empty.SerializeToString, + response_deserializer=bbgo__pb2.SubscribeResponse.FromString, + ) + + +class UserDataServiceServicer(object): + """Missing associated documentation comment in .proto file.""" + + def SubscribeUserData(self, request, context): """should support streaming """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') - def SubcribeUserData(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') + +def add_UserDataServiceServicer_to_server(servicer, server): + rpc_method_handlers = { + 'SubscribeUserData': grpc.unary_stream_rpc_method_handler( + servicer.SubscribeUserData, + request_deserializer=bbgo__pb2.Empty.FromString, + response_serializer=bbgo__pb2.SubscribeResponse.SerializeToString, + ), + } + generic_handler = grpc.method_handlers_generic_handler( + 'pb.UserDataService', rpc_method_handlers) + server.add_generic_rpc_handlers((generic_handler,)) + + + # This class is part of an EXPERIMENTAL API. +class UserDataService(object): + """Missing associated documentation comment in .proto file.""" + + @staticmethod + def SubscribeUserData(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_stream(request, target, '/pb.UserDataService/SubscribeUserData', + bbgo__pb2.Empty.SerializeToString, + bbgo__pb2.SubscribeResponse.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + + +class TradingServiceStub(object): + """Missing associated documentation comment in .proto file.""" + + def __init__(self, channel): + """Constructor. + + Args: + channel: A grpc.Channel. + """ + self.SubmitOrder = channel.unary_unary( + '/pb.TradingService/SubmitOrder', + request_serializer=bbgo__pb2.SubmitOrderRequest.SerializeToString, + response_deserializer=bbgo__pb2.SubmitOrderResponse.FromString, + ) + self.CancelOrder = channel.unary_unary( + '/pb.TradingService/CancelOrder', + request_serializer=bbgo__pb2.CancelOrderRequest.SerializeToString, + response_deserializer=bbgo__pb2.CancelOrderResponse.FromString, + ) + self.QueryOrder = channel.unary_unary( + '/pb.TradingService/QueryOrder', + request_serializer=bbgo__pb2.QueryOrderRequest.SerializeToString, + response_deserializer=bbgo__pb2.QueryOrderResponse.FromString, + ) + self.QueryOrders = channel.unary_unary( + '/pb.TradingService/QueryOrders', + request_serializer=bbgo__pb2.QueryOrdersRequest.SerializeToString, + response_deserializer=bbgo__pb2.QueryOrdersResponse.FromString, + ) + self.QueryTrades = channel.unary_unary( + '/pb.TradingService/QueryTrades', + request_serializer=bbgo__pb2.QueryTradesRequest.SerializeToString, + response_deserializer=bbgo__pb2.QueryTradesResponse.FromString, + ) + + +class TradingServiceServicer(object): + """Missing associated documentation comment in .proto file.""" def SubmitOrder(self, request, context): """request-response @@ -103,25 +231,9 @@ class BBGOServicer(object): context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') - def QueryKLines(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - -def add_BBGOServicer_to_server(servicer, server): +def add_TradingServiceServicer_to_server(servicer, server): rpc_method_handlers = { - 'Subcribe': grpc.unary_stream_rpc_method_handler( - servicer.Subcribe, - request_deserializer=bbgo__pb2.SubscribeRequest.FromString, - response_serializer=bbgo__pb2.SubscribeResponse.SerializeToString, - ), - 'SubcribeUserData': grpc.unary_stream_rpc_method_handler( - servicer.SubcribeUserData, - request_deserializer=bbgo__pb2.Empty.FromString, - response_serializer=bbgo__pb2.SubscribeResponse.SerializeToString, - ), 'SubmitOrder': grpc.unary_unary_rpc_method_handler( servicer.SubmitOrder, request_deserializer=bbgo__pb2.SubmitOrderRequest.FromString, @@ -147,55 +259,16 @@ def add_BBGOServicer_to_server(servicer, server): request_deserializer=bbgo__pb2.QueryTradesRequest.FromString, response_serializer=bbgo__pb2.QueryTradesResponse.SerializeToString, ), - 'QueryKLines': grpc.unary_unary_rpc_method_handler( - servicer.QueryKLines, - request_deserializer=bbgo__pb2.QueryKLinesRequest.FromString, - response_serializer=bbgo__pb2.QueryKLinesResponse.SerializeToString, - ), } generic_handler = grpc.method_handlers_generic_handler( - 'pb.BBGO', rpc_method_handlers) + 'pb.TradingService', rpc_method_handlers) server.add_generic_rpc_handlers((generic_handler,)) # This class is part of an EXPERIMENTAL API. -class BBGO(object): +class TradingService(object): """Missing associated documentation comment in .proto file.""" - @staticmethod - def Subcribe(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_stream(request, target, '/pb.BBGO/Subcribe', - bbgo__pb2.SubscribeRequest.SerializeToString, - bbgo__pb2.SubscribeResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def SubcribeUserData(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_stream(request, target, '/pb.BBGO/SubcribeUserData', - bbgo__pb2.Empty.SerializeToString, - bbgo__pb2.SubscribeResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - @staticmethod def SubmitOrder(request, target, @@ -207,7 +280,7 @@ class BBGO(object): wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/pb.BBGO/SubmitOrder', + return grpc.experimental.unary_unary(request, target, '/pb.TradingService/SubmitOrder', bbgo__pb2.SubmitOrderRequest.SerializeToString, bbgo__pb2.SubmitOrderResponse.FromString, options, channel_credentials, @@ -224,7 +297,7 @@ class BBGO(object): wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/pb.BBGO/CancelOrder', + return grpc.experimental.unary_unary(request, target, '/pb.TradingService/CancelOrder', bbgo__pb2.CancelOrderRequest.SerializeToString, bbgo__pb2.CancelOrderResponse.FromString, options, channel_credentials, @@ -241,7 +314,7 @@ class BBGO(object): wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/pb.BBGO/QueryOrder', + return grpc.experimental.unary_unary(request, target, '/pb.TradingService/QueryOrder', bbgo__pb2.QueryOrderRequest.SerializeToString, bbgo__pb2.QueryOrderResponse.FromString, options, channel_credentials, @@ -258,7 +331,7 @@ class BBGO(object): wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/pb.BBGO/QueryOrders', + return grpc.experimental.unary_unary(request, target, '/pb.TradingService/QueryOrders', bbgo__pb2.QueryOrdersRequest.SerializeToString, bbgo__pb2.QueryOrdersResponse.FromString, options, channel_credentials, @@ -275,25 +348,8 @@ class BBGO(object): wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/pb.BBGO/QueryTrades', + return grpc.experimental.unary_unary(request, target, '/pb.TradingService/QueryTrades', bbgo__pb2.QueryTradesRequest.SerializeToString, bbgo__pb2.QueryTradesResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def QueryKLines(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/pb.BBGO/QueryKLines', - bbgo__pb2.QueryKLinesRequest.SerializeToString, - bbgo__pb2.QueryKLinesResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata)