├── .gitignore ├── .github └── FUNDING.yml ├── investapi ├── version.tpl ├── version.go ├── helpers_test.go ├── helpers.go ├── client.go ├── signals_grpc.pb.go ├── stoporders_grpc.pb.go ├── users_grpc.pb.go ├── operations_grpc.pb.go ├── orders_grpc.pb.go ├── marketdata_grpc.pb.go └── sandbox.pb.go ├── generate.sh ├── Makefile ├── go.mod ├── LICENSE ├── Dockerfile ├── entrypoint.sh ├── example ├── sandbox │ └── sandbox.go ├── old │ └── main.go ├── takeprofit │ └── takeprofit.go └── new │ └── main.go ├── go.sum └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | custom: ['https://www.tbank.ru/rm/r_MarJWHfuBs.aNJjZwPrSm/5tN9636575/'] 2 | -------------------------------------------------------------------------------- /investapi/version.tpl: -------------------------------------------------------------------------------- 1 | package investapi 2 | 3 | // Version содержит хэш коммита, из которого был сгенерирован код клиента. 4 | // В данном случае это - https://github.com/RussianInvestments/investAPI/commit/development 5 | const Version = "development" 6 | -------------------------------------------------------------------------------- /investapi/version.go: -------------------------------------------------------------------------------- 1 | package investapi 2 | 3 | // Version содержит хэш коммита, из которого был сгенерирован код клиента. 4 | // В данном случае это - https://github.com/RussianInvestments/investAPI/commit/3eaf23a25f598fe483c913184acdbd9132bc68d2 5 | const Version = "3eaf23a25f598fe483c913184acdbd9132bc68d2" 6 | -------------------------------------------------------------------------------- /generate.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | 5 | # можно использовать и docker, и podman 6 | 7 | # containerEngine=docker 8 | containerEngine=podman 9 | 10 | 11 | # создаём базовый образ 12 | "$containerEngine" build -t localhost/go-invest-api . 13 | 14 | # запускаем скрипт entrypoint.sh в базовом образе 15 | "$containerEngine" run -v `pwd`/investapi:/opt/client/:z localhost/go-invest-api 16 | 17 | # делаем go.sum файл 18 | # go mod tidy 19 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | deps: 2 | go mod download 3 | go mod verify 4 | go mod tidy 5 | 6 | lint: 7 | gofmt -w=true -s=true -l=true ./example/ 8 | gofmt -w=true -s=true -l=true ./investapi/ 9 | golint ./... 10 | go vet ./... 11 | 12 | check: 13 | go test -v ./investapi/ 14 | 15 | generate: 16 | ./generate.sh 17 | 18 | # https://go.dev/blog/govulncheck 19 | # install it by `go install golang.org/x/vuln/cmd/govulncheck@latest` 20 | 21 | vuln: 22 | which govulncheck 23 | govulncheck ./... 24 | -------------------------------------------------------------------------------- /go.mod: -------------------------------------------------------------------------------- 1 | module github.com/vodolaz095/go-investAPI 2 | 3 | go 1.24.10 4 | 5 | require ( 6 | google.golang.org/genproto/googleapis/api v0.0.0-20251124214823-79d6a2a48846 7 | google.golang.org/grpc v1.77.0 8 | google.golang.org/protobuf v1.36.10 9 | ) 10 | 11 | require ( 12 | golang.org/x/net v0.47.0 // indirect 13 | golang.org/x/sys v0.38.0 // indirect 14 | golang.org/x/text v0.31.0 // indirect 15 | google.golang.org/genproto/googleapis/rpc v0.0.0-20251124214823-79d6a2a48846 // indirect 16 | ) 17 | -------------------------------------------------------------------------------- /investapi/helpers_test.go: -------------------------------------------------------------------------------- 1 | package investapi 2 | 3 | import ( 4 | "testing" 5 | ) 6 | 7 | func TestFloat64ToQuotation(t *testing.T) { 8 | quot := Float64ToQuotation(0.82) 9 | t.Logf("Unit %v", quot.Units) 10 | t.Logf("Nano %v", quot.Nano) 11 | } 12 | 13 | func TestQuotationToFloat(t *testing.T) { 14 | q := new(Quotation) 15 | q.Nano = 820000000 16 | q.Units = 0 17 | t.Logf("Quotation %s", q.String()) 18 | price := q.ToFloat64() 19 | t.Logf("Price %.5f", price) 20 | } 21 | 22 | func Test_MoneyValueFromFloat64(t *testing.T) { 23 | /* 24 | цена 100.02 для AAPL должна выставляться корректно. 25 | Проверьте, что она правильно преобразуется в формат MoneyValue, 26 | в котором дробная часть передается в миллиардных долях. 27 | 100.02 = {units=100,nano=20000000} 28 | */ 29 | 30 | v := 100.02 31 | 32 | m := MoneyValueFromFloat64(v) 33 | t.Logf("%d %d ", m.Units, m.Nano) 34 | 35 | if m.Units != 100 || m.Nano != 20000000 { 36 | t.Fatal("цена не та") 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2021 Остроумов Анатолий Александрович 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 4 | associated documentation files (the "Software"), to deal in the Software without restriction, 5 | including without limitation the rights to use, copy, modify, merge, publish, distribute, 6 | sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is 7 | furnished to do so, subject to the following conditions: 8 | 9 | The above copyright notice and this permission notice shall be included 10 | in all copies or substantial portions of the Software. 11 | 12 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT 13 | LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 14 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 15 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE 16 | OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 17 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM golang:1.24.10 2 | 3 | # устанавливаем unzip 4 | RUN apt-get update && apt-get install unzip -y 5 | 6 | # Задаём версии инструментов 7 | ARG PROTOC_VERSION="28.2" 8 | ARG PROTOC_GEN_GO_VERSION="1.35.1" 9 | ARG PROTOC_GEN_GO_GPRC_VERSION="1.5.1" 10 | 11 | # устанавливаем плагины для protoc 12 | ENV GOBIN=/usr/bin/ 13 | RUN go install google.golang.org/protobuf/cmd/protoc-gen-go@v${PROTOC_GEN_GO_VERSION} 14 | RUN go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v${PROTOC_GEN_GO_GPRC_VERSION} 15 | 16 | # Загружаем protoc и встроенные протоколы 17 | WORKDIR /tmp 18 | RUN wget "https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOC_VERSION}/protoc-${PROTOC_VERSION}-linux-x86_64.zip" 19 | 20 | # Устанавливаем protoc 21 | RUN unzip /tmp/protoc-${PROTOC_VERSION}-linux-x86_64.zip bin/protoc -d /usr/ 22 | RUN chown root:root /usr/bin/protoc 23 | RUN chmod 0755 /usr/bin/protoc 24 | 25 | # Устанавливаем встроенные протоколы 26 | RUN unzip protoc-${PROTOC_VERSION}-linux-x86_64.zip include/* -d /usr/bin/ 27 | RUN chown root:root /usr/bin/include/google/ -R 28 | 29 | # Создаём директории для вывода кода 30 | RUN mkdir -p /opt/client 31 | 32 | # Добавляем файлы 33 | ADD investapi/client.go /opt/client 34 | ADD investapi/helpers.go /opt/client 35 | ADD investapi/helpers_test.go /opt/client 36 | 37 | # Добавляем скрипт точки входа 38 | ADD entrypoint.sh /usr/bin/entrypoint.sh 39 | RUN chmod a+x /usr/bin/entrypoint.sh 40 | 41 | # При каждом запуске образа, будет выполнен скрипт entrypoint.sh 42 | ENTRYPOINT /usr/bin/entrypoint.sh 43 | -------------------------------------------------------------------------------- /investapi/helpers.go: -------------------------------------------------------------------------------- 1 | package investapi 2 | 3 | import ( 4 | "fmt" 5 | "math" 6 | "strings" 7 | ) 8 | 9 | const nano = 1000000000 10 | 11 | // ToFloat64 возвращает значения Quotation как число типа float64 12 | func (x *Quotation) ToFloat64() (output float64) { 13 | if x != nil { 14 | return float64(x.Units) + float64(x.Nano)/nano 15 | } 16 | return 0 17 | } 18 | 19 | // MoneyValueFromFloat64 создаёт MoneyValue c пустой валютой из числа типа float64 20 | func MoneyValueFromFloat64(a float64) *MoneyValue { 21 | i, f := math.Modf(a) 22 | return &MoneyValue{ 23 | Units: int64(i), 24 | Nano: int32(math.Round(f * nano)), 25 | Currency: "", 26 | } 27 | } 28 | 29 | // Float64ToQuotation преобразует float64 в ссылку на тип Quotation 30 | func Float64ToQuotation(input float64) (output *Quotation) { 31 | integerPart, floatPart := math.Modf(input) 32 | output = new(Quotation) 33 | output.Units = int64(integerPart) 34 | output.Nano = int32(math.Round(nano * floatPart)) 35 | return 36 | } 37 | 38 | // ToStringWithoutCurrency выводит строковое представление цены без указания валюты 39 | func (x *MoneyValue) ToStringWithoutCurrency() string { 40 | return fmt.Sprintf("%.2f", x.ToFloat64()) 41 | } 42 | 43 | // ToFloat64 выводит представление цены в виде дробного числа float64 44 | func (x *MoneyValue) ToFloat64() float64 { 45 | return float64(x.Units) + float64(x.Nano)/nano 46 | } 47 | 48 | // ToStringWithCurrency выводит строковое представление цены с указанием валюты 49 | func (x *MoneyValue) ToStringWithCurrency() string { 50 | return fmt.Sprintf("%.2f %s", x.ToFloat64(), strings.ToUpper(x.Currency)) 51 | } 52 | -------------------------------------------------------------------------------- /entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Данный скрипт клонирует репозиторий c официальными proto файлами, 4 | # и на их основе генерирует исходных код клиента для Golang 5 | # в директории /opt/client 6 | 7 | set -e 8 | 9 | output_dir=/opt 10 | 11 | # Убедимся, что компилятор Golang установлен 12 | which go 13 | go version 14 | go env 15 | 16 | # Убедимся, что утилита protoc установлена 17 | which protoc 18 | protoc --version 19 | 20 | # Клонируем исходный код протофайлов 21 | cd "$output_dir" 22 | git clone https://github.com/RussianInvestments/investAPI.git 23 | ls -l "$output_dir/investAPI/" 24 | 25 | # Смотрим, крайний коммит, на основе которого мы будет генерировать исходный код клиента 26 | cd "$output_dir/investAPI" 27 | git log -1 28 | 29 | # Сохраняем хэш коммита 30 | githash=$(git log --format='%H' -1) 31 | 32 | # Генерируем код модуля 33 | cd "$output_dir/investAPI/src/docs/contracts" 34 | protoc \ 35 | --proto_path=/usr/bin/include/google/ \ 36 | --proto_path="$output_dir/investAPI/src/docs/contracts" \ 37 | --go_out="$output_dir/client" \ 38 | --go_opt=paths=source_relative \ 39 | --go-grpc_opt=paths=source_relative \ 40 | --go-grpc_out="$output_dir/client" \ 41 | *.proto 42 | 43 | 44 | # Генерируем ленивку с хэшем коммита, из которого был сгенерирован клиент 45 | rm -f "$output_dir/client/version.go" 46 | cp "$output_dir/client/version.tpl" "$output_dir/client/version.go" 47 | sed -i "s/development/$githash/g" "$output_dir/client/version.go" 48 | 49 | # Смотрим, что получилось 50 | ls -l "$output_dir/client/" 51 | 52 | # Сообщаем, что получилось 53 | echo "Код сгенерирован из коммита https://github.com/RussianInvestments/investAPI/commit/$githash" 54 | -------------------------------------------------------------------------------- /example/sandbox/sandbox.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "context" 5 | "log" 6 | 7 | "github.com/vodolaz095/go-investAPI/investapi" 8 | ) 9 | 10 | /* 11 | Данный пример создаёт тестовый аккаунт и пополняет его 100 рублями 12 | */ 13 | 14 | const token = "тутДолженБытьТокен" // https://russianinvestments.github.io/investAPI/grpc/#tinkoff-invest-api_2 15 | 16 | func main() { 17 | client, err := investapi.NewWithCustomEndpoint(token, investapi.SandboxEndpoint) 18 | if err != nil { 19 | log.Fatalf("%s : при соединении с investAPI", err) 20 | } 21 | sandboxService := investapi.NewSandboxServiceClient(client.Connection) 22 | 23 | resp, err := sandboxService.OpenSandboxAccount(context.Background(), &investapi.OpenSandboxAccountRequest{}) 24 | if err != nil { 25 | log.Fatalf("%s : while opening sandbox account", err) 26 | } 27 | log.Printf("Тестовый счёт %s открыт", resp.AccountId) 28 | 29 | sandboxAccounts, err := sandboxService.GetSandboxAccounts(context.Background(), &investapi.GetAccountsRequest{}) 30 | if err != nil { 31 | log.Fatalf("%s : while getting sandbox accounts", err) 32 | } 33 | var howMuch investapi.MoneyValue 34 | howMuch = *investapi.MoneyValueFromFloat64(100) 35 | howMuch.Currency = "RUB" 36 | for _, account := range sandboxAccounts.GetAccounts() { 37 | if resp.AccountId == account.Id { 38 | _, err = sandboxService.SandboxPayIn(context.Background(), &investapi.SandboxPayInRequest{ 39 | AccountId: account.Id, 40 | Amount: &howMuch, 41 | }) 42 | if err != nil { 43 | log.Fatalf("%s : при попытке пополнить тестовый счёт %s", err, account.Id) 44 | } 45 | log.Printf("Тестовый аккаунт %s пополнен на 100 рублей", account.Id) 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /example/old/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "context" 5 | "crypto/tls" 6 | "log" 7 | 8 | "google.golang.org/grpc" 9 | "google.golang.org/grpc/credentials" 10 | "google.golang.org/grpc/status" 11 | 12 | "github.com/vodolaz095/go-investAPI/investapi" 13 | ) 14 | 15 | /* 16 | В этом примере мы с нуля настраиваем GRPC клиент общепринятыми практиками, 17 | потом этим клиентом мы соединяемся с API Тинькофф Инвестициями 18 | */ 19 | 20 | type tokenAuth struct { 21 | Token string 22 | } 23 | 24 | func (t tokenAuth) GetRequestMetadata(ctx context.Context, in ...string) (map[string]string, error) { 25 | return map[string]string{ 26 | "Authorization": "Bearer " + t.Token, 27 | }, nil 28 | } 29 | 30 | func (tokenAuth) RequireTransportSecurity() bool { 31 | return true 32 | } 33 | 34 | func main() { 35 | conn, err := grpc.Dial("invest-public-api.tinkoff.ru:443", 36 | grpc.WithTransportCredentials(credentials.NewTLS(&tls.Config{ 37 | ServerName: "invest-public-api.tinkoff.ru", 38 | })), // по умолчанию проверяет сертификат 39 | grpc.WithPerRPCCredentials(tokenAuth{ 40 | Token: "тутДолженБытьТокен", // https://russianinvestments.github.io/investAPI/grpc/#tinkoff-invest-api_2 41 | }), 42 | ) 43 | if err != nil { 44 | log.Fatalf("%s : при соединениии с api", err) 45 | } 46 | defer conn.Close() 47 | 48 | instrumentsAPI := investapi.NewInstrumentsServiceClient(conn) 49 | 50 | req := investapi.InstrumentRequest{ 51 | IdType: investapi.InstrumentIdType_INSTRUMENT_ID_TYPE_FIGI, 52 | Id: "BBG00RRT3TX4", 53 | } 54 | 55 | res, err := instrumentsAPI.GetInstrumentBy(context.TODO(), &req) 56 | if err != nil { 57 | // обработка ошибок 58 | st, parsed := status.FromError(err) 59 | if !parsed { 60 | log.Fatalf("неизвестная ошибка при получении котировок инструмента ОФЗ 25084: %s", err) 61 | } 62 | log.Printf("Ошибка получения котировок: %s", st.Err()) 63 | log.Printf("Код ошибки: %s", st.Message()) 64 | log.Printf("Объяснение стандартного кода ошибки: %s", st.Code().String()) 65 | details := st.Details() 66 | if len(details) > 0 { 67 | for i := range details { 68 | log.Printf("Детализация ошибки %v: %q", i, details[i]) 69 | } 70 | } else { 71 | log.Printf("Детализации ошибки отсутствует") 72 | } 73 | return 74 | } 75 | log.Printf("Инструмент %s найден!", res.Instrument.Name) 76 | } 77 | -------------------------------------------------------------------------------- /example/takeprofit/takeprofit.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "context" 5 | "log" 6 | "time" 7 | 8 | "github.com/vodolaz095/go-investAPI/investapi" 9 | ) 10 | 11 | /* 12 | * Реализация команды TakeProfit 13 | * Когда цена крайней сделки по акциям Газпрома достигнет 209.50 рублей, мы ставим лимитную 14 | * заявку на 209.29 копеек 15 | * НЕ ЯВЛЯЕТСЯ ИНВЕСТИЦИОННОЙ РЕКОМЕНДАЦИЕЙ 16 | */ 17 | 18 | const token = "тутДолженБытьТокен" // https://russianinvestments.github.io/investAPI/grpc/#tinkoff-invest-api_2 19 | const accountID = "" // аккаунт, на который мы покупаем бумагу 20 | var figi = "BBG004730RP0" // https://www.tinkoff.ru/invest/stocks/GAZP 21 | const minimumPrice = 209.50 // цена, при которой мы ставим лимитную заявку 22 | const wantedPrice = 209.29 // цена лимитной заявки 23 | 24 | func main() { 25 | client, err := investapi.New(token) 26 | if err != nil { 27 | log.Fatalf("%s : при соединении с investAPI", err) 28 | } 29 | 30 | // подписываемся на цену крайней сделки по акциям Газпрома 31 | request := investapi.MarketDataServerSideStreamRequest{ 32 | SubscribeCandlesRequest: nil, 33 | SubscribeOrderBookRequest: nil, 34 | SubscribeTradesRequest: nil, 35 | SubscribeInfoRequest: nil, 36 | SubscribeLastPriceRequest: &investapi.SubscribeLastPriceRequest{ 37 | SubscriptionAction: investapi.SubscriptionAction_SUBSCRIPTION_ACTION_SUBSCRIBE, 38 | Instruments: []*investapi.LastPriceInstrument{ 39 | {Figi: figi}, 40 | // тут можно подписаться на цены крайней сделки более чем одной бумаги 41 | }, 42 | }, 43 | } 44 | feed := investapi.NewMarketDataStreamServiceClient(client.Connection) 45 | stream, err := feed.MarketDataServerSideStream(context.TODO(), &request) 46 | if err != nil { 47 | log.Fatalf("%s : while subscribbing to feed", err) 48 | } 49 | defer stream.CloseSend() 50 | 51 | var msg *investapi.MarketDataResponse 52 | for { 53 | msg, err = stream.Recv() 54 | if err != nil { 55 | log.Fatalf("%s : while receiving price", err) 56 | } 57 | if msg != nil { 58 | log.Printf("Last prices: %s", msg.String()) 59 | lastPrice := msg.GetLastPrice() 60 | 61 | if lastPrice.GetFigi() == figi { 62 | if lastPrice.GetPrice() != nil { 63 | if lastPrice.GetPrice().ToFloat64() < minimumPrice { 64 | log.Println("Ставим лимитный заказ на покупку бумаги") 65 | resp, errO := client.OrdersServiceClient.PostOrder(context.TODO(), &investapi.PostOrderRequest{ 66 | Figi: &figi, 67 | Quantity: 1, 68 | Price: investapi.Float64ToQuotation(wantedPrice), 69 | Direction: investapi.OrderDirection_ORDER_DIRECTION_BUY, 70 | AccountId: accountID, 71 | OrderType: investapi.OrderType_ORDER_TYPE_LIMIT, 72 | OrderId: "lalala", // тут может быть что угодно для удобства работы с заявками 73 | }) 74 | if errO != nil { 75 | log.Printf("%s : while making order", errO) 76 | break 77 | } 78 | log.Printf("Order %s %s is created!", resp.OrderId, resp.Message) 79 | break // отключаем подписку 80 | } 81 | } 82 | } 83 | continue 84 | } 85 | time.Sleep(10 * time.Millisecond) 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /go.sum: -------------------------------------------------------------------------------- 1 | github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI= 2 | github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= 3 | github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= 4 | github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= 5 | github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= 6 | github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= 7 | github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= 8 | github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= 9 | github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= 10 | github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= 11 | go.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64= 12 | go.opentelemetry.io/auto/sdk v1.2.1/go.mod h1:KRTj+aOaElaLi+wW1kO/DZRXwkF4C5xPbEe3ZiIhN7Y= 13 | go.opentelemetry.io/otel v1.38.0 h1:RkfdswUDRimDg0m2Az18RKOsnI8UDzppJAtj01/Ymk8= 14 | go.opentelemetry.io/otel v1.38.0/go.mod h1:zcmtmQ1+YmQM9wrNsTGV/q/uyusom3P8RxwExxkZhjM= 15 | go.opentelemetry.io/otel/metric v1.38.0 h1:Kl6lzIYGAh5M159u9NgiRkmoMKjvbsKtYRwgfrA6WpA= 16 | go.opentelemetry.io/otel/metric v1.38.0/go.mod h1:kB5n/QoRM8YwmUahxvI3bO34eVtQf2i4utNVLr9gEmI= 17 | go.opentelemetry.io/otel/sdk v1.38.0 h1:l48sr5YbNf2hpCUj/FoGhW9yDkl+Ma+LrVl8qaM5b+E= 18 | go.opentelemetry.io/otel/sdk v1.38.0/go.mod h1:ghmNdGlVemJI3+ZB5iDEuk4bWA3GkTpW+DOoZMYBVVg= 19 | go.opentelemetry.io/otel/sdk/metric v1.38.0 h1:aSH66iL0aZqo//xXzQLYozmWrXxyFkBJ6qT5wthqPoM= 20 | go.opentelemetry.io/otel/sdk/metric v1.38.0/go.mod h1:dg9PBnW9XdQ1Hd6ZnRz689CbtrUp0wMMs9iPcgT9EZA= 21 | go.opentelemetry.io/otel/trace v1.38.0 h1:Fxk5bKrDZJUH+AMyyIXGcFAPah0oRcT+LuNtJrmcNLE= 22 | go.opentelemetry.io/otel/trace v1.38.0/go.mod h1:j1P9ivuFsTceSWe1oY+EeW3sc+Pp42sO++GHkg4wwhs= 23 | golang.org/x/net v0.47.0 h1:Mx+4dIFzqraBXUugkia1OOvlD6LemFo1ALMHjrXDOhY= 24 | golang.org/x/net v0.47.0/go.mod h1:/jNxtkgq5yWUGYkaZGqo27cfGZ1c5Nen03aYrrKpVRU= 25 | golang.org/x/sys v0.38.0 h1:3yZWxaJjBmCWXqhN1qh02AkOnCQ1poK6oF+a7xWL6Gc= 26 | golang.org/x/sys v0.38.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= 27 | golang.org/x/text v0.31.0 h1:aC8ghyu4JhP8VojJ2lEHBnochRno1sgL6nEi9WGFGMM= 28 | golang.org/x/text v0.31.0/go.mod h1:tKRAlv61yKIjGGHX/4tP1LTbc13YSec1pxVEWXzfoeM= 29 | gonum.org/v1/gonum v0.16.0 h1:5+ul4Swaf3ESvrOnidPp4GZbzf0mxVQpDCYUQE7OJfk= 30 | gonum.org/v1/gonum v0.16.0/go.mod h1:fef3am4MQ93R2HHpKnLk4/Tbh/s0+wqD5nfa6Pnwy4E= 31 | google.golang.org/genproto/googleapis/api v0.0.0-20251124214823-79d6a2a48846 h1:ZdyUkS9po3H7G0tuh955QVyyotWvOD4W0aEapeGeUYk= 32 | google.golang.org/genproto/googleapis/api v0.0.0-20251124214823-79d6a2a48846/go.mod h1:Fk4kyraUvqD7i5H6S43sj2W98fbZa75lpZz/eUyhfO0= 33 | google.golang.org/genproto/googleapis/rpc v0.0.0-20251124214823-79d6a2a48846 h1:Wgl1rcDNThT+Zn47YyCXOXyX/COgMTIdhJ717F0l4xk= 34 | google.golang.org/genproto/googleapis/rpc v0.0.0-20251124214823-79d6a2a48846/go.mod h1:7i2o+ce6H/6BluujYR+kqX3GKH+dChPTQU19wjRPiGk= 35 | google.golang.org/grpc v1.77.0 h1:wVVY6/8cGA6vvffn+wWK5ToddbgdU3d8MNENr4evgXM= 36 | google.golang.org/grpc v1.77.0/go.mod h1:z0BY1iVj0q8E1uSQCjL9cppRj+gnZjzDnzV0dHhrNig= 37 | google.golang.org/protobuf v1.36.10 h1:AYd7cD/uASjIL6Q9LiTjz8JLcrh/88q5UObnmY3aOOE= 38 | google.golang.org/protobuf v1.36.10/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco= 39 | -------------------------------------------------------------------------------- /example/new/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "context" 5 | "log" 6 | "time" 7 | 8 | "google.golang.org/grpc" 9 | "google.golang.org/grpc/metadata" 10 | "google.golang.org/grpc/status" 11 | 12 | "github.com/vodolaz095/go-investAPI/investapi" 13 | ) 14 | 15 | /* 16 | В этом примере мы создаём GRPC клиент с помощью встроенного конструктора, 17 | потом этим клиентом мы соединяемся с API Тинькофф Инвестициями 18 | и получаем цену крайней сделки по облигации федерального займа 25084 19 | https://www.tinkoff.ru/invest/bonds/SU25084RMFS3. 20 | Мы отображаем все хедеры, которые передал сервер. 21 | */ 22 | 23 | const token = "тутДолженБытьТокен" // https://russianinvestments.github.io/investAPI/grpc/#tinkoff-invest-api_2 24 | 25 | func main() { 26 | client, err := investapi.New(token) 27 | if err != nil { 28 | log.Fatalf("%s : при соединении с investAPI", err) 29 | } 30 | // в эту переменную мы записываем все хедеры, которые послал для нас сервер брокера 31 | var header metadata.MD 32 | 33 | // так мы вызываем метод для получения крайней цены сделки 34 | res, err := client.MarketDataServiceClient.GetLastPrices(context.Background(), 35 | // так мы посылаем тело запроса 36 | &investapi.GetLastPricesRequest{Figi: []string{"BBG00RRT3TX4"}}, 37 | // так мы извлекаем все хедеры, 38 | // которые сервер посылает вместе с ответом на запрос GetLastPrices 39 | grpc.Header(&header), 40 | ) 41 | 42 | // так мы вызываем метод для получения крайней цены сделки, если хедеры нам не нужны 43 | //res, err := client.MarketDataServiceClient.GetLastPrices(context.Background(), 44 | // &investapi.GetLastPricesRequest{Figi: []string{"BBG00RRT3TX4"}}, 45 | //) 46 | 47 | for k, v := range header { 48 | log.Printf("Получен хедер %s : %s", k, v) 49 | // 2022/06/07 10:58:40 Получен хедер date : [Tue, 07 Jun 2022 07:58:39 GMT] 50 | // 2022/06/07 10:58:40 Получен хедер x-ratelimit-reset : [20] 51 | // 2022/06/07 10:58:40 Получен хедер x-ratelimit-limit : [300, 300;w=60] 52 | // 2022/06/07 10:58:40 Получен хедер grpc-accept-encoding : [gzip] 53 | // 2022/06/07 10:58:40 Получен хедер server : [envoy] 54 | // 2022/06/07 10:58:40 Получен хедер x-envoy-upstream-service-time : [1] 55 | // 2022/06/07 10:58:40 Получен хедер content-type : [application/grpc] 56 | // 2022/06/07 10:58:40 Получен хедер x-tracking-id : [8f261b2d7286743623221465e853c9c5] 57 | // 2022/06/07 10:58:40 Получен хедер x-ratelimit-remaining : [181] 58 | } 59 | if err != nil { 60 | // обработка ошибок 61 | st, parsed := status.FromError(err) 62 | if !parsed { 63 | log.Fatalf("неизвестная ошибка при получении котировок инструмента ОФЗ 25084: %s", err) 64 | } 65 | log.Printf("Ошибка получения котировок: %s", st.Err()) 66 | log.Printf("Неформатированное сообщение от сервера: %s", st.Proto().String()) 67 | log.Printf("Код ошибки: %s", st.Message()) 68 | log.Printf("Объяснение стандартного кода ошибки: %s", st.Code().String()) 69 | details := st.Details() 70 | if len(details) > 0 { 71 | for i := range details { 72 | log.Printf("Детализация ошибки %v: %q", i, details[i]) 73 | } 74 | } else { 75 | log.Printf("Детализации ошибки отсутствует") 76 | } 77 | return 78 | } 79 | for _, price := range res.GetLastPrices() { 80 | log.Printf("%s назад цена сделки была %.4f рублей", 81 | time.Now().Sub(price.Time.AsTime()).String(), price.GetPrice().ToFloat64(), 82 | ) 83 | } 84 | // 2022/06/07 10:58:40 1m52.663352891s назад цена сделки была 95.5830 рублей 85 | 86 | // проверяем состояние соединения с grpc сервером брокера 87 | err = client.Ping(context.Background()) 88 | if err != nil { 89 | log.Fatalf("%s : при проверке соединения с investAPI", err) 90 | } 91 | 92 | // закрываем соединение 93 | err = client.Connection.Close() 94 | if err != nil { 95 | log.Fatalf("%s : при закрытии соединения", err) 96 | } 97 | } 98 | -------------------------------------------------------------------------------- /investapi/client.go: -------------------------------------------------------------------------------- 1 | package investapi 2 | 3 | import ( 4 | "context" 5 | "crypto/tls" 6 | "errors" 7 | "fmt" 8 | "strings" 9 | 10 | "google.golang.org/grpc" 11 | "google.golang.org/grpc/connectivity" 12 | "google.golang.org/grpc/credentials" 13 | "google.golang.org/grpc/credentials/insecure" 14 | ) 15 | 16 | // DefaultEndpoint - это адрес, на котором работает продукционное окружение InvestAPI 17 | const DefaultEndpoint = "invest-public-api.tinkoff.ru:443" 18 | 19 | // SandboxEndpoint - это адрес, на котором работает тестовое окружение 20 | const SandboxEndpoint = "sandbox-invest-public-api.tinkoff.ru:443" 21 | 22 | // tokenAuth используется для описания стратегии авторизации GRPC клиента 23 | type tokenAuth struct { 24 | // Token - это ключ доступа, который можно получить отсюда - // https://russianinvestments.github.io/investAPI/grpc/#tinkoff-invest-api_2 25 | Token string 26 | // Secure - флаг, включающий требование шифрования соединения 27 | Secure bool 28 | } 29 | 30 | // GetRequestMetadata используется для авторизации с помощью Bearer стратегии 31 | func (ta tokenAuth) GetRequestMetadata(ctx context.Context, in ...string) (map[string]string, error) { 32 | return map[string]string{ 33 | "Authorization": "Bearer " + ta.Token, 34 | }, nil 35 | } 36 | 37 | // RequireTransportSecurity требует, чтобы транспорт был защищённым 38 | func (ta tokenAuth) RequireTransportSecurity() bool { 39 | return ta.Secure 40 | } 41 | 42 | // Client - это структура для доступа к API, в которой есть соединение и сгенерированные клиенты для всех сервисов 43 | type Client struct { 44 | Connection *grpc.ClientConn 45 | InstrumentsServiceClient InstrumentsServiceClient 46 | UsersServiceClient UsersServiceClient 47 | MarketDataServiceClient MarketDataServiceClient 48 | OperationsServiceClient OperationsServiceClient 49 | OrdersServiceClient OrdersServiceClient 50 | StopOrdersServiceClient StopOrdersServiceClient 51 | SignalServiceClient SignalServiceClient 52 | } 53 | 54 | // Ping проверяет работоспособность соединения на основе получения состояния пула соединений 55 | func (c *Client) Ping(_ context.Context) (err error) { 56 | // Полезная статья 57 | // https://grpc.github.io/grpc/core/md_doc_keepalive.html 58 | state := c.Connection.GetState() 59 | switch state { 60 | case connectivity.Ready, connectivity.Idle: 61 | return nil 62 | default: 63 | return fmt.Errorf("некорректное состояние grpc соединения: %s", state) 64 | } 65 | } 66 | 67 | // New создаёт новый клиент для доступа к API по адресу продового окружения, используя Ключ доступа и 68 | // вариадическую переменную opts с параметрами вида grpc.DialOption для настройки соединения 69 | // как аргументы 70 | func New(token string, opts ...grpc.DialOption) (client *Client, err error) { 71 | return NewWithCustomEndpoint(token, DefaultEndpoint, opts...) 72 | } 73 | 74 | // NewWithCustomEndpoint создаёт новый клиент для доступа к API, используя Ключ доступа, адрес API и 75 | // вариадическую переменную opts с параметрами вида grpc.DialOption для настройки соединения 76 | // как аргументы 77 | func NewWithCustomEndpoint(token, endpoint string, opts ...grpc.DialOption) (client *Client, err error) { 78 | return NewWithOpts(token, endpoint, opts...) 79 | } 80 | 81 | // NewWithOpts создаёт новый клиент для доступа к API, используя Ключ доступа, адрес API и 82 | // вариадическую переменную opts с параметрами вида grpc.DialOption для настройки соединения 83 | // как аргументы 84 | func NewWithOpts(token, endpoint string, opts ...grpc.DialOption) (client *Client, err error) { 85 | opts = append(opts, 86 | grpc.WithTransportCredentials(credentials.NewTLS(&tls.Config{ 87 | ServerName: strings.Split(endpoint, ":")[0], 88 | })), 89 | grpc.WithPerRPCCredentials(tokenAuth{Token: token, Secure: true}), 90 | grpc.WithUserAgent("https://github.com/vodolaz095/go-investAPI"), 91 | ) 92 | return makeClient(endpoint, opts...) 93 | } 94 | 95 | // NewInsecure создаёт новый клиент с ВЫКЛЮЧЕНЫМ TLS шифрованием для доступа к API, используя 96 | // Ключ доступа как аргумент, доменное имя и вариадическую переменную opts с параметрами вида grpc.DialOption для настройки соединения 97 | // Этот клиент лучше не использовать за пределами тестовых окружений! Рекомендуется использовать с mock API инвестиций в тестовых сценариях 98 | func NewInsecure(token, endpoint string, opts ...grpc.DialOption) (client *Client, err error) { 99 | if endpoint == DefaultEndpoint { 100 | return nil, errors.New("non encrypted connection to production endpoint is not allowed") 101 | } 102 | opts = append(opts, 103 | grpc.WithTransportCredentials(insecure.NewCredentials()), // никогда так не делайте! 104 | grpc.WithPerRPCCredentials(tokenAuth{Token: token, Secure: false}), 105 | grpc.WithUserAgent("https://github.com/vodolaz095/go-investAPI"), 106 | ) 107 | return makeClient(endpoint, opts...) 108 | } 109 | 110 | func makeClient(endpoint string, opts ...grpc.DialOption) (client *Client, err error) { 111 | conn, err := grpc.NewClient(endpoint, opts...) 112 | if err != nil { 113 | return 114 | } 115 | client = new(Client) 116 | client.Connection = conn 117 | client.InstrumentsServiceClient = NewInstrumentsServiceClient(conn) 118 | client.UsersServiceClient = NewUsersServiceClient(conn) 119 | client.MarketDataServiceClient = NewMarketDataServiceClient(conn) 120 | client.OperationsServiceClient = NewOperationsServiceClient(conn) 121 | client.OrdersServiceClient = NewOrdersServiceClient(conn) 122 | client.StopOrdersServiceClient = NewStopOrdersServiceClient(conn) 123 | client.SignalServiceClient = NewSignalServiceClient(conn) 124 | return 125 | } 126 | -------------------------------------------------------------------------------- /investapi/signals_grpc.pb.go: -------------------------------------------------------------------------------- 1 | // Code generated by protoc-gen-go-grpc. DO NOT EDIT. 2 | // versions: 3 | // - protoc-gen-go-grpc v1.5.1 4 | // - protoc v5.28.2 5 | // source: signals.proto 6 | 7 | package investapi 8 | 9 | import ( 10 | context "context" 11 | grpc "google.golang.org/grpc" 12 | codes "google.golang.org/grpc/codes" 13 | status "google.golang.org/grpc/status" 14 | ) 15 | 16 | // This is a compile-time assertion to ensure that this generated file 17 | // is compatible with the grpc package it is being compiled against. 18 | // Requires gRPC-Go v1.64.0 or later. 19 | const _ = grpc.SupportPackageIsVersion9 20 | 21 | const ( 22 | SignalService_GetStrategies_FullMethodName = "/tinkoff.public.invest.api.contract.v1.SignalService/GetStrategies" 23 | SignalService_GetSignals_FullMethodName = "/tinkoff.public.invest.api.contract.v1.SignalService/GetSignals" 24 | ) 25 | 26 | // SignalServiceClient is the client API for SignalService service. 27 | // 28 | // 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. 29 | type SignalServiceClient interface { 30 | // GetStrategies — стратегии 31 | GetStrategies(ctx context.Context, in *GetStrategiesRequest, opts ...grpc.CallOption) (*GetStrategiesResponse, error) 32 | // GetSignals — сигналы 33 | GetSignals(ctx context.Context, in *GetSignalsRequest, opts ...grpc.CallOption) (*GetSignalsResponse, error) 34 | } 35 | 36 | type signalServiceClient struct { 37 | cc grpc.ClientConnInterface 38 | } 39 | 40 | func NewSignalServiceClient(cc grpc.ClientConnInterface) SignalServiceClient { 41 | return &signalServiceClient{cc} 42 | } 43 | 44 | func (c *signalServiceClient) GetStrategies(ctx context.Context, in *GetStrategiesRequest, opts ...grpc.CallOption) (*GetStrategiesResponse, error) { 45 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) 46 | out := new(GetStrategiesResponse) 47 | err := c.cc.Invoke(ctx, SignalService_GetStrategies_FullMethodName, in, out, cOpts...) 48 | if err != nil { 49 | return nil, err 50 | } 51 | return out, nil 52 | } 53 | 54 | func (c *signalServiceClient) GetSignals(ctx context.Context, in *GetSignalsRequest, opts ...grpc.CallOption) (*GetSignalsResponse, error) { 55 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) 56 | out := new(GetSignalsResponse) 57 | err := c.cc.Invoke(ctx, SignalService_GetSignals_FullMethodName, in, out, cOpts...) 58 | if err != nil { 59 | return nil, err 60 | } 61 | return out, nil 62 | } 63 | 64 | // SignalServiceServer is the server API for SignalService service. 65 | // All implementations must embed UnimplementedSignalServiceServer 66 | // for forward compatibility. 67 | type SignalServiceServer interface { 68 | // GetStrategies — стратегии 69 | GetStrategies(context.Context, *GetStrategiesRequest) (*GetStrategiesResponse, error) 70 | // GetSignals — сигналы 71 | GetSignals(context.Context, *GetSignalsRequest) (*GetSignalsResponse, error) 72 | mustEmbedUnimplementedSignalServiceServer() 73 | } 74 | 75 | // UnimplementedSignalServiceServer must be embedded to have 76 | // forward compatible implementations. 77 | // 78 | // NOTE: this should be embedded by value instead of pointer to avoid a nil 79 | // pointer dereference when methods are called. 80 | type UnimplementedSignalServiceServer struct{} 81 | 82 | func (UnimplementedSignalServiceServer) GetStrategies(context.Context, *GetStrategiesRequest) (*GetStrategiesResponse, error) { 83 | return nil, status.Errorf(codes.Unimplemented, "method GetStrategies not implemented") 84 | } 85 | func (UnimplementedSignalServiceServer) GetSignals(context.Context, *GetSignalsRequest) (*GetSignalsResponse, error) { 86 | return nil, status.Errorf(codes.Unimplemented, "method GetSignals not implemented") 87 | } 88 | func (UnimplementedSignalServiceServer) mustEmbedUnimplementedSignalServiceServer() {} 89 | func (UnimplementedSignalServiceServer) testEmbeddedByValue() {} 90 | 91 | // UnsafeSignalServiceServer may be embedded to opt out of forward compatibility for this service. 92 | // Use of this interface is not recommended, as added methods to SignalServiceServer will 93 | // result in compilation errors. 94 | type UnsafeSignalServiceServer interface { 95 | mustEmbedUnimplementedSignalServiceServer() 96 | } 97 | 98 | func RegisterSignalServiceServer(s grpc.ServiceRegistrar, srv SignalServiceServer) { 99 | // If the following call pancis, it indicates UnimplementedSignalServiceServer was 100 | // embedded by pointer and is nil. This will cause panics if an 101 | // unimplemented method is ever invoked, so we test this at initialization 102 | // time to prevent it from happening at runtime later due to I/O. 103 | if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { 104 | t.testEmbeddedByValue() 105 | } 106 | s.RegisterService(&SignalService_ServiceDesc, srv) 107 | } 108 | 109 | func _SignalService_GetStrategies_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 110 | in := new(GetStrategiesRequest) 111 | if err := dec(in); err != nil { 112 | return nil, err 113 | } 114 | if interceptor == nil { 115 | return srv.(SignalServiceServer).GetStrategies(ctx, in) 116 | } 117 | info := &grpc.UnaryServerInfo{ 118 | Server: srv, 119 | FullMethod: SignalService_GetStrategies_FullMethodName, 120 | } 121 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { 122 | return srv.(SignalServiceServer).GetStrategies(ctx, req.(*GetStrategiesRequest)) 123 | } 124 | return interceptor(ctx, in, info, handler) 125 | } 126 | 127 | func _SignalService_GetSignals_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 128 | in := new(GetSignalsRequest) 129 | if err := dec(in); err != nil { 130 | return nil, err 131 | } 132 | if interceptor == nil { 133 | return srv.(SignalServiceServer).GetSignals(ctx, in) 134 | } 135 | info := &grpc.UnaryServerInfo{ 136 | Server: srv, 137 | FullMethod: SignalService_GetSignals_FullMethodName, 138 | } 139 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { 140 | return srv.(SignalServiceServer).GetSignals(ctx, req.(*GetSignalsRequest)) 141 | } 142 | return interceptor(ctx, in, info, handler) 143 | } 144 | 145 | // SignalService_ServiceDesc is the grpc.ServiceDesc for SignalService service. 146 | // It's only intended for direct use with grpc.RegisterService, 147 | // and not to be introspected or modified (even as a copy) 148 | var SignalService_ServiceDesc = grpc.ServiceDesc{ 149 | ServiceName: "tinkoff.public.invest.api.contract.v1.SignalService", 150 | HandlerType: (*SignalServiceServer)(nil), 151 | Methods: []grpc.MethodDesc{ 152 | { 153 | MethodName: "GetStrategies", 154 | Handler: _SignalService_GetStrategies_Handler, 155 | }, 156 | { 157 | MethodName: "GetSignals", 158 | Handler: _SignalService_GetSignals_Handler, 159 | }, 160 | }, 161 | Streams: []grpc.StreamDesc{}, 162 | Metadata: "signals.proto", 163 | } 164 | -------------------------------------------------------------------------------- /investapi/stoporders_grpc.pb.go: -------------------------------------------------------------------------------- 1 | // Code generated by protoc-gen-go-grpc. DO NOT EDIT. 2 | // versions: 3 | // - protoc-gen-go-grpc v1.5.1 4 | // - protoc v5.28.2 5 | // source: stoporders.proto 6 | 7 | package investapi 8 | 9 | import ( 10 | context "context" 11 | grpc "google.golang.org/grpc" 12 | codes "google.golang.org/grpc/codes" 13 | status "google.golang.org/grpc/status" 14 | ) 15 | 16 | // This is a compile-time assertion to ensure that this generated file 17 | // is compatible with the grpc package it is being compiled against. 18 | // Requires gRPC-Go v1.64.0 or later. 19 | const _ = grpc.SupportPackageIsVersion9 20 | 21 | const ( 22 | StopOrdersService_PostStopOrder_FullMethodName = "/tinkoff.public.invest.api.contract.v1.StopOrdersService/PostStopOrder" 23 | StopOrdersService_GetStopOrders_FullMethodName = "/tinkoff.public.invest.api.contract.v1.StopOrdersService/GetStopOrders" 24 | StopOrdersService_CancelStopOrder_FullMethodName = "/tinkoff.public.invest.api.contract.v1.StopOrdersService/CancelStopOrder" 25 | ) 26 | 27 | // StopOrdersServiceClient is the client API for StopOrdersService service. 28 | // 29 | // 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. 30 | type StopOrdersServiceClient interface { 31 | // PostStopOrder — выставить стоп-заявку 32 | PostStopOrder(ctx context.Context, in *PostStopOrderRequest, opts ...grpc.CallOption) (*PostStopOrderResponse, error) 33 | // GetStopOrders — получить список активных стоп-заявок по счету 34 | GetStopOrders(ctx context.Context, in *GetStopOrdersRequest, opts ...grpc.CallOption) (*GetStopOrdersResponse, error) 35 | // CancelStopOrder — отменить стоп-заявку 36 | CancelStopOrder(ctx context.Context, in *CancelStopOrderRequest, opts ...grpc.CallOption) (*CancelStopOrderResponse, error) 37 | } 38 | 39 | type stopOrdersServiceClient struct { 40 | cc grpc.ClientConnInterface 41 | } 42 | 43 | func NewStopOrdersServiceClient(cc grpc.ClientConnInterface) StopOrdersServiceClient { 44 | return &stopOrdersServiceClient{cc} 45 | } 46 | 47 | func (c *stopOrdersServiceClient) PostStopOrder(ctx context.Context, in *PostStopOrderRequest, opts ...grpc.CallOption) (*PostStopOrderResponse, error) { 48 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) 49 | out := new(PostStopOrderResponse) 50 | err := c.cc.Invoke(ctx, StopOrdersService_PostStopOrder_FullMethodName, in, out, cOpts...) 51 | if err != nil { 52 | return nil, err 53 | } 54 | return out, nil 55 | } 56 | 57 | func (c *stopOrdersServiceClient) GetStopOrders(ctx context.Context, in *GetStopOrdersRequest, opts ...grpc.CallOption) (*GetStopOrdersResponse, error) { 58 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) 59 | out := new(GetStopOrdersResponse) 60 | err := c.cc.Invoke(ctx, StopOrdersService_GetStopOrders_FullMethodName, in, out, cOpts...) 61 | if err != nil { 62 | return nil, err 63 | } 64 | return out, nil 65 | } 66 | 67 | func (c *stopOrdersServiceClient) CancelStopOrder(ctx context.Context, in *CancelStopOrderRequest, opts ...grpc.CallOption) (*CancelStopOrderResponse, error) { 68 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) 69 | out := new(CancelStopOrderResponse) 70 | err := c.cc.Invoke(ctx, StopOrdersService_CancelStopOrder_FullMethodName, in, out, cOpts...) 71 | if err != nil { 72 | return nil, err 73 | } 74 | return out, nil 75 | } 76 | 77 | // StopOrdersServiceServer is the server API for StopOrdersService service. 78 | // All implementations must embed UnimplementedStopOrdersServiceServer 79 | // for forward compatibility. 80 | type StopOrdersServiceServer interface { 81 | // PostStopOrder — выставить стоп-заявку 82 | PostStopOrder(context.Context, *PostStopOrderRequest) (*PostStopOrderResponse, error) 83 | // GetStopOrders — получить список активных стоп-заявок по счету 84 | GetStopOrders(context.Context, *GetStopOrdersRequest) (*GetStopOrdersResponse, error) 85 | // CancelStopOrder — отменить стоп-заявку 86 | CancelStopOrder(context.Context, *CancelStopOrderRequest) (*CancelStopOrderResponse, error) 87 | mustEmbedUnimplementedStopOrdersServiceServer() 88 | } 89 | 90 | // UnimplementedStopOrdersServiceServer must be embedded to have 91 | // forward compatible implementations. 92 | // 93 | // NOTE: this should be embedded by value instead of pointer to avoid a nil 94 | // pointer dereference when methods are called. 95 | type UnimplementedStopOrdersServiceServer struct{} 96 | 97 | func (UnimplementedStopOrdersServiceServer) PostStopOrder(context.Context, *PostStopOrderRequest) (*PostStopOrderResponse, error) { 98 | return nil, status.Errorf(codes.Unimplemented, "method PostStopOrder not implemented") 99 | } 100 | func (UnimplementedStopOrdersServiceServer) GetStopOrders(context.Context, *GetStopOrdersRequest) (*GetStopOrdersResponse, error) { 101 | return nil, status.Errorf(codes.Unimplemented, "method GetStopOrders not implemented") 102 | } 103 | func (UnimplementedStopOrdersServiceServer) CancelStopOrder(context.Context, *CancelStopOrderRequest) (*CancelStopOrderResponse, error) { 104 | return nil, status.Errorf(codes.Unimplemented, "method CancelStopOrder not implemented") 105 | } 106 | func (UnimplementedStopOrdersServiceServer) mustEmbedUnimplementedStopOrdersServiceServer() {} 107 | func (UnimplementedStopOrdersServiceServer) testEmbeddedByValue() {} 108 | 109 | // UnsafeStopOrdersServiceServer may be embedded to opt out of forward compatibility for this service. 110 | // Use of this interface is not recommended, as added methods to StopOrdersServiceServer will 111 | // result in compilation errors. 112 | type UnsafeStopOrdersServiceServer interface { 113 | mustEmbedUnimplementedStopOrdersServiceServer() 114 | } 115 | 116 | func RegisterStopOrdersServiceServer(s grpc.ServiceRegistrar, srv StopOrdersServiceServer) { 117 | // If the following call pancis, it indicates UnimplementedStopOrdersServiceServer was 118 | // embedded by pointer and is nil. This will cause panics if an 119 | // unimplemented method is ever invoked, so we test this at initialization 120 | // time to prevent it from happening at runtime later due to I/O. 121 | if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { 122 | t.testEmbeddedByValue() 123 | } 124 | s.RegisterService(&StopOrdersService_ServiceDesc, srv) 125 | } 126 | 127 | func _StopOrdersService_PostStopOrder_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 128 | in := new(PostStopOrderRequest) 129 | if err := dec(in); err != nil { 130 | return nil, err 131 | } 132 | if interceptor == nil { 133 | return srv.(StopOrdersServiceServer).PostStopOrder(ctx, in) 134 | } 135 | info := &grpc.UnaryServerInfo{ 136 | Server: srv, 137 | FullMethod: StopOrdersService_PostStopOrder_FullMethodName, 138 | } 139 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { 140 | return srv.(StopOrdersServiceServer).PostStopOrder(ctx, req.(*PostStopOrderRequest)) 141 | } 142 | return interceptor(ctx, in, info, handler) 143 | } 144 | 145 | func _StopOrdersService_GetStopOrders_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 146 | in := new(GetStopOrdersRequest) 147 | if err := dec(in); err != nil { 148 | return nil, err 149 | } 150 | if interceptor == nil { 151 | return srv.(StopOrdersServiceServer).GetStopOrders(ctx, in) 152 | } 153 | info := &grpc.UnaryServerInfo{ 154 | Server: srv, 155 | FullMethod: StopOrdersService_GetStopOrders_FullMethodName, 156 | } 157 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { 158 | return srv.(StopOrdersServiceServer).GetStopOrders(ctx, req.(*GetStopOrdersRequest)) 159 | } 160 | return interceptor(ctx, in, info, handler) 161 | } 162 | 163 | func _StopOrdersService_CancelStopOrder_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 164 | in := new(CancelStopOrderRequest) 165 | if err := dec(in); err != nil { 166 | return nil, err 167 | } 168 | if interceptor == nil { 169 | return srv.(StopOrdersServiceServer).CancelStopOrder(ctx, in) 170 | } 171 | info := &grpc.UnaryServerInfo{ 172 | Server: srv, 173 | FullMethod: StopOrdersService_CancelStopOrder_FullMethodName, 174 | } 175 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { 176 | return srv.(StopOrdersServiceServer).CancelStopOrder(ctx, req.(*CancelStopOrderRequest)) 177 | } 178 | return interceptor(ctx, in, info, handler) 179 | } 180 | 181 | // StopOrdersService_ServiceDesc is the grpc.ServiceDesc for StopOrdersService service. 182 | // It's only intended for direct use with grpc.RegisterService, 183 | // and not to be introspected or modified (even as a copy) 184 | var StopOrdersService_ServiceDesc = grpc.ServiceDesc{ 185 | ServiceName: "tinkoff.public.invest.api.contract.v1.StopOrdersService", 186 | HandlerType: (*StopOrdersServiceServer)(nil), 187 | Methods: []grpc.MethodDesc{ 188 | { 189 | MethodName: "PostStopOrder", 190 | Handler: _StopOrdersService_PostStopOrder_Handler, 191 | }, 192 | { 193 | MethodName: "GetStopOrders", 194 | Handler: _StopOrdersService_GetStopOrders_Handler, 195 | }, 196 | { 197 | MethodName: "CancelStopOrder", 198 | Handler: _StopOrdersService_CancelStopOrder_Handler, 199 | }, 200 | }, 201 | Streams: []grpc.StreamDesc{}, 202 | Metadata: "stoporders.proto", 203 | } 204 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Go-InvestAPI 2 | ============================= 3 | [![PkgGoDev](https://pkg.go.dev/github.com/vodolaz095/go-investAPI/investapi)](https://pkg.go.dev/github.com/vodolaz095/go-investAPI/investapi?tab=doc) 4 | 5 | Неофициальный минималистичный grpc клиент для работы с [investAPI](https://developer.tbank.ru/invest/intro/intro) платформы 6 | [Т-Банк Инвестиции](https://www.tbank.ru/sl/AugaFvDlqEP) 7 | 8 | Предупреждение 9 | =============================== 10 | Это не официальная библиотека (хотя, она упомянута в документации к [API T-Банк Инвестиций](https://developer.tbank.ru/invest/sdk/faq_golang)), 11 | её работоспособность и безопасность не гарантирована автором! Несмотря на то, что большая часть кода библиотеки сгенерирована из официальных 12 | [определений протокола взаимодействия investAPI в виде proto файлов](https://github.com/RussianInvestments/investAPI/tree/main/src/docs/contracts), 13 | код не проходил независимый аудит безопасности, и не был протестирован представителями банка. 14 | Код может содержать уязвимости и логические ошибки, из-за которых Вы можете потерять деньги. 15 | Используйте этот код на свой страх и риск. 16 | 17 | 18 | Ссылка на официальный клиент - https://github.com/RussianInvestments/invest-api-go-sdk. 19 | Мой клиент был опубликован раньше, и он субъективно проще. 20 | 21 | Пример использования 22 | =============================== 23 | 24 | 1. Устанавливаем зависимости 25 | 26 | ```shell 27 | 28 | $ go get -u github.com/vodolaz095/go-investAPI/investapi 29 | 30 | ``` 31 | 32 | 2. Запускаем код 33 | ```go 34 | 35 | package main 36 | 37 | import ( 38 | "context" 39 | "log" 40 | "time" 41 | 42 | "google.golang.org/grpc/status" 43 | 44 | "github.com/vodolaz095/go-investAPI/investapi" 45 | ) 46 | 47 | const token = "тутДолженБытьТокен" // https://russianinvestments.github.io/investAPI/grpc/#tinkoff-invest-api_2 48 | 49 | func main() { 50 | client, err := investapi.New(token) 51 | if err != nil { 52 | log.Fatalf("%s : при соединении с investAPI", err) 53 | } 54 | res, err := client.MarketDataServiceClient.GetLastPrices(context.Background(), 55 | &investapi.GetLastPricesRequest{Figi: []string{"BBG00RRT3TX4"}}, 56 | ) 57 | if err != nil { 58 | // обработка ошибок 59 | st, parsed := status.FromError(err) 60 | if !parsed { 61 | log.Fatalf("неизвестная ошибка при получении котировок инструмента ОФЗ 25084: %s", err) 62 | } 63 | log.Printf("Ошибка получения котировок: %s", st.Err()) 64 | log.Printf("Код ошибки: %s", st.Message()) 65 | log.Printf("Объяснение стандартного кода ошибки: %s", st.Code().String()) 66 | details := st.Details() 67 | if len(details) > 0 { 68 | for i := range details { 69 | log.Printf("Детализация ошибки %v: %q", i, details[i]) 70 | } 71 | } else { 72 | log.Printf("Детализации ошибки отсутствует") 73 | } 74 | return 75 | } 76 | for _, price := range res.GetLastPrices() { 77 | log.Printf("%s назад цена сделки была %.4f рублей", 78 | time.Now().Sub(price.Time.AsTime()).String(), price.GetPrice().ToFloat64(), 79 | ) 80 | } 81 | err = client.Connection.Close() 82 | if err != nil { 83 | log.Fatalf("%s : при закрытии соединения", err) 84 | } 85 | } 86 | 87 | ``` 88 | 89 | 3. В директории [example](https://github.com/vodolaz095/go-investAPI/tree/master/example) лежат примеры использования 90 | 91 | 92 | Необратимые изменения начиная с версии 1.8.x 93 | =============================== 94 | 1. Функции `New(token string, opts ...grpc.DialOption) (client *Client, err error)` и `NewWithCustomEndpoint(token, endpoint string, opts ...grpc.DialOption) (client *Client, err error)` 95 | теперь включают крайний вариадический аргумент с опциями grpc соединения 96 | 2. В функциях `NewWithCustomEndpoint(token, endpoint string, opts ...grpc.DialOption) (client *Client, err error)` 97 | и `NewWithOpts(token, endpoint string, opts ...grpc.DialOption) (client *Client, err error)` строка соединения 98 | теперь включает номер порта - раньше было `"invest-public-api.tinkoff.ru` и порт 443 подразумевался, а теперь 99 | `invest-public-api.tinkoff.ru:443`- этот шаг позволит легче тестировать библиотеку с mock серверами, которые могут 100 | работать на нестандартных портах 101 | 3. Добавлена функция `NewInsecure(token, endpoint string, opts ...grpc.DialOption) (client *Client, err error)` которую как 102 | раз можно использовать для соединения с mock серверами, работающими без шифрования 103 | 104 | 105 | Как сгенерировать код клиента из proto файлов? 106 | =============================== 107 | Официальное описание протокола взаимодействия опубликовано тут [https://github.com/RussianInvestments/investAPI/tree/main/src/docs/contracts](https://github.com/RussianInvestments/investAPI/tree/main/src/docs/contracts). 108 | Код в моём репозитории генерирует клиент для Golang на основе этих `proto` файлов. 109 | Код проверялся на дистрибутиве `Fedora 39+` с `docker` версии 20.10.15, `podman` версии 4.9.4 и `Golang` версии 1.22.8 110 | 111 | 1. Удалите все файлы из поддиректории `investapi/`, кроме `client.go`, `helpers.go` и `helpers_test.go`! 112 | 113 | 2. Запустите команду (в зависимости от настройки системы могут потребоваться права суперпользователя для запуска Docker) 114 | 115 | ```shell 116 | 117 | ./generate.sh 118 | 119 | ``` 120 | 3. Команда должна создать локальный докер образ со всем инструментарием, необходимым для генерации файла клиента 121 | из *.proto файлов, загруженных отсюда https://github.com/RussianInvestments/investAPI/tree/main/src/docs/contracts 122 | 123 | 4. При запуске докер образа, контейнер клонирует код репозитория https://github.com/RussianInvestments/investAPI/ и генерирует 124 | файлы для Go модуля используя `protoc` и прочие инструменты - см `entrypoint.sh` как это происходит. 125 | 126 | 5. Как результат выполнения предыдущей команды, в поддиректории `investapi/` появятся файлы 127 | 128 | ``` 129 | common.pb.go 130 | instruments.pb.go 131 | instruments_grpc.pb.go 132 | marketdata.pb.go 133 | marketdata_grpc.pb.go 134 | operations.pb.go 135 | operations_grpc.pb.go 136 | orders.pb.go 137 | orders_grpc.pb.go 138 | sandbox.pb.go 139 | sandbox_grpc.pb.go 140 | stoporders.pb.go 141 | stoporders_grpc.pb.go 142 | users.pb.go 143 | users_grpc.pb.go 144 | 145 | ``` 146 | 147 | На данный момент файлы включены в код репозитория. 148 | 149 | 150 | Где используется? 151 | =============== 152 | 153 | - https://github.com/vodolaz095/stocks_broadcaster - утилита, которая ретранслирует кодировки в redis 154 | 155 | Интеграция с OpenTelemetry 156 | ================ 157 | 158 | Основано на примере https://github.com/uptrace/opentelemetry-go-extra/blob/main/example/grpc/client/client.go 159 | 160 | ```golang 161 | package main 162 | 163 | import ( 164 | "google.golang.org/grpc" 165 | "go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc" 166 | "github.com/vodolaz095/go-investAPI/investapi" 167 | ) 168 | 169 | const token = "тутДолженБытьТокен" // https://tinkoff.github.io/investAPI/grpc/#tinkoff-invest-api_1 170 | 171 | func main() { 172 | // other code 173 | client, err := investapi.New(token, 174 | grpc.WithUnaryInterceptor(otelgrpc.UnaryClientInterceptor()), 175 | grpc.WithStreamInterceptor(otelgrpc.StreamClientInterceptor()), 176 | ) 177 | // other code 178 | } 179 | 180 | 181 | ``` 182 | 183 | 184 | 185 | Лицензия 186 | =============== 187 | 188 | Все права защищены (c) 2022 Остроумов Анатолий Александрович 189 | 190 | Данная лицензия разрешает лицам, получившим копию данного программного обеспечения и сопутствующей документации 191 | (в дальнейшем именуемыми «Программное обеспечение»), безвозмездно использовать Программное обеспечение без ограничений, 192 | включая неограниченное право на использование, копирование, изменение, слияние, публикацию, распространение, 193 | сублицензирование и/или продажу копий Программного обеспечения, а также лицам, 194 | которым предоставляется данное Программное обеспечение, при соблюдении следующих условий: 195 | 196 | Указанное выше уведомление об авторском праве и данные условия должны быть 197 | включены во все копии или значимые части данного Программного обеспечения. 198 | 199 | ДАННОЕ ПРОГРАММНОЕ ОБЕСПЕЧЕНИЕ ПРЕДОСТАВЛЯЕТСЯ «КАК ЕСТЬ», БЕЗ КАКИХ-ЛИБО ГАРАНТИЙ, ЯВНО ВЫРАЖЕННЫХ ИЛИ ПОДРАЗУМЕВАЕМЫХ, 200 | ВКЛЮЧАЯ ГАРАНТИИ ТОВАРНОЙ ПРИГОДНОСТИ, СООТВЕТСТВИЯ ПО ЕГО КОНКРЕТНОМУ НАЗНАЧЕНИЮ И ОТСУТСТВИЯ НАРУШЕНИЙ, 201 | НО НЕ ОГРАНИЧИВАЯСЬ ИМИ. НИ В КАКОМ СЛУЧАЕ АВТОРЫ ИЛИ ПРАВООБЛАДАТЕЛИ НЕ НЕСУТ ОТВЕТСТВЕННОСТИ ПО КАКИМ-ЛИБО ИСКАМ, 202 | ЗА УЩЕРБ ИЛИ ПО ИНЫМ ТРЕБОВАНИЯМ, В ТОМ ЧИСЛЕ, ПРИ ДЕЙСТВИИ КОНТРАКТА, ДЕЛИКТЕ ИЛИ ИНОЙ СИТУАЦИИ, 203 | ВОЗНИКШИМ ИЗ-ЗА ИСПОЛЬЗОВАНИЯ ПРОГРАММНОГО ОБЕСПЕЧЕНИЯ ИЛИ ИНЫХ ДЕЙСТВИЙ С ПРОГРАММНЫМ ОБЕСПЕЧЕНИЕМ. 204 | 205 | 206 | Copyright (c) 2021 Остроумов Анатолий Александрович 207 | 208 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 209 | associated documentation files (the "Software"), to deal in the Software without restriction, 210 | including without limitation the rights to use, copy, modify, merge, publish, distribute, 211 | sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is 212 | furnished to do so, subject to the following conditions: 213 | 214 | The above copyright notice and this permission notice shall be included 215 | in all copies or substantial portions of the Software. 216 | 217 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT 218 | LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 219 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 220 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE 221 | OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 222 | -------------------------------------------------------------------------------- /investapi/users_grpc.pb.go: -------------------------------------------------------------------------------- 1 | // Code generated by protoc-gen-go-grpc. DO NOT EDIT. 2 | // versions: 3 | // - protoc-gen-go-grpc v1.5.1 4 | // - protoc v5.28.2 5 | // source: users.proto 6 | 7 | package investapi 8 | 9 | import ( 10 | context "context" 11 | grpc "google.golang.org/grpc" 12 | codes "google.golang.org/grpc/codes" 13 | status "google.golang.org/grpc/status" 14 | ) 15 | 16 | // This is a compile-time assertion to ensure that this generated file 17 | // is compatible with the grpc package it is being compiled against. 18 | // Requires gRPC-Go v1.64.0 or later. 19 | const _ = grpc.SupportPackageIsVersion9 20 | 21 | const ( 22 | UsersService_GetAccounts_FullMethodName = "/tinkoff.public.invest.api.contract.v1.UsersService/GetAccounts" 23 | UsersService_GetMarginAttributes_FullMethodName = "/tinkoff.public.invest.api.contract.v1.UsersService/GetMarginAttributes" 24 | UsersService_GetUserTariff_FullMethodName = "/tinkoff.public.invest.api.contract.v1.UsersService/GetUserTariff" 25 | UsersService_GetInfo_FullMethodName = "/tinkoff.public.invest.api.contract.v1.UsersService/GetInfo" 26 | UsersService_GetBankAccounts_FullMethodName = "/tinkoff.public.invest.api.contract.v1.UsersService/GetBankAccounts" 27 | UsersService_CurrencyTransfer_FullMethodName = "/tinkoff.public.invest.api.contract.v1.UsersService/CurrencyTransfer" 28 | ) 29 | 30 | // UsersServiceClient is the client API for UsersService service. 31 | // 32 | // 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. 33 | type UsersServiceClient interface { 34 | // GetAccounts — счета пользователя 35 | // Получить список счетов. 36 | GetAccounts(ctx context.Context, in *GetAccountsRequest, opts ...grpc.CallOption) (*GetAccountsResponse, error) 37 | // GetMarginAttributes — маржинальные показатели по счeту 38 | // Метод позволяет получить маржинальные показатели и ликвидность по заданному счeту. 39 | GetMarginAttributes(ctx context.Context, in *GetMarginAttributesRequest, opts ...grpc.CallOption) (*GetMarginAttributesResponse, error) 40 | // GetUserTariff — тариф пользователя 41 | // Получить информацию о текущих лимитах на подклчение, согласно текущему тарифу пользователя. 42 | GetUserTariff(ctx context.Context, in *GetUserTariffRequest, opts ...grpc.CallOption) (*GetUserTariffResponse, error) 43 | // GetInfo — информация о пользователе 44 | // Получить информацию о пользователе: тариф, признак квалификации, пройденные тесты и др. 45 | GetInfo(ctx context.Context, in *GetInfoRequest, opts ...grpc.CallOption) (*GetInfoResponse, error) 46 | // GetBankAccounts — банковские счета пользователя 47 | // Получить список счетов пользователя, в том числе и банковских. 48 | GetBankAccounts(ctx context.Context, in *GetBankAccountsRequest, opts ...grpc.CallOption) (*GetBankAccountsResponse, error) 49 | // CurrencyTransfer — перевод денежных средств между счетами 50 | // Перевести денежные средства между брокерскими счетами 51 | CurrencyTransfer(ctx context.Context, in *CurrencyTransferRequest, opts ...grpc.CallOption) (*CurrencyTransferResponse, error) 52 | } 53 | 54 | type usersServiceClient struct { 55 | cc grpc.ClientConnInterface 56 | } 57 | 58 | func NewUsersServiceClient(cc grpc.ClientConnInterface) UsersServiceClient { 59 | return &usersServiceClient{cc} 60 | } 61 | 62 | func (c *usersServiceClient) GetAccounts(ctx context.Context, in *GetAccountsRequest, opts ...grpc.CallOption) (*GetAccountsResponse, error) { 63 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) 64 | out := new(GetAccountsResponse) 65 | err := c.cc.Invoke(ctx, UsersService_GetAccounts_FullMethodName, in, out, cOpts...) 66 | if err != nil { 67 | return nil, err 68 | } 69 | return out, nil 70 | } 71 | 72 | func (c *usersServiceClient) GetMarginAttributes(ctx context.Context, in *GetMarginAttributesRequest, opts ...grpc.CallOption) (*GetMarginAttributesResponse, error) { 73 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) 74 | out := new(GetMarginAttributesResponse) 75 | err := c.cc.Invoke(ctx, UsersService_GetMarginAttributes_FullMethodName, in, out, cOpts...) 76 | if err != nil { 77 | return nil, err 78 | } 79 | return out, nil 80 | } 81 | 82 | func (c *usersServiceClient) GetUserTariff(ctx context.Context, in *GetUserTariffRequest, opts ...grpc.CallOption) (*GetUserTariffResponse, error) { 83 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) 84 | out := new(GetUserTariffResponse) 85 | err := c.cc.Invoke(ctx, UsersService_GetUserTariff_FullMethodName, in, out, cOpts...) 86 | if err != nil { 87 | return nil, err 88 | } 89 | return out, nil 90 | } 91 | 92 | func (c *usersServiceClient) GetInfo(ctx context.Context, in *GetInfoRequest, opts ...grpc.CallOption) (*GetInfoResponse, error) { 93 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) 94 | out := new(GetInfoResponse) 95 | err := c.cc.Invoke(ctx, UsersService_GetInfo_FullMethodName, in, out, cOpts...) 96 | if err != nil { 97 | return nil, err 98 | } 99 | return out, nil 100 | } 101 | 102 | func (c *usersServiceClient) GetBankAccounts(ctx context.Context, in *GetBankAccountsRequest, opts ...grpc.CallOption) (*GetBankAccountsResponse, error) { 103 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) 104 | out := new(GetBankAccountsResponse) 105 | err := c.cc.Invoke(ctx, UsersService_GetBankAccounts_FullMethodName, in, out, cOpts...) 106 | if err != nil { 107 | return nil, err 108 | } 109 | return out, nil 110 | } 111 | 112 | func (c *usersServiceClient) CurrencyTransfer(ctx context.Context, in *CurrencyTransferRequest, opts ...grpc.CallOption) (*CurrencyTransferResponse, error) { 113 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) 114 | out := new(CurrencyTransferResponse) 115 | err := c.cc.Invoke(ctx, UsersService_CurrencyTransfer_FullMethodName, in, out, cOpts...) 116 | if err != nil { 117 | return nil, err 118 | } 119 | return out, nil 120 | } 121 | 122 | // UsersServiceServer is the server API for UsersService service. 123 | // All implementations must embed UnimplementedUsersServiceServer 124 | // for forward compatibility. 125 | type UsersServiceServer interface { 126 | // GetAccounts — счета пользователя 127 | // Получить список счетов. 128 | GetAccounts(context.Context, *GetAccountsRequest) (*GetAccountsResponse, error) 129 | // GetMarginAttributes — маржинальные показатели по счeту 130 | // Метод позволяет получить маржинальные показатели и ликвидность по заданному счeту. 131 | GetMarginAttributes(context.Context, *GetMarginAttributesRequest) (*GetMarginAttributesResponse, error) 132 | // GetUserTariff — тариф пользователя 133 | // Получить информацию о текущих лимитах на подклчение, согласно текущему тарифу пользователя. 134 | GetUserTariff(context.Context, *GetUserTariffRequest) (*GetUserTariffResponse, error) 135 | // GetInfo — информация о пользователе 136 | // Получить информацию о пользователе: тариф, признак квалификации, пройденные тесты и др. 137 | GetInfo(context.Context, *GetInfoRequest) (*GetInfoResponse, error) 138 | // GetBankAccounts — банковские счета пользователя 139 | // Получить список счетов пользователя, в том числе и банковских. 140 | GetBankAccounts(context.Context, *GetBankAccountsRequest) (*GetBankAccountsResponse, error) 141 | // CurrencyTransfer — перевод денежных средств между счетами 142 | // Перевести денежные средства между брокерскими счетами 143 | CurrencyTransfer(context.Context, *CurrencyTransferRequest) (*CurrencyTransferResponse, error) 144 | mustEmbedUnimplementedUsersServiceServer() 145 | } 146 | 147 | // UnimplementedUsersServiceServer must be embedded to have 148 | // forward compatible implementations. 149 | // 150 | // NOTE: this should be embedded by value instead of pointer to avoid a nil 151 | // pointer dereference when methods are called. 152 | type UnimplementedUsersServiceServer struct{} 153 | 154 | func (UnimplementedUsersServiceServer) GetAccounts(context.Context, *GetAccountsRequest) (*GetAccountsResponse, error) { 155 | return nil, status.Errorf(codes.Unimplemented, "method GetAccounts not implemented") 156 | } 157 | func (UnimplementedUsersServiceServer) GetMarginAttributes(context.Context, *GetMarginAttributesRequest) (*GetMarginAttributesResponse, error) { 158 | return nil, status.Errorf(codes.Unimplemented, "method GetMarginAttributes not implemented") 159 | } 160 | func (UnimplementedUsersServiceServer) GetUserTariff(context.Context, *GetUserTariffRequest) (*GetUserTariffResponse, error) { 161 | return nil, status.Errorf(codes.Unimplemented, "method GetUserTariff not implemented") 162 | } 163 | func (UnimplementedUsersServiceServer) GetInfo(context.Context, *GetInfoRequest) (*GetInfoResponse, error) { 164 | return nil, status.Errorf(codes.Unimplemented, "method GetInfo not implemented") 165 | } 166 | func (UnimplementedUsersServiceServer) GetBankAccounts(context.Context, *GetBankAccountsRequest) (*GetBankAccountsResponse, error) { 167 | return nil, status.Errorf(codes.Unimplemented, "method GetBankAccounts not implemented") 168 | } 169 | func (UnimplementedUsersServiceServer) CurrencyTransfer(context.Context, *CurrencyTransferRequest) (*CurrencyTransferResponse, error) { 170 | return nil, status.Errorf(codes.Unimplemented, "method CurrencyTransfer not implemented") 171 | } 172 | func (UnimplementedUsersServiceServer) mustEmbedUnimplementedUsersServiceServer() {} 173 | func (UnimplementedUsersServiceServer) testEmbeddedByValue() {} 174 | 175 | // UnsafeUsersServiceServer may be embedded to opt out of forward compatibility for this service. 176 | // Use of this interface is not recommended, as added methods to UsersServiceServer will 177 | // result in compilation errors. 178 | type UnsafeUsersServiceServer interface { 179 | mustEmbedUnimplementedUsersServiceServer() 180 | } 181 | 182 | func RegisterUsersServiceServer(s grpc.ServiceRegistrar, srv UsersServiceServer) { 183 | // If the following call pancis, it indicates UnimplementedUsersServiceServer was 184 | // embedded by pointer and is nil. This will cause panics if an 185 | // unimplemented method is ever invoked, so we test this at initialization 186 | // time to prevent it from happening at runtime later due to I/O. 187 | if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { 188 | t.testEmbeddedByValue() 189 | } 190 | s.RegisterService(&UsersService_ServiceDesc, srv) 191 | } 192 | 193 | func _UsersService_GetAccounts_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 194 | in := new(GetAccountsRequest) 195 | if err := dec(in); err != nil { 196 | return nil, err 197 | } 198 | if interceptor == nil { 199 | return srv.(UsersServiceServer).GetAccounts(ctx, in) 200 | } 201 | info := &grpc.UnaryServerInfo{ 202 | Server: srv, 203 | FullMethod: UsersService_GetAccounts_FullMethodName, 204 | } 205 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { 206 | return srv.(UsersServiceServer).GetAccounts(ctx, req.(*GetAccountsRequest)) 207 | } 208 | return interceptor(ctx, in, info, handler) 209 | } 210 | 211 | func _UsersService_GetMarginAttributes_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 212 | in := new(GetMarginAttributesRequest) 213 | if err := dec(in); err != nil { 214 | return nil, err 215 | } 216 | if interceptor == nil { 217 | return srv.(UsersServiceServer).GetMarginAttributes(ctx, in) 218 | } 219 | info := &grpc.UnaryServerInfo{ 220 | Server: srv, 221 | FullMethod: UsersService_GetMarginAttributes_FullMethodName, 222 | } 223 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { 224 | return srv.(UsersServiceServer).GetMarginAttributes(ctx, req.(*GetMarginAttributesRequest)) 225 | } 226 | return interceptor(ctx, in, info, handler) 227 | } 228 | 229 | func _UsersService_GetUserTariff_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 230 | in := new(GetUserTariffRequest) 231 | if err := dec(in); err != nil { 232 | return nil, err 233 | } 234 | if interceptor == nil { 235 | return srv.(UsersServiceServer).GetUserTariff(ctx, in) 236 | } 237 | info := &grpc.UnaryServerInfo{ 238 | Server: srv, 239 | FullMethod: UsersService_GetUserTariff_FullMethodName, 240 | } 241 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { 242 | return srv.(UsersServiceServer).GetUserTariff(ctx, req.(*GetUserTariffRequest)) 243 | } 244 | return interceptor(ctx, in, info, handler) 245 | } 246 | 247 | func _UsersService_GetInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 248 | in := new(GetInfoRequest) 249 | if err := dec(in); err != nil { 250 | return nil, err 251 | } 252 | if interceptor == nil { 253 | return srv.(UsersServiceServer).GetInfo(ctx, in) 254 | } 255 | info := &grpc.UnaryServerInfo{ 256 | Server: srv, 257 | FullMethod: UsersService_GetInfo_FullMethodName, 258 | } 259 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { 260 | return srv.(UsersServiceServer).GetInfo(ctx, req.(*GetInfoRequest)) 261 | } 262 | return interceptor(ctx, in, info, handler) 263 | } 264 | 265 | func _UsersService_GetBankAccounts_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 266 | in := new(GetBankAccountsRequest) 267 | if err := dec(in); err != nil { 268 | return nil, err 269 | } 270 | if interceptor == nil { 271 | return srv.(UsersServiceServer).GetBankAccounts(ctx, in) 272 | } 273 | info := &grpc.UnaryServerInfo{ 274 | Server: srv, 275 | FullMethod: UsersService_GetBankAccounts_FullMethodName, 276 | } 277 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { 278 | return srv.(UsersServiceServer).GetBankAccounts(ctx, req.(*GetBankAccountsRequest)) 279 | } 280 | return interceptor(ctx, in, info, handler) 281 | } 282 | 283 | func _UsersService_CurrencyTransfer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 284 | in := new(CurrencyTransferRequest) 285 | if err := dec(in); err != nil { 286 | return nil, err 287 | } 288 | if interceptor == nil { 289 | return srv.(UsersServiceServer).CurrencyTransfer(ctx, in) 290 | } 291 | info := &grpc.UnaryServerInfo{ 292 | Server: srv, 293 | FullMethod: UsersService_CurrencyTransfer_FullMethodName, 294 | } 295 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { 296 | return srv.(UsersServiceServer).CurrencyTransfer(ctx, req.(*CurrencyTransferRequest)) 297 | } 298 | return interceptor(ctx, in, info, handler) 299 | } 300 | 301 | // UsersService_ServiceDesc is the grpc.ServiceDesc for UsersService service. 302 | // It's only intended for direct use with grpc.RegisterService, 303 | // and not to be introspected or modified (even as a copy) 304 | var UsersService_ServiceDesc = grpc.ServiceDesc{ 305 | ServiceName: "tinkoff.public.invest.api.contract.v1.UsersService", 306 | HandlerType: (*UsersServiceServer)(nil), 307 | Methods: []grpc.MethodDesc{ 308 | { 309 | MethodName: "GetAccounts", 310 | Handler: _UsersService_GetAccounts_Handler, 311 | }, 312 | { 313 | MethodName: "GetMarginAttributes", 314 | Handler: _UsersService_GetMarginAttributes_Handler, 315 | }, 316 | { 317 | MethodName: "GetUserTariff", 318 | Handler: _UsersService_GetUserTariff_Handler, 319 | }, 320 | { 321 | MethodName: "GetInfo", 322 | Handler: _UsersService_GetInfo_Handler, 323 | }, 324 | { 325 | MethodName: "GetBankAccounts", 326 | Handler: _UsersService_GetBankAccounts_Handler, 327 | }, 328 | { 329 | MethodName: "CurrencyTransfer", 330 | Handler: _UsersService_CurrencyTransfer_Handler, 331 | }, 332 | }, 333 | Streams: []grpc.StreamDesc{}, 334 | Metadata: "users.proto", 335 | } 336 | -------------------------------------------------------------------------------- /investapi/operations_grpc.pb.go: -------------------------------------------------------------------------------- 1 | // Code generated by protoc-gen-go-grpc. DO NOT EDIT. 2 | // versions: 3 | // - protoc-gen-go-grpc v1.5.1 4 | // - protoc v5.28.2 5 | // source: operations.proto 6 | 7 | package investapi 8 | 9 | import ( 10 | context "context" 11 | grpc "google.golang.org/grpc" 12 | codes "google.golang.org/grpc/codes" 13 | status "google.golang.org/grpc/status" 14 | ) 15 | 16 | // This is a compile-time assertion to ensure that this generated file 17 | // is compatible with the grpc package it is being compiled against. 18 | // Requires gRPC-Go v1.64.0 or later. 19 | const _ = grpc.SupportPackageIsVersion9 20 | 21 | const ( 22 | OperationsService_GetOperations_FullMethodName = "/tinkoff.public.invest.api.contract.v1.OperationsService/GetOperations" 23 | OperationsService_GetPortfolio_FullMethodName = "/tinkoff.public.invest.api.contract.v1.OperationsService/GetPortfolio" 24 | OperationsService_GetPositions_FullMethodName = "/tinkoff.public.invest.api.contract.v1.OperationsService/GetPositions" 25 | OperationsService_GetWithdrawLimits_FullMethodName = "/tinkoff.public.invest.api.contract.v1.OperationsService/GetWithdrawLimits" 26 | OperationsService_GetBrokerReport_FullMethodName = "/tinkoff.public.invest.api.contract.v1.OperationsService/GetBrokerReport" 27 | OperationsService_GetDividendsForeignIssuer_FullMethodName = "/tinkoff.public.invest.api.contract.v1.OperationsService/GetDividendsForeignIssuer" 28 | OperationsService_GetOperationsByCursor_FullMethodName = "/tinkoff.public.invest.api.contract.v1.OperationsService/GetOperationsByCursor" 29 | ) 30 | 31 | // OperationsServiceClient is the client API for OperationsService service. 32 | // 33 | // 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. 34 | type OperationsServiceClient interface { 35 | // GetOperations — список операций по счету 36 | // При работе с методом учитывайте [особенности взаимодействия](/invest/services/operations/operations_problems). 37 | GetOperations(ctx context.Context, in *OperationsRequest, opts ...grpc.CallOption) (*OperationsResponse, error) 38 | // GetPortfolio — портфель по счету 39 | GetPortfolio(ctx context.Context, in *PortfolioRequest, opts ...grpc.CallOption) (*PortfolioResponse, error) 40 | // GetPositions — список позиций по счету 41 | GetPositions(ctx context.Context, in *PositionsRequest, opts ...grpc.CallOption) (*PositionsResponse, error) 42 | // GetWithdrawLimits — доступный остаток для вывода средств 43 | GetWithdrawLimits(ctx context.Context, in *WithdrawLimitsRequest, opts ...grpc.CallOption) (*WithdrawLimitsResponse, error) 44 | // GetBrokerReport — брокерский отчет. 45 | GetBrokerReport(ctx context.Context, in *BrokerReportRequest, opts ...grpc.CallOption) (*BrokerReportResponse, error) 46 | // GetDividendsForeignIssuer — отчет «Справка о доходах за пределами РФ» 47 | GetDividendsForeignIssuer(ctx context.Context, in *GetDividendsForeignIssuerRequest, opts ...grpc.CallOption) (*GetDividendsForeignIssuerResponse, error) 48 | // GetOperationsByCursor — список операций по счету с пагинацией 49 | // При работе с методом учитывайте [особенности взаимодействия](/invest/services/operations/operations_problems). 50 | GetOperationsByCursor(ctx context.Context, in *GetOperationsByCursorRequest, opts ...grpc.CallOption) (*GetOperationsByCursorResponse, error) 51 | } 52 | 53 | type operationsServiceClient struct { 54 | cc grpc.ClientConnInterface 55 | } 56 | 57 | func NewOperationsServiceClient(cc grpc.ClientConnInterface) OperationsServiceClient { 58 | return &operationsServiceClient{cc} 59 | } 60 | 61 | func (c *operationsServiceClient) GetOperations(ctx context.Context, in *OperationsRequest, opts ...grpc.CallOption) (*OperationsResponse, error) { 62 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) 63 | out := new(OperationsResponse) 64 | err := c.cc.Invoke(ctx, OperationsService_GetOperations_FullMethodName, in, out, cOpts...) 65 | if err != nil { 66 | return nil, err 67 | } 68 | return out, nil 69 | } 70 | 71 | func (c *operationsServiceClient) GetPortfolio(ctx context.Context, in *PortfolioRequest, opts ...grpc.CallOption) (*PortfolioResponse, error) { 72 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) 73 | out := new(PortfolioResponse) 74 | err := c.cc.Invoke(ctx, OperationsService_GetPortfolio_FullMethodName, in, out, cOpts...) 75 | if err != nil { 76 | return nil, err 77 | } 78 | return out, nil 79 | } 80 | 81 | func (c *operationsServiceClient) GetPositions(ctx context.Context, in *PositionsRequest, opts ...grpc.CallOption) (*PositionsResponse, error) { 82 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) 83 | out := new(PositionsResponse) 84 | err := c.cc.Invoke(ctx, OperationsService_GetPositions_FullMethodName, in, out, cOpts...) 85 | if err != nil { 86 | return nil, err 87 | } 88 | return out, nil 89 | } 90 | 91 | func (c *operationsServiceClient) GetWithdrawLimits(ctx context.Context, in *WithdrawLimitsRequest, opts ...grpc.CallOption) (*WithdrawLimitsResponse, error) { 92 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) 93 | out := new(WithdrawLimitsResponse) 94 | err := c.cc.Invoke(ctx, OperationsService_GetWithdrawLimits_FullMethodName, in, out, cOpts...) 95 | if err != nil { 96 | return nil, err 97 | } 98 | return out, nil 99 | } 100 | 101 | func (c *operationsServiceClient) GetBrokerReport(ctx context.Context, in *BrokerReportRequest, opts ...grpc.CallOption) (*BrokerReportResponse, error) { 102 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) 103 | out := new(BrokerReportResponse) 104 | err := c.cc.Invoke(ctx, OperationsService_GetBrokerReport_FullMethodName, in, out, cOpts...) 105 | if err != nil { 106 | return nil, err 107 | } 108 | return out, nil 109 | } 110 | 111 | func (c *operationsServiceClient) GetDividendsForeignIssuer(ctx context.Context, in *GetDividendsForeignIssuerRequest, opts ...grpc.CallOption) (*GetDividendsForeignIssuerResponse, error) { 112 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) 113 | out := new(GetDividendsForeignIssuerResponse) 114 | err := c.cc.Invoke(ctx, OperationsService_GetDividendsForeignIssuer_FullMethodName, in, out, cOpts...) 115 | if err != nil { 116 | return nil, err 117 | } 118 | return out, nil 119 | } 120 | 121 | func (c *operationsServiceClient) GetOperationsByCursor(ctx context.Context, in *GetOperationsByCursorRequest, opts ...grpc.CallOption) (*GetOperationsByCursorResponse, error) { 122 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) 123 | out := new(GetOperationsByCursorResponse) 124 | err := c.cc.Invoke(ctx, OperationsService_GetOperationsByCursor_FullMethodName, in, out, cOpts...) 125 | if err != nil { 126 | return nil, err 127 | } 128 | return out, nil 129 | } 130 | 131 | // OperationsServiceServer is the server API for OperationsService service. 132 | // All implementations must embed UnimplementedOperationsServiceServer 133 | // for forward compatibility. 134 | type OperationsServiceServer interface { 135 | // GetOperations — список операций по счету 136 | // При работе с методом учитывайте [особенности взаимодействия](/invest/services/operations/operations_problems). 137 | GetOperations(context.Context, *OperationsRequest) (*OperationsResponse, error) 138 | // GetPortfolio — портфель по счету 139 | GetPortfolio(context.Context, *PortfolioRequest) (*PortfolioResponse, error) 140 | // GetPositions — список позиций по счету 141 | GetPositions(context.Context, *PositionsRequest) (*PositionsResponse, error) 142 | // GetWithdrawLimits — доступный остаток для вывода средств 143 | GetWithdrawLimits(context.Context, *WithdrawLimitsRequest) (*WithdrawLimitsResponse, error) 144 | // GetBrokerReport — брокерский отчет. 145 | GetBrokerReport(context.Context, *BrokerReportRequest) (*BrokerReportResponse, error) 146 | // GetDividendsForeignIssuer — отчет «Справка о доходах за пределами РФ» 147 | GetDividendsForeignIssuer(context.Context, *GetDividendsForeignIssuerRequest) (*GetDividendsForeignIssuerResponse, error) 148 | // GetOperationsByCursor — список операций по счету с пагинацией 149 | // При работе с методом учитывайте [особенности взаимодействия](/invest/services/operations/operations_problems). 150 | GetOperationsByCursor(context.Context, *GetOperationsByCursorRequest) (*GetOperationsByCursorResponse, error) 151 | mustEmbedUnimplementedOperationsServiceServer() 152 | } 153 | 154 | // UnimplementedOperationsServiceServer must be embedded to have 155 | // forward compatible implementations. 156 | // 157 | // NOTE: this should be embedded by value instead of pointer to avoid a nil 158 | // pointer dereference when methods are called. 159 | type UnimplementedOperationsServiceServer struct{} 160 | 161 | func (UnimplementedOperationsServiceServer) GetOperations(context.Context, *OperationsRequest) (*OperationsResponse, error) { 162 | return nil, status.Errorf(codes.Unimplemented, "method GetOperations not implemented") 163 | } 164 | func (UnimplementedOperationsServiceServer) GetPortfolio(context.Context, *PortfolioRequest) (*PortfolioResponse, error) { 165 | return nil, status.Errorf(codes.Unimplemented, "method GetPortfolio not implemented") 166 | } 167 | func (UnimplementedOperationsServiceServer) GetPositions(context.Context, *PositionsRequest) (*PositionsResponse, error) { 168 | return nil, status.Errorf(codes.Unimplemented, "method GetPositions not implemented") 169 | } 170 | func (UnimplementedOperationsServiceServer) GetWithdrawLimits(context.Context, *WithdrawLimitsRequest) (*WithdrawLimitsResponse, error) { 171 | return nil, status.Errorf(codes.Unimplemented, "method GetWithdrawLimits not implemented") 172 | } 173 | func (UnimplementedOperationsServiceServer) GetBrokerReport(context.Context, *BrokerReportRequest) (*BrokerReportResponse, error) { 174 | return nil, status.Errorf(codes.Unimplemented, "method GetBrokerReport not implemented") 175 | } 176 | func (UnimplementedOperationsServiceServer) GetDividendsForeignIssuer(context.Context, *GetDividendsForeignIssuerRequest) (*GetDividendsForeignIssuerResponse, error) { 177 | return nil, status.Errorf(codes.Unimplemented, "method GetDividendsForeignIssuer not implemented") 178 | } 179 | func (UnimplementedOperationsServiceServer) GetOperationsByCursor(context.Context, *GetOperationsByCursorRequest) (*GetOperationsByCursorResponse, error) { 180 | return nil, status.Errorf(codes.Unimplemented, "method GetOperationsByCursor not implemented") 181 | } 182 | func (UnimplementedOperationsServiceServer) mustEmbedUnimplementedOperationsServiceServer() {} 183 | func (UnimplementedOperationsServiceServer) testEmbeddedByValue() {} 184 | 185 | // UnsafeOperationsServiceServer may be embedded to opt out of forward compatibility for this service. 186 | // Use of this interface is not recommended, as added methods to OperationsServiceServer will 187 | // result in compilation errors. 188 | type UnsafeOperationsServiceServer interface { 189 | mustEmbedUnimplementedOperationsServiceServer() 190 | } 191 | 192 | func RegisterOperationsServiceServer(s grpc.ServiceRegistrar, srv OperationsServiceServer) { 193 | // If the following call pancis, it indicates UnimplementedOperationsServiceServer was 194 | // embedded by pointer and is nil. This will cause panics if an 195 | // unimplemented method is ever invoked, so we test this at initialization 196 | // time to prevent it from happening at runtime later due to I/O. 197 | if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { 198 | t.testEmbeddedByValue() 199 | } 200 | s.RegisterService(&OperationsService_ServiceDesc, srv) 201 | } 202 | 203 | func _OperationsService_GetOperations_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 204 | in := new(OperationsRequest) 205 | if err := dec(in); err != nil { 206 | return nil, err 207 | } 208 | if interceptor == nil { 209 | return srv.(OperationsServiceServer).GetOperations(ctx, in) 210 | } 211 | info := &grpc.UnaryServerInfo{ 212 | Server: srv, 213 | FullMethod: OperationsService_GetOperations_FullMethodName, 214 | } 215 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { 216 | return srv.(OperationsServiceServer).GetOperations(ctx, req.(*OperationsRequest)) 217 | } 218 | return interceptor(ctx, in, info, handler) 219 | } 220 | 221 | func _OperationsService_GetPortfolio_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 222 | in := new(PortfolioRequest) 223 | if err := dec(in); err != nil { 224 | return nil, err 225 | } 226 | if interceptor == nil { 227 | return srv.(OperationsServiceServer).GetPortfolio(ctx, in) 228 | } 229 | info := &grpc.UnaryServerInfo{ 230 | Server: srv, 231 | FullMethod: OperationsService_GetPortfolio_FullMethodName, 232 | } 233 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { 234 | return srv.(OperationsServiceServer).GetPortfolio(ctx, req.(*PortfolioRequest)) 235 | } 236 | return interceptor(ctx, in, info, handler) 237 | } 238 | 239 | func _OperationsService_GetPositions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 240 | in := new(PositionsRequest) 241 | if err := dec(in); err != nil { 242 | return nil, err 243 | } 244 | if interceptor == nil { 245 | return srv.(OperationsServiceServer).GetPositions(ctx, in) 246 | } 247 | info := &grpc.UnaryServerInfo{ 248 | Server: srv, 249 | FullMethod: OperationsService_GetPositions_FullMethodName, 250 | } 251 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { 252 | return srv.(OperationsServiceServer).GetPositions(ctx, req.(*PositionsRequest)) 253 | } 254 | return interceptor(ctx, in, info, handler) 255 | } 256 | 257 | func _OperationsService_GetWithdrawLimits_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 258 | in := new(WithdrawLimitsRequest) 259 | if err := dec(in); err != nil { 260 | return nil, err 261 | } 262 | if interceptor == nil { 263 | return srv.(OperationsServiceServer).GetWithdrawLimits(ctx, in) 264 | } 265 | info := &grpc.UnaryServerInfo{ 266 | Server: srv, 267 | FullMethod: OperationsService_GetWithdrawLimits_FullMethodName, 268 | } 269 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { 270 | return srv.(OperationsServiceServer).GetWithdrawLimits(ctx, req.(*WithdrawLimitsRequest)) 271 | } 272 | return interceptor(ctx, in, info, handler) 273 | } 274 | 275 | func _OperationsService_GetBrokerReport_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 276 | in := new(BrokerReportRequest) 277 | if err := dec(in); err != nil { 278 | return nil, err 279 | } 280 | if interceptor == nil { 281 | return srv.(OperationsServiceServer).GetBrokerReport(ctx, in) 282 | } 283 | info := &grpc.UnaryServerInfo{ 284 | Server: srv, 285 | FullMethod: OperationsService_GetBrokerReport_FullMethodName, 286 | } 287 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { 288 | return srv.(OperationsServiceServer).GetBrokerReport(ctx, req.(*BrokerReportRequest)) 289 | } 290 | return interceptor(ctx, in, info, handler) 291 | } 292 | 293 | func _OperationsService_GetDividendsForeignIssuer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 294 | in := new(GetDividendsForeignIssuerRequest) 295 | if err := dec(in); err != nil { 296 | return nil, err 297 | } 298 | if interceptor == nil { 299 | return srv.(OperationsServiceServer).GetDividendsForeignIssuer(ctx, in) 300 | } 301 | info := &grpc.UnaryServerInfo{ 302 | Server: srv, 303 | FullMethod: OperationsService_GetDividendsForeignIssuer_FullMethodName, 304 | } 305 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { 306 | return srv.(OperationsServiceServer).GetDividendsForeignIssuer(ctx, req.(*GetDividendsForeignIssuerRequest)) 307 | } 308 | return interceptor(ctx, in, info, handler) 309 | } 310 | 311 | func _OperationsService_GetOperationsByCursor_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 312 | in := new(GetOperationsByCursorRequest) 313 | if err := dec(in); err != nil { 314 | return nil, err 315 | } 316 | if interceptor == nil { 317 | return srv.(OperationsServiceServer).GetOperationsByCursor(ctx, in) 318 | } 319 | info := &grpc.UnaryServerInfo{ 320 | Server: srv, 321 | FullMethod: OperationsService_GetOperationsByCursor_FullMethodName, 322 | } 323 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { 324 | return srv.(OperationsServiceServer).GetOperationsByCursor(ctx, req.(*GetOperationsByCursorRequest)) 325 | } 326 | return interceptor(ctx, in, info, handler) 327 | } 328 | 329 | // OperationsService_ServiceDesc is the grpc.ServiceDesc for OperationsService service. 330 | // It's only intended for direct use with grpc.RegisterService, 331 | // and not to be introspected or modified (even as a copy) 332 | var OperationsService_ServiceDesc = grpc.ServiceDesc{ 333 | ServiceName: "tinkoff.public.invest.api.contract.v1.OperationsService", 334 | HandlerType: (*OperationsServiceServer)(nil), 335 | Methods: []grpc.MethodDesc{ 336 | { 337 | MethodName: "GetOperations", 338 | Handler: _OperationsService_GetOperations_Handler, 339 | }, 340 | { 341 | MethodName: "GetPortfolio", 342 | Handler: _OperationsService_GetPortfolio_Handler, 343 | }, 344 | { 345 | MethodName: "GetPositions", 346 | Handler: _OperationsService_GetPositions_Handler, 347 | }, 348 | { 349 | MethodName: "GetWithdrawLimits", 350 | Handler: _OperationsService_GetWithdrawLimits_Handler, 351 | }, 352 | { 353 | MethodName: "GetBrokerReport", 354 | Handler: _OperationsService_GetBrokerReport_Handler, 355 | }, 356 | { 357 | MethodName: "GetDividendsForeignIssuer", 358 | Handler: _OperationsService_GetDividendsForeignIssuer_Handler, 359 | }, 360 | { 361 | MethodName: "GetOperationsByCursor", 362 | Handler: _OperationsService_GetOperationsByCursor_Handler, 363 | }, 364 | }, 365 | Streams: []grpc.StreamDesc{}, 366 | Metadata: "operations.proto", 367 | } 368 | 369 | const ( 370 | OperationsStreamService_PortfolioStream_FullMethodName = "/tinkoff.public.invest.api.contract.v1.OperationsStreamService/PortfolioStream" 371 | OperationsStreamService_PositionsStream_FullMethodName = "/tinkoff.public.invest.api.contract.v1.OperationsStreamService/PositionsStream" 372 | ) 373 | 374 | // OperationsStreamServiceClient is the client API for OperationsStreamService service. 375 | // 376 | // 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. 377 | type OperationsStreamServiceClient interface { 378 | // PortfolioStream — стрим обновлений портфеля 379 | PortfolioStream(ctx context.Context, in *PortfolioStreamRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[PortfolioStreamResponse], error) 380 | // PositionsStream — стрим обновлений информации по изменению позиций портфеля 381 | PositionsStream(ctx context.Context, in *PositionsStreamRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[PositionsStreamResponse], error) 382 | } 383 | 384 | type operationsStreamServiceClient struct { 385 | cc grpc.ClientConnInterface 386 | } 387 | 388 | func NewOperationsStreamServiceClient(cc grpc.ClientConnInterface) OperationsStreamServiceClient { 389 | return &operationsStreamServiceClient{cc} 390 | } 391 | 392 | func (c *operationsStreamServiceClient) PortfolioStream(ctx context.Context, in *PortfolioStreamRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[PortfolioStreamResponse], error) { 393 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) 394 | stream, err := c.cc.NewStream(ctx, &OperationsStreamService_ServiceDesc.Streams[0], OperationsStreamService_PortfolioStream_FullMethodName, cOpts...) 395 | if err != nil { 396 | return nil, err 397 | } 398 | x := &grpc.GenericClientStream[PortfolioStreamRequest, PortfolioStreamResponse]{ClientStream: stream} 399 | if err := x.ClientStream.SendMsg(in); err != nil { 400 | return nil, err 401 | } 402 | if err := x.ClientStream.CloseSend(); err != nil { 403 | return nil, err 404 | } 405 | return x, nil 406 | } 407 | 408 | // This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. 409 | type OperationsStreamService_PortfolioStreamClient = grpc.ServerStreamingClient[PortfolioStreamResponse] 410 | 411 | func (c *operationsStreamServiceClient) PositionsStream(ctx context.Context, in *PositionsStreamRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[PositionsStreamResponse], error) { 412 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) 413 | stream, err := c.cc.NewStream(ctx, &OperationsStreamService_ServiceDesc.Streams[1], OperationsStreamService_PositionsStream_FullMethodName, cOpts...) 414 | if err != nil { 415 | return nil, err 416 | } 417 | x := &grpc.GenericClientStream[PositionsStreamRequest, PositionsStreamResponse]{ClientStream: stream} 418 | if err := x.ClientStream.SendMsg(in); err != nil { 419 | return nil, err 420 | } 421 | if err := x.ClientStream.CloseSend(); err != nil { 422 | return nil, err 423 | } 424 | return x, nil 425 | } 426 | 427 | // This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. 428 | type OperationsStreamService_PositionsStreamClient = grpc.ServerStreamingClient[PositionsStreamResponse] 429 | 430 | // OperationsStreamServiceServer is the server API for OperationsStreamService service. 431 | // All implementations must embed UnimplementedOperationsStreamServiceServer 432 | // for forward compatibility. 433 | type OperationsStreamServiceServer interface { 434 | // PortfolioStream — стрим обновлений портфеля 435 | PortfolioStream(*PortfolioStreamRequest, grpc.ServerStreamingServer[PortfolioStreamResponse]) error 436 | // PositionsStream — стрим обновлений информации по изменению позиций портфеля 437 | PositionsStream(*PositionsStreamRequest, grpc.ServerStreamingServer[PositionsStreamResponse]) error 438 | mustEmbedUnimplementedOperationsStreamServiceServer() 439 | } 440 | 441 | // UnimplementedOperationsStreamServiceServer must be embedded to have 442 | // forward compatible implementations. 443 | // 444 | // NOTE: this should be embedded by value instead of pointer to avoid a nil 445 | // pointer dereference when methods are called. 446 | type UnimplementedOperationsStreamServiceServer struct{} 447 | 448 | func (UnimplementedOperationsStreamServiceServer) PortfolioStream(*PortfolioStreamRequest, grpc.ServerStreamingServer[PortfolioStreamResponse]) error { 449 | return status.Errorf(codes.Unimplemented, "method PortfolioStream not implemented") 450 | } 451 | func (UnimplementedOperationsStreamServiceServer) PositionsStream(*PositionsStreamRequest, grpc.ServerStreamingServer[PositionsStreamResponse]) error { 452 | return status.Errorf(codes.Unimplemented, "method PositionsStream not implemented") 453 | } 454 | func (UnimplementedOperationsStreamServiceServer) mustEmbedUnimplementedOperationsStreamServiceServer() { 455 | } 456 | func (UnimplementedOperationsStreamServiceServer) testEmbeddedByValue() {} 457 | 458 | // UnsafeOperationsStreamServiceServer may be embedded to opt out of forward compatibility for this service. 459 | // Use of this interface is not recommended, as added methods to OperationsStreamServiceServer will 460 | // result in compilation errors. 461 | type UnsafeOperationsStreamServiceServer interface { 462 | mustEmbedUnimplementedOperationsStreamServiceServer() 463 | } 464 | 465 | func RegisterOperationsStreamServiceServer(s grpc.ServiceRegistrar, srv OperationsStreamServiceServer) { 466 | // If the following call pancis, it indicates UnimplementedOperationsStreamServiceServer was 467 | // embedded by pointer and is nil. This will cause panics if an 468 | // unimplemented method is ever invoked, so we test this at initialization 469 | // time to prevent it from happening at runtime later due to I/O. 470 | if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { 471 | t.testEmbeddedByValue() 472 | } 473 | s.RegisterService(&OperationsStreamService_ServiceDesc, srv) 474 | } 475 | 476 | func _OperationsStreamService_PortfolioStream_Handler(srv interface{}, stream grpc.ServerStream) error { 477 | m := new(PortfolioStreamRequest) 478 | if err := stream.RecvMsg(m); err != nil { 479 | return err 480 | } 481 | return srv.(OperationsStreamServiceServer).PortfolioStream(m, &grpc.GenericServerStream[PortfolioStreamRequest, PortfolioStreamResponse]{ServerStream: stream}) 482 | } 483 | 484 | // This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. 485 | type OperationsStreamService_PortfolioStreamServer = grpc.ServerStreamingServer[PortfolioStreamResponse] 486 | 487 | func _OperationsStreamService_PositionsStream_Handler(srv interface{}, stream grpc.ServerStream) error { 488 | m := new(PositionsStreamRequest) 489 | if err := stream.RecvMsg(m); err != nil { 490 | return err 491 | } 492 | return srv.(OperationsStreamServiceServer).PositionsStream(m, &grpc.GenericServerStream[PositionsStreamRequest, PositionsStreamResponse]{ServerStream: stream}) 493 | } 494 | 495 | // This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. 496 | type OperationsStreamService_PositionsStreamServer = grpc.ServerStreamingServer[PositionsStreamResponse] 497 | 498 | // OperationsStreamService_ServiceDesc is the grpc.ServiceDesc for OperationsStreamService service. 499 | // It's only intended for direct use with grpc.RegisterService, 500 | // and not to be introspected or modified (even as a copy) 501 | var OperationsStreamService_ServiceDesc = grpc.ServiceDesc{ 502 | ServiceName: "tinkoff.public.invest.api.contract.v1.OperationsStreamService", 503 | HandlerType: (*OperationsStreamServiceServer)(nil), 504 | Methods: []grpc.MethodDesc{}, 505 | Streams: []grpc.StreamDesc{ 506 | { 507 | StreamName: "PortfolioStream", 508 | Handler: _OperationsStreamService_PortfolioStream_Handler, 509 | ServerStreams: true, 510 | }, 511 | { 512 | StreamName: "PositionsStream", 513 | Handler: _OperationsStreamService_PositionsStream_Handler, 514 | ServerStreams: true, 515 | }, 516 | }, 517 | Metadata: "operations.proto", 518 | } 519 | -------------------------------------------------------------------------------- /investapi/orders_grpc.pb.go: -------------------------------------------------------------------------------- 1 | // Code generated by protoc-gen-go-grpc. DO NOT EDIT. 2 | // versions: 3 | // - protoc-gen-go-grpc v1.5.1 4 | // - protoc v5.28.2 5 | // source: orders.proto 6 | 7 | package investapi 8 | 9 | import ( 10 | context "context" 11 | grpc "google.golang.org/grpc" 12 | codes "google.golang.org/grpc/codes" 13 | status "google.golang.org/grpc/status" 14 | ) 15 | 16 | // This is a compile-time assertion to ensure that this generated file 17 | // is compatible with the grpc package it is being compiled against. 18 | // Requires gRPC-Go v1.64.0 or later. 19 | const _ = grpc.SupportPackageIsVersion9 20 | 21 | const ( 22 | OrdersStreamService_TradesStream_FullMethodName = "/tinkoff.public.invest.api.contract.v1.OrdersStreamService/TradesStream" 23 | OrdersStreamService_OrderStateStream_FullMethodName = "/tinkoff.public.invest.api.contract.v1.OrdersStreamService/OrderStateStream" 24 | ) 25 | 26 | // OrdersStreamServiceClient is the client API for OrdersStreamService service. 27 | // 28 | // 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. 29 | type OrdersStreamServiceClient interface { 30 | // TradesStream — стрим сделок пользователя 31 | TradesStream(ctx context.Context, in *TradesStreamRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[TradesStreamResponse], error) 32 | // OrderStateStream — стрим поручений пользователя 33 | // Перед работой прочитайте [статью](/invest/services/orders/orders_state_stream). 34 | OrderStateStream(ctx context.Context, in *OrderStateStreamRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[OrderStateStreamResponse], error) 35 | } 36 | 37 | type ordersStreamServiceClient struct { 38 | cc grpc.ClientConnInterface 39 | } 40 | 41 | func NewOrdersStreamServiceClient(cc grpc.ClientConnInterface) OrdersStreamServiceClient { 42 | return &ordersStreamServiceClient{cc} 43 | } 44 | 45 | func (c *ordersStreamServiceClient) TradesStream(ctx context.Context, in *TradesStreamRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[TradesStreamResponse], error) { 46 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) 47 | stream, err := c.cc.NewStream(ctx, &OrdersStreamService_ServiceDesc.Streams[0], OrdersStreamService_TradesStream_FullMethodName, cOpts...) 48 | if err != nil { 49 | return nil, err 50 | } 51 | x := &grpc.GenericClientStream[TradesStreamRequest, TradesStreamResponse]{ClientStream: stream} 52 | if err := x.ClientStream.SendMsg(in); err != nil { 53 | return nil, err 54 | } 55 | if err := x.ClientStream.CloseSend(); err != nil { 56 | return nil, err 57 | } 58 | return x, nil 59 | } 60 | 61 | // This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. 62 | type OrdersStreamService_TradesStreamClient = grpc.ServerStreamingClient[TradesStreamResponse] 63 | 64 | func (c *ordersStreamServiceClient) OrderStateStream(ctx context.Context, in *OrderStateStreamRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[OrderStateStreamResponse], error) { 65 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) 66 | stream, err := c.cc.NewStream(ctx, &OrdersStreamService_ServiceDesc.Streams[1], OrdersStreamService_OrderStateStream_FullMethodName, cOpts...) 67 | if err != nil { 68 | return nil, err 69 | } 70 | x := &grpc.GenericClientStream[OrderStateStreamRequest, OrderStateStreamResponse]{ClientStream: stream} 71 | if err := x.ClientStream.SendMsg(in); err != nil { 72 | return nil, err 73 | } 74 | if err := x.ClientStream.CloseSend(); err != nil { 75 | return nil, err 76 | } 77 | return x, nil 78 | } 79 | 80 | // This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. 81 | type OrdersStreamService_OrderStateStreamClient = grpc.ServerStreamingClient[OrderStateStreamResponse] 82 | 83 | // OrdersStreamServiceServer is the server API for OrdersStreamService service. 84 | // All implementations must embed UnimplementedOrdersStreamServiceServer 85 | // for forward compatibility. 86 | type OrdersStreamServiceServer interface { 87 | // TradesStream — стрим сделок пользователя 88 | TradesStream(*TradesStreamRequest, grpc.ServerStreamingServer[TradesStreamResponse]) error 89 | // OrderStateStream — стрим поручений пользователя 90 | // Перед работой прочитайте [статью](/invest/services/orders/orders_state_stream). 91 | OrderStateStream(*OrderStateStreamRequest, grpc.ServerStreamingServer[OrderStateStreamResponse]) error 92 | mustEmbedUnimplementedOrdersStreamServiceServer() 93 | } 94 | 95 | // UnimplementedOrdersStreamServiceServer must be embedded to have 96 | // forward compatible implementations. 97 | // 98 | // NOTE: this should be embedded by value instead of pointer to avoid a nil 99 | // pointer dereference when methods are called. 100 | type UnimplementedOrdersStreamServiceServer struct{} 101 | 102 | func (UnimplementedOrdersStreamServiceServer) TradesStream(*TradesStreamRequest, grpc.ServerStreamingServer[TradesStreamResponse]) error { 103 | return status.Errorf(codes.Unimplemented, "method TradesStream not implemented") 104 | } 105 | func (UnimplementedOrdersStreamServiceServer) OrderStateStream(*OrderStateStreamRequest, grpc.ServerStreamingServer[OrderStateStreamResponse]) error { 106 | return status.Errorf(codes.Unimplemented, "method OrderStateStream not implemented") 107 | } 108 | func (UnimplementedOrdersStreamServiceServer) mustEmbedUnimplementedOrdersStreamServiceServer() {} 109 | func (UnimplementedOrdersStreamServiceServer) testEmbeddedByValue() {} 110 | 111 | // UnsafeOrdersStreamServiceServer may be embedded to opt out of forward compatibility for this service. 112 | // Use of this interface is not recommended, as added methods to OrdersStreamServiceServer will 113 | // result in compilation errors. 114 | type UnsafeOrdersStreamServiceServer interface { 115 | mustEmbedUnimplementedOrdersStreamServiceServer() 116 | } 117 | 118 | func RegisterOrdersStreamServiceServer(s grpc.ServiceRegistrar, srv OrdersStreamServiceServer) { 119 | // If the following call pancis, it indicates UnimplementedOrdersStreamServiceServer was 120 | // embedded by pointer and is nil. This will cause panics if an 121 | // unimplemented method is ever invoked, so we test this at initialization 122 | // time to prevent it from happening at runtime later due to I/O. 123 | if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { 124 | t.testEmbeddedByValue() 125 | } 126 | s.RegisterService(&OrdersStreamService_ServiceDesc, srv) 127 | } 128 | 129 | func _OrdersStreamService_TradesStream_Handler(srv interface{}, stream grpc.ServerStream) error { 130 | m := new(TradesStreamRequest) 131 | if err := stream.RecvMsg(m); err != nil { 132 | return err 133 | } 134 | return srv.(OrdersStreamServiceServer).TradesStream(m, &grpc.GenericServerStream[TradesStreamRequest, TradesStreamResponse]{ServerStream: stream}) 135 | } 136 | 137 | // This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. 138 | type OrdersStreamService_TradesStreamServer = grpc.ServerStreamingServer[TradesStreamResponse] 139 | 140 | func _OrdersStreamService_OrderStateStream_Handler(srv interface{}, stream grpc.ServerStream) error { 141 | m := new(OrderStateStreamRequest) 142 | if err := stream.RecvMsg(m); err != nil { 143 | return err 144 | } 145 | return srv.(OrdersStreamServiceServer).OrderStateStream(m, &grpc.GenericServerStream[OrderStateStreamRequest, OrderStateStreamResponse]{ServerStream: stream}) 146 | } 147 | 148 | // This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. 149 | type OrdersStreamService_OrderStateStreamServer = grpc.ServerStreamingServer[OrderStateStreamResponse] 150 | 151 | // OrdersStreamService_ServiceDesc is the grpc.ServiceDesc for OrdersStreamService service. 152 | // It's only intended for direct use with grpc.RegisterService, 153 | // and not to be introspected or modified (even as a copy) 154 | var OrdersStreamService_ServiceDesc = grpc.ServiceDesc{ 155 | ServiceName: "tinkoff.public.invest.api.contract.v1.OrdersStreamService", 156 | HandlerType: (*OrdersStreamServiceServer)(nil), 157 | Methods: []grpc.MethodDesc{}, 158 | Streams: []grpc.StreamDesc{ 159 | { 160 | StreamName: "TradesStream", 161 | Handler: _OrdersStreamService_TradesStream_Handler, 162 | ServerStreams: true, 163 | }, 164 | { 165 | StreamName: "OrderStateStream", 166 | Handler: _OrdersStreamService_OrderStateStream_Handler, 167 | ServerStreams: true, 168 | }, 169 | }, 170 | Metadata: "orders.proto", 171 | } 172 | 173 | const ( 174 | OrdersService_PostOrder_FullMethodName = "/tinkoff.public.invest.api.contract.v1.OrdersService/PostOrder" 175 | OrdersService_PostOrderAsync_FullMethodName = "/tinkoff.public.invest.api.contract.v1.OrdersService/PostOrderAsync" 176 | OrdersService_CancelOrder_FullMethodName = "/tinkoff.public.invest.api.contract.v1.OrdersService/CancelOrder" 177 | OrdersService_GetOrderState_FullMethodName = "/tinkoff.public.invest.api.contract.v1.OrdersService/GetOrderState" 178 | OrdersService_GetOrders_FullMethodName = "/tinkoff.public.invest.api.contract.v1.OrdersService/GetOrders" 179 | OrdersService_ReplaceOrder_FullMethodName = "/tinkoff.public.invest.api.contract.v1.OrdersService/ReplaceOrder" 180 | OrdersService_GetMaxLots_FullMethodName = "/tinkoff.public.invest.api.contract.v1.OrdersService/GetMaxLots" 181 | OrdersService_GetOrderPrice_FullMethodName = "/tinkoff.public.invest.api.contract.v1.OrdersService/GetOrderPrice" 182 | ) 183 | 184 | // OrdersServiceClient is the client API for OrdersService service. 185 | // 186 | // 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. 187 | type OrdersServiceClient interface { 188 | // PostOrder — выставить заявку 189 | PostOrder(ctx context.Context, in *PostOrderRequest, opts ...grpc.CallOption) (*PostOrderResponse, error) 190 | // PostOrderAsync — выставить заявку асинхронным методом 191 | // Особенности работы приведены в [статье](/invest/services/orders/async). 192 | PostOrderAsync(ctx context.Context, in *PostOrderAsyncRequest, opts ...grpc.CallOption) (*PostOrderAsyncResponse, error) 193 | // CancelOrder — отменить заявку 194 | CancelOrder(ctx context.Context, in *CancelOrderRequest, opts ...grpc.CallOption) (*CancelOrderResponse, error) 195 | // GetOrderState — получить статус торгового поручения 196 | GetOrderState(ctx context.Context, in *GetOrderStateRequest, opts ...grpc.CallOption) (*OrderState, error) 197 | // GetOrders — получить список активных заявок по счету 198 | GetOrders(ctx context.Context, in *GetOrdersRequest, opts ...grpc.CallOption) (*GetOrdersResponse, error) 199 | // ReplaceOrder — изменить выставленную заявку 200 | ReplaceOrder(ctx context.Context, in *ReplaceOrderRequest, opts ...grpc.CallOption) (*PostOrderResponse, error) 201 | // GetMaxLots — расчет количества доступных для покупки/продажи лотов 202 | GetMaxLots(ctx context.Context, in *GetMaxLotsRequest, opts ...grpc.CallOption) (*GetMaxLotsResponse, error) 203 | // GetOrderPrice — получить предварительную стоимость для лимитной заявки 204 | GetOrderPrice(ctx context.Context, in *GetOrderPriceRequest, opts ...grpc.CallOption) (*GetOrderPriceResponse, error) 205 | } 206 | 207 | type ordersServiceClient struct { 208 | cc grpc.ClientConnInterface 209 | } 210 | 211 | func NewOrdersServiceClient(cc grpc.ClientConnInterface) OrdersServiceClient { 212 | return &ordersServiceClient{cc} 213 | } 214 | 215 | func (c *ordersServiceClient) PostOrder(ctx context.Context, in *PostOrderRequest, opts ...grpc.CallOption) (*PostOrderResponse, error) { 216 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) 217 | out := new(PostOrderResponse) 218 | err := c.cc.Invoke(ctx, OrdersService_PostOrder_FullMethodName, in, out, cOpts...) 219 | if err != nil { 220 | return nil, err 221 | } 222 | return out, nil 223 | } 224 | 225 | func (c *ordersServiceClient) PostOrderAsync(ctx context.Context, in *PostOrderAsyncRequest, opts ...grpc.CallOption) (*PostOrderAsyncResponse, error) { 226 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) 227 | out := new(PostOrderAsyncResponse) 228 | err := c.cc.Invoke(ctx, OrdersService_PostOrderAsync_FullMethodName, in, out, cOpts...) 229 | if err != nil { 230 | return nil, err 231 | } 232 | return out, nil 233 | } 234 | 235 | func (c *ordersServiceClient) CancelOrder(ctx context.Context, in *CancelOrderRequest, opts ...grpc.CallOption) (*CancelOrderResponse, error) { 236 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) 237 | out := new(CancelOrderResponse) 238 | err := c.cc.Invoke(ctx, OrdersService_CancelOrder_FullMethodName, in, out, cOpts...) 239 | if err != nil { 240 | return nil, err 241 | } 242 | return out, nil 243 | } 244 | 245 | func (c *ordersServiceClient) GetOrderState(ctx context.Context, in *GetOrderStateRequest, opts ...grpc.CallOption) (*OrderState, error) { 246 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) 247 | out := new(OrderState) 248 | err := c.cc.Invoke(ctx, OrdersService_GetOrderState_FullMethodName, in, out, cOpts...) 249 | if err != nil { 250 | return nil, err 251 | } 252 | return out, nil 253 | } 254 | 255 | func (c *ordersServiceClient) GetOrders(ctx context.Context, in *GetOrdersRequest, opts ...grpc.CallOption) (*GetOrdersResponse, error) { 256 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) 257 | out := new(GetOrdersResponse) 258 | err := c.cc.Invoke(ctx, OrdersService_GetOrders_FullMethodName, in, out, cOpts...) 259 | if err != nil { 260 | return nil, err 261 | } 262 | return out, nil 263 | } 264 | 265 | func (c *ordersServiceClient) ReplaceOrder(ctx context.Context, in *ReplaceOrderRequest, opts ...grpc.CallOption) (*PostOrderResponse, error) { 266 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) 267 | out := new(PostOrderResponse) 268 | err := c.cc.Invoke(ctx, OrdersService_ReplaceOrder_FullMethodName, in, out, cOpts...) 269 | if err != nil { 270 | return nil, err 271 | } 272 | return out, nil 273 | } 274 | 275 | func (c *ordersServiceClient) GetMaxLots(ctx context.Context, in *GetMaxLotsRequest, opts ...grpc.CallOption) (*GetMaxLotsResponse, error) { 276 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) 277 | out := new(GetMaxLotsResponse) 278 | err := c.cc.Invoke(ctx, OrdersService_GetMaxLots_FullMethodName, in, out, cOpts...) 279 | if err != nil { 280 | return nil, err 281 | } 282 | return out, nil 283 | } 284 | 285 | func (c *ordersServiceClient) GetOrderPrice(ctx context.Context, in *GetOrderPriceRequest, opts ...grpc.CallOption) (*GetOrderPriceResponse, error) { 286 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) 287 | out := new(GetOrderPriceResponse) 288 | err := c.cc.Invoke(ctx, OrdersService_GetOrderPrice_FullMethodName, in, out, cOpts...) 289 | if err != nil { 290 | return nil, err 291 | } 292 | return out, nil 293 | } 294 | 295 | // OrdersServiceServer is the server API for OrdersService service. 296 | // All implementations must embed UnimplementedOrdersServiceServer 297 | // for forward compatibility. 298 | type OrdersServiceServer interface { 299 | // PostOrder — выставить заявку 300 | PostOrder(context.Context, *PostOrderRequest) (*PostOrderResponse, error) 301 | // PostOrderAsync — выставить заявку асинхронным методом 302 | // Особенности работы приведены в [статье](/invest/services/orders/async). 303 | PostOrderAsync(context.Context, *PostOrderAsyncRequest) (*PostOrderAsyncResponse, error) 304 | // CancelOrder — отменить заявку 305 | CancelOrder(context.Context, *CancelOrderRequest) (*CancelOrderResponse, error) 306 | // GetOrderState — получить статус торгового поручения 307 | GetOrderState(context.Context, *GetOrderStateRequest) (*OrderState, error) 308 | // GetOrders — получить список активных заявок по счету 309 | GetOrders(context.Context, *GetOrdersRequest) (*GetOrdersResponse, error) 310 | // ReplaceOrder — изменить выставленную заявку 311 | ReplaceOrder(context.Context, *ReplaceOrderRequest) (*PostOrderResponse, error) 312 | // GetMaxLots — расчет количества доступных для покупки/продажи лотов 313 | GetMaxLots(context.Context, *GetMaxLotsRequest) (*GetMaxLotsResponse, error) 314 | // GetOrderPrice — получить предварительную стоимость для лимитной заявки 315 | GetOrderPrice(context.Context, *GetOrderPriceRequest) (*GetOrderPriceResponse, error) 316 | mustEmbedUnimplementedOrdersServiceServer() 317 | } 318 | 319 | // UnimplementedOrdersServiceServer must be embedded to have 320 | // forward compatible implementations. 321 | // 322 | // NOTE: this should be embedded by value instead of pointer to avoid a nil 323 | // pointer dereference when methods are called. 324 | type UnimplementedOrdersServiceServer struct{} 325 | 326 | func (UnimplementedOrdersServiceServer) PostOrder(context.Context, *PostOrderRequest) (*PostOrderResponse, error) { 327 | return nil, status.Errorf(codes.Unimplemented, "method PostOrder not implemented") 328 | } 329 | func (UnimplementedOrdersServiceServer) PostOrderAsync(context.Context, *PostOrderAsyncRequest) (*PostOrderAsyncResponse, error) { 330 | return nil, status.Errorf(codes.Unimplemented, "method PostOrderAsync not implemented") 331 | } 332 | func (UnimplementedOrdersServiceServer) CancelOrder(context.Context, *CancelOrderRequest) (*CancelOrderResponse, error) { 333 | return nil, status.Errorf(codes.Unimplemented, "method CancelOrder not implemented") 334 | } 335 | func (UnimplementedOrdersServiceServer) GetOrderState(context.Context, *GetOrderStateRequest) (*OrderState, error) { 336 | return nil, status.Errorf(codes.Unimplemented, "method GetOrderState not implemented") 337 | } 338 | func (UnimplementedOrdersServiceServer) GetOrders(context.Context, *GetOrdersRequest) (*GetOrdersResponse, error) { 339 | return nil, status.Errorf(codes.Unimplemented, "method GetOrders not implemented") 340 | } 341 | func (UnimplementedOrdersServiceServer) ReplaceOrder(context.Context, *ReplaceOrderRequest) (*PostOrderResponse, error) { 342 | return nil, status.Errorf(codes.Unimplemented, "method ReplaceOrder not implemented") 343 | } 344 | func (UnimplementedOrdersServiceServer) GetMaxLots(context.Context, *GetMaxLotsRequest) (*GetMaxLotsResponse, error) { 345 | return nil, status.Errorf(codes.Unimplemented, "method GetMaxLots not implemented") 346 | } 347 | func (UnimplementedOrdersServiceServer) GetOrderPrice(context.Context, *GetOrderPriceRequest) (*GetOrderPriceResponse, error) { 348 | return nil, status.Errorf(codes.Unimplemented, "method GetOrderPrice not implemented") 349 | } 350 | func (UnimplementedOrdersServiceServer) mustEmbedUnimplementedOrdersServiceServer() {} 351 | func (UnimplementedOrdersServiceServer) testEmbeddedByValue() {} 352 | 353 | // UnsafeOrdersServiceServer may be embedded to opt out of forward compatibility for this service. 354 | // Use of this interface is not recommended, as added methods to OrdersServiceServer will 355 | // result in compilation errors. 356 | type UnsafeOrdersServiceServer interface { 357 | mustEmbedUnimplementedOrdersServiceServer() 358 | } 359 | 360 | func RegisterOrdersServiceServer(s grpc.ServiceRegistrar, srv OrdersServiceServer) { 361 | // If the following call pancis, it indicates UnimplementedOrdersServiceServer was 362 | // embedded by pointer and is nil. This will cause panics if an 363 | // unimplemented method is ever invoked, so we test this at initialization 364 | // time to prevent it from happening at runtime later due to I/O. 365 | if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { 366 | t.testEmbeddedByValue() 367 | } 368 | s.RegisterService(&OrdersService_ServiceDesc, srv) 369 | } 370 | 371 | func _OrdersService_PostOrder_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 372 | in := new(PostOrderRequest) 373 | if err := dec(in); err != nil { 374 | return nil, err 375 | } 376 | if interceptor == nil { 377 | return srv.(OrdersServiceServer).PostOrder(ctx, in) 378 | } 379 | info := &grpc.UnaryServerInfo{ 380 | Server: srv, 381 | FullMethod: OrdersService_PostOrder_FullMethodName, 382 | } 383 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { 384 | return srv.(OrdersServiceServer).PostOrder(ctx, req.(*PostOrderRequest)) 385 | } 386 | return interceptor(ctx, in, info, handler) 387 | } 388 | 389 | func _OrdersService_PostOrderAsync_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 390 | in := new(PostOrderAsyncRequest) 391 | if err := dec(in); err != nil { 392 | return nil, err 393 | } 394 | if interceptor == nil { 395 | return srv.(OrdersServiceServer).PostOrderAsync(ctx, in) 396 | } 397 | info := &grpc.UnaryServerInfo{ 398 | Server: srv, 399 | FullMethod: OrdersService_PostOrderAsync_FullMethodName, 400 | } 401 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { 402 | return srv.(OrdersServiceServer).PostOrderAsync(ctx, req.(*PostOrderAsyncRequest)) 403 | } 404 | return interceptor(ctx, in, info, handler) 405 | } 406 | 407 | func _OrdersService_CancelOrder_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 408 | in := new(CancelOrderRequest) 409 | if err := dec(in); err != nil { 410 | return nil, err 411 | } 412 | if interceptor == nil { 413 | return srv.(OrdersServiceServer).CancelOrder(ctx, in) 414 | } 415 | info := &grpc.UnaryServerInfo{ 416 | Server: srv, 417 | FullMethod: OrdersService_CancelOrder_FullMethodName, 418 | } 419 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { 420 | return srv.(OrdersServiceServer).CancelOrder(ctx, req.(*CancelOrderRequest)) 421 | } 422 | return interceptor(ctx, in, info, handler) 423 | } 424 | 425 | func _OrdersService_GetOrderState_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 426 | in := new(GetOrderStateRequest) 427 | if err := dec(in); err != nil { 428 | return nil, err 429 | } 430 | if interceptor == nil { 431 | return srv.(OrdersServiceServer).GetOrderState(ctx, in) 432 | } 433 | info := &grpc.UnaryServerInfo{ 434 | Server: srv, 435 | FullMethod: OrdersService_GetOrderState_FullMethodName, 436 | } 437 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { 438 | return srv.(OrdersServiceServer).GetOrderState(ctx, req.(*GetOrderStateRequest)) 439 | } 440 | return interceptor(ctx, in, info, handler) 441 | } 442 | 443 | func _OrdersService_GetOrders_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 444 | in := new(GetOrdersRequest) 445 | if err := dec(in); err != nil { 446 | return nil, err 447 | } 448 | if interceptor == nil { 449 | return srv.(OrdersServiceServer).GetOrders(ctx, in) 450 | } 451 | info := &grpc.UnaryServerInfo{ 452 | Server: srv, 453 | FullMethod: OrdersService_GetOrders_FullMethodName, 454 | } 455 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { 456 | return srv.(OrdersServiceServer).GetOrders(ctx, req.(*GetOrdersRequest)) 457 | } 458 | return interceptor(ctx, in, info, handler) 459 | } 460 | 461 | func _OrdersService_ReplaceOrder_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 462 | in := new(ReplaceOrderRequest) 463 | if err := dec(in); err != nil { 464 | return nil, err 465 | } 466 | if interceptor == nil { 467 | return srv.(OrdersServiceServer).ReplaceOrder(ctx, in) 468 | } 469 | info := &grpc.UnaryServerInfo{ 470 | Server: srv, 471 | FullMethod: OrdersService_ReplaceOrder_FullMethodName, 472 | } 473 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { 474 | return srv.(OrdersServiceServer).ReplaceOrder(ctx, req.(*ReplaceOrderRequest)) 475 | } 476 | return interceptor(ctx, in, info, handler) 477 | } 478 | 479 | func _OrdersService_GetMaxLots_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 480 | in := new(GetMaxLotsRequest) 481 | if err := dec(in); err != nil { 482 | return nil, err 483 | } 484 | if interceptor == nil { 485 | return srv.(OrdersServiceServer).GetMaxLots(ctx, in) 486 | } 487 | info := &grpc.UnaryServerInfo{ 488 | Server: srv, 489 | FullMethod: OrdersService_GetMaxLots_FullMethodName, 490 | } 491 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { 492 | return srv.(OrdersServiceServer).GetMaxLots(ctx, req.(*GetMaxLotsRequest)) 493 | } 494 | return interceptor(ctx, in, info, handler) 495 | } 496 | 497 | func _OrdersService_GetOrderPrice_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 498 | in := new(GetOrderPriceRequest) 499 | if err := dec(in); err != nil { 500 | return nil, err 501 | } 502 | if interceptor == nil { 503 | return srv.(OrdersServiceServer).GetOrderPrice(ctx, in) 504 | } 505 | info := &grpc.UnaryServerInfo{ 506 | Server: srv, 507 | FullMethod: OrdersService_GetOrderPrice_FullMethodName, 508 | } 509 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { 510 | return srv.(OrdersServiceServer).GetOrderPrice(ctx, req.(*GetOrderPriceRequest)) 511 | } 512 | return interceptor(ctx, in, info, handler) 513 | } 514 | 515 | // OrdersService_ServiceDesc is the grpc.ServiceDesc for OrdersService service. 516 | // It's only intended for direct use with grpc.RegisterService, 517 | // and not to be introspected or modified (even as a copy) 518 | var OrdersService_ServiceDesc = grpc.ServiceDesc{ 519 | ServiceName: "tinkoff.public.invest.api.contract.v1.OrdersService", 520 | HandlerType: (*OrdersServiceServer)(nil), 521 | Methods: []grpc.MethodDesc{ 522 | { 523 | MethodName: "PostOrder", 524 | Handler: _OrdersService_PostOrder_Handler, 525 | }, 526 | { 527 | MethodName: "PostOrderAsync", 528 | Handler: _OrdersService_PostOrderAsync_Handler, 529 | }, 530 | { 531 | MethodName: "CancelOrder", 532 | Handler: _OrdersService_CancelOrder_Handler, 533 | }, 534 | { 535 | MethodName: "GetOrderState", 536 | Handler: _OrdersService_GetOrderState_Handler, 537 | }, 538 | { 539 | MethodName: "GetOrders", 540 | Handler: _OrdersService_GetOrders_Handler, 541 | }, 542 | { 543 | MethodName: "ReplaceOrder", 544 | Handler: _OrdersService_ReplaceOrder_Handler, 545 | }, 546 | { 547 | MethodName: "GetMaxLots", 548 | Handler: _OrdersService_GetMaxLots_Handler, 549 | }, 550 | { 551 | MethodName: "GetOrderPrice", 552 | Handler: _OrdersService_GetOrderPrice_Handler, 553 | }, 554 | }, 555 | Streams: []grpc.StreamDesc{}, 556 | Metadata: "orders.proto", 557 | } 558 | -------------------------------------------------------------------------------- /investapi/marketdata_grpc.pb.go: -------------------------------------------------------------------------------- 1 | // Code generated by protoc-gen-go-grpc. DO NOT EDIT. 2 | // versions: 3 | // - protoc-gen-go-grpc v1.5.1 4 | // - protoc v5.28.2 5 | // source: marketdata.proto 6 | 7 | package investapi 8 | 9 | import ( 10 | context "context" 11 | grpc "google.golang.org/grpc" 12 | codes "google.golang.org/grpc/codes" 13 | status "google.golang.org/grpc/status" 14 | ) 15 | 16 | // This is a compile-time assertion to ensure that this generated file 17 | // is compatible with the grpc package it is being compiled against. 18 | // Requires gRPC-Go v1.64.0 or later. 19 | const _ = grpc.SupportPackageIsVersion9 20 | 21 | const ( 22 | MarketDataService_GetCandles_FullMethodName = "/tinkoff.public.invest.api.contract.v1.MarketDataService/GetCandles" 23 | MarketDataService_GetLastPrices_FullMethodName = "/tinkoff.public.invest.api.contract.v1.MarketDataService/GetLastPrices" 24 | MarketDataService_GetOrderBook_FullMethodName = "/tinkoff.public.invest.api.contract.v1.MarketDataService/GetOrderBook" 25 | MarketDataService_GetTradingStatus_FullMethodName = "/tinkoff.public.invest.api.contract.v1.MarketDataService/GetTradingStatus" 26 | MarketDataService_GetTradingStatuses_FullMethodName = "/tinkoff.public.invest.api.contract.v1.MarketDataService/GetTradingStatuses" 27 | MarketDataService_GetLastTrades_FullMethodName = "/tinkoff.public.invest.api.contract.v1.MarketDataService/GetLastTrades" 28 | MarketDataService_GetClosePrices_FullMethodName = "/tinkoff.public.invest.api.contract.v1.MarketDataService/GetClosePrices" 29 | MarketDataService_GetTechAnalysis_FullMethodName = "/tinkoff.public.invest.api.contract.v1.MarketDataService/GetTechAnalysis" 30 | MarketDataService_GetMarketValues_FullMethodName = "/tinkoff.public.invest.api.contract.v1.MarketDataService/GetMarketValues" 31 | ) 32 | 33 | // MarketDataServiceClient is the client API for MarketDataService service. 34 | // 35 | // 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. 36 | type MarketDataServiceClient interface { 37 | // GetCandles — исторические свечи по инструменту 38 | GetCandles(ctx context.Context, in *GetCandlesRequest, opts ...grpc.CallOption) (*GetCandlesResponse, error) 39 | // GetLastPrices — цены последних сделок по инструментам 40 | GetLastPrices(ctx context.Context, in *GetLastPricesRequest, opts ...grpc.CallOption) (*GetLastPricesResponse, error) 41 | // GetOrderBook — стакан по инструменту 42 | GetOrderBook(ctx context.Context, in *GetOrderBookRequest, opts ...grpc.CallOption) (*GetOrderBookResponse, error) 43 | // GetTradingStatus — статус торгов по инструменту 44 | GetTradingStatus(ctx context.Context, in *GetTradingStatusRequest, opts ...grpc.CallOption) (*GetTradingStatusResponse, error) 45 | // GetTradingStatuses — статус торгов по инструментам 46 | GetTradingStatuses(ctx context.Context, in *GetTradingStatusesRequest, opts ...grpc.CallOption) (*GetTradingStatusesResponse, error) 47 | // GetLastTrades — обезличенные сделки 48 | // Обезличенные сделки по инструменту. Метод гарантирует получение информации за последний час. 49 | GetLastTrades(ctx context.Context, in *GetLastTradesRequest, opts ...grpc.CallOption) (*GetLastTradesResponse, error) 50 | // GetClosePrices — цены закрытия торговой сессии по инструментам 51 | GetClosePrices(ctx context.Context, in *GetClosePricesRequest, opts ...grpc.CallOption) (*GetClosePricesResponse, error) 52 | // GetTechAnalysis — технические индикаторы по инструменту 53 | GetTechAnalysis(ctx context.Context, in *GetTechAnalysisRequest, opts ...grpc.CallOption) (*GetTechAnalysisResponse, error) 54 | // GetMarketValues — рыночные данные по инструментам 55 | GetMarketValues(ctx context.Context, in *GetMarketValuesRequest, opts ...grpc.CallOption) (*GetMarketValuesResponse, error) 56 | } 57 | 58 | type marketDataServiceClient struct { 59 | cc grpc.ClientConnInterface 60 | } 61 | 62 | func NewMarketDataServiceClient(cc grpc.ClientConnInterface) MarketDataServiceClient { 63 | return &marketDataServiceClient{cc} 64 | } 65 | 66 | func (c *marketDataServiceClient) GetCandles(ctx context.Context, in *GetCandlesRequest, opts ...grpc.CallOption) (*GetCandlesResponse, error) { 67 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) 68 | out := new(GetCandlesResponse) 69 | err := c.cc.Invoke(ctx, MarketDataService_GetCandles_FullMethodName, in, out, cOpts...) 70 | if err != nil { 71 | return nil, err 72 | } 73 | return out, nil 74 | } 75 | 76 | func (c *marketDataServiceClient) GetLastPrices(ctx context.Context, in *GetLastPricesRequest, opts ...grpc.CallOption) (*GetLastPricesResponse, error) { 77 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) 78 | out := new(GetLastPricesResponse) 79 | err := c.cc.Invoke(ctx, MarketDataService_GetLastPrices_FullMethodName, in, out, cOpts...) 80 | if err != nil { 81 | return nil, err 82 | } 83 | return out, nil 84 | } 85 | 86 | func (c *marketDataServiceClient) GetOrderBook(ctx context.Context, in *GetOrderBookRequest, opts ...grpc.CallOption) (*GetOrderBookResponse, error) { 87 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) 88 | out := new(GetOrderBookResponse) 89 | err := c.cc.Invoke(ctx, MarketDataService_GetOrderBook_FullMethodName, in, out, cOpts...) 90 | if err != nil { 91 | return nil, err 92 | } 93 | return out, nil 94 | } 95 | 96 | func (c *marketDataServiceClient) GetTradingStatus(ctx context.Context, in *GetTradingStatusRequest, opts ...grpc.CallOption) (*GetTradingStatusResponse, error) { 97 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) 98 | out := new(GetTradingStatusResponse) 99 | err := c.cc.Invoke(ctx, MarketDataService_GetTradingStatus_FullMethodName, in, out, cOpts...) 100 | if err != nil { 101 | return nil, err 102 | } 103 | return out, nil 104 | } 105 | 106 | func (c *marketDataServiceClient) GetTradingStatuses(ctx context.Context, in *GetTradingStatusesRequest, opts ...grpc.CallOption) (*GetTradingStatusesResponse, error) { 107 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) 108 | out := new(GetTradingStatusesResponse) 109 | err := c.cc.Invoke(ctx, MarketDataService_GetTradingStatuses_FullMethodName, in, out, cOpts...) 110 | if err != nil { 111 | return nil, err 112 | } 113 | return out, nil 114 | } 115 | 116 | func (c *marketDataServiceClient) GetLastTrades(ctx context.Context, in *GetLastTradesRequest, opts ...grpc.CallOption) (*GetLastTradesResponse, error) { 117 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) 118 | out := new(GetLastTradesResponse) 119 | err := c.cc.Invoke(ctx, MarketDataService_GetLastTrades_FullMethodName, in, out, cOpts...) 120 | if err != nil { 121 | return nil, err 122 | } 123 | return out, nil 124 | } 125 | 126 | func (c *marketDataServiceClient) GetClosePrices(ctx context.Context, in *GetClosePricesRequest, opts ...grpc.CallOption) (*GetClosePricesResponse, error) { 127 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) 128 | out := new(GetClosePricesResponse) 129 | err := c.cc.Invoke(ctx, MarketDataService_GetClosePrices_FullMethodName, in, out, cOpts...) 130 | if err != nil { 131 | return nil, err 132 | } 133 | return out, nil 134 | } 135 | 136 | func (c *marketDataServiceClient) GetTechAnalysis(ctx context.Context, in *GetTechAnalysisRequest, opts ...grpc.CallOption) (*GetTechAnalysisResponse, error) { 137 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) 138 | out := new(GetTechAnalysisResponse) 139 | err := c.cc.Invoke(ctx, MarketDataService_GetTechAnalysis_FullMethodName, in, out, cOpts...) 140 | if err != nil { 141 | return nil, err 142 | } 143 | return out, nil 144 | } 145 | 146 | func (c *marketDataServiceClient) GetMarketValues(ctx context.Context, in *GetMarketValuesRequest, opts ...grpc.CallOption) (*GetMarketValuesResponse, error) { 147 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) 148 | out := new(GetMarketValuesResponse) 149 | err := c.cc.Invoke(ctx, MarketDataService_GetMarketValues_FullMethodName, in, out, cOpts...) 150 | if err != nil { 151 | return nil, err 152 | } 153 | return out, nil 154 | } 155 | 156 | // MarketDataServiceServer is the server API for MarketDataService service. 157 | // All implementations must embed UnimplementedMarketDataServiceServer 158 | // for forward compatibility. 159 | type MarketDataServiceServer interface { 160 | // GetCandles — исторические свечи по инструменту 161 | GetCandles(context.Context, *GetCandlesRequest) (*GetCandlesResponse, error) 162 | // GetLastPrices — цены последних сделок по инструментам 163 | GetLastPrices(context.Context, *GetLastPricesRequest) (*GetLastPricesResponse, error) 164 | // GetOrderBook — стакан по инструменту 165 | GetOrderBook(context.Context, *GetOrderBookRequest) (*GetOrderBookResponse, error) 166 | // GetTradingStatus — статус торгов по инструменту 167 | GetTradingStatus(context.Context, *GetTradingStatusRequest) (*GetTradingStatusResponse, error) 168 | // GetTradingStatuses — статус торгов по инструментам 169 | GetTradingStatuses(context.Context, *GetTradingStatusesRequest) (*GetTradingStatusesResponse, error) 170 | // GetLastTrades — обезличенные сделки 171 | // Обезличенные сделки по инструменту. Метод гарантирует получение информации за последний час. 172 | GetLastTrades(context.Context, *GetLastTradesRequest) (*GetLastTradesResponse, error) 173 | // GetClosePrices — цены закрытия торговой сессии по инструментам 174 | GetClosePrices(context.Context, *GetClosePricesRequest) (*GetClosePricesResponse, error) 175 | // GetTechAnalysis — технические индикаторы по инструменту 176 | GetTechAnalysis(context.Context, *GetTechAnalysisRequest) (*GetTechAnalysisResponse, error) 177 | // GetMarketValues — рыночные данные по инструментам 178 | GetMarketValues(context.Context, *GetMarketValuesRequest) (*GetMarketValuesResponse, error) 179 | mustEmbedUnimplementedMarketDataServiceServer() 180 | } 181 | 182 | // UnimplementedMarketDataServiceServer must be embedded to have 183 | // forward compatible implementations. 184 | // 185 | // NOTE: this should be embedded by value instead of pointer to avoid a nil 186 | // pointer dereference when methods are called. 187 | type UnimplementedMarketDataServiceServer struct{} 188 | 189 | func (UnimplementedMarketDataServiceServer) GetCandles(context.Context, *GetCandlesRequest) (*GetCandlesResponse, error) { 190 | return nil, status.Errorf(codes.Unimplemented, "method GetCandles not implemented") 191 | } 192 | func (UnimplementedMarketDataServiceServer) GetLastPrices(context.Context, *GetLastPricesRequest) (*GetLastPricesResponse, error) { 193 | return nil, status.Errorf(codes.Unimplemented, "method GetLastPrices not implemented") 194 | } 195 | func (UnimplementedMarketDataServiceServer) GetOrderBook(context.Context, *GetOrderBookRequest) (*GetOrderBookResponse, error) { 196 | return nil, status.Errorf(codes.Unimplemented, "method GetOrderBook not implemented") 197 | } 198 | func (UnimplementedMarketDataServiceServer) GetTradingStatus(context.Context, *GetTradingStatusRequest) (*GetTradingStatusResponse, error) { 199 | return nil, status.Errorf(codes.Unimplemented, "method GetTradingStatus not implemented") 200 | } 201 | func (UnimplementedMarketDataServiceServer) GetTradingStatuses(context.Context, *GetTradingStatusesRequest) (*GetTradingStatusesResponse, error) { 202 | return nil, status.Errorf(codes.Unimplemented, "method GetTradingStatuses not implemented") 203 | } 204 | func (UnimplementedMarketDataServiceServer) GetLastTrades(context.Context, *GetLastTradesRequest) (*GetLastTradesResponse, error) { 205 | return nil, status.Errorf(codes.Unimplemented, "method GetLastTrades not implemented") 206 | } 207 | func (UnimplementedMarketDataServiceServer) GetClosePrices(context.Context, *GetClosePricesRequest) (*GetClosePricesResponse, error) { 208 | return nil, status.Errorf(codes.Unimplemented, "method GetClosePrices not implemented") 209 | } 210 | func (UnimplementedMarketDataServiceServer) GetTechAnalysis(context.Context, *GetTechAnalysisRequest) (*GetTechAnalysisResponse, error) { 211 | return nil, status.Errorf(codes.Unimplemented, "method GetTechAnalysis not implemented") 212 | } 213 | func (UnimplementedMarketDataServiceServer) GetMarketValues(context.Context, *GetMarketValuesRequest) (*GetMarketValuesResponse, error) { 214 | return nil, status.Errorf(codes.Unimplemented, "method GetMarketValues not implemented") 215 | } 216 | func (UnimplementedMarketDataServiceServer) mustEmbedUnimplementedMarketDataServiceServer() {} 217 | func (UnimplementedMarketDataServiceServer) testEmbeddedByValue() {} 218 | 219 | // UnsafeMarketDataServiceServer may be embedded to opt out of forward compatibility for this service. 220 | // Use of this interface is not recommended, as added methods to MarketDataServiceServer will 221 | // result in compilation errors. 222 | type UnsafeMarketDataServiceServer interface { 223 | mustEmbedUnimplementedMarketDataServiceServer() 224 | } 225 | 226 | func RegisterMarketDataServiceServer(s grpc.ServiceRegistrar, srv MarketDataServiceServer) { 227 | // If the following call pancis, it indicates UnimplementedMarketDataServiceServer was 228 | // embedded by pointer and is nil. This will cause panics if an 229 | // unimplemented method is ever invoked, so we test this at initialization 230 | // time to prevent it from happening at runtime later due to I/O. 231 | if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { 232 | t.testEmbeddedByValue() 233 | } 234 | s.RegisterService(&MarketDataService_ServiceDesc, srv) 235 | } 236 | 237 | func _MarketDataService_GetCandles_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 238 | in := new(GetCandlesRequest) 239 | if err := dec(in); err != nil { 240 | return nil, err 241 | } 242 | if interceptor == nil { 243 | return srv.(MarketDataServiceServer).GetCandles(ctx, in) 244 | } 245 | info := &grpc.UnaryServerInfo{ 246 | Server: srv, 247 | FullMethod: MarketDataService_GetCandles_FullMethodName, 248 | } 249 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { 250 | return srv.(MarketDataServiceServer).GetCandles(ctx, req.(*GetCandlesRequest)) 251 | } 252 | return interceptor(ctx, in, info, handler) 253 | } 254 | 255 | func _MarketDataService_GetLastPrices_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 256 | in := new(GetLastPricesRequest) 257 | if err := dec(in); err != nil { 258 | return nil, err 259 | } 260 | if interceptor == nil { 261 | return srv.(MarketDataServiceServer).GetLastPrices(ctx, in) 262 | } 263 | info := &grpc.UnaryServerInfo{ 264 | Server: srv, 265 | FullMethod: MarketDataService_GetLastPrices_FullMethodName, 266 | } 267 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { 268 | return srv.(MarketDataServiceServer).GetLastPrices(ctx, req.(*GetLastPricesRequest)) 269 | } 270 | return interceptor(ctx, in, info, handler) 271 | } 272 | 273 | func _MarketDataService_GetOrderBook_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 274 | in := new(GetOrderBookRequest) 275 | if err := dec(in); err != nil { 276 | return nil, err 277 | } 278 | if interceptor == nil { 279 | return srv.(MarketDataServiceServer).GetOrderBook(ctx, in) 280 | } 281 | info := &grpc.UnaryServerInfo{ 282 | Server: srv, 283 | FullMethod: MarketDataService_GetOrderBook_FullMethodName, 284 | } 285 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { 286 | return srv.(MarketDataServiceServer).GetOrderBook(ctx, req.(*GetOrderBookRequest)) 287 | } 288 | return interceptor(ctx, in, info, handler) 289 | } 290 | 291 | func _MarketDataService_GetTradingStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 292 | in := new(GetTradingStatusRequest) 293 | if err := dec(in); err != nil { 294 | return nil, err 295 | } 296 | if interceptor == nil { 297 | return srv.(MarketDataServiceServer).GetTradingStatus(ctx, in) 298 | } 299 | info := &grpc.UnaryServerInfo{ 300 | Server: srv, 301 | FullMethod: MarketDataService_GetTradingStatus_FullMethodName, 302 | } 303 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { 304 | return srv.(MarketDataServiceServer).GetTradingStatus(ctx, req.(*GetTradingStatusRequest)) 305 | } 306 | return interceptor(ctx, in, info, handler) 307 | } 308 | 309 | func _MarketDataService_GetTradingStatuses_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 310 | in := new(GetTradingStatusesRequest) 311 | if err := dec(in); err != nil { 312 | return nil, err 313 | } 314 | if interceptor == nil { 315 | return srv.(MarketDataServiceServer).GetTradingStatuses(ctx, in) 316 | } 317 | info := &grpc.UnaryServerInfo{ 318 | Server: srv, 319 | FullMethod: MarketDataService_GetTradingStatuses_FullMethodName, 320 | } 321 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { 322 | return srv.(MarketDataServiceServer).GetTradingStatuses(ctx, req.(*GetTradingStatusesRequest)) 323 | } 324 | return interceptor(ctx, in, info, handler) 325 | } 326 | 327 | func _MarketDataService_GetLastTrades_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 328 | in := new(GetLastTradesRequest) 329 | if err := dec(in); err != nil { 330 | return nil, err 331 | } 332 | if interceptor == nil { 333 | return srv.(MarketDataServiceServer).GetLastTrades(ctx, in) 334 | } 335 | info := &grpc.UnaryServerInfo{ 336 | Server: srv, 337 | FullMethod: MarketDataService_GetLastTrades_FullMethodName, 338 | } 339 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { 340 | return srv.(MarketDataServiceServer).GetLastTrades(ctx, req.(*GetLastTradesRequest)) 341 | } 342 | return interceptor(ctx, in, info, handler) 343 | } 344 | 345 | func _MarketDataService_GetClosePrices_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 346 | in := new(GetClosePricesRequest) 347 | if err := dec(in); err != nil { 348 | return nil, err 349 | } 350 | if interceptor == nil { 351 | return srv.(MarketDataServiceServer).GetClosePrices(ctx, in) 352 | } 353 | info := &grpc.UnaryServerInfo{ 354 | Server: srv, 355 | FullMethod: MarketDataService_GetClosePrices_FullMethodName, 356 | } 357 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { 358 | return srv.(MarketDataServiceServer).GetClosePrices(ctx, req.(*GetClosePricesRequest)) 359 | } 360 | return interceptor(ctx, in, info, handler) 361 | } 362 | 363 | func _MarketDataService_GetTechAnalysis_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 364 | in := new(GetTechAnalysisRequest) 365 | if err := dec(in); err != nil { 366 | return nil, err 367 | } 368 | if interceptor == nil { 369 | return srv.(MarketDataServiceServer).GetTechAnalysis(ctx, in) 370 | } 371 | info := &grpc.UnaryServerInfo{ 372 | Server: srv, 373 | FullMethod: MarketDataService_GetTechAnalysis_FullMethodName, 374 | } 375 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { 376 | return srv.(MarketDataServiceServer).GetTechAnalysis(ctx, req.(*GetTechAnalysisRequest)) 377 | } 378 | return interceptor(ctx, in, info, handler) 379 | } 380 | 381 | func _MarketDataService_GetMarketValues_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 382 | in := new(GetMarketValuesRequest) 383 | if err := dec(in); err != nil { 384 | return nil, err 385 | } 386 | if interceptor == nil { 387 | return srv.(MarketDataServiceServer).GetMarketValues(ctx, in) 388 | } 389 | info := &grpc.UnaryServerInfo{ 390 | Server: srv, 391 | FullMethod: MarketDataService_GetMarketValues_FullMethodName, 392 | } 393 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { 394 | return srv.(MarketDataServiceServer).GetMarketValues(ctx, req.(*GetMarketValuesRequest)) 395 | } 396 | return interceptor(ctx, in, info, handler) 397 | } 398 | 399 | // MarketDataService_ServiceDesc is the grpc.ServiceDesc for MarketDataService service. 400 | // It's only intended for direct use with grpc.RegisterService, 401 | // and not to be introspected or modified (even as a copy) 402 | var MarketDataService_ServiceDesc = grpc.ServiceDesc{ 403 | ServiceName: "tinkoff.public.invest.api.contract.v1.MarketDataService", 404 | HandlerType: (*MarketDataServiceServer)(nil), 405 | Methods: []grpc.MethodDesc{ 406 | { 407 | MethodName: "GetCandles", 408 | Handler: _MarketDataService_GetCandles_Handler, 409 | }, 410 | { 411 | MethodName: "GetLastPrices", 412 | Handler: _MarketDataService_GetLastPrices_Handler, 413 | }, 414 | { 415 | MethodName: "GetOrderBook", 416 | Handler: _MarketDataService_GetOrderBook_Handler, 417 | }, 418 | { 419 | MethodName: "GetTradingStatus", 420 | Handler: _MarketDataService_GetTradingStatus_Handler, 421 | }, 422 | { 423 | MethodName: "GetTradingStatuses", 424 | Handler: _MarketDataService_GetTradingStatuses_Handler, 425 | }, 426 | { 427 | MethodName: "GetLastTrades", 428 | Handler: _MarketDataService_GetLastTrades_Handler, 429 | }, 430 | { 431 | MethodName: "GetClosePrices", 432 | Handler: _MarketDataService_GetClosePrices_Handler, 433 | }, 434 | { 435 | MethodName: "GetTechAnalysis", 436 | Handler: _MarketDataService_GetTechAnalysis_Handler, 437 | }, 438 | { 439 | MethodName: "GetMarketValues", 440 | Handler: _MarketDataService_GetMarketValues_Handler, 441 | }, 442 | }, 443 | Streams: []grpc.StreamDesc{}, 444 | Metadata: "marketdata.proto", 445 | } 446 | 447 | const ( 448 | MarketDataStreamService_MarketDataStream_FullMethodName = "/tinkoff.public.invest.api.contract.v1.MarketDataStreamService/MarketDataStream" 449 | MarketDataStreamService_MarketDataServerSideStream_FullMethodName = "/tinkoff.public.invest.api.contract.v1.MarketDataStreamService/MarketDataServerSideStream" 450 | ) 451 | 452 | // MarketDataStreamServiceClient is the client API for MarketDataStreamService service. 453 | // 454 | // 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. 455 | type MarketDataStreamServiceClient interface { 456 | // MarketDataStream — bidirectional стрим предоставления биржевой информации 457 | MarketDataStream(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[MarketDataRequest, MarketDataResponse], error) 458 | // MarketDataServerSideStream — server-side стрим предоставления биржевой информации 459 | MarketDataServerSideStream(ctx context.Context, in *MarketDataServerSideStreamRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[MarketDataResponse], error) 460 | } 461 | 462 | type marketDataStreamServiceClient struct { 463 | cc grpc.ClientConnInterface 464 | } 465 | 466 | func NewMarketDataStreamServiceClient(cc grpc.ClientConnInterface) MarketDataStreamServiceClient { 467 | return &marketDataStreamServiceClient{cc} 468 | } 469 | 470 | func (c *marketDataStreamServiceClient) MarketDataStream(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[MarketDataRequest, MarketDataResponse], error) { 471 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) 472 | stream, err := c.cc.NewStream(ctx, &MarketDataStreamService_ServiceDesc.Streams[0], MarketDataStreamService_MarketDataStream_FullMethodName, cOpts...) 473 | if err != nil { 474 | return nil, err 475 | } 476 | x := &grpc.GenericClientStream[MarketDataRequest, MarketDataResponse]{ClientStream: stream} 477 | return x, nil 478 | } 479 | 480 | // This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. 481 | type MarketDataStreamService_MarketDataStreamClient = grpc.BidiStreamingClient[MarketDataRequest, MarketDataResponse] 482 | 483 | func (c *marketDataStreamServiceClient) MarketDataServerSideStream(ctx context.Context, in *MarketDataServerSideStreamRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[MarketDataResponse], error) { 484 | cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) 485 | stream, err := c.cc.NewStream(ctx, &MarketDataStreamService_ServiceDesc.Streams[1], MarketDataStreamService_MarketDataServerSideStream_FullMethodName, cOpts...) 486 | if err != nil { 487 | return nil, err 488 | } 489 | x := &grpc.GenericClientStream[MarketDataServerSideStreamRequest, MarketDataResponse]{ClientStream: stream} 490 | if err := x.ClientStream.SendMsg(in); err != nil { 491 | return nil, err 492 | } 493 | if err := x.ClientStream.CloseSend(); err != nil { 494 | return nil, err 495 | } 496 | return x, nil 497 | } 498 | 499 | // This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. 500 | type MarketDataStreamService_MarketDataServerSideStreamClient = grpc.ServerStreamingClient[MarketDataResponse] 501 | 502 | // MarketDataStreamServiceServer is the server API for MarketDataStreamService service. 503 | // All implementations must embed UnimplementedMarketDataStreamServiceServer 504 | // for forward compatibility. 505 | type MarketDataStreamServiceServer interface { 506 | // MarketDataStream — bidirectional стрим предоставления биржевой информации 507 | MarketDataStream(grpc.BidiStreamingServer[MarketDataRequest, MarketDataResponse]) error 508 | // MarketDataServerSideStream — server-side стрим предоставления биржевой информации 509 | MarketDataServerSideStream(*MarketDataServerSideStreamRequest, grpc.ServerStreamingServer[MarketDataResponse]) error 510 | mustEmbedUnimplementedMarketDataStreamServiceServer() 511 | } 512 | 513 | // UnimplementedMarketDataStreamServiceServer must be embedded to have 514 | // forward compatible implementations. 515 | // 516 | // NOTE: this should be embedded by value instead of pointer to avoid a nil 517 | // pointer dereference when methods are called. 518 | type UnimplementedMarketDataStreamServiceServer struct{} 519 | 520 | func (UnimplementedMarketDataStreamServiceServer) MarketDataStream(grpc.BidiStreamingServer[MarketDataRequest, MarketDataResponse]) error { 521 | return status.Errorf(codes.Unimplemented, "method MarketDataStream not implemented") 522 | } 523 | func (UnimplementedMarketDataStreamServiceServer) MarketDataServerSideStream(*MarketDataServerSideStreamRequest, grpc.ServerStreamingServer[MarketDataResponse]) error { 524 | return status.Errorf(codes.Unimplemented, "method MarketDataServerSideStream not implemented") 525 | } 526 | func (UnimplementedMarketDataStreamServiceServer) mustEmbedUnimplementedMarketDataStreamServiceServer() { 527 | } 528 | func (UnimplementedMarketDataStreamServiceServer) testEmbeddedByValue() {} 529 | 530 | // UnsafeMarketDataStreamServiceServer may be embedded to opt out of forward compatibility for this service. 531 | // Use of this interface is not recommended, as added methods to MarketDataStreamServiceServer will 532 | // result in compilation errors. 533 | type UnsafeMarketDataStreamServiceServer interface { 534 | mustEmbedUnimplementedMarketDataStreamServiceServer() 535 | } 536 | 537 | func RegisterMarketDataStreamServiceServer(s grpc.ServiceRegistrar, srv MarketDataStreamServiceServer) { 538 | // If the following call pancis, it indicates UnimplementedMarketDataStreamServiceServer was 539 | // embedded by pointer and is nil. This will cause panics if an 540 | // unimplemented method is ever invoked, so we test this at initialization 541 | // time to prevent it from happening at runtime later due to I/O. 542 | if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { 543 | t.testEmbeddedByValue() 544 | } 545 | s.RegisterService(&MarketDataStreamService_ServiceDesc, srv) 546 | } 547 | 548 | func _MarketDataStreamService_MarketDataStream_Handler(srv interface{}, stream grpc.ServerStream) error { 549 | return srv.(MarketDataStreamServiceServer).MarketDataStream(&grpc.GenericServerStream[MarketDataRequest, MarketDataResponse]{ServerStream: stream}) 550 | } 551 | 552 | // This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. 553 | type MarketDataStreamService_MarketDataStreamServer = grpc.BidiStreamingServer[MarketDataRequest, MarketDataResponse] 554 | 555 | func _MarketDataStreamService_MarketDataServerSideStream_Handler(srv interface{}, stream grpc.ServerStream) error { 556 | m := new(MarketDataServerSideStreamRequest) 557 | if err := stream.RecvMsg(m); err != nil { 558 | return err 559 | } 560 | return srv.(MarketDataStreamServiceServer).MarketDataServerSideStream(m, &grpc.GenericServerStream[MarketDataServerSideStreamRequest, MarketDataResponse]{ServerStream: stream}) 561 | } 562 | 563 | // This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. 564 | type MarketDataStreamService_MarketDataServerSideStreamServer = grpc.ServerStreamingServer[MarketDataResponse] 565 | 566 | // MarketDataStreamService_ServiceDesc is the grpc.ServiceDesc for MarketDataStreamService service. 567 | // It's only intended for direct use with grpc.RegisterService, 568 | // and not to be introspected or modified (even as a copy) 569 | var MarketDataStreamService_ServiceDesc = grpc.ServiceDesc{ 570 | ServiceName: "tinkoff.public.invest.api.contract.v1.MarketDataStreamService", 571 | HandlerType: (*MarketDataStreamServiceServer)(nil), 572 | Methods: []grpc.MethodDesc{}, 573 | Streams: []grpc.StreamDesc{ 574 | { 575 | StreamName: "MarketDataStream", 576 | Handler: _MarketDataStreamService_MarketDataStream_Handler, 577 | ServerStreams: true, 578 | ClientStreams: true, 579 | }, 580 | { 581 | StreamName: "MarketDataServerSideStream", 582 | Handler: _MarketDataStreamService_MarketDataServerSideStream_Handler, 583 | ServerStreams: true, 584 | }, 585 | }, 586 | Metadata: "marketdata.proto", 587 | } 588 | -------------------------------------------------------------------------------- /investapi/sandbox.pb.go: -------------------------------------------------------------------------------- 1 | // Code generated by protoc-gen-go. DO NOT EDIT. 2 | // versions: 3 | // protoc-gen-go v1.35.1 4 | // protoc v5.28.2 5 | // source: sandbox.proto 6 | 7 | package investapi 8 | 9 | import ( 10 | _ "google.golang.org/genproto/googleapis/api/annotations" 11 | protoreflect "google.golang.org/protobuf/reflect/protoreflect" 12 | protoimpl "google.golang.org/protobuf/runtime/protoimpl" 13 | reflect "reflect" 14 | sync "sync" 15 | ) 16 | 17 | const ( 18 | // Verify that this generated code is sufficiently up-to-date. 19 | _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) 20 | // Verify that runtime/protoimpl is sufficiently up-to-date. 21 | _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) 22 | ) 23 | 24 | // Запрос открытия счета в песочнице. 25 | type OpenSandboxAccountRequest struct { 26 | state protoimpl.MessageState 27 | sizeCache protoimpl.SizeCache 28 | unknownFields protoimpl.UnknownFields 29 | 30 | Name *string `protobuf:"bytes,1,opt,name=name,proto3,oneof" json:"name,omitempty"` // Название счета 31 | } 32 | 33 | func (x *OpenSandboxAccountRequest) Reset() { 34 | *x = OpenSandboxAccountRequest{} 35 | mi := &file_sandbox_proto_msgTypes[0] 36 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 37 | ms.StoreMessageInfo(mi) 38 | } 39 | 40 | func (x *OpenSandboxAccountRequest) String() string { 41 | return protoimpl.X.MessageStringOf(x) 42 | } 43 | 44 | func (*OpenSandboxAccountRequest) ProtoMessage() {} 45 | 46 | func (x *OpenSandboxAccountRequest) ProtoReflect() protoreflect.Message { 47 | mi := &file_sandbox_proto_msgTypes[0] 48 | if x != nil { 49 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 50 | if ms.LoadMessageInfo() == nil { 51 | ms.StoreMessageInfo(mi) 52 | } 53 | return ms 54 | } 55 | return mi.MessageOf(x) 56 | } 57 | 58 | // Deprecated: Use OpenSandboxAccountRequest.ProtoReflect.Descriptor instead. 59 | func (*OpenSandboxAccountRequest) Descriptor() ([]byte, []int) { 60 | return file_sandbox_proto_rawDescGZIP(), []int{0} 61 | } 62 | 63 | func (x *OpenSandboxAccountRequest) GetName() string { 64 | if x != nil && x.Name != nil { 65 | return *x.Name 66 | } 67 | return "" 68 | } 69 | 70 | // Номер открытого счета в песочнице. 71 | type OpenSandboxAccountResponse struct { 72 | state protoimpl.MessageState 73 | sizeCache protoimpl.SizeCache 74 | unknownFields protoimpl.UnknownFields 75 | 76 | AccountId string `protobuf:"bytes,1,opt,name=account_id,json=accountId,proto3" json:"account_id,omitempty"` //Номер счета 77 | } 78 | 79 | func (x *OpenSandboxAccountResponse) Reset() { 80 | *x = OpenSandboxAccountResponse{} 81 | mi := &file_sandbox_proto_msgTypes[1] 82 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 83 | ms.StoreMessageInfo(mi) 84 | } 85 | 86 | func (x *OpenSandboxAccountResponse) String() string { 87 | return protoimpl.X.MessageStringOf(x) 88 | } 89 | 90 | func (*OpenSandboxAccountResponse) ProtoMessage() {} 91 | 92 | func (x *OpenSandboxAccountResponse) ProtoReflect() protoreflect.Message { 93 | mi := &file_sandbox_proto_msgTypes[1] 94 | if x != nil { 95 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 96 | if ms.LoadMessageInfo() == nil { 97 | ms.StoreMessageInfo(mi) 98 | } 99 | return ms 100 | } 101 | return mi.MessageOf(x) 102 | } 103 | 104 | // Deprecated: Use OpenSandboxAccountResponse.ProtoReflect.Descriptor instead. 105 | func (*OpenSandboxAccountResponse) Descriptor() ([]byte, []int) { 106 | return file_sandbox_proto_rawDescGZIP(), []int{1} 107 | } 108 | 109 | func (x *OpenSandboxAccountResponse) GetAccountId() string { 110 | if x != nil { 111 | return x.AccountId 112 | } 113 | return "" 114 | } 115 | 116 | // Запрос закрытия счета в песочнице. 117 | type CloseSandboxAccountRequest struct { 118 | state protoimpl.MessageState 119 | sizeCache protoimpl.SizeCache 120 | unknownFields protoimpl.UnknownFields 121 | 122 | AccountId string `protobuf:"bytes,1,opt,name=account_id,json=accountId,proto3" json:"account_id,omitempty"` //Номер счета 123 | } 124 | 125 | func (x *CloseSandboxAccountRequest) Reset() { 126 | *x = CloseSandboxAccountRequest{} 127 | mi := &file_sandbox_proto_msgTypes[2] 128 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 129 | ms.StoreMessageInfo(mi) 130 | } 131 | 132 | func (x *CloseSandboxAccountRequest) String() string { 133 | return protoimpl.X.MessageStringOf(x) 134 | } 135 | 136 | func (*CloseSandboxAccountRequest) ProtoMessage() {} 137 | 138 | func (x *CloseSandboxAccountRequest) ProtoReflect() protoreflect.Message { 139 | mi := &file_sandbox_proto_msgTypes[2] 140 | if x != nil { 141 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 142 | if ms.LoadMessageInfo() == nil { 143 | ms.StoreMessageInfo(mi) 144 | } 145 | return ms 146 | } 147 | return mi.MessageOf(x) 148 | } 149 | 150 | // Deprecated: Use CloseSandboxAccountRequest.ProtoReflect.Descriptor instead. 151 | func (*CloseSandboxAccountRequest) Descriptor() ([]byte, []int) { 152 | return file_sandbox_proto_rawDescGZIP(), []int{2} 153 | } 154 | 155 | func (x *CloseSandboxAccountRequest) GetAccountId() string { 156 | if x != nil { 157 | return x.AccountId 158 | } 159 | return "" 160 | } 161 | 162 | // Результат закрытия счета в песочнице. 163 | type CloseSandboxAccountResponse struct { 164 | state protoimpl.MessageState 165 | sizeCache protoimpl.SizeCache 166 | unknownFields protoimpl.UnknownFields 167 | } 168 | 169 | func (x *CloseSandboxAccountResponse) Reset() { 170 | *x = CloseSandboxAccountResponse{} 171 | mi := &file_sandbox_proto_msgTypes[3] 172 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 173 | ms.StoreMessageInfo(mi) 174 | } 175 | 176 | func (x *CloseSandboxAccountResponse) String() string { 177 | return protoimpl.X.MessageStringOf(x) 178 | } 179 | 180 | func (*CloseSandboxAccountResponse) ProtoMessage() {} 181 | 182 | func (x *CloseSandboxAccountResponse) ProtoReflect() protoreflect.Message { 183 | mi := &file_sandbox_proto_msgTypes[3] 184 | if x != nil { 185 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 186 | if ms.LoadMessageInfo() == nil { 187 | ms.StoreMessageInfo(mi) 188 | } 189 | return ms 190 | } 191 | return mi.MessageOf(x) 192 | } 193 | 194 | // Deprecated: Use CloseSandboxAccountResponse.ProtoReflect.Descriptor instead. 195 | func (*CloseSandboxAccountResponse) Descriptor() ([]byte, []int) { 196 | return file_sandbox_proto_rawDescGZIP(), []int{3} 197 | } 198 | 199 | // Запрос пополнения счета в песочнице. 200 | type SandboxPayInRequest struct { 201 | state protoimpl.MessageState 202 | sizeCache protoimpl.SizeCache 203 | unknownFields protoimpl.UnknownFields 204 | 205 | AccountId string `protobuf:"bytes,1,opt,name=account_id,json=accountId,proto3" json:"account_id,omitempty"` //Номер счета 206 | Amount *MoneyValue `protobuf:"bytes,2,opt,name=amount,proto3" json:"amount,omitempty"` //Сумма пополнения счета в рублях 207 | } 208 | 209 | func (x *SandboxPayInRequest) Reset() { 210 | *x = SandboxPayInRequest{} 211 | mi := &file_sandbox_proto_msgTypes[4] 212 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 213 | ms.StoreMessageInfo(mi) 214 | } 215 | 216 | func (x *SandboxPayInRequest) String() string { 217 | return protoimpl.X.MessageStringOf(x) 218 | } 219 | 220 | func (*SandboxPayInRequest) ProtoMessage() {} 221 | 222 | func (x *SandboxPayInRequest) ProtoReflect() protoreflect.Message { 223 | mi := &file_sandbox_proto_msgTypes[4] 224 | if x != nil { 225 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 226 | if ms.LoadMessageInfo() == nil { 227 | ms.StoreMessageInfo(mi) 228 | } 229 | return ms 230 | } 231 | return mi.MessageOf(x) 232 | } 233 | 234 | // Deprecated: Use SandboxPayInRequest.ProtoReflect.Descriptor instead. 235 | func (*SandboxPayInRequest) Descriptor() ([]byte, []int) { 236 | return file_sandbox_proto_rawDescGZIP(), []int{4} 237 | } 238 | 239 | func (x *SandboxPayInRequest) GetAccountId() string { 240 | if x != nil { 241 | return x.AccountId 242 | } 243 | return "" 244 | } 245 | 246 | func (x *SandboxPayInRequest) GetAmount() *MoneyValue { 247 | if x != nil { 248 | return x.Amount 249 | } 250 | return nil 251 | } 252 | 253 | // Результат пополнения счета, текущий баланс. 254 | type SandboxPayInResponse struct { 255 | state protoimpl.MessageState 256 | sizeCache protoimpl.SizeCache 257 | unknownFields protoimpl.UnknownFields 258 | 259 | Balance *MoneyValue `protobuf:"bytes,1,opt,name=balance,proto3" json:"balance,omitempty"` //Текущий баланс счета 260 | } 261 | 262 | func (x *SandboxPayInResponse) Reset() { 263 | *x = SandboxPayInResponse{} 264 | mi := &file_sandbox_proto_msgTypes[5] 265 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 266 | ms.StoreMessageInfo(mi) 267 | } 268 | 269 | func (x *SandboxPayInResponse) String() string { 270 | return protoimpl.X.MessageStringOf(x) 271 | } 272 | 273 | func (*SandboxPayInResponse) ProtoMessage() {} 274 | 275 | func (x *SandboxPayInResponse) ProtoReflect() protoreflect.Message { 276 | mi := &file_sandbox_proto_msgTypes[5] 277 | if x != nil { 278 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 279 | if ms.LoadMessageInfo() == nil { 280 | ms.StoreMessageInfo(mi) 281 | } 282 | return ms 283 | } 284 | return mi.MessageOf(x) 285 | } 286 | 287 | // Deprecated: Use SandboxPayInResponse.ProtoReflect.Descriptor instead. 288 | func (*SandboxPayInResponse) Descriptor() ([]byte, []int) { 289 | return file_sandbox_proto_rawDescGZIP(), []int{5} 290 | } 291 | 292 | func (x *SandboxPayInResponse) GetBalance() *MoneyValue { 293 | if x != nil { 294 | return x.Balance 295 | } 296 | return nil 297 | } 298 | 299 | var File_sandbox_proto protoreflect.FileDescriptor 300 | 301 | var file_sandbox_proto_rawDesc = []byte{ 302 | 0x0a, 0x0d, 0x73, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 303 | 0x25, 0x74, 0x69, 0x6e, 0x6b, 0x6f, 0x66, 0x66, 0x2e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x2e, 304 | 0x69, 0x6e, 0x76, 0x65, 0x73, 0x74, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 305 | 0x61, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x1a, 0x0c, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 306 | 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0c, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x73, 0x2e, 0x70, 0x72, 0x6f, 307 | 0x74, 0x6f, 0x1a, 0x10, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 308 | 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x10, 0x73, 0x74, 0x6f, 0x70, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x73, 309 | 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0b, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2e, 0x70, 0x72, 310 | 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 311 | 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x62, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x2e, 0x70, 312 | 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x3d, 0x0a, 0x19, 0x4f, 0x70, 0x65, 0x6e, 0x53, 0x61, 0x6e, 0x64, 313 | 0x62, 0x6f, 0x78, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 314 | 0x74, 0x12, 0x17, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x48, 315 | 0x00, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x42, 0x07, 0x0a, 0x05, 0x5f, 0x6e, 316 | 0x61, 0x6d, 0x65, 0x22, 0x3b, 0x0a, 0x1a, 0x4f, 0x70, 0x65, 0x6e, 0x53, 0x61, 0x6e, 0x64, 0x62, 317 | 0x6f, 0x78, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 318 | 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 319 | 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 320 | 0x22, 0x41, 0x0a, 0x1a, 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 321 | 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x23, 322 | 0x0a, 0x0a, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 323 | 0x28, 0x09, 0x42, 0x04, 0xe2, 0x41, 0x01, 0x02, 0x52, 0x09, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 324 | 0x74, 0x49, 0x64, 0x22, 0x1d, 0x0a, 0x1b, 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x53, 0x61, 0x6e, 0x64, 325 | 0x62, 0x6f, 0x78, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 326 | 0x73, 0x65, 0x22, 0x8b, 0x01, 0x0a, 0x13, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x50, 0x61, 327 | 0x79, 0x49, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x23, 0x0a, 0x0a, 0x61, 0x63, 328 | 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x04, 329 | 0xe2, 0x41, 0x01, 0x02, 0x52, 0x09, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 0x12, 330 | 0x4f, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 331 | 0x31, 0x2e, 0x74, 0x69, 0x6e, 0x6b, 0x6f, 0x66, 0x66, 0x2e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 332 | 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x73, 0x74, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 333 | 0x72, 0x61, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x6f, 0x6e, 0x65, 0x79, 0x56, 0x61, 0x6c, 334 | 0x75, 0x65, 0x42, 0x04, 0xe2, 0x41, 0x01, 0x02, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 335 | 0x22, 0x63, 0x0a, 0x14, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x50, 0x61, 0x79, 0x49, 0x6e, 336 | 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4b, 0x0a, 0x07, 0x62, 0x61, 0x6c, 0x61, 337 | 0x6e, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x74, 0x69, 0x6e, 0x6b, 338 | 0x6f, 0x66, 0x66, 0x2e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x73, 339 | 0x74, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x76, 340 | 0x31, 0x2e, 0x4d, 0x6f, 0x6e, 0x65, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x07, 0x62, 0x61, 341 | 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x32, 0xfa, 0x16, 0x0a, 0x0e, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, 342 | 0x78, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x99, 0x01, 0x0a, 0x12, 0x4f, 0x70, 0x65, 343 | 0x6e, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 344 | 0x40, 0x2e, 0x74, 0x69, 0x6e, 0x6b, 0x6f, 0x66, 0x66, 0x2e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 345 | 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x73, 0x74, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 346 | 0x72, 0x61, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x53, 0x61, 0x6e, 0x64, 347 | 0x62, 0x6f, 0x78, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 348 | 0x74, 0x1a, 0x41, 0x2e, 0x74, 0x69, 0x6e, 0x6b, 0x6f, 0x66, 0x66, 0x2e, 0x70, 0x75, 0x62, 0x6c, 349 | 0x69, 0x63, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x73, 0x74, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x63, 0x6f, 350 | 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x53, 0x61, 351 | 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 352 | 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x8b, 0x01, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x53, 0x61, 0x6e, 0x64, 353 | 0x62, 0x6f, 0x78, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x12, 0x39, 0x2e, 0x74, 0x69, 354 | 0x6e, 0x6b, 0x6f, 0x66, 0x66, 0x2e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x2e, 0x69, 0x6e, 0x76, 355 | 0x65, 0x73, 0x74, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 356 | 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x52, 357 | 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3a, 0x2e, 0x74, 0x69, 0x6e, 0x6b, 0x6f, 0x66, 0x66, 358 | 0x2e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x73, 0x74, 0x2e, 0x61, 359 | 0x70, 0x69, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x47, 360 | 0x65, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 361 | 0x73, 0x65, 0x12, 0x9c, 0x01, 0x0a, 0x13, 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x53, 0x61, 0x6e, 0x64, 362 | 0x62, 0x6f, 0x78, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x41, 0x2e, 0x74, 0x69, 0x6e, 363 | 0x6b, 0x6f, 0x66, 0x66, 0x2e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x2e, 0x69, 0x6e, 0x76, 0x65, 364 | 0x73, 0x74, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 365 | 0x76, 0x31, 0x2e, 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x41, 366 | 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x42, 0x2e, 367 | 0x74, 0x69, 0x6e, 0x6b, 0x6f, 0x66, 0x66, 0x2e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x2e, 0x69, 368 | 0x6e, 0x76, 0x65, 0x73, 0x74, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 369 | 0x63, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x53, 0x61, 0x6e, 0x64, 0x62, 370 | 0x6f, 0x78, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 371 | 0x65, 0x12, 0x85, 0x01, 0x0a, 0x10, 0x50, 0x6f, 0x73, 0x74, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, 372 | 0x78, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x12, 0x37, 0x2e, 0x74, 0x69, 0x6e, 0x6b, 0x6f, 0x66, 0x66, 373 | 0x2e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x73, 0x74, 0x2e, 0x61, 374 | 0x70, 0x69, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x50, 375 | 0x6f, 0x73, 0x74, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 376 | 0x38, 0x2e, 0x74, 0x69, 0x6e, 0x6b, 0x6f, 0x66, 0x66, 0x2e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 377 | 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x73, 0x74, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 378 | 0x72, 0x61, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x6f, 0x73, 0x74, 0x4f, 0x72, 0x64, 0x65, 379 | 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x94, 0x01, 0x0a, 0x15, 0x50, 0x6f, 380 | 0x73, 0x74, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x41, 0x73, 381 | 0x79, 0x6e, 0x63, 0x12, 0x3c, 0x2e, 0x74, 0x69, 0x6e, 0x6b, 0x6f, 0x66, 0x66, 0x2e, 0x70, 0x75, 382 | 0x62, 0x6c, 0x69, 0x63, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x73, 0x74, 0x2e, 0x61, 0x70, 0x69, 0x2e, 383 | 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x6f, 0x73, 0x74, 384 | 0x4f, 0x72, 0x64, 0x65, 0x72, 0x41, 0x73, 0x79, 0x6e, 0x63, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 385 | 0x74, 0x1a, 0x3d, 0x2e, 0x74, 0x69, 0x6e, 0x6b, 0x6f, 0x66, 0x66, 0x2e, 0x70, 0x75, 0x62, 0x6c, 386 | 0x69, 0x63, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x73, 0x74, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x63, 0x6f, 387 | 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x6f, 0x73, 0x74, 0x4f, 0x72, 388 | 0x64, 0x65, 0x72, 0x41, 0x73, 0x79, 0x6e, 0x63, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 389 | 0x12, 0x8b, 0x01, 0x0a, 0x13, 0x52, 0x65, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x53, 0x61, 0x6e, 0x64, 390 | 0x62, 0x6f, 0x78, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x12, 0x3a, 0x2e, 0x74, 0x69, 0x6e, 0x6b, 0x6f, 391 | 0x66, 0x66, 0x2e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x73, 0x74, 392 | 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x76, 0x31, 393 | 0x2e, 0x52, 0x65, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 394 | 0x75, 0x65, 0x73, 0x74, 0x1a, 0x38, 0x2e, 0x74, 0x69, 0x6e, 0x6b, 0x6f, 0x66, 0x66, 0x2e, 0x70, 395 | 0x75, 0x62, 0x6c, 0x69, 0x63, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x73, 0x74, 0x2e, 0x61, 0x70, 0x69, 396 | 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x6f, 0x73, 397 | 0x74, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x85, 398 | 0x01, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x4f, 0x72, 0x64, 399 | 0x65, 0x72, 0x73, 0x12, 0x37, 0x2e, 0x74, 0x69, 0x6e, 0x6b, 0x6f, 0x66, 0x66, 0x2e, 0x70, 0x75, 400 | 0x62, 0x6c, 0x69, 0x63, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x73, 0x74, 0x2e, 0x61, 0x70, 0x69, 0x2e, 401 | 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x4f, 402 | 0x72, 0x64, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x38, 0x2e, 0x74, 403 | 0x69, 0x6e, 0x6b, 0x6f, 0x66, 0x66, 0x2e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x2e, 0x69, 0x6e, 404 | 0x76, 0x65, 0x73, 0x74, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 405 | 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x73, 0x52, 0x65, 406 | 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x8b, 0x01, 0x0a, 0x12, 0x43, 0x61, 0x6e, 0x63, 0x65, 407 | 0x6c, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x12, 0x39, 0x2e, 408 | 0x74, 0x69, 0x6e, 0x6b, 0x6f, 0x66, 0x66, 0x2e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x2e, 0x69, 409 | 0x6e, 0x76, 0x65, 0x73, 0x74, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 410 | 0x63, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x4f, 0x72, 0x64, 0x65, 411 | 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3a, 0x2e, 0x74, 0x69, 0x6e, 0x6b, 0x6f, 412 | 0x66, 0x66, 0x2e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x73, 0x74, 413 | 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x76, 0x31, 414 | 0x2e, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 415 | 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x86, 0x01, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x53, 0x61, 0x6e, 0x64, 416 | 0x62, 0x6f, 0x78, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x3b, 0x2e, 417 | 0x74, 0x69, 0x6e, 0x6b, 0x6f, 0x66, 0x66, 0x2e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x2e, 0x69, 418 | 0x6e, 0x76, 0x65, 0x73, 0x74, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 419 | 0x63, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x53, 0x74, 420 | 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x31, 0x2e, 0x74, 0x69, 0x6e, 421 | 0x6b, 0x6f, 0x66, 0x66, 0x2e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x2e, 0x69, 0x6e, 0x76, 0x65, 422 | 0x73, 0x74, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 423 | 0x76, 0x31, 0x2e, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x91, 0x01, 424 | 0x0a, 0x14, 0x47, 0x65, 0x74, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x4f, 0x72, 0x64, 0x65, 425 | 0x72, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x3b, 0x2e, 0x74, 0x69, 0x6e, 0x6b, 0x6f, 0x66, 0x66, 426 | 0x2e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x73, 0x74, 0x2e, 0x61, 427 | 0x70, 0x69, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x47, 428 | 0x65, 0x74, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x50, 0x72, 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 429 | 0x65, 0x73, 0x74, 0x1a, 0x3c, 0x2e, 0x74, 0x69, 0x6e, 0x6b, 0x6f, 0x66, 0x66, 0x2e, 0x70, 0x75, 430 | 0x62, 0x6c, 0x69, 0x63, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x73, 0x74, 0x2e, 0x61, 0x70, 0x69, 0x2e, 431 | 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x4f, 432 | 0x72, 0x64, 0x65, 0x72, 0x50, 0x72, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 433 | 0x65, 0x12, 0x88, 0x01, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 434 | 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x37, 0x2e, 0x74, 0x69, 0x6e, 0x6b, 435 | 0x6f, 0x66, 0x66, 0x2e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x73, 436 | 0x74, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x76, 437 | 0x31, 0x2e, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 438 | 0x73, 0x74, 0x1a, 0x38, 0x2e, 0x74, 0x69, 0x6e, 0x6b, 0x6f, 0x66, 0x66, 0x2e, 0x70, 0x75, 0x62, 439 | 0x6c, 0x69, 0x63, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x73, 0x74, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x63, 440 | 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x6f, 0x73, 0x69, 0x74, 441 | 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x8b, 0x01, 0x0a, 442 | 0x14, 0x47, 0x65, 0x74, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x4f, 0x70, 0x65, 0x72, 0x61, 443 | 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x38, 0x2e, 0x74, 0x69, 0x6e, 0x6b, 0x6f, 0x66, 0x66, 0x2e, 444 | 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x73, 0x74, 0x2e, 0x61, 0x70, 445 | 0x69, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x70, 446 | 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 447 | 0x39, 0x2e, 0x74, 0x69, 0x6e, 0x6b, 0x6f, 0x66, 0x66, 0x2e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 448 | 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x73, 0x74, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 449 | 0x72, 0x61, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 450 | 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0xa9, 0x01, 0x0a, 0x1c, 0x47, 451 | 0x65, 0x74, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 452 | 0x6f, 0x6e, 0x73, 0x42, 0x79, 0x43, 0x75, 0x72, 0x73, 0x6f, 0x72, 0x12, 0x43, 0x2e, 0x74, 0x69, 453 | 0x6e, 0x6b, 0x6f, 0x66, 0x66, 0x2e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x2e, 0x69, 0x6e, 0x76, 454 | 0x65, 0x73, 0x74, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 455 | 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 456 | 0x73, 0x42, 0x79, 0x43, 0x75, 0x72, 0x73, 0x6f, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 457 | 0x1a, 0x44, 0x2e, 0x74, 0x69, 0x6e, 0x6b, 0x6f, 0x66, 0x66, 0x2e, 0x70, 0x75, 0x62, 0x6c, 0x69, 458 | 0x63, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x73, 0x74, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x63, 0x6f, 0x6e, 459 | 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x4f, 0x70, 0x65, 0x72, 460 | 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x42, 0x79, 0x43, 0x75, 0x72, 0x73, 0x6f, 0x72, 0x52, 0x65, 461 | 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x88, 0x01, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x53, 0x61, 462 | 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x50, 0x6f, 0x72, 0x74, 0x66, 0x6f, 0x6c, 0x69, 0x6f, 0x12, 0x37, 463 | 0x2e, 0x74, 0x69, 0x6e, 0x6b, 0x6f, 0x66, 0x66, 0x2e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x2e, 464 | 0x69, 0x6e, 0x76, 0x65, 0x73, 0x74, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 465 | 0x61, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x6f, 0x72, 0x74, 0x66, 0x6f, 0x6c, 0x69, 0x6f, 466 | 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x38, 0x2e, 0x74, 0x69, 0x6e, 0x6b, 0x6f, 0x66, 467 | 0x66, 0x2e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x73, 0x74, 0x2e, 468 | 0x61, 0x70, 0x69, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x2e, 469 | 0x50, 0x6f, 0x72, 0x74, 0x66, 0x6f, 0x6c, 0x69, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 470 | 0x65, 0x12, 0x87, 0x01, 0x0a, 0x0c, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x50, 0x61, 0x79, 471 | 0x49, 0x6e, 0x12, 0x3a, 0x2e, 0x74, 0x69, 0x6e, 0x6b, 0x6f, 0x66, 0x66, 0x2e, 0x70, 0x75, 0x62, 472 | 0x6c, 0x69, 0x63, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x73, 0x74, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x63, 473 | 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x61, 0x6e, 0x64, 0x62, 474 | 0x6f, 0x78, 0x50, 0x61, 0x79, 0x49, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3b, 475 | 0x2e, 0x74, 0x69, 0x6e, 0x6b, 0x6f, 0x66, 0x66, 0x2e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x2e, 476 | 0x69, 0x6e, 0x76, 0x65, 0x73, 0x74, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 477 | 0x61, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x50, 0x61, 478 | 0x79, 0x49, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x97, 0x01, 0x0a, 0x18, 479 | 0x47, 0x65, 0x74, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 480 | 0x61, 0x77, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x73, 0x12, 0x3c, 0x2e, 0x74, 0x69, 0x6e, 0x6b, 0x6f, 481 | 0x66, 0x66, 0x2e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x73, 0x74, 482 | 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x76, 0x31, 483 | 0x2e, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x73, 0x52, 484 | 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3d, 0x2e, 0x74, 0x69, 0x6e, 0x6b, 0x6f, 0x66, 0x66, 485 | 0x2e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x73, 0x74, 0x2e, 0x61, 486 | 0x70, 0x69, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x57, 487 | 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x73, 0x52, 0x65, 0x73, 488 | 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x88, 0x01, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x53, 0x61, 0x6e, 489 | 0x64, 0x62, 0x6f, 0x78, 0x4d, 0x61, 0x78, 0x4c, 0x6f, 0x74, 0x73, 0x12, 0x38, 0x2e, 0x74, 0x69, 490 | 0x6e, 0x6b, 0x6f, 0x66, 0x66, 0x2e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x2e, 0x69, 0x6e, 0x76, 491 | 0x65, 0x73, 0x74, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 492 | 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x4d, 0x61, 0x78, 0x4c, 0x6f, 0x74, 0x73, 0x52, 0x65, 493 | 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x39, 0x2e, 0x74, 0x69, 0x6e, 0x6b, 0x6f, 0x66, 0x66, 0x2e, 494 | 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x73, 0x74, 0x2e, 0x61, 0x70, 495 | 0x69, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 496 | 0x74, 0x4d, 0x61, 0x78, 0x4c, 0x6f, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 497 | 0x12, 0x91, 0x01, 0x0a, 0x14, 0x50, 0x6f, 0x73, 0x74, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 498 | 0x53, 0x74, 0x6f, 0x70, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x12, 0x3b, 0x2e, 0x74, 0x69, 0x6e, 0x6b, 499 | 0x6f, 0x66, 0x66, 0x2e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x73, 500 | 0x74, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x76, 501 | 0x31, 0x2e, 0x50, 0x6f, 0x73, 0x74, 0x53, 0x74, 0x6f, 0x70, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 502 | 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3c, 0x2e, 0x74, 0x69, 0x6e, 0x6b, 0x6f, 0x66, 0x66, 503 | 0x2e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x73, 0x74, 0x2e, 0x61, 504 | 0x70, 0x69, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x50, 505 | 0x6f, 0x73, 0x74, 0x53, 0x74, 0x6f, 0x70, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 506 | 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x91, 0x01, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x53, 0x61, 0x6e, 0x64, 507 | 0x62, 0x6f, 0x78, 0x53, 0x74, 0x6f, 0x70, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x73, 0x12, 0x3b, 0x2e, 508 | 0x74, 0x69, 0x6e, 0x6b, 0x6f, 0x66, 0x66, 0x2e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x2e, 0x69, 509 | 0x6e, 0x76, 0x65, 0x73, 0x74, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 510 | 0x63, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x74, 0x6f, 0x70, 0x4f, 0x72, 0x64, 511 | 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3c, 0x2e, 0x74, 0x69, 0x6e, 512 | 0x6b, 0x6f, 0x66, 0x66, 0x2e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x2e, 0x69, 0x6e, 0x76, 0x65, 513 | 0x73, 0x74, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 514 | 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x74, 0x6f, 0x70, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x73, 515 | 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x97, 0x01, 0x0a, 0x16, 0x43, 0x61, 0x6e, 516 | 0x63, 0x65, 0x6c, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x53, 0x74, 0x6f, 0x70, 0x4f, 0x72, 517 | 0x64, 0x65, 0x72, 0x12, 0x3d, 0x2e, 0x74, 0x69, 0x6e, 0x6b, 0x6f, 0x66, 0x66, 0x2e, 0x70, 0x75, 518 | 0x62, 0x6c, 0x69, 0x63, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x73, 0x74, 0x2e, 0x61, 0x70, 0x69, 0x2e, 519 | 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x61, 0x6e, 0x63, 520 | 0x65, 0x6c, 0x53, 0x74, 0x6f, 0x70, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 521 | 0x73, 0x74, 0x1a, 0x3e, 0x2e, 0x74, 0x69, 0x6e, 0x6b, 0x6f, 0x66, 0x66, 0x2e, 0x70, 0x75, 0x62, 522 | 0x6c, 0x69, 0x63, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x73, 0x74, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x63, 523 | 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x61, 0x6e, 0x63, 0x65, 524 | 0x6c, 0x53, 0x74, 0x6f, 0x70, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 525 | 0x73, 0x65, 0x42, 0x61, 0x0a, 0x1c, 0x72, 0x75, 0x2e, 0x74, 0x69, 0x6e, 0x6b, 0x6f, 0x66, 0x66, 526 | 0x2e, 0x70, 0x69, 0x61, 0x70, 0x69, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 527 | 0x76, 0x31, 0x50, 0x01, 0x5a, 0x0c, 0x2e, 0x2f, 0x3b, 0x69, 0x6e, 0x76, 0x65, 0x73, 0x74, 0x61, 528 | 0x70, 0x69, 0xa2, 0x02, 0x05, 0x54, 0x49, 0x41, 0x50, 0x49, 0xaa, 0x02, 0x14, 0x54, 0x69, 0x6e, 529 | 0x6b, 0x6f, 0x66, 0x66, 0x2e, 0x49, 0x6e, 0x76, 0x65, 0x73, 0x74, 0x41, 0x70, 0x69, 0x2e, 0x56, 530 | 0x31, 0xca, 0x02, 0x11, 0x54, 0x69, 0x6e, 0x6b, 0x6f, 0x66, 0x66, 0x5c, 0x49, 0x6e, 0x76, 0x65, 531 | 0x73, 0x74, 0x5c, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 532 | } 533 | 534 | var ( 535 | file_sandbox_proto_rawDescOnce sync.Once 536 | file_sandbox_proto_rawDescData = file_sandbox_proto_rawDesc 537 | ) 538 | 539 | func file_sandbox_proto_rawDescGZIP() []byte { 540 | file_sandbox_proto_rawDescOnce.Do(func() { 541 | file_sandbox_proto_rawDescData = protoimpl.X.CompressGZIP(file_sandbox_proto_rawDescData) 542 | }) 543 | return file_sandbox_proto_rawDescData 544 | } 545 | 546 | var file_sandbox_proto_msgTypes = make([]protoimpl.MessageInfo, 6) 547 | var file_sandbox_proto_goTypes = []any{ 548 | (*OpenSandboxAccountRequest)(nil), // 0: tinkoff.public.invest.api.contract.v1.OpenSandboxAccountRequest 549 | (*OpenSandboxAccountResponse)(nil), // 1: tinkoff.public.invest.api.contract.v1.OpenSandboxAccountResponse 550 | (*CloseSandboxAccountRequest)(nil), // 2: tinkoff.public.invest.api.contract.v1.CloseSandboxAccountRequest 551 | (*CloseSandboxAccountResponse)(nil), // 3: tinkoff.public.invest.api.contract.v1.CloseSandboxAccountResponse 552 | (*SandboxPayInRequest)(nil), // 4: tinkoff.public.invest.api.contract.v1.SandboxPayInRequest 553 | (*SandboxPayInResponse)(nil), // 5: tinkoff.public.invest.api.contract.v1.SandboxPayInResponse 554 | (*MoneyValue)(nil), // 6: tinkoff.public.invest.api.contract.v1.MoneyValue 555 | (*GetAccountsRequest)(nil), // 7: tinkoff.public.invest.api.contract.v1.GetAccountsRequest 556 | (*PostOrderRequest)(nil), // 8: tinkoff.public.invest.api.contract.v1.PostOrderRequest 557 | (*PostOrderAsyncRequest)(nil), // 9: tinkoff.public.invest.api.contract.v1.PostOrderAsyncRequest 558 | (*ReplaceOrderRequest)(nil), // 10: tinkoff.public.invest.api.contract.v1.ReplaceOrderRequest 559 | (*GetOrdersRequest)(nil), // 11: tinkoff.public.invest.api.contract.v1.GetOrdersRequest 560 | (*CancelOrderRequest)(nil), // 12: tinkoff.public.invest.api.contract.v1.CancelOrderRequest 561 | (*GetOrderStateRequest)(nil), // 13: tinkoff.public.invest.api.contract.v1.GetOrderStateRequest 562 | (*GetOrderPriceRequest)(nil), // 14: tinkoff.public.invest.api.contract.v1.GetOrderPriceRequest 563 | (*PositionsRequest)(nil), // 15: tinkoff.public.invest.api.contract.v1.PositionsRequest 564 | (*OperationsRequest)(nil), // 16: tinkoff.public.invest.api.contract.v1.OperationsRequest 565 | (*GetOperationsByCursorRequest)(nil), // 17: tinkoff.public.invest.api.contract.v1.GetOperationsByCursorRequest 566 | (*PortfolioRequest)(nil), // 18: tinkoff.public.invest.api.contract.v1.PortfolioRequest 567 | (*WithdrawLimitsRequest)(nil), // 19: tinkoff.public.invest.api.contract.v1.WithdrawLimitsRequest 568 | (*GetMaxLotsRequest)(nil), // 20: tinkoff.public.invest.api.contract.v1.GetMaxLotsRequest 569 | (*PostStopOrderRequest)(nil), // 21: tinkoff.public.invest.api.contract.v1.PostStopOrderRequest 570 | (*GetStopOrdersRequest)(nil), // 22: tinkoff.public.invest.api.contract.v1.GetStopOrdersRequest 571 | (*CancelStopOrderRequest)(nil), // 23: tinkoff.public.invest.api.contract.v1.CancelStopOrderRequest 572 | (*GetAccountsResponse)(nil), // 24: tinkoff.public.invest.api.contract.v1.GetAccountsResponse 573 | (*PostOrderResponse)(nil), // 25: tinkoff.public.invest.api.contract.v1.PostOrderResponse 574 | (*PostOrderAsyncResponse)(nil), // 26: tinkoff.public.invest.api.contract.v1.PostOrderAsyncResponse 575 | (*GetOrdersResponse)(nil), // 27: tinkoff.public.invest.api.contract.v1.GetOrdersResponse 576 | (*CancelOrderResponse)(nil), // 28: tinkoff.public.invest.api.contract.v1.CancelOrderResponse 577 | (*OrderState)(nil), // 29: tinkoff.public.invest.api.contract.v1.OrderState 578 | (*GetOrderPriceResponse)(nil), // 30: tinkoff.public.invest.api.contract.v1.GetOrderPriceResponse 579 | (*PositionsResponse)(nil), // 31: tinkoff.public.invest.api.contract.v1.PositionsResponse 580 | (*OperationsResponse)(nil), // 32: tinkoff.public.invest.api.contract.v1.OperationsResponse 581 | (*GetOperationsByCursorResponse)(nil), // 33: tinkoff.public.invest.api.contract.v1.GetOperationsByCursorResponse 582 | (*PortfolioResponse)(nil), // 34: tinkoff.public.invest.api.contract.v1.PortfolioResponse 583 | (*WithdrawLimitsResponse)(nil), // 35: tinkoff.public.invest.api.contract.v1.WithdrawLimitsResponse 584 | (*GetMaxLotsResponse)(nil), // 36: tinkoff.public.invest.api.contract.v1.GetMaxLotsResponse 585 | (*PostStopOrderResponse)(nil), // 37: tinkoff.public.invest.api.contract.v1.PostStopOrderResponse 586 | (*GetStopOrdersResponse)(nil), // 38: tinkoff.public.invest.api.contract.v1.GetStopOrdersResponse 587 | (*CancelStopOrderResponse)(nil), // 39: tinkoff.public.invest.api.contract.v1.CancelStopOrderResponse 588 | } 589 | var file_sandbox_proto_depIdxs = []int32{ 590 | 6, // 0: tinkoff.public.invest.api.contract.v1.SandboxPayInRequest.amount:type_name -> tinkoff.public.invest.api.contract.v1.MoneyValue 591 | 6, // 1: tinkoff.public.invest.api.contract.v1.SandboxPayInResponse.balance:type_name -> tinkoff.public.invest.api.contract.v1.MoneyValue 592 | 0, // 2: tinkoff.public.invest.api.contract.v1.SandboxService.OpenSandboxAccount:input_type -> tinkoff.public.invest.api.contract.v1.OpenSandboxAccountRequest 593 | 7, // 3: tinkoff.public.invest.api.contract.v1.SandboxService.GetSandboxAccounts:input_type -> tinkoff.public.invest.api.contract.v1.GetAccountsRequest 594 | 2, // 4: tinkoff.public.invest.api.contract.v1.SandboxService.CloseSandboxAccount:input_type -> tinkoff.public.invest.api.contract.v1.CloseSandboxAccountRequest 595 | 8, // 5: tinkoff.public.invest.api.contract.v1.SandboxService.PostSandboxOrder:input_type -> tinkoff.public.invest.api.contract.v1.PostOrderRequest 596 | 9, // 6: tinkoff.public.invest.api.contract.v1.SandboxService.PostSandboxOrderAsync:input_type -> tinkoff.public.invest.api.contract.v1.PostOrderAsyncRequest 597 | 10, // 7: tinkoff.public.invest.api.contract.v1.SandboxService.ReplaceSandboxOrder:input_type -> tinkoff.public.invest.api.contract.v1.ReplaceOrderRequest 598 | 11, // 8: tinkoff.public.invest.api.contract.v1.SandboxService.GetSandboxOrders:input_type -> tinkoff.public.invest.api.contract.v1.GetOrdersRequest 599 | 12, // 9: tinkoff.public.invest.api.contract.v1.SandboxService.CancelSandboxOrder:input_type -> tinkoff.public.invest.api.contract.v1.CancelOrderRequest 600 | 13, // 10: tinkoff.public.invest.api.contract.v1.SandboxService.GetSandboxOrderState:input_type -> tinkoff.public.invest.api.contract.v1.GetOrderStateRequest 601 | 14, // 11: tinkoff.public.invest.api.contract.v1.SandboxService.GetSandboxOrderPrice:input_type -> tinkoff.public.invest.api.contract.v1.GetOrderPriceRequest 602 | 15, // 12: tinkoff.public.invest.api.contract.v1.SandboxService.GetSandboxPositions:input_type -> tinkoff.public.invest.api.contract.v1.PositionsRequest 603 | 16, // 13: tinkoff.public.invest.api.contract.v1.SandboxService.GetSandboxOperations:input_type -> tinkoff.public.invest.api.contract.v1.OperationsRequest 604 | 17, // 14: tinkoff.public.invest.api.contract.v1.SandboxService.GetSandboxOperationsByCursor:input_type -> tinkoff.public.invest.api.contract.v1.GetOperationsByCursorRequest 605 | 18, // 15: tinkoff.public.invest.api.contract.v1.SandboxService.GetSandboxPortfolio:input_type -> tinkoff.public.invest.api.contract.v1.PortfolioRequest 606 | 4, // 16: tinkoff.public.invest.api.contract.v1.SandboxService.SandboxPayIn:input_type -> tinkoff.public.invest.api.contract.v1.SandboxPayInRequest 607 | 19, // 17: tinkoff.public.invest.api.contract.v1.SandboxService.GetSandboxWithdrawLimits:input_type -> tinkoff.public.invest.api.contract.v1.WithdrawLimitsRequest 608 | 20, // 18: tinkoff.public.invest.api.contract.v1.SandboxService.GetSandboxMaxLots:input_type -> tinkoff.public.invest.api.contract.v1.GetMaxLotsRequest 609 | 21, // 19: tinkoff.public.invest.api.contract.v1.SandboxService.PostSandboxStopOrder:input_type -> tinkoff.public.invest.api.contract.v1.PostStopOrderRequest 610 | 22, // 20: tinkoff.public.invest.api.contract.v1.SandboxService.GetSandboxStopOrders:input_type -> tinkoff.public.invest.api.contract.v1.GetStopOrdersRequest 611 | 23, // 21: tinkoff.public.invest.api.contract.v1.SandboxService.CancelSandboxStopOrder:input_type -> tinkoff.public.invest.api.contract.v1.CancelStopOrderRequest 612 | 1, // 22: tinkoff.public.invest.api.contract.v1.SandboxService.OpenSandboxAccount:output_type -> tinkoff.public.invest.api.contract.v1.OpenSandboxAccountResponse 613 | 24, // 23: tinkoff.public.invest.api.contract.v1.SandboxService.GetSandboxAccounts:output_type -> tinkoff.public.invest.api.contract.v1.GetAccountsResponse 614 | 3, // 24: tinkoff.public.invest.api.contract.v1.SandboxService.CloseSandboxAccount:output_type -> tinkoff.public.invest.api.contract.v1.CloseSandboxAccountResponse 615 | 25, // 25: tinkoff.public.invest.api.contract.v1.SandboxService.PostSandboxOrder:output_type -> tinkoff.public.invest.api.contract.v1.PostOrderResponse 616 | 26, // 26: tinkoff.public.invest.api.contract.v1.SandboxService.PostSandboxOrderAsync:output_type -> tinkoff.public.invest.api.contract.v1.PostOrderAsyncResponse 617 | 25, // 27: tinkoff.public.invest.api.contract.v1.SandboxService.ReplaceSandboxOrder:output_type -> tinkoff.public.invest.api.contract.v1.PostOrderResponse 618 | 27, // 28: tinkoff.public.invest.api.contract.v1.SandboxService.GetSandboxOrders:output_type -> tinkoff.public.invest.api.contract.v1.GetOrdersResponse 619 | 28, // 29: tinkoff.public.invest.api.contract.v1.SandboxService.CancelSandboxOrder:output_type -> tinkoff.public.invest.api.contract.v1.CancelOrderResponse 620 | 29, // 30: tinkoff.public.invest.api.contract.v1.SandboxService.GetSandboxOrderState:output_type -> tinkoff.public.invest.api.contract.v1.OrderState 621 | 30, // 31: tinkoff.public.invest.api.contract.v1.SandboxService.GetSandboxOrderPrice:output_type -> tinkoff.public.invest.api.contract.v1.GetOrderPriceResponse 622 | 31, // 32: tinkoff.public.invest.api.contract.v1.SandboxService.GetSandboxPositions:output_type -> tinkoff.public.invest.api.contract.v1.PositionsResponse 623 | 32, // 33: tinkoff.public.invest.api.contract.v1.SandboxService.GetSandboxOperations:output_type -> tinkoff.public.invest.api.contract.v1.OperationsResponse 624 | 33, // 34: tinkoff.public.invest.api.contract.v1.SandboxService.GetSandboxOperationsByCursor:output_type -> tinkoff.public.invest.api.contract.v1.GetOperationsByCursorResponse 625 | 34, // 35: tinkoff.public.invest.api.contract.v1.SandboxService.GetSandboxPortfolio:output_type -> tinkoff.public.invest.api.contract.v1.PortfolioResponse 626 | 5, // 36: tinkoff.public.invest.api.contract.v1.SandboxService.SandboxPayIn:output_type -> tinkoff.public.invest.api.contract.v1.SandboxPayInResponse 627 | 35, // 37: tinkoff.public.invest.api.contract.v1.SandboxService.GetSandboxWithdrawLimits:output_type -> tinkoff.public.invest.api.contract.v1.WithdrawLimitsResponse 628 | 36, // 38: tinkoff.public.invest.api.contract.v1.SandboxService.GetSandboxMaxLots:output_type -> tinkoff.public.invest.api.contract.v1.GetMaxLotsResponse 629 | 37, // 39: tinkoff.public.invest.api.contract.v1.SandboxService.PostSandboxStopOrder:output_type -> tinkoff.public.invest.api.contract.v1.PostStopOrderResponse 630 | 38, // 40: tinkoff.public.invest.api.contract.v1.SandboxService.GetSandboxStopOrders:output_type -> tinkoff.public.invest.api.contract.v1.GetStopOrdersResponse 631 | 39, // 41: tinkoff.public.invest.api.contract.v1.SandboxService.CancelSandboxStopOrder:output_type -> tinkoff.public.invest.api.contract.v1.CancelStopOrderResponse 632 | 22, // [22:42] is the sub-list for method output_type 633 | 2, // [2:22] is the sub-list for method input_type 634 | 2, // [2:2] is the sub-list for extension type_name 635 | 2, // [2:2] is the sub-list for extension extendee 636 | 0, // [0:2] is the sub-list for field type_name 637 | } 638 | 639 | func init() { file_sandbox_proto_init() } 640 | func file_sandbox_proto_init() { 641 | if File_sandbox_proto != nil { 642 | return 643 | } 644 | file_common_proto_init() 645 | file_orders_proto_init() 646 | file_operations_proto_init() 647 | file_stoporders_proto_init() 648 | file_users_proto_init() 649 | file_sandbox_proto_msgTypes[0].OneofWrappers = []any{} 650 | type x struct{} 651 | out := protoimpl.TypeBuilder{ 652 | File: protoimpl.DescBuilder{ 653 | GoPackagePath: reflect.TypeOf(x{}).PkgPath(), 654 | RawDescriptor: file_sandbox_proto_rawDesc, 655 | NumEnums: 0, 656 | NumMessages: 6, 657 | NumExtensions: 0, 658 | NumServices: 1, 659 | }, 660 | GoTypes: file_sandbox_proto_goTypes, 661 | DependencyIndexes: file_sandbox_proto_depIdxs, 662 | MessageInfos: file_sandbox_proto_msgTypes, 663 | }.Build() 664 | File_sandbox_proto = out.File 665 | file_sandbox_proto_rawDesc = nil 666 | file_sandbox_proto_goTypes = nil 667 | file_sandbox_proto_depIdxs = nil 668 | } 669 | --------------------------------------------------------------------------------