From f82a545bc7d7ae9303209d9919cd2dbf24a17adb Mon Sep 17 00:00:00 2001 From: Rohit Durvasula Date: Thu, 28 Mar 2024 15:16:12 -0700 Subject: [PATCH] Release v0.3.0 --- .gitignore | 34 + LICENSE | 13 + README.md | 263 +++ auth/api_key.go | 139 ++ auth/authenticator.go | 85 + client/client.go | 36 + client/errors/errors.go | 181 ++ client/filter/filter.go | 109 ++ client/filter/filter_test.go | 73 + client/options/options.go | 161 ++ client/orchestration/v1/action.go | 25 + client/orchestration/v1/client.go | 62 + client/orchestration/v1/network.go | 25 + client/orchestration/v1/protocol.go | 25 + client/orchestration/v1/staking_target.go | 73 + .../orchestration/v1/view_staking_context.go | 27 + client/orchestration/v1/workflow.go | 137 ++ client/rewards/v1/client.go | 59 + client/rewards/v1/reward.go | 73 + client/rewards/v1/reward_filter.go | 133 ++ client/rewards/v1/reward_filter_test.go | 71 + client/rewards/v1/stake.go | 73 + client/transport/transport.go | 45 + docs/images/banner.svg | 110 ++ docs/openapi/orchestration.swagger.json | 1493 ++++++++++++++++ docs/openapi/rewards.swagger.json | 562 +++++++ examples/cosmos/list-rewards/main.go | 80 + .../create-and-process-workflow/main.go | 176 ++ examples/ethereum/create-workflow/main.go | 67 + examples/ethereum/list-rewards/main.go | 66 + examples/ethereum/list-stakes/main.go | 65 + examples/hello-world/main.go | 98 ++ examples/list-workflows/main.go | 64 + examples/solana/create-workflow/main.go | 158 ++ examples/solana/list-rewards/main.go | 76 + .../coinbase/staking/orchestration/v1/doc.go | 177 ++ .../orchestration/v1/staking_client.go | 1207 +++++++++++++ gen/client/coinbase/staking/rewards/v1/doc.go | 185 ++ .../staking/rewards/v1/reward_client.go | 450 +++++ .../staking/orchestration/v1/action.pb.go | 303 ++++ .../staking/orchestration/v1/action_aip.go | 106 ++ .../staking/orchestration/v1/api.pb.go | 357 ++++ .../staking/orchestration/v1/api.pb.gw.go | 1031 ++++++++++++ .../staking/orchestration/v1/api_grpc.pb.go | 423 +++++ .../staking/orchestration/v1/common.pb.go | 170 ++ .../orchestration/v1/ethereum_kiln.pb.go | 761 +++++++++ .../staking/orchestration/v1/network.pb.go | 303 ++++ .../staking/orchestration/v1/network_aip.go | 78 + .../staking/orchestration/v1/protocol.pb.go | 284 ++++ .../staking/orchestration/v1/protocol_aip.go | 54 + .../staking/orchestration/v1/solana.pb.go | 1039 ++++++++++++ .../orchestration/v1/staking_context.pb.go | 397 +++++ .../orchestration/v1/staking_target.pb.go | 574 +++++++ .../orchestration/v1/staking_target_aip.go | 198 +++ .../staking/orchestration/v1/workflow.pb.go | 1497 +++++++++++++++++ .../staking/orchestration/v1/workflow_aip.go | 63 + .../coinbase/staking/rewards/v1/common.pb.go | 191 +++ .../staking/rewards/v1/protocol.pb.go | 161 ++ .../staking/rewards/v1/protocol_aip.go | 54 + .../coinbase/staking/rewards/v1/reward.pb.go | 788 +++++++++ .../coinbase/staking/rewards/v1/reward_aip.go | 78 + .../staking/rewards/v1/reward_service.pb.go | 244 +++ .../rewards/v1/reward_service.pb.gw.go | 328 ++++ .../rewards/v1/reward_service_grpc.pb.go | 150 ++ .../coinbase/staking/rewards/v1/stake.pb.go | 865 ++++++++++ .../coinbase/staking/rewards/v1/stake_aip.go | 78 + go.mod | 41 + go.sum | 250 +++ internal/signer/ethereum.go | 50 + internal/signer/signer.go | 31 + protos/buf.gen.orchestration.yaml | 39 + protos/buf.gen.rewards.yaml | 41 + protos/buf.lock | 13 + protos/buf.yaml | 13 + .../staking/orchestration/v1/action.proto | 41 + .../staking/orchestration/v1/api.proto | 327 ++++ .../staking/orchestration/v1/common.proto | 17 + .../orchestration/v1/ethereum_kiln.proto | 113 ++ .../staking/orchestration/v1/network.proto | 43 + .../staking/orchestration/v1/protocol.proto | 31 + .../staking/orchestration/v1/solana.proto | 168 ++ .../orchestration/v1/staking_context.proto | 45 + .../orchestration/v1/staking_target.proto | 97 ++ .../staking/orchestration/v1/workflow.proto | 280 +++ .../coinbase/staking/rewards/v1/common.proto | 26 + .../staking/rewards/v1/protocol.proto | 21 + .../coinbase/staking/rewards/v1/reward.proto | 164 ++ .../staking/rewards/v1/reward_service.proto | 110 ++ .../coinbase/staking/rewards/v1/stake.proto | 190 +++ 89 files changed, 19682 insertions(+) create mode 100644 .gitignore create mode 100644 LICENSE create mode 100644 README.md create mode 100644 auth/api_key.go create mode 100644 auth/authenticator.go create mode 100644 client/client.go create mode 100644 client/errors/errors.go create mode 100644 client/filter/filter.go create mode 100644 client/filter/filter_test.go create mode 100644 client/options/options.go create mode 100644 client/orchestration/v1/action.go create mode 100644 client/orchestration/v1/client.go create mode 100644 client/orchestration/v1/network.go create mode 100644 client/orchestration/v1/protocol.go create mode 100644 client/orchestration/v1/staking_target.go create mode 100644 client/orchestration/v1/view_staking_context.go create mode 100644 client/orchestration/v1/workflow.go create mode 100644 client/rewards/v1/client.go create mode 100644 client/rewards/v1/reward.go create mode 100644 client/rewards/v1/reward_filter.go create mode 100644 client/rewards/v1/reward_filter_test.go create mode 100644 client/rewards/v1/stake.go create mode 100644 client/transport/transport.go create mode 100644 docs/images/banner.svg create mode 100644 docs/openapi/orchestration.swagger.json create mode 100644 docs/openapi/rewards.swagger.json create mode 100644 examples/cosmos/list-rewards/main.go create mode 100644 examples/ethereum/create-and-process-workflow/main.go create mode 100644 examples/ethereum/create-workflow/main.go create mode 100644 examples/ethereum/list-rewards/main.go create mode 100644 examples/ethereum/list-stakes/main.go create mode 100644 examples/hello-world/main.go create mode 100644 examples/list-workflows/main.go create mode 100644 examples/solana/create-workflow/main.go create mode 100644 examples/solana/list-rewards/main.go create mode 100644 gen/client/coinbase/staking/orchestration/v1/doc.go create mode 100644 gen/client/coinbase/staking/orchestration/v1/staking_client.go create mode 100644 gen/client/coinbase/staking/rewards/v1/doc.go create mode 100644 gen/client/coinbase/staking/rewards/v1/reward_client.go create mode 100644 gen/go/coinbase/staking/orchestration/v1/action.pb.go create mode 100644 gen/go/coinbase/staking/orchestration/v1/action_aip.go create mode 100644 gen/go/coinbase/staking/orchestration/v1/api.pb.go create mode 100644 gen/go/coinbase/staking/orchestration/v1/api.pb.gw.go create mode 100644 gen/go/coinbase/staking/orchestration/v1/api_grpc.pb.go create mode 100644 gen/go/coinbase/staking/orchestration/v1/common.pb.go create mode 100644 gen/go/coinbase/staking/orchestration/v1/ethereum_kiln.pb.go create mode 100644 gen/go/coinbase/staking/orchestration/v1/network.pb.go create mode 100644 gen/go/coinbase/staking/orchestration/v1/network_aip.go create mode 100644 gen/go/coinbase/staking/orchestration/v1/protocol.pb.go create mode 100644 gen/go/coinbase/staking/orchestration/v1/protocol_aip.go create mode 100644 gen/go/coinbase/staking/orchestration/v1/solana.pb.go create mode 100644 gen/go/coinbase/staking/orchestration/v1/staking_context.pb.go create mode 100644 gen/go/coinbase/staking/orchestration/v1/staking_target.pb.go create mode 100644 gen/go/coinbase/staking/orchestration/v1/staking_target_aip.go create mode 100644 gen/go/coinbase/staking/orchestration/v1/workflow.pb.go create mode 100644 gen/go/coinbase/staking/orchestration/v1/workflow_aip.go create mode 100644 gen/go/coinbase/staking/rewards/v1/common.pb.go create mode 100644 gen/go/coinbase/staking/rewards/v1/protocol.pb.go create mode 100644 gen/go/coinbase/staking/rewards/v1/protocol_aip.go create mode 100644 gen/go/coinbase/staking/rewards/v1/reward.pb.go create mode 100644 gen/go/coinbase/staking/rewards/v1/reward_aip.go create mode 100644 gen/go/coinbase/staking/rewards/v1/reward_service.pb.go create mode 100644 gen/go/coinbase/staking/rewards/v1/reward_service.pb.gw.go create mode 100644 gen/go/coinbase/staking/rewards/v1/reward_service_grpc.pb.go create mode 100644 gen/go/coinbase/staking/rewards/v1/stake.pb.go create mode 100644 gen/go/coinbase/staking/rewards/v1/stake_aip.go create mode 100644 go.mod create mode 100644 go.sum create mode 100644 internal/signer/ethereum.go create mode 100644 internal/signer/signer.go create mode 100644 protos/buf.gen.orchestration.yaml create mode 100644 protos/buf.gen.rewards.yaml create mode 100644 protos/buf.lock create mode 100644 protos/buf.yaml create mode 100644 protos/coinbase/staking/orchestration/v1/action.proto create mode 100644 protos/coinbase/staking/orchestration/v1/api.proto create mode 100644 protos/coinbase/staking/orchestration/v1/common.proto create mode 100644 protos/coinbase/staking/orchestration/v1/ethereum_kiln.proto create mode 100644 protos/coinbase/staking/orchestration/v1/network.proto create mode 100644 protos/coinbase/staking/orchestration/v1/protocol.proto create mode 100644 protos/coinbase/staking/orchestration/v1/solana.proto create mode 100644 protos/coinbase/staking/orchestration/v1/staking_context.proto create mode 100644 protos/coinbase/staking/orchestration/v1/staking_target.proto create mode 100644 protos/coinbase/staking/orchestration/v1/workflow.proto create mode 100644 protos/coinbase/staking/rewards/v1/common.proto create mode 100644 protos/coinbase/staking/rewards/v1/protocol.proto create mode 100644 protos/coinbase/staking/rewards/v1/reward.proto create mode 100644 protos/coinbase/staking/rewards/v1/reward_service.proto create mode 100644 protos/coinbase/staking/rewards/v1/stake.proto diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..67e7649 --- /dev/null +++ b/.gitignore @@ -0,0 +1,34 @@ +# IDE/Tools +.docker +.idea +.vscode +# vim +.*.sw? + +# Local +.DS_Store + +# Binaries for programs and plugins +*.exe +*.exe~ +*.dll +*.so +*.dylib + +# Test binary, built with `go test -c` +*.test + +# Output of the go coverage tool, specifically when used with LiteIDE +*.out + +# Dependency directories (remove the comment below to include it) +vendor/ + +# Cloud API key +.coinbase_cloud_api_key*.json + +# Example binaries +bin + +# VSCode artifacts +**/__debug_bin** diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..2d2fd2a --- /dev/null +++ b/LICENSE @@ -0,0 +1,13 @@ +Copyright (c) 2018-2024 Coinbase, Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/README.md b/README.md new file mode 100644 index 0000000..db8c58e --- /dev/null +++ b/README.md @@ -0,0 +1,263 @@ +![Coinbase Staking API](docs/images/banner.svg) + +# [Coinbase Staking API](https://github.com/coinbase/staking-client-library-go) + +> Programmatic access to Coinbase's best-in-class staking infrastructure and services. :large_blue_circle: + +[![Current version](https://img.shields.io/github/tag/coinbase/staking-client-library-go?color=3498DB&label=version)](https://github.com/coinbase/staking-client-library-go/releases) [![GitHub contributors](https://img.shields.io/github/contributors/coinbase/staking-client-library-go?color=3498DB)](https://github.com/coinbase/staking-client-library-go/graphs/contributors) [![GitHub Stars](https://img.shields.io/github/stars/coinbase/staking-client-library-go.svg?color=3498DB)](https://github.com/coinbase/staking-client-library-go/stargazers) [![GitHub](https://img.shields.io/github/license/coinbase/staking-client-library-go?color=3498DB)](https://github.com/coinbase/staking-client-library-go/blob/main/LICENSE) + +## Overview + +The **Coinbase Staking API** empowers developers to deliver a fully-featured staking experience in their Web2 apps, wallets, or dApps using *one common interface* across protocols. + +A traditional infrastructure-heavy staking integration can take months. Coinbase's Staking API enables onboarding within hours by providing powerful and simple APIs on both sides of the staking experience. + +* [Orchestration](./protos/coinbase/staking/orchestration/v1): *Write*. Power non-custodial staking workflows for your users. + +* [Rewards](./protos/coinbase/staking/rewards/v1): *Read*. Access onchain, staking-related rewards data. + +## Quick Start + +1. Create and download an API key from the [Cloud Platform](https://portal.cloud.coinbase.com/access/api). +2. Place the key named `.coinbase_cloud_api_key.json` at the root of this repository. +3. Run one of the code samples [below](#stake-partial-eth-💠) or any of our [provided examples](./examples/) :rocket:. + +### Stake Partial ETH :diamond_shape_with_a_dot_inside: + +This code sample creates an ETH staking workflow. View the full code sample [here](examples/ethereum/create-workflow/main.go) + +
+ Code Sample + +```golang +// examples/ethereum/create-workflow/main.go +package main + +import ( + "context" + "fmt" + "log" + + "github.cbhq.net/cloud/staking-client-library-go/auth" + "github.cbhq.net/cloud/staking-client-library-go/client" + "github.cbhq.net/cloud/staking-client-library-go/client/options" + stakingpb "github.cbhq.net/cloud/staking-client-library-go/gen/go/coinbase/staking/orchestration/v1" +) + +func main() { + // TODO: Add your project ID found at cloud.coinbase.com or in your API key. + projectID := "" + + ctx := context.Background() + + // Loads the API key from the default location. + apiKey, err := auth.NewAPIKey(auth.WithLoadAPIKeyFromFile(true)) + if err != nil { + log.Fatalf("error loading API key: %s", err.Error()) + } + + // Creates the Coinbase Staking API client. + stakingClient, err := client.New(ctx, options.WithAPIKey(apiKey)) + if err != nil { + log.Fatalf("error instantiating staking client: %s", err.Error()) + } + + // Constructs the API request + req := &stakingpb.CreateWorkflowRequest{ + Parent: fmt.Sprintf("projects/%s", projectID), + Workflow: &stakingpb.Workflow{ + Action: "protocols/ethereum_kiln/networks/holesky/actions/stake", + StakingParameters: &stakingpb.Workflow_EthereumKilnStakingParameters{ + EthereumKilnStakingParameters: &stakingpb.EthereumKilnStakingParameters{ + Parameters: &stakingpb.EthereumKilnStakingParameters_StakeParameters{ + StakeParameters: &stakingpb.EthereumKilnStakeParameters{ + StakerAddress: "0xdb816889F2a7362EF242E5a717dfD5B38Ae849FE", + IntegratorContractAddress: "0xA55416de5DE61A0AC1aa8970a280E04388B1dE4b", + Amount: &stakingpb.Amount{ + Value: "20", + Currency: "ETH", + }, + }, + }, + }, + }, + SkipBroadcast: true, + }, + } + + workflow, err := stakingClient.Orchestration.CreateWorkflow(ctx, req) + if err != nil { + log.Fatalf("couldn't create workflow: %s", err.Error()) + } + + log.Printf("Workflow created: %s", workflow.Name) +} +``` + +
+ +
+ Output + + ```text + 2024/03/28 11:43:49 Workflow created: projects/62376b2f-3f24-42c9-9025-d576a3c06d6f/workflows/ffbf9b45-c57b-49cb-a4d5-fdab66d8cb25 + ``` + +
+ +### View Ethereum Rewards :moneybag: + +This code sample returns rewards for an Ethereum validator address. View the full code sample [here](examples/ethereum/list-rewards/main.go). + +
+ Code Sample + +```golang +// examples/ethereum/list-rewards/main.go +package main + +import ( + "context" + "encoding/json" + "errors" + "fmt" + "log" + "time" + + "google.golang.org/api/iterator" + + "github.cbhq.net/cloud/staking-client-library-go/auth" + "github.cbhq.net/cloud/staking-client-library-go/client" + "github.cbhq.net/cloud/staking-client-library-go/client/options" + rewardsV1 "github.cbhq.net/cloud/staking-client-library-go/client/rewards/v1" + rewardspb "github.cbhq.net/cloud/staking-client-library-go/gen/go/coinbase/staking/rewards/v1" +) + +func main() { + ctx := context.Background() + + // Loads the API key from the default location. + apiKey, err := auth.NewAPIKey(auth.WithLoadAPIKeyFromFile(true)) + if err != nil { + log.Fatalf("error loading API key: %s", err.Error()) + } + + // Creates the Coinbase Staking API client. + stakingClient, err := client.New(ctx, options.WithAPIKey(apiKey)) + if err != nil { + log.Fatalf("error instantiating staking client: %s", err.Error()) + } + + // Lists the rewards for the given address for the previous last 2 days, aggregated by day. + rewardsIter := stakingClient.Rewards.ListRewards(ctx, &rewardspb.ListRewardsRequest{ + Parent: rewardspb.ProtocolResourceName{Protocol: "ethereum"}.String(), + PageSize: 200, + Filter: rewardsV1.WithAddress().Eq("0xac53512c39d0081ca4437c285305eb423f474e6153693c12fbba4a3df78bcaa3422b31d800c5bea71c1b017168a60474"). + And(rewardsV1.WithPeriodEndTime().Gte(time.Now().AddDate(0, 0, -2))). + And(rewardsV1.WithPeriodEndTime().Lt(time.Now())).String(), + }) + + // Iterates through the rewards and print them. + for { + reward, err := rewardsIter.Next() + if errors.Is(err, iterator.Done) { + break + } + + if err != nil { + log.Fatalf("error listing rewards: %s", err.Error()) + } + + marshaled, err := json.MarshalIndent(reward, "", " ") + if err != nil { + log.Fatalf("error marshaling reward: %s", err.Error()) + } + + fmt.Printf(string(marshaled)) + } +} +``` + +
+ +
+ Output + + ```json + { + "address": "0xac53512c39d0081ca4437c285305eb423f474e6153693c12fbba4a3df78bcaa3422b31d800c5bea71c1b017168a60474", + "period_identifier": { + "date": "2024-03-26" + }, + "aggregation_unit": 2, + "period_start_time": { + "seconds": 1711411200 + }, + "period_end_time": { + "seconds": 1711497599 + }, + "total_earned_native_unit": { + "amount": "0.00211503", + "exp": "18", + "ticker": "ETH", + "raw_numeric": "2115030000000000" + }, + "total_earned_usd": [ + { + "source": 1, + "conversion_time": { + "seconds": 1711498140 + }, + "amount": { + "amount": "7.58", + "exp": "2", + "ticker": "USD", + "raw_numeric": "758" + }, + "conversion_price": "3582.979980" + } + ], + "protocol": "ethereum" + } + { + "address": "0xac53512c39d0081ca4437c285305eb423f474e6153693c12fbba4a3df78bcaa3422b31d800c5bea71c1b017168a60474", + "period_identifier": { + "date": "2024-03-27" + }, + "aggregation_unit": 2, + "period_start_time": { + "seconds": 1711497600 + }, + "period_end_time": { + "seconds": 1711583999 + }, + "total_earned_native_unit": { + "amount": "0.002034193", + "exp": "18", + "ticker": "ETH", + "raw_numeric": "2034193000000000" + }, + "total_earned_usd": [ + { + "source": 1, + "conversion_time": { + "seconds": 1711584540 + }, + "amount": { + "amount": "7.13", + "exp": "2", + "ticker": "USD", + "raw_numeric": "713" + }, + "conversion_price": "3504.580078" + } + ], + "protocol": "ethereum" + } + ``` + +
+ +## Documentation + +There are numerous examples in the [`examples directory`](./examples) to help get you started. For even more, refer to our [documentation website](https://docs.cloud.coinbase.com/) for detailed definitions, API specifications, integration guides, and more! diff --git a/auth/api_key.go b/auth/api_key.go new file mode 100644 index 0000000..af08c13 --- /dev/null +++ b/auth/api_key.go @@ -0,0 +1,139 @@ +package auth + +import ( + "encoding/json" + "errors" + "fmt" + "os" + "path" + "path/filepath" +) + +const ( + // NameEnvVar is the environment variable for the Coinbase Cloud API Key name. + nameEnvVar = "COINBASE_CLOUD_API_KEY_NAME" + + // PrivateKeyEnvVar is the environment variable for the Coinbase Cloud API Key private key. + privateKeyEnvVar = "COINBASE_CLOUD_API_KEY_PRIVATE_KEY" +) + +// APIKey represents a Coinbase Cloud API Key. +type APIKey struct { + Name string `json:"name"` + PrivateKey string `json:"privateKey"` +} + +// apiKeyConfig contains configuration information for constructing the API Key. +type apiKeyConfig struct { + loadAPIKeyFromEnv bool + loadAPIKeyFromFile bool + apiKeyName string + apiKeyPrivateKey string +} + +// APIKeyOption is a function that applies changes to a apiKeyConfig. +type APIKeyOption func(t *apiKeyConfig) + +// WithAPIKeyName returns an option to set the API Key. +func WithAPIKeyName(apiKeyName, apiKeyPrivateKey string) APIKeyOption { + return func(t *apiKeyConfig) { + t.apiKeyName = apiKeyName + t.apiKeyPrivateKey = apiKeyPrivateKey + } +} + +// WithLoadAPIKeyFromEnv returns an option to set whether to load the API +// Key from environment variables. If the API Key name and private key are both set, +// they take precedence over the environment variables. +func WithLoadAPIKeyFromEnv(loadAPIKeyFromEnv bool) APIKeyOption { + return func(t *apiKeyConfig) { + t.loadAPIKeyFromEnv = loadAPIKeyFromEnv + } +} + +// WithLoadAPIKeyFromFile returns an option to set whether to load the API +// Key from file directly. If the API Key name and private key are both set, +// they take precedence over the environment variables. Next if the env vars are +// set they take precedence or else the file is used if set. +func WithLoadAPIKeyFromFile(loadAPIKeyFromFile bool) APIKeyOption { + return func(t *apiKeyConfig) { + t.loadAPIKeyFromFile = loadAPIKeyFromFile + } +} + +// NewAPIKey creates a new Coinbase Cloud API Key based on the provided options. +func NewAPIKey(opts ...APIKeyOption) (*APIKey, error) { + config := &apiKeyConfig{} + + for _, opt := range opts { + opt(config) + } + + if config.apiKeyName != "" && config.apiKeyPrivateKey != "" { + return &APIKey{ + Name: config.apiKeyName, + PrivateKey: config.apiKeyPrivateKey, + }, nil + } + + if config.loadAPIKeyFromEnv { + return loadAPIKeyFromEnv() + } + + if config.loadAPIKeyFromFile { + return loadAPIKeyFromFile() + } + + return nil, fmt.Errorf("no valid api key gen option selected") +} + +// loadAPIKeyFromEnv loads a new Coinbase Cloud API Key from environment variables. +func loadAPIKeyFromEnv() (*APIKey, error) { + name := os.Getenv(nameEnvVar) + if name == "" { + return nil, errors.New("environment variable COINBASE_CLOUD_API_KEY_NAME must be set") + } + + privateKey := os.Getenv(privateKeyEnvVar) + if privateKey == "" { + return nil, errors.New("environment variable COINBASE_CLOUD_API_KEY_PRIVATE_KEY must be set") + } + + return &APIKey{ + Name: name, + PrivateKey: privateKey, + }, nil +} + +// loadAPIKeyFromFile loads a new Coinbase Cloud API Key from a private_key file downloaded from CB Cloud UI directly. +// It currently expects the private_key file to be located in path from where binary is being run. +func loadAPIKeyFromFile() (*APIKey, error) { + keyFileName := ".coinbase_cloud_api_key.json" + + wd, err := os.Getwd() + if err != nil { + return nil, fmt.Errorf("file load: %w", err) + } + + for wd != "" && wd != "/" { + keyFilepath := path.Join(wd, keyFileName) + wd = path.Dir(wd) + + f, err := os.Open(filepath.Clean(keyFilepath)) + if err != nil { + // skip if file not accessible + continue + } + + var a APIKey + + dec := json.NewDecoder(f) + if err := dec.Decode(&a); err != nil { + return nil, fmt.Errorf("file load: %w", err) + } + + return &a, nil + } + + return nil, fmt.Errorf("error loading file") +} diff --git a/auth/authenticator.go b/auth/authenticator.go new file mode 100644 index 0000000..62fa0aa --- /dev/null +++ b/auth/authenticator.go @@ -0,0 +1,85 @@ +package auth + +import ( + "crypto/rand" + "crypto/x509" + "encoding/pem" + "fmt" + "math" + "math/big" + "time" + + "gopkg.in/square/go-jose.v2" + "gopkg.in/square/go-jose.v2/jwt" +) + +// Authenticator builds a JWT based on the APIKey. +type Authenticator struct { + apiKey *APIKey +} + +// APIKeyClaims holds public claim values for a JWT, as well as a URI. +type APIKeyClaims struct { + *jwt.Claims + URI string `json:"uri"` +} + +// NewAuthenticator returns a new Authenticator. +func NewAuthenticator(apiKey *APIKey) *Authenticator { + return &Authenticator{ + apiKey: apiKey, + } +} + +// BuildJWT constructs and returns the JWT as a string along with an error, if any. +func (a *Authenticator) BuildJWT(service, uri string) (string, error) { + block, _ := pem.Decode([]byte(a.apiKey.PrivateKey)) + if block == nil { + return "", fmt.Errorf("could not decode private key") + } + + key, err := x509.ParseECPrivateKey(block.Bytes) + if err != nil { + return "", fmt.Errorf("could not parse private key: %w", err) + } + + sig, err := jose.NewSigner( + jose.SigningKey{Algorithm: jose.ES256, Key: key}, + (&jose.SignerOptions{NonceSource: nonceSource{}}).WithType("JWT").WithHeader("kid", a.apiKey.Name), + ) + if err != nil { + return "", fmt.Errorf("could not create signer: %w", err) + } + + cl := &APIKeyClaims{ + Claims: &jwt.Claims{ + Subject: a.apiKey.Name, + Issuer: "coinbase-cloud", + NotBefore: jwt.NewNumericDate(time.Now()), + Expiry: jwt.NewNumericDate(time.Now().Add(1 * time.Minute)), + Audience: jwt.Audience{service}, + }, + URI: uri, + } + + jwtString, err := jwt.Signed(sig).Claims(cl).CompactSerialize() + if err != nil { + return "", fmt.Errorf("could not sign: %w", err) + } + + return jwtString, nil +} + +// nonceSource implements the jose.NonceSource interface. It is used for building +// the JWT. +type nonceSource struct{} + +// Nonce calculates and returns nonce as a string and an error, if any. +func (n nonceSource) Nonce() (string, error) { + r, err := rand.Int(rand.Reader, big.NewInt(math.MaxInt64)) + if err != nil { + return "", fmt.Errorf("could not generate nonce: %w", err) + } + + return r.String(), nil +} diff --git a/client/client.go b/client/client.go new file mode 100644 index 0000000..146a9f0 --- /dev/null +++ b/client/client.go @@ -0,0 +1,36 @@ +package client + +import ( + "context" + "fmt" + + "github.com/coinbase/staking-client-library-go/client/options" + orchestrationClient "github.com/coinbase/staking-client-library-go/client/orchestration/v1" + rewardsClient "github.com/coinbase/staking-client-library-go/client/rewards/v1" +) + +type StakingClient struct { + Orchestration *orchestrationClient.OrchestrationServiceClient + Rewards *rewardsClient.RewardsServiceClient +} + +// New returns a StakingClient based on the given inputs. +func New( + ctx context.Context, + stakingOpts ...options.StakingClientOption, +) (*StakingClient, error) { + orchestrationClient, err := orchestrationClient.NewOrchestrationServiceClient(ctx, stakingOpts...) + if err != nil { + return nil, fmt.Errorf("failed to create orchestration client: %w", err) + } + + rewardsClient, err := rewardsClient.NewRewardsServiceClient(ctx, stakingOpts...) + if err != nil { + return nil, fmt.Errorf("failed to create rewards client: %w", err) + } + + return &StakingClient{ + Orchestration: orchestrationClient, + Rewards: rewardsClient, + }, nil +} diff --git a/client/errors/errors.go b/client/errors/errors.go new file mode 100644 index 0000000..8025950 --- /dev/null +++ b/client/errors/errors.go @@ -0,0 +1,181 @@ +package errors + +import ( + "encoding/json" + "errors" + "fmt" + "log" + + "google.golang.org/api/googleapi" + "google.golang.org/genproto/googleapis/rpc/errdetails" + "google.golang.org/genproto/googleapis/rpc/status" + "google.golang.org/protobuf/encoding/protojson" +) + +type StakingAPIError struct { + // Original error + err error + // httpCode is the HTTP response status code and will always be populated. + httpCode int + message string + details ErrDetails +} + +// Code presents the HTTP code of the APIError. +func (s *StakingAPIError) Code() int { + return s.httpCode +} + +// Message presents the high level error message of the APIError. +func (s *StakingAPIError) Message() string { + return s.message +} + +// Details presents the error details of the APIError. +func (s *StakingAPIError) Details() ErrDetails { + return s.details +} + +// Unwrap extracts the original error. +func (s *StakingAPIError) Unwrap() error { + return s.err +} + +// Error returns a readable representation of the StakingAPIError. +func (s *StakingAPIError) Error() string { + // This happens when error returned wasn't a googleapi.Error in which case we don't know how to parse the error. + // This should never happen as the auto-generated staking-api client should always return a googleapi.Error. + // In this case, the best we can do is to print the original error. + if s.httpCode == 0 && s.message == "" { + return fmt.Sprintf("stakingapi error: %s", s.Unwrap().Error()) + } else if s.httpCode != 0 && s.message != "" { + return fmt.Sprintf("stakingapi error: httpCode: %d message: %s", s.httpCode, s.message) + } else if s.err != nil { + // Either http code or message is missing. This should be very unlikely. It can happen when an orchestration + // service simply returns the response body say as "Unauthorized". In this case, we also print the original error. + return fmt.Sprintf("stakingapi error: httpCode: %d message: %s err: %s", s.httpCode, s.message, s.Unwrap().Error()) + } else { + return fmt.Sprintf("stakingapi error: httpCode: %d message: %s", s.httpCode, s.message) + } +} + +func (s *StakingAPIError) Print() error { + d := struct { + Code int `json:"code"` + Message string `json:"message"` + Details ErrDetails `json:"details"` + }{ + Code: s.Code(), + Message: s.Message(), + Details: s.Details(), + } + + jsonBytes, err := json.MarshalIndent(d, "", " ") + if err != nil { + return err + } + + log.Printf("\n%s", string(jsonBytes)) + + return nil +} + +// FromError parses a googleapi.Error and builds a StakingAPIError. +func FromError(err error) *StakingAPIError { + sae := StakingAPIError{ + err: err, + } + + var herr *googleapi.Error + + if errors.As(err, &herr) { + // A proper user facing error message from the staking api ends up being in the googleapi.Error.Body instead of + // other fields like Code, Message, Details already in it. This requires us to parse the Body field instead to + // get the actual error details. + // The body is a json string that can be parsed into a status.Status object. + s := status.Status{} + if err := protojson.Unmarshal([]byte(herr.Body), &s); err != nil { + // If we can't parse the body, just return metadata from the googleapi.Error object. + return &StakingAPIError{ + err: herr.Unwrap(), + httpCode: herr.Code, + message: herr.Message, + } + } + + sae.httpCode = herr.Code + sae.message = s.GetMessage() + + // Coerce the Any messages into proto.Message then parse the details. + details := []interface{}{} + + for _, any := range s.GetDetails() { + m, err := any.UnmarshalNew() + if err != nil { + // Ignore malformed Any values. + continue + } + + details = append(details, m) + } + + sae.details = parseDetails(details) + } + + return &sae +} + +// ErrDetails holds the google/rpc/error_details.proto messages. +type ErrDetails struct { + ErrorInfo *errdetails.ErrorInfo `json:"errorInfo,omitempty"` + BadRequest *errdetails.BadRequest `json:"badRequest,omitempty"` + PreconditionFailure *errdetails.PreconditionFailure `json:"preconditionFailure,omitempty"` + QuotaFailure *errdetails.QuotaFailure `json:"quotaFailure,omitempty"` + RetryInfo *errdetails.RetryInfo `json:"retryInfo,omitempty"` + ResourceInfo *errdetails.ResourceInfo `json:"resourceInfo,omitempty"` + RequestInfo *errdetails.RequestInfo `json:"requestInfo,omitempty"` + DebugInfo *errdetails.DebugInfo `json:"debugInfo,omitempty"` + Help *errdetails.Help `json:"help,omitempty"` + LocalizedMessage *errdetails.LocalizedMessage `json:"localizedMessage,omitempty"` + + // Unknown stores unidentifiable error details. + Unknown []interface{} `json:"unknown,omitempty"` +} + +// parseDetails accepts a slice of interface{} that should be backed by some +// sort of proto.Message that can be cast to the google/rpc/error_details.proto +// types. +// +// This is for orchestration use only. +func parseDetails(details []interface{}) ErrDetails { + var ed ErrDetails + + for _, d := range details { + switch d := d.(type) { + case *errdetails.ErrorInfo: + ed.ErrorInfo = d + case *errdetails.BadRequest: + ed.BadRequest = d + case *errdetails.PreconditionFailure: + ed.PreconditionFailure = d + case *errdetails.QuotaFailure: + ed.QuotaFailure = d + case *errdetails.RetryInfo: + ed.RetryInfo = d + case *errdetails.ResourceInfo: + ed.ResourceInfo = d + case *errdetails.RequestInfo: + ed.RequestInfo = d + case *errdetails.DebugInfo: + ed.DebugInfo = d + case *errdetails.Help: + ed.Help = d + case *errdetails.LocalizedMessage: + ed.LocalizedMessage = d + default: + ed.Unknown = append(ed.Unknown, d) + } + } + + return ed +} diff --git a/client/filter/filter.go b/client/filter/filter.go new file mode 100644 index 0000000..08115ea --- /dev/null +++ b/client/filter/filter.go @@ -0,0 +1,109 @@ +package filter + +import ( + "fmt" + "strings" + "time" +) + +// Supported operations taken from https://google.aip.dev/160 + +type ComparisonOperation string + +const ( + Equals ComparisonOperation = "=" + NotEquals ComparisonOperation = "!=" + LessThan ComparisonOperation = "<" + LessEquals ComparisonOperation = "<=" + GreaterEquals ComparisonOperation = ">=" + GreaterThan ComparisonOperation = ">" +) + +type LogicalOperation string + +const ( + And LogicalOperation = "AND" +) + +// Filterer interface for both Term and LogicalExpressions. +type Filterer interface { + And(other Filterer) *LogicalExpressions + String() string +} + +// LogicalExpression represents a pair of filter terms joined with a logical operator. +type LogicalExpression struct { + Op LogicalOperation + Filter Filterer +} + +// LogicalExpressions represents a list of logical expressions. +type LogicalExpressions struct { + expressions []LogicalExpression +} + +// Term helps represent a single filter condition, e.g. "field = value". +type Term struct { + field string + op ComparisonOperation + value interface{} +} + +func (t *Term) And(other Filterer) *LogicalExpressions { + return &LogicalExpressions{ + expressions: []LogicalExpression{ + {Op: And, Filter: t}, + {Op: And, Filter: other}, + }, + } +} + +func (t *Term) String() string { + parsedValue := t.value + + if timeValue, ok := t.value.(time.Time); ok { + // If the type assertion is successful, the value is a time.Time, + // so we need to parse it to a string in RFC3339 format. + parsedValue = fmt.Sprintf("'%s'", timeValue.Format(time.RFC3339)) + } else if intValue, ok := t.value.(int); ok { + // If the type assertion is successful, the value is an int + parsedValue = fmt.Sprintf("%d", intValue) + } else if stringValue, ok := t.value.(string); ok { + // If the type assertion is successful, the value is a string + parsedValue = fmt.Sprintf("'%s'", stringValue) + } + + return fmt.Sprintf("%s %s %s", t.field, t.op, parsedValue) +} + +func NewTerm(field string, op ComparisonOperation, value interface{}) *Term { + return &Term{field: field, op: op, value: value} +} + +func (le *LogicalExpressions) And(other Filterer) *LogicalExpressions { + le.expressions = append(le.expressions, LogicalExpression{Op: And, Filter: other}) + + return le +} + +func (le *LogicalExpressions) String() string { + if len(le.expressions) == 0 { + return "" + } + + parts := make([]string, len(le.expressions)*2-1) + + index := 0 + + for i, expr := range le.expressions { + if i > 0 { + parts[index] = fmt.Sprintf(" %s ", expr.Op) + index++ + } + + parts[index] = expr.Filter.String() + index++ + } + + return "(" + strings.Join(parts, "") + ")" +} diff --git a/client/filter/filter_test.go b/client/filter/filter_test.go new file mode 100644 index 0000000..e79e107 --- /dev/null +++ b/client/filter/filter_test.go @@ -0,0 +1,73 @@ +package filter + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// AFilter is a custom type to define filter operation on the 'a' field. +type AFilter struct{} + +// Eq method is a custom method to define the equals operation on the 'a' field. +func (AFilter) Eq(value int) *Term { + return NewTerm("a", Equals, value) +} + +// Neq method is a custom method to define the not equals operation on the 'a' field. +func (AFilter) Neq(value int) *Term { + return NewTerm("a", NotEquals, value) +} + +// Gt method is a custom method to define the greater than operation on the 'a' field. +func (AFilter) Gt(value int) *Term { + return NewTerm("a", GreaterThan, value) +} + +// Gte method is a custom method to define the greater than or equals operation on the 'a' field. +func (AFilter) Gte(value int) *Term { + return NewTerm("a", GreaterEquals, value) +} + +// Lt method is a custom method to define the less than operation on the 'a' field. +func (AFilter) Lt(value int) *Term { + return NewTerm("a", LessThan, value) +} + +// Lte method is a custom method to define the less than or equals operation on the 'a' field. +func (AFilter) Lte(value int) *Term { + return NewTerm("a", LessEquals, value) +} + +func WithA() AFilter { + return AFilter{} +} + +// BFilter is a custom type to define filter operation on the 'b' field. +type BFilter struct{} + +// Eq method is a custom method to define the equals operation on the 'b' field. +func (BFilter) Eq(value string) *Term { + return NewTerm("b", Equals, value) +} + +func WithB() BFilter { + return BFilter{} +} + +func TestFilter(t *testing.T) { + f := WithA().Gt(10).String() + assert.Equal(t, "a > '10'", f) + + // Filter to perform a simple AND between 2 conditions. + f = WithA().Gte(10).And(WithA().Lt(20)).String() + assert.Equal(t, "(a >= '10' AND a < '20')", f) + + // Filter to perform a simple AND between 3 conditions with no special order enforcement. + f = WithA().Gte(10).And(WithA().Lt(20)).And(WithB().Eq("example")).String() + assert.Equal(t, "(a >= '10' AND a < '20' AND b = 'example')", f) + + // Filter to perform a simple AND between 3 conditions while enforcing order of operations - forcing latter 2 conditions to be AND'ed first. + f = WithA().Gte(10).And(WithA().Lt(20).And(WithB().Eq("example"))).String() + assert.Equal(t, "(a >= '10' AND (a < '20' AND b = 'example'))", f) +} diff --git a/client/options/options.go b/client/options/options.go new file mode 100644 index 0000000..9026219 --- /dev/null +++ b/client/options/options.go @@ -0,0 +1,161 @@ +package options + +import ( + "errors" + "fmt" + "net/http" + + "github.com/googleapis/gax-go/v2" + + "google.golang.org/api/option" + + "github.com/coinbase/staking-client-library-go/auth" + "github.com/coinbase/staking-client-library-go/client/transport" +) + +// StakingClientConfig stores configuration information about a Staking client. +type StakingClientConfig struct { + Endpoint string + ServiceName string + APIKey *auth.APIKey + HTTPClient *http.Client + ClientOptions []option.ClientOption + Insecure bool +} + +// StakingClientOption is a function that applies changes to a clientConfig. +type StakingClientOption func(c *StakingClientConfig) + +// WithEndpoint returns an option to set the service endpoint. +func WithEndpoint(endpoint string) StakingClientOption { + return func(c *StakingClientConfig) { + c.Endpoint = endpoint + } +} + +// WithAPIKey returns an option to set the Coinbase Cloud API Key. +func WithAPIKey(apiKey *auth.APIKey) StakingClientOption { + return func(c *StakingClientConfig) { + c.APIKey = apiKey + } +} + +// WithInsecure returns an option to set the insecure flag. +// If insecure is set to true, the client will not use transport authentication. +func WithInsecure(insecure bool) StakingClientOption { + return func(c *StakingClientConfig) { + c.Insecure = insecure + } +} + +// WithHTTPClient returns an option to set the HTTP Client. +func WithHTTPClient(httpClient *http.Client) StakingClientOption { + return func(c *StakingClientConfig) { + c.HTTPClient = httpClient + } +} + +// WithClientOptions returns an option to set the inner set of ClientOptions. +func WithClientOptions(clientOptions ...option.ClientOption) StakingClientOption { + return func(c *StakingClientConfig) { + c.ClientOptions = clientOptions + } +} + +// GetConfig returns a StakingClientConfig with all the StakingClientOptions applied. +// It uses the given default endpoint if none of the options set it. +func GetConfig( + serviceName string, + defaultEndpoint string, + stakingOpts ...StakingClientOption, +) (*StakingClientConfig, error) { + config := &StakingClientConfig{} + + for _, stakingOpt := range stakingOpts { + stakingOpt(config) + } + + if config.Endpoint == "" { + config.Endpoint = defaultEndpoint + } + + if serviceName == "" { + return nil, errors.New("service name must be provided") + } + + config.ServiceName = serviceName + + return config, nil +} + +// GetClientOptions returns the list of ClientOptions based on the given endpoint, service name, +// and config. +func GetClientOptions(config *StakingClientConfig) ([]option.ClientOption, error) { + clientOptions := []option.ClientOption{} + + // Start with explicitly indicated client options. + if len(config.ClientOptions) > 0 { + clientOptions = append(clientOptions, config.ClientOptions...) + } + + if config.Endpoint == "" { + return nil, errors.New("endpoint must be provided") + } + + clientOptions = append(clientOptions, option.WithEndpoint(config.Endpoint)) + + if config.ServiceName == "" { + return nil, errors.New("service name must be provided") + } + + httpClient, err := GetHTTPClient(config.ServiceName, config) + if err != nil { + return nil, err + } + + clientOptions = append(clientOptions, option.WithHTTPClient(httpClient)) + + return clientOptions, nil +} + +// GetHTTPClient returns the HTTPClient based on the given service name and config. +func GetHTTPClient(serviceName string, config *StakingClientConfig) (*http.Client, error) { + var httpClient *http.Client + if config.HTTPClient != nil { + httpClient = config.HTTPClient + } else { + httpClient = &http.Client{} + } + + if !config.Insecure { + if httpClient.Transport == nil { + httpClient.Transport = http.DefaultTransport + } + + httpClient.Transport = transport.NewTransport( + httpClient.Transport, + serviceName, + config.APIKey, + ) + } + + return httpClient, nil +} + +// LongRunningOperation is the interface for long-running operations that is +// used to create the gax call options for interacting with LROs. +type LongRunningOperation interface { + Name() string + PathPrefix() string +} + +// LROOptions returns the call options for long-running operations. +// This overrides the gapic generated client `WithPath` call option that ignores the +// path prefix, with a call option that includes the path prefix. +func LROOptions(op LongRunningOperation, version string, opts []gax.CallOption) []gax.CallOption { + if op.PathPrefix() == "" { + return opts + } + + return append(opts, gax.WithPath(fmt.Sprintf("%s/%s/%s", op.PathPrefix(), version, op.Name()))) +} diff --git a/client/orchestration/v1/action.go b/client/orchestration/v1/action.go new file mode 100644 index 0000000..3d65845 --- /dev/null +++ b/client/orchestration/v1/action.go @@ -0,0 +1,25 @@ +package v1 + +import ( + "context" + + "github.com/googleapis/gax-go/v2" + + stakingerrors "github.com/coinbase/staking-client-library-go/client/errors" + stakingpb "github.com/coinbase/staking-client-library-go/gen/go/coinbase/staking/orchestration/v1" +) + +// ListActions lists the Actions supported by Staking API. +func (s *OrchestrationServiceClient) ListActions( + ctx context.Context, + req *stakingpb.ListActionsRequest, + opts ...gax.CallOption, +) (*stakingpb.ListActionsResponse, error) { + actions, err := s.client.ListActions(ctx, req, opts...) + if err != nil { + err := stakingerrors.FromError(err) + _ = err.Print() + } + + return actions, err +} diff --git a/client/orchestration/v1/client.go b/client/orchestration/v1/client.go new file mode 100644 index 0000000..6a66486 --- /dev/null +++ b/client/orchestration/v1/client.go @@ -0,0 +1,62 @@ +package v1 + +import ( + "context" + + "google.golang.org/grpc" + + clients "github.com/coinbase/staking-client-library-go/client/options" + innerClient "github.com/coinbase/staking-client-library-go/gen/client/coinbase/staking/orchestration/v1" +) + +const ( + // ServiceName is the name of the service used by the Authenticator. + serviceName = "staking" + + // ServiceEndpoint is the default endpoint URL to use. + serviceEndpoint = "https://api.developer.coinbase.com/staking/orchestration" +) + +// OrchestrationServiceClient is the client to use to access StakingService APIs. +type OrchestrationServiceClient struct { + client *innerClient.StakingClient +} + +// NewOrchestrationServiceClient returns a OrchestrationServiceClient based on the given inputs. +func NewOrchestrationServiceClient( + ctx context.Context, + stakingOpts ...clients.StakingClientOption, +) (*OrchestrationServiceClient, error) { + config, err := clients.GetConfig(serviceName, serviceEndpoint, stakingOpts...) + if err != nil { + return nil, err + } + + clientOptions, err := clients.GetClientOptions(config) + if err != nil { + return nil, err + } + + innerClient, err := innerClient.NewStakingRESTClient(ctx, clientOptions...) + if err != nil { + return nil, err + } + + return &OrchestrationServiceClient{ + client: innerClient, + }, nil +} + +// Close closes the connection to the API service. The user should invoke this when +// the client is no longer required. +func (s *OrchestrationServiceClient) Close() error { + return s.client.Close() +} + +// Connection returns a connection to the API service. +// +// Deprecated: Connections are now pooled so this method does not always +// return the same resource. +func (s *OrchestrationServiceClient) Connection() *grpc.ClientConn { + return s.client.Connection() +} diff --git a/client/orchestration/v1/network.go b/client/orchestration/v1/network.go new file mode 100644 index 0000000..f8cccc8 --- /dev/null +++ b/client/orchestration/v1/network.go @@ -0,0 +1,25 @@ +package v1 + +import ( + "context" + + "github.com/googleapis/gax-go/v2" + + stakingerrors "github.com/coinbase/staking-client-library-go/client/errors" + stakingpb "github.com/coinbase/staking-client-library-go/gen/go/coinbase/staking/orchestration/v1" +) + +// ListNetworks lists the Networks supported by Staking API. +func (s *OrchestrationServiceClient) ListNetworks( + ctx context.Context, + req *stakingpb.ListNetworksRequest, + opts ...gax.CallOption, +) (*stakingpb.ListNetworksResponse, error) { + networks, err := s.client.ListNetworks(ctx, req, opts...) + if err != nil { + err := stakingerrors.FromError(err) + _ = err.Print() + } + + return networks, err +} diff --git a/client/orchestration/v1/protocol.go b/client/orchestration/v1/protocol.go new file mode 100644 index 0000000..7d92b25 --- /dev/null +++ b/client/orchestration/v1/protocol.go @@ -0,0 +1,25 @@ +package v1 + +import ( + "context" + + "github.com/googleapis/gax-go/v2" + + stakingerrors "github.com/coinbase/staking-client-library-go/client/errors" + stakingpb "github.com/coinbase/staking-client-library-go/gen/go/coinbase/staking/orchestration/v1" +) + +// ListProtocols lists the Protocols supported by Staking API. +func (s *OrchestrationServiceClient) ListProtocols( + ctx context.Context, + req *stakingpb.ListProtocolsRequest, + opts ...gax.CallOption, +) (*stakingpb.ListProtocolsResponse, error) { + protocols, err := s.client.ListProtocols(ctx, req, opts...) + if err != nil { + err := stakingerrors.FromError(err) + _ = err.Print() + } + + return protocols, err +} diff --git a/client/orchestration/v1/staking_target.go b/client/orchestration/v1/staking_target.go new file mode 100644 index 0000000..6544d4d --- /dev/null +++ b/client/orchestration/v1/staking_target.go @@ -0,0 +1,73 @@ +package v1 + +import ( + "context" + "errors" + + "github.com/googleapis/gax-go/v2" + + "google.golang.org/api/iterator" + + stakingerrors "github.com/coinbase/staking-client-library-go/client/errors" + innerClient "github.com/coinbase/staking-client-library-go/gen/client/coinbase/staking/orchestration/v1" + stakingpb "github.com/coinbase/staking-client-library-go/gen/go/coinbase/staking/orchestration/v1" +) + +// StakingTargetIterator is an interface for iterating through the response to ListStakingTargets. +type StakingTargetIterator interface { + // PageInfo supports pagination. See the google.golang.org/api/iterator package for details. + PageInfo() *iterator.PageInfo + + // Next returns the next result. Its second return value is iterator.Done if there are no more + // results. Once Next returns Done, all subsequent calls will return Done. + Next() (*stakingpb.StakingTarget, error) + + // Response is the raw response for the current page. + // Calling Next() or InternalFetch() updates this value. + Response() *stakingpb.ListStakingTargetsResponse +} + +// StakingTargetIteratorImpl is an implementation of StakingTargetIterator that unwraps correctly. +type StakingTargetIteratorImpl struct { + iter *innerClient.StakingTargetIterator +} + +// PageInfo supports pagination. See the google.golang.org/api/iterator package for details. +func (n *StakingTargetIteratorImpl) PageInfo() *iterator.PageInfo { + return n.iter.PageInfo() +} + +// Next returns the next result. Its second return value is iterator.Done if there are no more +// results. Once Next returns Done, all subsequent calls will return Done. +func (n *StakingTargetIteratorImpl) Next() (*stakingpb.StakingTarget, error) { + stakingTarget, err := n.iter.Next() + if errors.Is(err, iterator.Done) || err == nil { + return stakingTarget, err + } + + return stakingTarget, stakingerrors.FromError(err) +} + +// Response is the raw response for the current page. +// Calling Next() or InternalFetch() updates this value. +func (n *StakingTargetIteratorImpl) Response() *stakingpb.ListStakingTargetsResponse { + if n.iter.Response == nil { + return nil + } + + response, ok := n.iter.Response.(*stakingpb.ListStakingTargetsResponse) + if !ok { + return nil + } + + return response +} + +// ListStakingTargets lists the StakingTargets supported by Staking API. +func (s *OrchestrationServiceClient) ListStakingTargets( + ctx context.Context, + req *stakingpb.ListStakingTargetsRequest, + opts ...gax.CallOption, +) StakingTargetIterator { + return &StakingTargetIteratorImpl{iter: s.client.ListStakingTargets(ctx, req, opts...)} +} diff --git a/client/orchestration/v1/view_staking_context.go b/client/orchestration/v1/view_staking_context.go new file mode 100644 index 0000000..60c44fd --- /dev/null +++ b/client/orchestration/v1/view_staking_context.go @@ -0,0 +1,27 @@ +package v1 + +import ( + "context" + + "github.com/googleapis/gax-go/v2" + + stakingerrors "github.com/coinbase/staking-client-library-go/client/errors" + stakingpb "github.com/coinbase/staking-client-library-go/gen/go/coinbase/staking/orchestration/v1" +) + +// ViewStakingContext helps view staking context information given a specific network address. +func (s *OrchestrationServiceClient) ViewStakingContext( + ctx context.Context, + req *stakingpb.ViewStakingContextRequest, + opts ...gax.CallOption, +) (*stakingpb.ViewStakingContextResponse, error) { + response, err := s.client.ViewStakingContext(ctx, req, opts...) + if err == nil { + return response, nil + } + + sae := stakingerrors.FromError(err) + _ = sae.Print() + + return nil, sae +} diff --git a/client/orchestration/v1/workflow.go b/client/orchestration/v1/workflow.go new file mode 100644 index 0000000..c285642 --- /dev/null +++ b/client/orchestration/v1/workflow.go @@ -0,0 +1,137 @@ +package v1 + +import ( + "context" + "errors" + + "github.com/googleapis/gax-go/v2" + + "google.golang.org/api/iterator" + + stakingerrors "github.com/coinbase/staking-client-library-go/client/errors" + innerClient "github.com/coinbase/staking-client-library-go/gen/client/coinbase/staking/orchestration/v1" + stakingpb "github.com/coinbase/staking-client-library-go/gen/go/coinbase/staking/orchestration/v1" +) + +// CreateWorkflow starts a workflow with the given protocol specific parameters. +func (s *OrchestrationServiceClient) CreateWorkflow( + ctx context.Context, + req *stakingpb.CreateWorkflowRequest, + opts ...gax.CallOption, +) (*stakingpb.Workflow, error) { + wf, err := s.client.CreateWorkflow(ctx, req, opts...) + if err == nil { + return wf, nil + } + + sae := stakingerrors.FromError(err) + _ = sae.Print() + + return wf, sae +} + +// GetWorkflow get the current state of a workflow. +func (s *OrchestrationServiceClient) GetWorkflow( + ctx context.Context, + req *stakingpb.GetWorkflowRequest, + opts ...gax.CallOption, +) (*stakingpb.Workflow, error) { + wf, err := s.client.GetWorkflow(ctx, req, opts...) + if err == nil { + return wf, nil + } + + sae := stakingerrors.FromError(err) + _ = sae.Print() + + return wf, sae +} + +// WorkflowIterator is an interface for iterating through the response to ListWorkflows. +type WorkflowIterator interface { + // PageInfo supports pagination. See the google.golang.org/api/iterator package for details. + PageInfo() *iterator.PageInfo + + // Next returns the next result. Its second return value is iterator.Done if there are no more + // results. Once Next returns Done, all subsequent calls will return Done. + Next() (*stakingpb.Workflow, error) + + // Response is the raw response for the current page. + // Calling Next() or InternalFetch() updates this value. + Response() *stakingpb.ListWorkflowsResponse +} + +// WorkflowIteratorImpl is an implementation of WorkflowIterator that unwraps correctly. +type WorkflowIteratorImpl struct { + iter *innerClient.WorkflowIterator +} + +// PageInfo supports pagination. See the google.golang.org/api/iterator package for details. +func (n *WorkflowIteratorImpl) PageInfo() *iterator.PageInfo { + return n.iter.PageInfo() +} + +// Next returns the next result. Its second return value is iterator.Done if there are no more +// results. Once Next returns Done, all subsequent calls will return Done. +func (n *WorkflowIteratorImpl) Next() (*stakingpb.Workflow, error) { + workflow, err := n.iter.Next() + if errors.Is(err, iterator.Done) || err == nil { + return workflow, err + } + + return workflow, stakingerrors.FromError(err) +} + +// Response is the raw response for the current page. +// Calling Next() or InternalFetch() updates this value. +func (n *WorkflowIteratorImpl) Response() *stakingpb.ListWorkflowsResponse { + if n.iter.Response == nil { + return nil + } + + response, ok := n.iter.Response.(*stakingpb.ListWorkflowsResponse) + if !ok { + return nil + } + + return response +} + +// ListWorkflows lists the Workflows supported by Staking API. +func (s *OrchestrationServiceClient) ListWorkflows( + ctx context.Context, + req *stakingpb.ListWorkflowsRequest, + opts ...gax.CallOption, +) WorkflowIterator { + return &WorkflowIteratorImpl{iter: s.client.ListWorkflows(ctx, req, opts...)} +} + +// PerformWorkflowStep helps update workflow move to the next state by returning the signed tx back. +func (s *OrchestrationServiceClient) PerformWorkflowStep( + ctx context.Context, + req *stakingpb.PerformWorkflowStepRequest, + opts ...gax.CallOption, +) (*stakingpb.Workflow, error) { + wf, err := s.client.PerformWorkflowStep(ctx, req, opts...) + if err == nil { + return wf, nil + } + + sae := stakingerrors.FromError(err) + _ = sae.Print() + + return wf, sae +} + +func WorkflowFinished(workflow *stakingpb.Workflow) bool { + return workflow.State == stakingpb.Workflow_STATE_COMPLETED || + workflow.State == stakingpb.Workflow_STATE_FAILED +} + +func WorkflowWaitingForSigning(workflow *stakingpb.Workflow) bool { + return workflow.State == stakingpb.Workflow_STATE_WAITING_FOR_SIGNING +} + +func WorkflowWaitingForExternalBroadcast(workflow *stakingpb.Workflow) bool { + return workflow.State == stakingpb.Workflow_STATE_WAITING_FOR_EXT_BROADCAST +} diff --git a/client/rewards/v1/client.go b/client/rewards/v1/client.go new file mode 100644 index 0000000..b8d0702 --- /dev/null +++ b/client/rewards/v1/client.go @@ -0,0 +1,59 @@ +package v1 + +import ( + "context" + + "google.golang.org/grpc" + + clients "github.com/coinbase/staking-client-library-go/client/options" + innerClient "github.com/coinbase/staking-client-library-go/gen/client/coinbase/staking/rewards/v1" +) + +const ( + // ServiceEndpoint is the endpoint the client will use. + serviceEndpoint = "https://api.developer.coinbase.com/staking/rewards" +) + +// RewardsServiceClient is the client to use to access StakingService APIs. +type RewardsServiceClient struct { + client *innerClient.RewardClient +} + +// NewRewardsServiceClient returns a RewardsServiceClient based on the given inputs. +func NewRewardsServiceClient( + ctx context.Context, + stakingOpts ...clients.StakingClientOption, +) (*RewardsServiceClient, error) { + config, err := clients.GetConfig("rewards-reporting", serviceEndpoint, stakingOpts...) + if err != nil { + return nil, err + } + + clientOptions, err := clients.GetClientOptions(config) + if err != nil { + return nil, err + } + + innerClient, err := innerClient.NewRewardRESTClient(ctx, clientOptions...) + if err != nil { + return nil, err + } + + return &RewardsServiceClient{ + client: innerClient, + }, nil +} + +// Close closes the connection to the API service. The user should invoke this when +// the client is no longer required. +func (s *RewardsServiceClient) Close() error { + return s.client.Close() +} + +// Connection returns a connection to the API service. +// +// Deprecated: Connections are now pooled so this method does not always +// return the same resource. +func (s *RewardsServiceClient) Connection() *grpc.ClientConn { + return s.client.Connection() +} diff --git a/client/rewards/v1/reward.go b/client/rewards/v1/reward.go new file mode 100644 index 0000000..de7005a --- /dev/null +++ b/client/rewards/v1/reward.go @@ -0,0 +1,73 @@ +package v1 + +import ( + "context" + "errors" + + "github.com/googleapis/gax-go/v2" + + "google.golang.org/api/iterator" + + stakingerrors "github.com/coinbase/staking-client-library-go/client/errors" + innerClient "github.com/coinbase/staking-client-library-go/gen/client/coinbase/staking/rewards/v1" + stakingpb "github.com/coinbase/staking-client-library-go/gen/go/coinbase/staking/rewards/v1" +) + +// RewardIterator is an interface for iterating through the response to ListRewards. +type RewardIterator interface { + // PageInfo supports pagination. See the google.golang.org/api/iterator package for details. + PageInfo() *iterator.PageInfo + + // Next returns the next result. Its second return value is iterator.Done if there are no more + // results. Once Next returns Done, all subsequent calls will return Done. + Next() (*stakingpb.Reward, error) + + // Response is the raw response for the current page. + // Calling Next() or InternalFetch() updates this value. + Response() *stakingpb.ListRewardsResponse +} + +// RewardIteratorImpl is an implementation of RewardIterator that unwraps correctly. +type RewardIteratorImpl struct { + iter *innerClient.RewardIterator +} + +// PageInfo supports pagination. See the google.golang.org/api/iterator package for details. +func (n *RewardIteratorImpl) PageInfo() *iterator.PageInfo { + return n.iter.PageInfo() +} + +// Next returns the next result. Its second return value is iterator.Done if there are no more +// results. Once Next returns Done, all subsequent calls will return Done. +func (n *RewardIteratorImpl) Next() (*stakingpb.Reward, error) { + reward, err := n.iter.Next() + if errors.Is(err, iterator.Done) || err == nil { + return reward, err + } + + return reward, stakingerrors.FromError(err) +} + +// Response is the raw response for the current page. +// Calling Next() or InternalFetch() updates this value. +func (n *RewardIteratorImpl) Response() *stakingpb.ListRewardsResponse { + if n.iter.Response == nil { + return nil + } + + response, ok := n.iter.Response.(*stakingpb.ListRewardsResponse) + if !ok { + return nil + } + + return response +} + +// ListRewards helps list onchain rewards of an address for a specific protocol, with optional filters for time range, aggregation period, and more. +func (s *RewardsServiceClient) ListRewards( + ctx context.Context, + req *stakingpb.ListRewardsRequest, + opts ...gax.CallOption, +) RewardIterator { + return &RewardIteratorImpl{iter: s.client.ListRewards(ctx, req, opts...)} +} diff --git a/client/rewards/v1/reward_filter.go b/client/rewards/v1/reward_filter.go new file mode 100644 index 0000000..00dd5bb --- /dev/null +++ b/client/rewards/v1/reward_filter.go @@ -0,0 +1,133 @@ +package v1 + +import ( + "time" + + "github.com/coinbase/staking-client-library-go/client/filter" +) + +// AddressFilter is a custom type to define filter operation on the address field. +type AddressFilter struct{} + +// Eq method is a custom method to define the equals operation on the address field. +func (AddressFilter) Eq(value string) *filter.Term { + return filter.NewTerm("address", filter.Equals, value) +} + +// WithAddress instructs the backend API to return rewards aggregations that have `address` set in a manner which matches the desired filter. +// Needs a companion equals operator to be functional (ex: WithAddress().Eq("my_address"). +func WithAddress() AddressFilter { + return AddressFilter{} +} + +// EpochFilter is a custom type to define filter operation on the epoch field. +type EpochFilter struct{} + +// Eq method is a custom method to define the equals operation on the epoch field. +func (EpochFilter) Eq(value int) *filter.Term { + return filter.NewTerm("epoch", filter.Equals, value) +} + +// Neq method is a custom method to define the not equals operation on the epoch field. +func (EpochFilter) Neq(value int) *filter.Term { + return filter.NewTerm("epoch", filter.NotEquals, value) +} + +// Gt method is a custom method to define the greater than operation on the epoch field. +func (EpochFilter) Gt(value int) *filter.Term { + return filter.NewTerm("epoch", filter.GreaterThan, value) +} + +// Gte method is a custom method to define the greater than or equals operation on the epoch field. +func (EpochFilter) Gte(value int) *filter.Term { + return filter.NewTerm("epoch", filter.GreaterEquals, value) +} + +// Lt method is a custom method to define the less than operation on the epoch field. +func (EpochFilter) Lt(value int) *filter.Term { + return filter.NewTerm("epoch", filter.LessThan, value) +} + +// Lte method is a custom method to define the less than or equals operation on the epoch field. +func (EpochFilter) Lte(value int) *filter.Term { + return filter.NewTerm("epoch", filter.LessEquals, value) +} + +// WithEpoch instructs the backend API to return rewards aggregations that have `epoch` set in a manner which matches the desired filter. +// Needs a companion comparison operator (ex: >, <, =, etc) to be functional. +func WithEpoch() EpochFilter { + return EpochFilter{} +} + +// DateFilter is a custom type to define filter operation on the date. +type DateFilter struct{} + +// Eq method is a custom method to define the equals operation on the date. +func (DateFilter) Eq(value string) *filter.Term { + return filter.NewTerm("date", filter.Equals, value) +} + +// Neq method is a custom method to define the not equals operation on the date. +func (DateFilter) Neq(value string) *filter.Term { + return filter.NewTerm("date", filter.NotEquals, value) +} + +// Gt method is a custom method to define the greater than operation on the date. +func (DateFilter) Gt(value string) *filter.Term { + return filter.NewTerm("date", filter.GreaterThan, value) +} + +// Gte method is a custom method to define the greater than or equals operation on the date. +func (DateFilter) Gte(value string) *filter.Term { + return filter.NewTerm("date", filter.GreaterEquals, value) +} + +// Lt method is a custom method to define the less than operation on the date. +func (DateFilter) Lt(value string) *filter.Term { + return filter.NewTerm("date", filter.LessThan, value) +} + +// Lte method is a custom method to define the less than or equals operation on the date. +func (DateFilter) Lte(value string) *filter.Term { + return filter.NewTerm("date", filter.LessEquals, value) +} + +// WithDate instructs the backend API to return rewards aggregations that have `date` set in a manner which matches the desired filter. +// Needs a companion comparison operator (ex: >, <, =, etc) to be functional. +func WithDate() DateFilter { + return DateFilter{} +} + +// PeriodEndTimeFilter is a custom type to define filter operation on the period_end_time field. +type PeriodEndTimeFilter struct{} + +// Eq method is a custom method to define the equals operation on the period_end_time field. +func (PeriodEndTimeFilter) Eq(value time.Time) *filter.Term { + return filter.NewTerm("period_end_time", filter.Equals, value) +} + +// Gt method is a custom method to define the greater than operation on the period_end_time field. +func (PeriodEndTimeFilter) Gt(value time.Time) *filter.Term { + return filter.NewTerm("period_end_time", filter.GreaterThan, value) +} + +// Gte method is a custom method to define the greater than or equals operation on the period_end_time field. +func (PeriodEndTimeFilter) Gte(value time.Time) *filter.Term { + return filter.NewTerm("period_end_time", filter.GreaterEquals, value) +} + +// Lt method is a custom method to define the less than operation on the period_end_time field. +func (PeriodEndTimeFilter) Lt(value time.Time) *filter.Term { + return filter.NewTerm("period_end_time", filter.LessThan, value) +} + +// Lte method is a custom method to define the less than or equals operation on the period_end_time field. +func (PeriodEndTimeFilter) Lte(value time.Time) *filter.Term { + return filter.NewTerm("period_end_time", filter.LessEquals, value) +} + +// Instructs the backend API to return rewards aggregations that have `period_end_time` set in a manner which matches the desired filter. +// Needs a companion comparison operator (ex: >, <, =, etc) to be functional. +func WithPeriodEndTime() PeriodEndTimeFilter { + return PeriodEndTimeFilter{} +} diff --git a/client/rewards/v1/reward_filter_test.go b/client/rewards/v1/reward_filter_test.go new file mode 100644 index 0000000..8aff925 --- /dev/null +++ b/client/rewards/v1/reward_filter_test.go @@ -0,0 +1,71 @@ +package v1 + +import ( + "fmt" + "testing" + "time" + + "github.com/stretchr/testify/assert" +) + +func TestRewardFilter(t *testing.T) { + f := WithAddress().Eq("abcd").String() + assert.Equal(t, "address = 'abcd'", f) + + f = WithEpoch().Eq(10).String() + assert.Equal(t, "epoch = 10", f) + + f = WithAddress().Eq("abcd").And(WithEpoch().Lt(10)).String() + assert.Equal(t, "(address = 'abcd' AND epoch < 10)", f) + + f = WithAddress().Eq("abcd").And(WithEpoch().Lte(10)).String() + assert.Equal(t, "(address = 'abcd' AND epoch <= 10)", f) + + f = WithAddress().Eq("abcd").And(WithEpoch().Gt(10)).String() + assert.Equal(t, "(address = 'abcd' AND epoch > 10)", f) + + f = WithAddress().Eq("abcd").And(WithEpoch().Gte(10)).String() + assert.Equal(t, "(address = 'abcd' AND epoch >= 10)", f) + + f = WithAddress().Eq("abcd").And(WithEpoch().Neq(10)).String() + assert.Equal(t, "(address = 'abcd' AND epoch != 10)", f) + + f = WithDate().Eq("2020-01-01").String() + assert.Equal(t, "date = '2020-01-01'", f) + + f = WithAddress().Eq("abcd").And(WithDate().Lt("2020-01-01")).String() + assert.Equal(t, "(address = 'abcd' AND date < '2020-01-01')", f) + + f = WithAddress().Eq("abcd").And(WithDate().Lte("2020-01-01")).String() + assert.Equal(t, "(address = 'abcd' AND date <= '2020-01-01')", f) + + f = WithAddress().Eq("abcd").And(WithDate().Gt("2020-01-01")).String() + assert.Equal(t, "(address = 'abcd' AND date > '2020-01-01')", f) + + f = WithAddress().Eq("abcd").And(WithDate().Gte("2020-01-01")).String() + assert.Equal(t, "(address = 'abcd' AND date >= '2020-01-01')", f) + + f = WithAddress().Eq("abcd").And(WithDate().Neq("2020-01-01")).String() + assert.Equal(t, "(address = 'abcd' AND date != '2020-01-01')", f) + + now := time.Now() + fiveDaysAgo := now.AddDate(0, 0, -5) + + nowRFC3339 := now.Format(time.RFC3339) + fiveDaysAgoRFC3339 := fiveDaysAgo.Format(time.RFC3339) + + f = WithPeriodEndTime().Eq(fiveDaysAgo).String() + assert.Equal(t, fmt.Sprintf("period_end_time = '%s'", fiveDaysAgoRFC3339), f) + + f = WithAddress().Eq("abcd").And(WithPeriodEndTime().Lt(fiveDaysAgo)).String() + assert.Equal(t, fmt.Sprintf("(address = 'abcd' AND period_end_time < '%s')", fiveDaysAgoRFC3339), f) + + f = WithAddress().Eq("abcd").And(WithPeriodEndTime().Lte(fiveDaysAgo)).String() + assert.Equal(t, fmt.Sprintf("(address = 'abcd' AND period_end_time <= '%s')", fiveDaysAgoRFC3339), f) + + f = WithAddress().Eq("abcd").And(WithPeriodEndTime().Gt(fiveDaysAgo)).String() + assert.Equal(t, fmt.Sprintf("(address = 'abcd' AND period_end_time > '%s')", fiveDaysAgoRFC3339), f) + + f = WithAddress().Eq("abcd").And(WithPeriodEndTime().Gte(fiveDaysAgo)).And(WithPeriodEndTime().Lt(now)).String() + assert.Equal(t, fmt.Sprintf("(address = 'abcd' AND period_end_time >= '%s' AND period_end_time < '%s')", fiveDaysAgoRFC3339, nowRFC3339), f) +} diff --git a/client/rewards/v1/stake.go b/client/rewards/v1/stake.go new file mode 100644 index 0000000..5096c8b --- /dev/null +++ b/client/rewards/v1/stake.go @@ -0,0 +1,73 @@ +package v1 + +import ( + "context" + "errors" + + "github.com/googleapis/gax-go/v2" + + "google.golang.org/api/iterator" + + stakingerrors "github.com/coinbase/staking-client-library-go/client/errors" + innerClient "github.com/coinbase/staking-client-library-go/gen/client/coinbase/staking/rewards/v1" + stakingpb "github.com/coinbase/staking-client-library-go/gen/go/coinbase/staking/rewards/v1" +) + +// StakeIterator is an interface for iterating through the response to ListStakes. +type StakeIterator interface { + // PageInfo supports pagination. See the google.golang.org/api/iterator package for details. + PageInfo() *iterator.PageInfo + + // Next returns the next result. Its second return value is iterator.Done if there are no more + // results. Once Next returns Done, all subsequent calls will return Done. + Next() (*stakingpb.Stake, error) + + // Response is the raw response for the current page. + // Calling Next() or InternalFetch() updates this value. + Response() *stakingpb.ListStakesResponse +} + +// StakeIteratorImpl is an implementation of StakeIterator that unwraps correctly. +type StakeIteratorImpl struct { + iter *innerClient.StakeIterator +} + +// PageInfo supports pagination. See the google.golang.org/api/iterator package for details. +func (n *StakeIteratorImpl) PageInfo() *iterator.PageInfo { + return n.iter.PageInfo() +} + +// Next returns the next result. Its second return value is iterator.Done if there are no more +// results. Once Next returns Done, all subsequent calls will return Done. +func (n *StakeIteratorImpl) Next() (*stakingpb.Stake, error) { + reward, err := n.iter.Next() + if errors.Is(err, iterator.Done) || err == nil { + return reward, err + } + + return reward, stakingerrors.FromError(err) +} + +// Response is the raw response for the current page. +// Calling Next() or InternalFetch() updates this value. +func (n *StakeIteratorImpl) Response() *stakingpb.ListStakesResponse { + if n.iter.Response == nil { + return nil + } + + response, ok := n.iter.Response.(*stakingpb.ListStakesResponse) + if !ok { + return nil + } + + return response +} + +// ListStakes list staking activities for a given protocol. +func (s *RewardsServiceClient) ListStakes( + ctx context.Context, + req *stakingpb.ListStakesRequest, + opts ...gax.CallOption, +) StakeIterator { + return &StakeIteratorImpl{iter: s.client.ListStakes(ctx, req, opts...)} +} diff --git a/client/transport/transport.go b/client/transport/transport.go new file mode 100644 index 0000000..877058f --- /dev/null +++ b/client/transport/transport.go @@ -0,0 +1,45 @@ +package transport + +import ( + "fmt" + "net/http" + + "github.com/coinbase/staking-client-library-go/auth" +) + +// Transport implements the http.RoundTripper interface for use by Staking HTTP clients. +type Transport struct { + roundTripper http.RoundTripper + authenticator *auth.Authenticator + serviceName string +} + +// NewTransport returns new transport based on the given inputs. +func NewTransport( + roundTripper http.RoundTripper, + serviceName string, + apiKey *auth.APIKey, +) *Transport { + return &Transport{ + roundTripper: roundTripper, + authenticator: auth.NewAuthenticator(apiKey), + serviceName: serviceName, + } +} + +// RoundTrip implements the http.RoundTripper interface and wraps +// the base round tripper with logic to inject the API key auth-based HTTP headers +// into the request. Reference: https://pkg.go.dev/net/http#RoundTripper +func (t *Transport) RoundTrip(req *http.Request) (*http.Response, error) { + jwt, err := t.authenticator.BuildJWT( + t.serviceName, + fmt.Sprintf("%s %s%s", req.Method, req.URL.Host, req.URL.Path), + ) + if err != nil { + return nil, fmt.Errorf("error building data for auth header: %w", err) + } + + req.Header.Set("Authorization", fmt.Sprintf("Bearer %s", jwt)) + + return t.roundTripper.RoundTrip(req) +} diff --git a/docs/images/banner.svg b/docs/images/banner.svg new file mode 100644 index 0000000..0fd3aa8 --- /dev/null +++ b/docs/images/banner.svg @@ -0,0 +1,110 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/openapi/orchestration.swagger.json b/docs/openapi/orchestration.swagger.json new file mode 100644 index 0000000..39d3a86 --- /dev/null +++ b/docs/openapi/orchestration.swagger.json @@ -0,0 +1,1493 @@ +{ + "swagger": "2.0", + "info": { + "title": "Orchestration Service", + "description": "Service that can power non-custodial staking experiences for your users.", + "version": "v1" + }, + "tags": [ + { + "name": "Protocol", + "description": "Protocols details" + }, + { + "name": "Network", + "description": "Networks details" + }, + { + "name": "Action", + "description": "Actions details" + }, + { + "name": "StakingTarget", + "description": "Staking targets details" + }, + { + "name": "StakingContext", + "description": "Staking context details" + }, + { + "name": "Workflow", + "description": "Workflow management details" + }, + { + "name": "StakingService" + } + ], + "host": "api.developer.coinbase.com", + "basePath": "/staking", + "schemes": [ + "https" + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": { + "/v1/protocols": { + "get": { + "summary": "List supported protocols", + "description": "List supported protocols", + "operationId": "listProtocols", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1ListProtocolsResponse" + } + }, + "400": { + "description": "The request attempted has invalid parameters", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + }, + "401": { + "description": "Returned if authentication information is invalid", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + }, + "403": { + "description": "Returned when a user does not have permission to the resource.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + }, + "404": { + "description": "Returned when a resource is not found.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + }, + "429": { + "description": "Returned when a resource limit has been reached.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + }, + "500": { + "description": "Returned when an internal server error happens.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "tags": [ + "Protocol" + ] + } + }, + "/v1/viewStakingContext:view": { + "get": { + "summary": "Returns point-in-time context of staking data for an address", + "description": "Returns point-in-time context of staking data for an address", + "operationId": "ViewStakingContext", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1ViewStakingContextResponse" + } + }, + "400": { + "description": "The request attempted has invalid parameters", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + }, + "401": { + "description": "Returned if authentication information is invalid", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + }, + "403": { + "description": "Returned when a user does not have permission to the resource.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + }, + "404": { + "description": "Returned when a resource is not found.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + }, + "429": { + "description": "Returned when a resource limit has been reached.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + }, + "500": { + "description": "Returned when an internal server error happens.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "address", + "description": "The address to fetch staking context for.", + "in": "query", + "required": true, + "type": "string" + }, + { + "name": "network", + "description": "The network to fetch staking context for.", + "in": "query", + "required": true, + "type": "string" + }, + { + "name": "ethereumKilnStakingContextParameters.integratorContractAddress", + "description": "Integrator contract address.", + "in": "query", + "required": false, + "type": "string" + } + ], + "tags": [ + "StakingContext" + ] + } + }, + "/v1/{name}": { + "get": { + "summary": "Get workflow", + "operationId": "getWorkflow", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1Workflow" + } + }, + "400": { + "description": "The request attempted has invalid parameters", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + }, + "401": { + "description": "Returned if authentication information is invalid", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + }, + "403": { + "description": "Returned when a user does not have permission to the resource.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + }, + "404": { + "description": "Returned when a resource is not found.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + }, + "429": { + "description": "Returned when a resource limit has been reached.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + }, + "500": { + "description": "Returned when an internal server error happens.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "name", + "description": "The resource name of the workflow.\nFormat: projects/{project}/workflows/{workflow}", + "in": "path", + "required": true, + "type": "string", + "pattern": "projects/[^/]+/workflows/[^/]+" + } + ], + "tags": [ + "Workflow" + ] + } + }, + "/v1/{name}/step": { + "post": { + "summary": "Perform the next step in a workflow", + "description": "Perform the next step in a workflow", + "operationId": "updateWorkflow", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1Workflow" + } + }, + "400": { + "description": "The request attempted has invalid parameters", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + }, + "401": { + "description": "Returned if authentication information is invalid", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + }, + "403": { + "description": "Returned when a user does not have permission to the resource.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + }, + "404": { + "description": "Returned when a resource is not found.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + }, + "429": { + "description": "Returned when a resource limit has been reached.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + }, + "500": { + "description": "Returned when an internal server error happens.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "name", + "description": "The resource name of the workflow.\nFormat: projects/{project}/workflows/{workflow}", + "in": "path", + "required": true, + "type": "string", + "pattern": "projects/[^/]+/workflows/[^/]+" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/StakingServicePerformWorkflowStepBody" + } + } + ], + "tags": [ + "Workflow" + ] + } + }, + "/v1/{parent}/actions": { + "get": { + "summary": "List supported actions", + "description": "List supported actions", + "operationId": "listActions", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1ListActionsResponse" + } + }, + "400": { + "description": "The request attempted has invalid parameters", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + }, + "401": { + "description": "Returned if authentication information is invalid", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + }, + "403": { + "description": "Returned when a user does not have permission to the resource.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + }, + "404": { + "description": "Returned when a resource is not found.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + }, + "429": { + "description": "Returned when a resource limit has been reached.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + }, + "500": { + "description": "Returned when an internal server error happens.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "parent", + "description": "The resource name of the parent that owns\nthe collection of actions.\nFormat: protocols/{protocol}/networks/{network}", + "in": "path", + "required": true, + "type": "string", + "pattern": "protocols/[^/]+/networks/[^/]+" + } + ], + "tags": [ + "Action" + ] + } + }, + "/v1/{parent}/networks": { + "get": { + "summary": "List supported networks", + "description": "List supported networks", + "operationId": "listNetworks", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1ListNetworksResponse" + } + }, + "400": { + "description": "The request attempted has invalid parameters", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + }, + "401": { + "description": "Returned if authentication information is invalid", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + }, + "403": { + "description": "Returned when a user does not have permission to the resource.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + }, + "404": { + "description": "Returned when a resource is not found.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + }, + "429": { + "description": "Returned when a resource limit has been reached.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + }, + "500": { + "description": "Returned when an internal server error happens.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "parent", + "description": "The resource name of the parent that owns\nthe collection of networks.\nFormat: protocols/{protocol}", + "in": "path", + "required": true, + "type": "string", + "pattern": "protocols/[^/]+" + } + ], + "tags": [ + "Network" + ] + } + }, + "/v1/{parent}/stakingTargets": { + "get": { + "summary": "List supported staking targets", + "description": "List supported staking targets", + "operationId": "listStakingTargets", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1ListStakingTargetsResponse" + } + }, + "400": { + "description": "The request attempted has invalid parameters", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + }, + "401": { + "description": "Returned if authentication information is invalid", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + }, + "403": { + "description": "Returned when a user does not have permission to the resource.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + }, + "404": { + "description": "Returned when a resource is not found.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + }, + "429": { + "description": "Returned when a resource limit has been reached.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + }, + "500": { + "description": "Returned when an internal server error happens.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "parent", + "description": "The resource name of the parent that owns\nthe collection of staking targets.\nFormat: protocols/{protocol}/networks/{network}", + "in": "path", + "required": true, + "type": "string", + "pattern": "protocols/[^/]+/networks/[^/]+" + }, + { + "name": "pageSize", + "description": "The maximum number of staking targets to return. The service may\nreturn fewer than this value.\n\nIf unspecified, 100 staking targets will be returned.\nThe maximum value is 1000; values over 1000 will be floored to 1000.", + "in": "query", + "required": false, + "type": "integer", + "format": "int32" + }, + { + "name": "pageToken", + "description": "A page token as part of the response of a previous call.\nProvide this to retrieve the next page.\n\nWhen paginating, all other parameters must match the previous\nrequest to list resources.", + "in": "query", + "required": false, + "type": "string" + } + ], + "tags": [ + "StakingTarget" + ] + } + }, + "/v1/{parent}/workflows": { + "get": { + "summary": "List supported workflows", + "operationId": "listWorkflows", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1ListWorkflowsResponse" + } + }, + "400": { + "description": "The request attempted has invalid parameters", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + }, + "401": { + "description": "Returned if authentication information is invalid", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + }, + "403": { + "description": "Returned when a user does not have permission to the resource.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + }, + "404": { + "description": "Returned when a resource is not found.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + }, + "429": { + "description": "Returned when a resource limit has been reached.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + }, + "500": { + "description": "Returned when an internal server error happens.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "parent", + "description": "The resource name of the parent that owns\nthe collection of networks.\nFormat: projects/{project}", + "in": "path", + "required": true, + "type": "string", + "pattern": "projects/[^/]+" + }, + { + "name": "filter", + "description": "[AIP-160](https://google.aip.dev/160) filter\nSupported fields:\n- string action: \"stake\", \"unstake\"\n- string protocol: \"ethereum_kiln\"\n- string network: \"holesky\", \"mainnet\"", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "pageSize", + "description": "The maximum number of workflows to return. The service may\nreturn fewer than this value.\n\nIf unspecified, 100 workflows will be returned.\nThe maximum value is 1000; values over 1000 will be floored to 1000.", + "in": "query", + "required": false, + "type": "integer", + "format": "int32" + }, + { + "name": "pageToken", + "description": "A page token as part of the response of a previous call.\nProvide this to retrieve the next page.\n\nWhen paginating, all other parameters must match the previous\nrequest to list resources.", + "in": "query", + "required": false, + "type": "string" + } + ], + "tags": [ + "Workflow" + ] + }, + "post": { + "summary": "Create workflow", + "operationId": "createWorkflow", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1Workflow" + } + }, + "400": { + "description": "The request attempted has invalid parameters", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + }, + "401": { + "description": "Returned if authentication information is invalid", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + }, + "403": { + "description": "Returned when a user does not have permission to the resource.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + }, + "404": { + "description": "Returned when a resource is not found.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + }, + "429": { + "description": "Returned when a resource limit has been reached.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + }, + "500": { + "description": "Returned when an internal server error happens.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "parent", + "description": "The resource name of the parent that owns\nthe workflow.\nFormat: projects/{project}", + "in": "path", + "required": true, + "type": "string", + "pattern": "projects/[^/]+" + }, + { + "name": "workflow", + "description": "The workflow to create.", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1Workflow", + "required": [ + "workflow" + ] + } + } + ], + "tags": [ + "Workflow" + ] + } + } + }, + "definitions": { + "StakeAccountBalanceState": { + "type": "string", + "enum": [ + "BALANCE_STATE_UNSPECIFIED", + "BALANCE_STATE_INACTIVE", + "BALANCE_STATE_ACTIVATING", + "BALANCE_STATE_ACTIVE", + "BALANCE_STATE_DEACTIVATING" + ], + "default": "BALANCE_STATE_UNSPECIFIED", + "description": "Represents the different states a stake account balance can have.\nUsed to check to see if stake is actively earning rewards or ready to be withdrawn.\n\n - BALANCE_STATE_UNSPECIFIED: The balance is not known.\n - BALANCE_STATE_INACTIVE: The balance is not actively staking.\n - BALANCE_STATE_ACTIVATING: The balance is in a warm up period and will activate in the next epoch.\n - BALANCE_STATE_ACTIVE: The balance is actively staking and earning rewards.\n - BALANCE_STATE_DEACTIVATING: The balance is in a cool down period and will be deactivated in the next epoch." + }, + "StakingServicePerformWorkflowStepBody": { + "type": "object", + "properties": { + "step": { + "type": "integer", + "format": "int32", + "description": "The index of the step to be performed." + }, + "data": { + "type": "string", + "description": "Transaction metadata. This is either the signed transaction or transaction hash depending on the workflow's broadcast method." + } + }, + "description": "The request message for PerformWorkflowStep.", + "required": [ + "step", + "data" + ] + }, + "WaitStepOutputWaitUnit": { + "type": "string", + "enum": [ + "WAIT_UNIT_UNSPECIFIED", + "WAIT_UNIT_SECONDS", + "WAIT_UNIT_BLOCKS", + "WAIT_UNIT_EPOCHS", + "WAIT_UNIT_CHECKPOINTS" + ], + "default": "WAIT_UNIT_UNSPECIFIED", + "description": "The unit of wait time.\n\n - WAIT_UNIT_UNSPECIFIED: Unspecified wait time.\n - WAIT_UNIT_SECONDS: Wait time measured in seconds.\n - WAIT_UNIT_BLOCKS: Wait time measured in blocks.\n - WAIT_UNIT_EPOCHS: Wait time measured in epochs.\n - WAIT_UNIT_CHECKPOINTS: Wait time measured in checkpoints." + }, + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/protobufAny" + } + } + } + }, + "v1Action": { + "type": "object", + "properties": { + "name": { + "type": "string", + "title": "The resource name of the Action.\nFormat: protocols/{protocolName}/networks/{networkName}/actions/{actionName}\nEx: protocols/ethereum_kiln/networks/holesky/validators/stake" + } + }, + "description": "An Action resource represents an action you may take on a network (e.g. stake, unstake)." + }, + "v1Amount": { + "type": "object", + "properties": { + "value": { + "type": "string", + "description": "The total value of the token." + }, + "currency": { + "type": "string", + "description": "The currency of the token" + } + }, + "description": "The amount of a token you wish to perform an action\nwith." + }, + "v1Contract": { + "type": "object", + "properties": { + "name": { + "type": "string", + "title": "The resource name of the Contract Address.\nFormat: protocols/{protocolName}/networks/{networkName}/stakingTargets/{contractName}\nEx: protocols/ethereum_kiln/networks/holesky/stakingTargets/0xA55416de5DE61A0AC1aa8970a280E04388B1dE4b" + }, + "address": { + "type": "string", + "description": "The contract address you may submit actions to." + } + }, + "description": "A Contract resource, which represents an active contract\nfor the given protocol network which you can submit an action\nto." + }, + "v1EthereumKilnClaimStakeParameters": { + "type": "object", + "properties": { + "stakerAddress": { + "type": "string", + "description": "The address you wish to claim stake for." + }, + "integratorContractAddress": { + "type": "string", + "title": "The address of the integrator contract" + } + }, + "description": "The parameters required for the claim stake action on Ethereum Kiln.", + "title": "EthereumKiln: Claim Stake Parameters", + "required": [ + "stakerAddress", + "integratorContractAddress" + ] + }, + "v1EthereumKilnStakeParameters": { + "type": "object", + "properties": { + "stakerAddress": { + "type": "string", + "description": "The address you wish to stake from." + }, + "integratorContractAddress": { + "type": "string", + "description": "The address of the integrator contract." + }, + "amount": { + "$ref": "#/definitions/v1Amount", + "description": "The amount of Ethereum to stake in wei." + } + }, + "description": "The parameters required for the stake action on Ethereum Kiln.", + "title": "EthereumKiln: Stake Parameters", + "required": [ + "stakerAddress", + "integratorContractAddress", + "amount" + ] + }, + "v1EthereumKilnStakingContextDetails": { + "type": "object", + "properties": { + "ethereumBalance": { + "$ref": "#/definitions/v1Amount", + "description": "The Ethereum balance of the address.\nThis can be used to gate the stake action to make sure the requested stake amount\nis less than ethereum_balance." + }, + "integratorShareBalance": { + "$ref": "#/definitions/v1Amount", + "description": "The number of integrator shares owned by the address." + }, + "integratorShareUnderlyingBalance": { + "$ref": "#/definitions/v1Amount", + "title": "The total Ethereum you can exchange for your integrator shares.\nThis can be used to gate the unstake action to make sure the requested unstake amount\nis less than integrator_share_underlying_balance" + }, + "totalExitableEth": { + "$ref": "#/definitions/v1Amount", + "description": "The total amount of Ethereum you can redeem for all non-claimed vPool shares.\nThis along with the condition total_shares_pending_exit == fulfillable_share_count\ncan be used to gate the claim_stake action." + }, + "totalSharesPendingExit": { + "$ref": "#/definitions/v1Amount", + "description": "The number of vPool shares are eligible to receive now or at a later point in time." + }, + "fulfillableShareCount": { + "$ref": "#/definitions/v1Amount", + "description": "The number of vPool shares you are able to claim now." + } + }, + "description": "The protocol specific details for an Ethereum Kiln staking context.", + "title": "EthereumKiln: Staking context details" + }, + "v1EthereumKilnStakingContextParameters": { + "type": "object", + "properties": { + "integratorContractAddress": { + "type": "string", + "description": "Integrator contract address." + } + }, + "description": "The protocol specific parameters required for fetching a staking context.", + "title": "EthereumKiln: Staking Context Parameters" + }, + "v1EthereumKilnStakingParameters": { + "type": "object", + "properties": { + "stakeParameters": { + "$ref": "#/definitions/v1EthereumKilnStakeParameters", + "description": "The parameters for stake action on Ethereum Kiln." + }, + "unstakeParameters": { + "$ref": "#/definitions/v1EthereumKilnUnstakeParameters", + "description": "The parameters for unstake action on Ethereum Kiln." + }, + "claimStakeParameters": { + "$ref": "#/definitions/v1EthereumKilnClaimStakeParameters", + "description": "The parameters for claim stake action on Ethereum Kiln." + } + }, + "description": "The parameters needed for staking on Ethereum via Kiln.", + "title": "EthereumKiln: Staking Parameters" + }, + "v1EthereumKilnUnstakeParameters": { + "type": "object", + "properties": { + "stakerAddress": { + "type": "string", + "description": "The address you wish to unstake from." + }, + "integratorContractAddress": { + "type": "string", + "description": "The address of the integrator contract." + }, + "amount": { + "$ref": "#/definitions/v1Amount", + "description": "The amount of Ethereum to unstake in wei." + } + }, + "description": "The parameters required for the unstake action on Ethereum Kiln.", + "title": "EthereumKiln: Unstake Parameters", + "required": [ + "stakerAddress", + "integratorContractAddress", + "amount" + ] + }, + "v1ListActionsResponse": { + "type": "object", + "properties": { + "actions": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1Action" + }, + "description": "The list of actions." + } + }, + "description": "The response message for ListActions." + }, + "v1ListNetworksResponse": { + "type": "object", + "properties": { + "networks": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1Network" + }, + "description": "The list of networks." + } + }, + "description": "The response message for ListNetworks." + }, + "v1ListProtocolsResponse": { + "type": "object", + "properties": { + "protocols": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1Protocol" + }, + "description": "The list of protocols." + } + }, + "description": "The response message for ListProtocols." + }, + "v1ListStakingTargetsResponse": { + "type": "object", + "properties": { + "stakingTargets": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1StakingTarget" + }, + "description": "The list of staking targets." + }, + "nextPageToken": { + "type": "string", + "description": "A token which can be provided as `page_token` to retrieve the next page.\nIf this field is omitted, there are no additional pages." + } + }, + "description": "The response message for ListStakingTargets." + }, + "v1ListWorkflowsResponse": { + "type": "object", + "properties": { + "workflows": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1Workflow" + }, + "description": "The list of workflows." + }, + "nextPageToken": { + "type": "string", + "description": "A token which can be provided as `page_token` to retrieve the next page.\nIf this field is omitted, there are no additional pages." + } + }, + "description": "The response message for ListWorkflows." + }, + "v1Network": { + "type": "object", + "properties": { + "name": { + "type": "string", + "title": "The resource name of the Network.\nFormat: protocols/{protocolName}/networks/{networkName}\nEx: protocols/ethereum_kiln/networks/holesky" + } + }, + "description": "A Network resource represents a blockchain network e.g. mainnet, testnet, etc." + }, + "v1PriorityFee": { + "type": "object", + "properties": { + "computeUnitLimit": { + "type": "string", + "format": "int64", + "description": "The maximum number of compute units a transaction is allowed to consume." + }, + "unitPrice": { + "type": "string", + "format": "int64", + "description": "The price to pay per compute unit." + } + }, + "description": "A prioritization fee that can be added to a Solana transaction." + }, + "v1Protocol": { + "type": "object", + "properties": { + "name": { + "type": "string", + "title": "The resource name of the Protocol.\nFormat: protocols/{protocolName}\nEx: protocols/ethereum_kiln" + } + }, + "description": "A Protocol resource (e.g. ethereum_kiln, solana etc.)." + }, + "v1SolanaClaimStakeParameters": { + "type": "object", + "properties": { + "walletAddress": { + "type": "string", + "description": "The address which is the signing authority to claim stake." + }, + "stakeAccountAddress": { + "type": "string", + "description": "The address of the stake account to claim stake from." + }, + "priorityFee": { + "$ref": "#/definitions/v1PriorityFee", + "description": "The option to set a priority fee for the transaction." + } + }, + "description": "The parameters required to perform a claim stake operation on Solana.", + "title": "Solana: Claim Stake Parameters" + }, + "v1SolanaStakeParameters": { + "type": "object", + "properties": { + "walletAddress": { + "type": "string", + "description": "The address where the funds are coming from to stake." + }, + "validatorAddress": { + "type": "string", + "description": "The address of the validator." + }, + "amount": { + "$ref": "#/definitions/v1Amount", + "title": "The amount of Solana to stake in lamports. (1 lamport = 0.000000001 SOL)" + }, + "priorityFee": { + "$ref": "#/definitions/v1PriorityFee", + "description": "The option to set a priority fee for the transaction." + } + }, + "description": "The parameters required to perform a stake operation on Solana.", + "title": "Solana: Stake Parameters" + }, + "v1SolanaStakingContextDetails": { + "type": "object", + "properties": { + "balance": { + "$ref": "#/definitions/v1Amount", + "description": "The total balance of the main wallet address (system account).\nUsed to check the balance for any future staking or transaction to send." + }, + "currentEpoch": { + "type": "string", + "format": "int64", + "description": "The current epoch that the Solana blockchain is in.\nUsed as a frame of reference for future stake activations and deactivations." + }, + "epochCompletionPercentage": { + "type": "string", + "description": "How much of the epoch has passed as a percentage.\nUsed to inform how much time is left before a stake is activated or deactivated." + }, + "stakeAccounts": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1StakeAccount" + }, + "description": "The list of staking accounts that are linked to the main wallet address (system account).\nUsed to check for statuses and balances of all stake accounts related to the main wallet address that\nthey're linked to." + } + }, + "description": "The protocol specific details for a Solana staking context.", + "title": "Solana: Staking Context Details" + }, + "v1SolanaStakingContextParameters": { + "type": "object", + "description": "The protocol specific parameters required for fetching a staking context.", + "title": "Solana: Staking Context Parameters" + }, + "v1SolanaStakingParameters": { + "type": "object", + "properties": { + "stakeParameters": { + "$ref": "#/definitions/v1SolanaStakeParameters", + "description": "The parameters for stake action on Solana." + }, + "unstakeParameters": { + "$ref": "#/definitions/v1SolanaUnstakeParameters", + "description": "The parameters for unstake action on Solana." + }, + "claimStakeParameters": { + "$ref": "#/definitions/v1SolanaClaimStakeParameters", + "description": "The parameters for claim stake action on Solana." + } + }, + "description": "The parameters needed for staking on Solana.", + "title": "Solana: Staking Parameters" + }, + "v1SolanaUnstakeParameters": { + "type": "object", + "properties": { + "walletAddress": { + "type": "string", + "description": "The address which is the signing authority to unstake." + }, + "stakeAccountAddress": { + "type": "string", + "description": "The address of the stake account to unstake from." + }, + "amount": { + "$ref": "#/definitions/v1Amount", + "title": "The amount of Solana to unstake in lamports. (1 lamport = 0.000000001 SOL)" + }, + "priorityFee": { + "$ref": "#/definitions/v1PriorityFee", + "description": "The option to set a priority fee for the transaction." + } + }, + "description": "The parameters required to perform a unstake operation on Solana.", + "title": "Solana: Unstake Parameters" + }, + "v1StakeAccount": { + "type": "object", + "properties": { + "address": { + "type": "string", + "description": "The address of the stake account.\nUsed to hold the staked funds transferred over from the main wallet." + }, + "bondedStake": { + "$ref": "#/definitions/v1Amount", + "description": "The bonded balance in lamports on the stake account (rent is not included in bonded amount).\nUsed to check the amount that is currently staked." + }, + "rentReserve": { + "$ref": "#/definitions/v1Amount", + "description": "The rent amount for the stake account in lamports.\nUsed to highlight the amount used as the rent to maintain the address on the Solana blockchain." + }, + "balance": { + "$ref": "#/definitions/v1Amount", + "description": "The total balance on the address in lamports.\nUsed to check the total balance for the stake account." + }, + "balanceState": { + "$ref": "#/definitions/StakeAccountBalanceState", + "description": "The balance state of the stake account.\nUsed to show what state the currently staked funds are in.", + "readOnly": true + }, + "validator": { + "type": "string", + "description": "The validator (vote account) that the stake account is assigned to stake to.\nUsed to show where the staked funds are staked to." + } + }, + "description": "The balance information for a stake account." + }, + "v1StakingTarget": { + "type": "object", + "properties": { + "validator": { + "$ref": "#/definitions/v1Validator", + "description": "A validator to stake to." + }, + "contract": { + "$ref": "#/definitions/v1Contract", + "description": "A contract to send a staking action to." + } + }, + "description": "A Staking Target represents a destination that you perform an action on related to staking." + }, + "v1TxStepOutput": { + "type": "object", + "properties": { + "unsignedTx": { + "type": "string", + "description": "The unsigned transaction which was signed in order to be broadcasted.", + "readOnly": true + }, + "signedTx": { + "type": "string", + "description": "The signed transaction which was asked to be broadcasted.", + "readOnly": true + }, + "txHash": { + "type": "string", + "description": "The hash of the broadcasted transaction.", + "readOnly": true + }, + "state": { + "$ref": "#/definitions/v1TxStepOutputState", + "description": "The state of the transaction step.", + "readOnly": true + }, + "errorMessage": { + "type": "string", + "description": "The error message if the transaction step failed.", + "readOnly": true + } + }, + "description": "The details of a transaction being constructed and broadcasted to the network." + }, + "v1TxStepOutputState": { + "type": "string", + "enum": [ + "STATE_UNSPECIFIED", + "STATE_NOT_CONSTRUCTED", + "STATE_CONSTRUCTED", + "STATE_PENDING_SIGNING", + "STATE_SIGNED", + "STATE_BROADCASTING", + "STATE_CONFIRMING", + "STATE_CONFIRMED", + "STATE_FINALIZED", + "STATE_FAILED", + "STATE_SUCCESS", + "STATE_PENDING_EXT_BROADCAST" + ], + "default": "STATE_UNSPECIFIED", + "description": "State defines an enumeration of states for a staking transaction.\n\n - STATE_UNSPECIFIED: Unspecified transaction state, this is for backwards compatibility.\n - STATE_NOT_CONSTRUCTED: Tx has not yet been constructed in the backend.\n - STATE_CONSTRUCTED: Tx construction is over in the backend.\n - STATE_PENDING_SIGNING: Tx is waiting to be signed.\n - STATE_SIGNED: Tx has been signed and returned to the backend.\n - STATE_BROADCASTING: Tx is being broadcasted to the network.\n - STATE_CONFIRMING: Tx is waiting for confirmation.\n - STATE_CONFIRMED: Tx has been confirmed to be included in a block.\n - STATE_FINALIZED: Tx has been finalized.\n - STATE_FAILED: Tx construction or broadcasting failed.\n - STATE_SUCCESS: Tx has been successfully executed.\n - STATE_PENDING_EXT_BROADCAST: Tx is waiting to be externally broadcasted by the customer." + }, + "v1Validator": { + "type": "object", + "properties": { + "name": { + "type": "string", + "title": "The resource name of the Validator.\nFormat: protocols/{protocolName}/networks/{networkName}/stakingTargets/{validatorName}\nEx: protocols/solana/networks/testnet/stakingTargets/GkqYQysEGmuL6V2AJoNnWZUz2ZBGWhzQXsJiXm2CLKAN" + }, + "address": { + "type": "string", + "description": "The public address of the validator." + }, + "commissionRate": { + "type": "number", + "format": "float", + "title": "The rate of commission for the validator" + } + }, + "description": "A Validator resource represents an active validator for the given protocol network." + }, + "v1ViewStakingContextResponse": { + "type": "object", + "properties": { + "address": { + "type": "string", + "description": "The address you are getting a staking context for." + }, + "ethereumKilnStakingContextDetails": { + "$ref": "#/definitions/v1EthereumKilnStakingContextDetails", + "description": "EthereumKiln staking context details." + }, + "solanaStakingContextDetails": { + "$ref": "#/definitions/v1SolanaStakingContextDetails", + "description": "Solana staking context details." + } + }, + "description": "The response message for the ViewStakingContext request.", + "required": [ + "address", + "ethereumKilnStakingContextDetails", + "solanaStakingContextDetails" + ] + }, + "v1WaitStepOutput": { + "type": "object", + "properties": { + "start": { + "type": "string", + "format": "int64", + "description": "The beginning of wait period.", + "readOnly": true + }, + "current": { + "type": "string", + "format": "int64", + "description": "The current wait progress.", + "readOnly": true + }, + "target": { + "type": "string", + "format": "int64", + "description": "The target wait end point.", + "readOnly": true + }, + "unit": { + "$ref": "#/definitions/WaitStepOutputWaitUnit", + "description": "The wait unit (like checkpoint, block, epoch etc).", + "readOnly": true + }, + "state": { + "$ref": "#/definitions/v1WaitStepOutputState", + "description": "The state of the wait step.", + "readOnly": true + } + }, + "description": "The output details of a step where we wait for some kind of on-chain activity to finish like reaching a certain checkpoint, epoch or block." + }, + "v1WaitStepOutputState": { + "type": "string", + "enum": [ + "STATE_UNSPECIFIED", + "STATE_NOT_STARTED", + "STATE_IN_PROGRESS", + "STATE_COMPLETED" + ], + "default": "STATE_UNSPECIFIED", + "description": "WaitStepState defines an enumeration of states for a wait step.\n\n - STATE_UNSPECIFIED: Unspecified wait step state.\n - STATE_NOT_STARTED: Wait step has not started.\n - STATE_IN_PROGRESS: Wait step is in-progress.\n - STATE_COMPLETED: Wait step completed." + }, + "v1Workflow": { + "type": "object", + "properties": { + "name": { + "type": "string", + "title": "The resource name of the workflow.\nFormat: projects/{projectUUID}/workflows/{workflowUUID}\nEx: projects/ 123e4567-e89b-12d3-a456-426614174000/workflows/123e4567-e89b-12d3-a456-426614174000", + "readOnly": true + }, + "action": { + "type": "string", + "title": "The resource name of the action being\nperformed.\nFormat: protocols/{protocol}/networks/{network}/actions/{action}" + }, + "solanaStakingParameters": { + "$ref": "#/definitions/v1SolanaStakingParameters", + "description": "Solana staking parameters." + }, + "ethereumKilnStakingParameters": { + "$ref": "#/definitions/v1EthereumKilnStakingParameters", + "description": "EthereumKiln staking parameters." + }, + "state": { + "$ref": "#/definitions/v1WorkflowState", + "description": "The current state of the workflow.", + "readOnly": true + }, + "currentStepId": { + "type": "integer", + "format": "int32", + "description": "The index of the current step.", + "readOnly": true + }, + "steps": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1WorkflowStep" + }, + "description": "The list of steps for this workflow.", + "readOnly": true + }, + "createTime": { + "type": "string", + "format": "date-time", + "description": "The timestamp the workflow was created.", + "readOnly": true + }, + "updateTime": { + "type": "string", + "format": "date-time", + "description": "The timestamp the workflow was last updated.", + "readOnly": true + }, + "skipBroadcast": { + "type": "boolean", + "description": "Flag to skip tx broadcast to network on behalf of the user. Use this flag if you instead prefer to broadcast signed txs on your own." + }, + "completeTime": { + "type": "string", + "format": "date-time", + "description": "The timestamp the workflow completed.", + "readOnly": true + } + }, + "description": "A Workflow resource.", + "required": [ + "action", + "solanaStakingParameters", + "ethereumKilnStakingParameters" + ] + }, + "v1WorkflowState": { + "type": "string", + "enum": [ + "STATE_UNSPECIFIED", + "STATE_IN_PROGRESS", + "STATE_WAITING_FOR_SIGNING", + "STATE_COMPLETED", + "STATE_FAILED", + "STATE_WAITING_FOR_EXT_BROADCAST" + ], + "default": "STATE_UNSPECIFIED", + "description": "Example flow: A workflow with skip_broadcast = true leading to a successful completion.\n IN_PROGRESS -\u003e WAITING_FOR_EXT_BROADCAST -\u003e IN_PROGRESS -\u003e COMPLETED\n Example flow: A workflow with skip_broadcast = false leading to a successful completion.\n IN_PROGRESS -\u003e WAITING_FOR_SIGNING -\u003e IN_PROGRESS -\u003e COMPLETED\n Example flow: A workflow with skip_broadcast = false leading to a failure.\n IN_PROGRESS -\u003e WAITING_FOR_SIGNING -\u003e IN_PROGRESS -\u003e FAILED\n\n - STATE_UNSPECIFIED: Unspecified workflow state, this is for backwards compatibility.\n - STATE_IN_PROGRESS: In Progress represents a workflow that is currently in progress.\n - STATE_WAITING_FOR_SIGNING: Waiting for signing represents the workflow is waiting on the consumer to sign and return the corresponding signed tx.\n - STATE_COMPLETED: Completed represents the workflow has completed.\n - STATE_FAILED: Failed represents the workflow has failed.\n - STATE_WAITING_FOR_EXT_BROADCAST: Waiting for external broadcast represents the workflow is waiting for the customer to broadcast a tx and return its corresponding tx hash.", + "title": "The state of a workflow" + }, + "v1WorkflowStep": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The human readable name of the step.", + "readOnly": true + }, + "txStepOutput": { + "$ref": "#/definitions/v1TxStepOutput", + "description": "The tx step output (e.g. transaction metadata such as unsigned tx, signed tx etc).", + "readOnly": true + }, + "waitStepOutput": { + "$ref": "#/definitions/v1WaitStepOutput", + "description": "The waiting details for any kind like how many checkpoints away for unbonding etc.", + "readOnly": true + } + }, + "description": "The information for a step in the workflow.", + "title": "The information for a step in the workflow" + } + } +} diff --git a/docs/openapi/rewards.swagger.json b/docs/openapi/rewards.swagger.json new file mode 100644 index 0000000..6e32cd4 --- /dev/null +++ b/docs/openapi/rewards.swagger.json @@ -0,0 +1,562 @@ +{ + "swagger": "2.0", + "info": { + "title": "Rewards Service", + "description": "Service that provides access to onchain, staking-related rewards data.", + "version": "v1" + }, + "tags": [ + { + "name": "Reward", + "description": "A high-level view of an address's rewards aggregated over some period of time (ex: over an Epoch)." + }, + { + "name": "Stake", + "description": "A snapshot of an address's staking-related balance at a particular point in time. Feature coming soon." + }, + { + "name": "RewardService" + } + ], + "host": "api.developer.coinbase.com", + "basePath": "/rewards", + "schemes": [ + "https" + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": { + "/v1/{parent}/rewards": { + "get": { + "summary": "List and filter rewards", + "description": "Lists onchain rewards of an address for a specific protocol, with optional filters for time range, aggregation period, and more.", + "operationId": "RewardService_ListRewards", + "responses": { + "200": { + "description": "OK", + "schema": { + "example": { + "rewards": [ + { + "address": "beefKGBWeSpHzYBHZXwp5So7wdQGX6mu4ZHCsH3uTar", + "epoch": "533", + "aggregationUnit": "epoch", + "periodStartTime": null, + "periodEndTime": "2023-11-16T00:13:44Z", + "totalEarnedNativeUnit": { + "amount": "224.7098145", + "exp": "9", + "ticker": "SOL", + "rawNumeric": "224709814509" + }, + "totalEarnedUsd": null, + "endingBalance": null, + "protocol": "solana" + }, + { + "address": "beefKGBWeSpHzYBHZXwp5So7wdQGX6mu4ZHCsH3uTar", + "epoch": "532", + "aggregationUnit": "epoch", + "periodStartTime": null, + "periodEndTime": "2023-11-13T19:38:36Z", + "totalEarnedNativeUnit": { + "amount": "225.0794241", + "exp": "9", + "ticker": "SOL", + "rawNumeric": "225079424094" + }, + "totalEarnedUsd": null, + "endingBalance": null, + "protocol": "solana" + } + ], + "nextPageToken": "VAql-wtdiJWkWII9bJBDnE9oEc-8IlgU0DtKbxSDtBg=:1:1700241277" + } + } + }, + "400": { + "description": "The request attempted has invalid parameters", + "schema": { + "example": { + "code": 3, + "message": "Filter validation failed. \u003cRemediation assistance here\u003e.", + "details": [] + } + } + }, + "401": { + "description": "Returned if authentication information is invalid", + "schema": { + "example": "Unauthorized" + } + }, + "500": { + "description": "Returned when an internal server error happens.", + "schema": { + "example": { + "code": 3, + "message": "Internal server error.", + "details": [] + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "parent", + "description": "The protocol that the rewards were earned on.\nThe response will only include rewards for the protocol specified here.", + "in": "path", + "required": true, + "type": "string", + "pattern": "protocols/[^/]+" + }, + { + "name": "pageSize", + "description": "The maximum number of items to return. Maximum size of this value is 500.\nIf user supplies a value \u003e 500, the API will truncate to 500.", + "in": "query", + "required": false, + "type": "integer", + "format": "int32" + }, + { + "name": "pageToken", + "description": "A page token as part of the response of a previous call.\nProvide this to retrieve the next page.\n\nWhen paginating, all other parameters must match the previous\nrequest to list resources correctly.", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "filter", + "description": "[AIP-160](https://google.aip.dev/160) format compliant filter. Supported protocols are 'ethereum', 'solana', and 'cosmos'.\nSupplying other protocols will return an error.\n* **Ethereum**:\n - Fields:\n - `address` - A ethereum validator public key.\n - `date` - A date in format 'YYYY-MM-DD'. Supports multiple comparisons (ex: '2024-01-15).\n - `period_end_time` - A timestamp in RFC-3339 format. Supports multiple comparisons (ex: '2024-01-01T00:00:00Z' and '2024-01-15T00:00:00Z').\n - Example(s):\n - `\"address='0xac53512c39d0081ca4437c285305eb423f474e6153693c12fbba4a3df78bcaa3422b31d800c5bea71c1b017168a60474' AND date \u003e= '2024-01-01' AND date \u003c '2024-01-15'\"`\n - `\"address='0xac53512c39d0081ca4437c285305eb423f474e6153693c12fbba4a3df78bcaa3422b31d800c5bea71c1b017168a60474' AND period_end_time \u003e= '2024-01-01T00:00:00Z' AND period_end_time \u003c '2024-01-15T00:00:00Z'\"`\n - `\"address='0xac53512c39d0081ca4437c285305eb423f474e6153693c12fbba4a3df78bcaa3422b31d800c5bea71c1b017168a60474' AND date = '2024-01-01'\"`\n\n* **Solana**:\n - Fields:\n - `address` - A solana validator or delegator address.\n - `epoch` - A solana epoch. Supports epoch comparisons (ex: `epoch \u003e= 1000 AND epoch \u003c= 2000`).\n - `period_end_time` - A timestamp in RFC-3339 format. Supports multiple comparisons (ex: '2024-01-01T00:00:00Z' and '2024-01-15T00:00:00Z').\n - Example(s):\n - `\"address='beefKGBWeSpHzYBHZXwp5So7wdQGX6mu4ZHCsH3uTar' AND epoch \u003e= 540 AND epoch \u003c 550\"`\n - `\"address='beefKGBWeSpHzYBHZXwp5So7wdQGX6mu4ZHCsH3uTar' AND period_end_time \u003e= '2024-01-01T00:00:00Z' AND period_end_time \u003c '2024-01-15T00:00:00Z'\"`\n - `\"address='beefKGBWeSpHzYBHZXwp5So7wdQGX6mu4ZHCsH3uTar' AND epoch = 550\"`\n\n* **Cosmos**:\n - Fields:\n - `address` - A cosmos validator or delegator address (ex: `cosmosvaloper1c4k24jzduc365kywrsvf5ujz4ya6mwympnc4en` and `cosmos1c4k24jzduc365kywrsvf5ujz4ya6mwymy8vq4q`)\n - `date` - A date in format 'YYYY-MM-DD'. Supports multiple comparisons (ex: '2024-01-15).\n - `period_end_time` - A timestamp in RFC-3339 format. Supports multiple comparisons (ex: '2024-01-01T00:00:00Z' and '2024-01-15T00:00:00Z').\n - Example(s):\n - `\"address='cosmos1mfduj0qax6ut8rd6cfc4j0ds06z0mwlhrljhqh' AND date = '2024-11-16'\"`\n - `\"address='cosmos1mfduj0qax6ut8rd6cfc4j0ds06z0mwlhrljhqh' AND period_end_time \u003e= '2024-01-01T00:00:00Z' AND period_end_time \u003c '2024-01-15T00:00:00Z'\"`\n - `\"address='cosmos1mfduj0qax6ut8rd6cfc4j0ds06z0mwlhrljhqh' AND date = '2024-01-01'\"`", + "in": "query", + "required": false, + "type": "string" + } + ], + "tags": [ + "Reward" + ] + } + }, + "/v1/{parent}/stakes": { + "get": { + "summary": "List and filter staking balances", + "description": "Lists staking balance of a protocol, with optional filters for time range and address.", + "operationId": "RewardService_ListStakes", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1ListStakesResponse" + } + }, + "400": { + "description": "The request attempted has invalid parameters", + "schema": { + "example": { + "code": 3, + "message": "Filter validation failed. \u003cRemediation assistance here\u003e.", + "details": [] + } + } + }, + "401": { + "description": "Returned if authentication information is invalid", + "schema": { + "example": "Unauthorized" + } + }, + "500": { + "description": "Returned when an internal server error happens.", + "schema": { + "example": { + "code": 3, + "message": "Internal server error.", + "details": [] + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "parent", + "description": "The protocol that the staking balance exists on.\nThe response will only include staking balances for the protocol specified here.", + "in": "path", + "required": true, + "type": "string", + "pattern": "protocols/[^/]+" + }, + { + "name": "pageSize", + "description": "The maximum number of items to return.", + "in": "query", + "required": false, + "type": "integer", + "format": "int32" + }, + { + "name": "pageToken", + "description": "A page token as part of the response of a previous call.\nProvide this to retrieve the next page.\n\nWhen paginating, all other parameters must match the previous\nrequest to list resources.", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "filter", + "description": "[AIP-160](https://google.aip.dev/160) format compliant filter. Supported protocols are 'ethereum', 'solana'.\nSupplying other protocols will return an error.\n* **Ethereum**:\n - Fields:\n - `address` - A ethereum validator public key.\n - `evaluation_time` - A timestamp in RFC-3339 format. Supports multiple comparisons (ex: '2024-01-01T00:00:00Z' and '2024-01-15T00:00:00Z').\n - Example(s):\n - `\"address='0xac53512c39d0081ca4437c285305eb423f474e6153693c12fbba4a3df78bcaa3422b31d800c5bea71c1b017168a60474'\"`\n - `\"address='0xac53512c39d0081ca4437c285305eb423f474e6153693c12fbba4a3df78bcaa3422b31d800c5bea71c1b017168a60474' AND evaluation_time \u003e= '2024-01-01T00:00:00Z' AND evaluation_time \u003c '2024-01-15T00:00:00Z'\"`\n\n* **Solana**:\n - Fields:\n - `address` - A solana staking address.\n - `evaluation_time` - A timestamp in RFC-3339 format. Supports multiple comparisons (ex: '2024-01-01T00:00:00Z' and '2024-01-15T00:00:00Z').\n - Example(s):\n - `\"address='beefKGBWeSpHzYBHZXwp5So7wdQGX6mu4ZHCsH3uTar'\"`\n - `\"address='beefKGBWeSpHzYBHZXwp5So7wdQGX6mu4ZHCsH3uTar' AND evaluation_time \u003e= '2024-01-01T00:00:00Z' AND evaluation_time \u003c '2024-01-15T00:00:00Z'\"`", + "in": "query", + "required": false, + "type": "string" + } + ], + "tags": [ + "Stake" + ] + } + } + }, + "definitions": { + "RewardRateCalculationMethods": { + "type": "string", + "enum": [ + "CALCULATION_METHODS_UNSPECIFIED", + "SOLO_STAKER", + "POOLED_STAKER", + "EPOCH_AUTO_COMPOUNDING", + "NO_AUTO_COMPOUNDING" + ], + "default": "CALCULATION_METHODS_UNSPECIFIED", + "description": "Representing the different methods of calculating yield.\n\n - CALCULATION_METHODS_UNSPECIFIED: Calculation method is unknown or unspecified.\n - SOLO_STAKER: A single Ethereum validator acting in isolation is currently not able to compound earned rewards because\nEthereum only allows validators to stake 32 ETH precisely.\nThis percentage yield is assuming that the rewards never compound, mimicking the behavior of a solo staker.\n - POOLED_STAKER: A pool of Ethereum validators of sufficient size is able to compound rewards almost immediately.\nThis percentage yield is assuming rewards compound immediately, mimicking the behavior of a sufficiently large pool.\n - EPOCH_AUTO_COMPOUNDING: A Solana delegator's staking rewards are staked (and therefore auto-compound) when rewards are paid out between epochs.\nThis percentage yield is assuming the rewards are auto-compounded on that schedule, mimicking a Solana delegator.\n - NO_AUTO_COMPOUNDING: A Solana validator's rewards accumulate in a separate account from the validator's active stake.\nThis percentage yield is assuming the rewards are not auto-compounded at any point, mimicking a Solana validator who never staked their rewards." + }, + "StakeDelegation": { + "type": "object", + "properties": { + "address": { + "type": "string", + "title": "Address associated to the delegation" + }, + "amount": { + "$ref": "#/definitions/v1AssetAmount", + "title": "Amount of delegation received or given" + }, + "commissionRate": { + "type": "string", + "title": "Commission rate for delegation" + } + }, + "description": "A single delegation from one address to another." + }, + "USDValueSource": { + "type": "string", + "enum": [ + "SOURCE_UNSPECIFIED", + "COINBASE_EXCHANGE" + ], + "default": "SOURCE_UNSPECIFIED", + "description": "The source of the USD price conversion.\n\n - SOURCE_UNSPECIFIED: The USD value source is unknown or unspecified.\n - COINBASE_EXCHANGE: The USD value source is the Coinbase exchange." + }, + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/protobufAny" + } + } + } + }, + "v1AggregationUnit": { + "type": "string", + "enum": [ + "AGGREGATION_UNIT_UNSPECIFIED", + "EPOCH", + "DAY" + ], + "default": "AGGREGATION_UNIT_UNSPECIFIED", + "description": "The unit of time that the reward events were aggregated by.\n\n - AGGREGATION_UNIT_UNSPECIFIED: Aggregation unit is unknown or unspecified.\n - EPOCH: Indicates the rewards are aggregated by epoch. This means there will be a 'epoch' field displaying the epoch on this resource.\n - DAY: Indicates the rewards are aggregated by day. This means there will be a 'date' field displaying the date on this resource." + }, + "v1AssetAmount": { + "type": "object", + "properties": { + "amount": { + "type": "string", + "title": "The amount of the asset in the most common denomination.\nEx: ETH (converted from gwei)\nEx: USD (converted from fractional pennies)", + "readOnly": true + }, + "exp": { + "type": "string", + "description": "The number of decimals needed to convert from the raw numeric value to the most\ncommon denomination.", + "readOnly": true + }, + "ticker": { + "type": "string", + "description": "The ticker of this asset (ex: USD, ETH, SOL).", + "readOnly": true + }, + "rawNumeric": { + "type": "string", + "description": "The raw, unadulterated numeric value.\nEx: Wei (in Ethereum) and Lamports (in Solana).", + "readOnly": true + } + }, + "description": "Amount encapsulation for a given asset." + }, + "v1ListRewardsResponse": { + "type": "object", + "properties": { + "rewards": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1Reward" + }, + "description": "The rewards returned in this response.", + "readOnly": true + }, + "nextPageToken": { + "type": "string", + "description": "The page token the user must use in the next request if the next page is desired.", + "readOnly": true + } + }, + "description": "The response message for ListRewards." + }, + "v1ListStakesResponse": { + "type": "object", + "properties": { + "stakes": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1Stake" + }, + "description": "The staking balances returned in this response.", + "readOnly": true + }, + "nextPageToken": { + "type": "string", + "description": "The page token the user must use in the next request if the next page is desired.", + "readOnly": true + } + }, + "description": "The response message for ListStakes." + }, + "v1ParticipantType": { + "type": "string", + "enum": [ + "PARTICIPANT_TYPE_UNSPECIFIED", + "DELEGATOR", + "VALIDATOR" + ], + "default": "PARTICIPANT_TYPE_UNSPECIFIED", + "description": "The participant type of a staking-related address.\n\n - PARTICIPANT_TYPE_UNSPECIFIED: The participant type is unknown.\n - DELEGATOR: Used when the onchain participant type is a delegator\n(i.e. someone who delegates the responsibilities of validating blocks to another address in return for a share of the rewards).\n - VALIDATOR: Used when the onchain participant type is a validator\n(i.e. an address that is directly responsible for performing validation of blocks)." + }, + "v1Reward": { + "type": "object", + "properties": { + "address": { + "type": "string", + "description": "The address that earned this reward.", + "readOnly": true + }, + "epoch": { + "type": "string", + "format": "int64", + "description": "A unique identifier for the consensus-cycle of the blockchain.", + "readOnly": true + }, + "date": { + "type": "string", + "description": "The date of the reward in format 'YYYY-MM-DD' in UTC.", + "readOnly": true + }, + "aggregationUnit": { + "$ref": "#/definitions/v1AggregationUnit", + "description": "The unit of time that the reward events were rolled up by.\nCan be either \"epoch\" or \"daily\".", + "readOnly": true + }, + "periodStartTime": { + "type": "string", + "format": "date-time", + "description": "The starting time of this reward period. Returned when querying by epoch.\nTimestamps are in UTC, conforming to the RFC-3339 spec (e.g. 2024-11-13T19:38:36Z).\nField currently unavailable. Coming soon.", + "readOnly": true + }, + "periodEndTime": { + "type": "string", + "format": "date-time", + "description": "The ending time of this reward period. Returned when querying by epoch.\nTimestamps are in UTC, conforming to the RFC-3339 spec (e.g. 2024-11-13T19:38:36Z).", + "readOnly": true + }, + "totalEarnedNativeUnit": { + "$ref": "#/definitions/v1AssetAmount", + "description": "The amount earned in this time period in the native unit of the protocol.", + "readOnly": true + }, + "totalEarnedUsd": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1USDValue" + }, + "description": "The amount earned in this time period in USD. Calculated by getting each individual reward of this\ntime period and summing the USD value of each individual component. USD value is calculate at\nthe time each component was earned.", + "readOnly": true + }, + "endingBalance": { + "$ref": "#/definitions/v1Stake", + "description": "A snapshot of the staking balance the end of this period.\nField currently unavailable. Coming soon.", + "readOnly": true + }, + "protocol": { + "type": "string", + "description": "The protocol on which this reward was earned.", + "readOnly": true + } + }, + "description": "Rewards earned within a particular period of time." + }, + "v1RewardRate": { + "type": "object", + "properties": { + "percentage": { + "type": "string", + "description": "The percentage rate of rewards calculation. Will include two digits after the decimal (ex: 3.05).", + "readOnly": true + }, + "calculatedTime": { + "type": "string", + "format": "date-time", + "description": "The time at which this yield calculation was calculated.\nTimestamps are in UTC, conforming to the RFC-3339 spec (e.g. 2023-11-13T19:38:36Z).", + "readOnly": true + }, + "calculationMethod": { + "$ref": "#/definitions/RewardRateCalculationMethods", + "description": "The method used to calculate this yield. This could include information about which\nrewards we're including in the calculation, how we're estimating the compounding period, etc.", + "readOnly": true + } + }, + "description": "Reward yield calculation at a given point in time." + }, + "v1Stake": { + "type": "object", + "properties": { + "address": { + "type": "string", + "description": "The address of the staking balance.", + "readOnly": true + }, + "evaluationTime": { + "type": "string", + "format": "date-time", + "description": "The time at which this balance was evaluated.\nTimestamps are in UTC, conforming to the RFC-3339 spec (e.g. 2023-11-13T19:38:36Z).", + "readOnly": true + }, + "bondedStake": { + "$ref": "#/definitions/v1AssetAmount", + "description": "The total amount of stake that is actively earning rewards to this address.\nIncludes any delegated stake and self-stake.\nFor delegators, this would be only the amount delegated to a validator in most cases.\nOnly includes stake that is *actively contributing to rewards and can't be reduced\nwithout affecting the rewards dynamics*.\n\nPending inactive stake is included.\nPending active stake is not included.", + "readOnly": true + }, + "totalDelegationReceived": { + "$ref": "#/definitions/v1AssetAmount", + "description": "The amount of stake that this address receives from other addresses.\nFor most delegators, this will be 0.", + "readOnly": true + }, + "delegationsReceived": { + "$ref": "#/definitions/StakeDelegation", + "title": "The list of individual delegations this address has received from other addresses", + "readOnly": true + }, + "delegationsGiven": { + "$ref": "#/definitions/StakeDelegation", + "description": "The amount that this address stakes to another address.", + "readOnly": true + }, + "rewardRateCalculations": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1RewardRate" + }, + "description": "An estimated yield of this address.", + "readOnly": true + }, + "participantType": { + "$ref": "#/definitions/v1ParticipantType", + "description": "The participant type at the time of evaluation (i.e. validator, delegator).", + "readOnly": true + }, + "protocol": { + "type": "string", + "description": "The protocol on which this staking balance exists.", + "readOnly": true + }, + "unbondedBalance": { + "$ref": "#/definitions/v1AssetAmount", + "description": "The amount of stake that is not actively earning rewards to this address.\nThis amount includes any native token balance that is under the domain and control of the address in question,\nbut is not actively staked.\n\nPending active stake would be included here.", + "readOnly": true + } + }, + "description": "The representation of a staking activity at a particular point in time." + }, + "v1USDValue": { + "type": "object", + "properties": { + "source": { + "$ref": "#/definitions/USDValueSource", + "description": "The source of the USD price conversion. Could be internal to Coinbase, and external source, or any other source.", + "readOnly": true + }, + "conversionTime": { + "type": "string", + "format": "date-time", + "description": "The timestamp at which the USD value was sourced to convert the value into USD.\nThis value is as close to the time the reward was earned as possible.\nTimestamps are in UTC, conforming to the RFC-3339 spec (e.g. 2024-11-13T19:38:36Z).", + "readOnly": true + }, + "amount": { + "$ref": "#/definitions/v1AssetAmount", + "description": "The USD value of the reward at the conversion time.", + "readOnly": true + }, + "conversionPrice": { + "type": "string", + "description": "The price of the native unit at the conversion time.", + "readOnly": true + } + }, + "description": "Information regarding the USD value of a reward, with necessary context and metadata." + } + } +} diff --git a/examples/cosmos/list-rewards/main.go b/examples/cosmos/list-rewards/main.go new file mode 100644 index 0000000..366f99f --- /dev/null +++ b/examples/cosmos/list-rewards/main.go @@ -0,0 +1,80 @@ +/* + * This example code, demonstrates rewards client library usage for listing rewards + */ + +package main + +import ( + "context" + "errors" + "log" + "time" + + "google.golang.org/api/iterator" + "google.golang.org/protobuf/encoding/protojson" + + "github.com/coinbase/staking-client-library-go/auth" + "github.com/coinbase/staking-client-library-go/client" + "github.com/coinbase/staking-client-library-go/client/options" + rewardsV1 "github.com/coinbase/staking-client-library-go/client/rewards/v1" + rewardspb "github.com/coinbase/staking-client-library-go/gen/go/coinbase/staking/rewards/v1" +) + +const ( + // TODO: Replace address as per your requirement. + address = "cosmos1crqm3598z6qmyn2kkcl9dz7uqs4qdqnrlyn8pq" +) + +// An example function to demonstrate how to use the staking client libraries. +func main() { + ctx := context.Background() + + apiKey, err := auth.NewAPIKey(auth.WithLoadAPIKeyFromFile(true)) + if err != nil { + log.Fatalf("error loading API key: %s", err.Error()) + } + + authOpt := options.WithAPIKey(apiKey) + + // Create a staking client. + stakingClient, err := client.New(ctx, authOpt) + if err != nil { + log.Fatalf("error instantiating staking client: %s", err.Error()) + } + + // List all rewards for the given address, aggregated by day, for epochs that ended in the last 30 days. + + now := time.Now() + nowDateOnly := now.Truncate(24 * time.Hour) + + thirtyDaysAgo := now.AddDate(0, 0, -30) + thirtyDaysAgoDateOnly := thirtyDaysAgo.Truncate(24 * time.Hour) + + rewardsIter := stakingClient.Rewards.ListRewards(ctx, &rewardspb.ListRewardsRequest{ + Parent: rewardspb.ProtocolResourceName{Protocol: "cosmos"}.String(), + PageSize: 20, + Filter: rewardsV1.WithAddress().Eq(address). + And(rewardsV1.WithDate().Gte(thirtyDaysAgoDateOnly.Format("2006-01-02"))). + And(rewardsV1.WithDate().Lt(nowDateOnly.Format("2006-01-02"))).String(), + }) + + count := 0 + for { + reward, err := rewardsIter.Next() + if errors.Is(err, iterator.Done) { + break + } + + if err != nil { + log.Fatalf("error listing rewards: %s", err.Error()) + } + + d, err := protojson.Marshal(reward) + if err != nil { + log.Fatalf("error marshalling reward object: %s", err.Error()) + } + + log.Printf("[%d] Reward details: %s", count, d) + count += 1 + } +} diff --git a/examples/ethereum/create-and-process-workflow/main.go b/examples/ethereum/create-and-process-workflow/main.go new file mode 100644 index 0000000..c3c4ba6 --- /dev/null +++ b/examples/ethereum/create-and-process-workflow/main.go @@ -0,0 +1,176 @@ +/* + * This example code, demonstrates staking client library usage for performing e2e staking on Ethereum Kiln. + */ + +package main + +import ( + "context" + "fmt" + "log" + "os" + "time" + + "github.com/coinbase/staking-client-library-go/auth" + "github.com/coinbase/staking-client-library-go/client" + stakingerrors "github.com/coinbase/staking-client-library-go/client/errors" + "github.com/coinbase/staking-client-library-go/client/options" + v1 "github.com/coinbase/staking-client-library-go/client/orchestration/v1" + stakingpb "github.com/coinbase/staking-client-library-go/gen/go/coinbase/staking/orchestration/v1" + "github.com/coinbase/staking-client-library-go/internal/signer" +) + +const ( + // TODO: Replace with your project ID and private key. + projectID = "" + privateKey = "" + + // TODO: Replace with your staker addresses and amount. + stakerAddress = "" + integratorContractAddress = "0xA55416de5DE61A0AC1aa8970a280E04388B1dE4b" + amount = "11" + currency = "ETH" +) + +// An example function to demonstrate how to use the staking client libraries. +func main() { + ctx := context.Background() + + apiKey, err := auth.NewAPIKey(auth.WithLoadAPIKeyFromFile(true)) + if err != nil { + log.Fatalf("error loading API key: %s", err.Error()) + } + + authOpt := options.WithAPIKey(apiKey) + + // Create a staking client. + stakingClient, err := client.New(ctx, authOpt) + if err != nil { + log.Fatalf("error instantiating staking client: %s", err.Error()) + } + + if projectID == "" || privateKey == "" || stakerAddress == "" { + log.Fatalf("projectID, privateKey and stakerAddress must be set") + } + + req := &stakingpb.CreateWorkflowRequest{ + Parent: fmt.Sprintf("projects/%s", projectID), + Workflow: &stakingpb.Workflow{ + Action: "protocols/ethereum_kiln/networks/holesky/actions/stake", + StakingParameters: &stakingpb.Workflow_EthereumKilnStakingParameters{ + EthereumKilnStakingParameters: &stakingpb.EthereumKilnStakingParameters{ + Parameters: &stakingpb.EthereumKilnStakingParameters_StakeParameters{ + StakeParameters: &stakingpb.EthereumKilnStakeParameters{ + StakerAddress: stakerAddress, + IntegratorContractAddress: integratorContractAddress, + Amount: &stakingpb.Amount{ + Value: amount, + Currency: currency, + }, + }, + }, + }, + }, + SkipBroadcast: true, + }, + } + + workflow, err := stakingClient.Orchestration.CreateWorkflow(ctx, req) + if err != nil { + sae := stakingerrors.FromError(err) + _ = sae.Print() + os.Exit(1) + } + + log.Printf("Workflow created %s ...\n", workflow.Name) + + // Run loop until workflow reaches a terminal state + for { + // Get the latest workflow state + workflow, err = stakingClient.Orchestration.GetWorkflow(ctx, &stakingpb.GetWorkflowRequest{Name: workflow.Name}) + if err != nil { + log.Fatalf(fmt.Errorf("error getting workflow: %w", err).Error()) + } + + printWorkflowProgressDetails(workflow) + + // If workflow is in WAITING_FOR_SIGNING state, sign the transaction and update the workflow + if v1.WorkflowWaitingForSigning(workflow) { + unsignedTx := workflow.Steps[workflow.GetCurrentStepId()].GetTxStepOutput().GetUnsignedTx() + + // Logic to sign the transaction. This can be substituted with any other signing mechanism. + log.Printf("Signing unsigned tx %s ...\n", unsignedTx) + + signedTx, err := signer.New("ethereum_kiln").SignTransaction(privateKey, &signer.UnsignedTx{Data: []byte(unsignedTx)}) + if err != nil { + log.Fatalf(fmt.Errorf("error signing transaction: %w", err).Error()) + } + + log.Printf("Returning back signed tx %s ...\n", string(signedTx.Data)) + + workflow, err = stakingClient.Orchestration.PerformWorkflowStep(ctx, &stakingpb.PerformWorkflowStepRequest{ + Name: workflow.Name, + Step: workflow.GetCurrentStepId(), + Data: string(signedTx.Data), + }) + if err != nil { + log.Fatalf(fmt.Errorf("error updating workflow with signed tx: %w", err).Error()) + } + } else if v1.WorkflowWaitingForExternalBroadcast(workflow) { + unsignedTx := workflow.Steps[workflow.GetCurrentStepId()].GetTxStepOutput().GetUnsignedTx() + + fmt.Printf("Please sign and broadcast this unsigned tx %s externally and return back the tx hash via the PerformWorkflowStep API ...\n", unsignedTx) + break + } else if v1.WorkflowFinished(workflow) { + break + } + + // Sleep for 5 seconds before polling for workflow status again + time.Sleep(5 * time.Second) + } +} + +func printWorkflowProgressDetails(workflow *stakingpb.Workflow) { + if len(workflow.GetSteps()) <= 0 { + fmt.Println("Waiting for steps to be created ...") + time.Sleep(2 * time.Second) + } + + step := workflow.Steps[workflow.GetCurrentStepId()] + + createTime := workflow.GetCreateTime().AsTime() + updateTime := workflow.GetUpdateTime().AsTime() + runtime := updateTime.Sub(createTime) + + var stepDetails string + + switch step.GetOutput().(type) { + case *stakingpb.WorkflowStep_TxStepOutput: + stepDetails = fmt.Sprintf("state: %s tx hash: %s", + step.GetTxStepOutput().GetState().String(), + step.GetTxStepOutput().GetTxHash(), + ) + case *stakingpb.WorkflowStep_WaitStepOutput: + stepDetails = fmt.Sprintf("state: %s current: %d target: %d", + step.GetWaitStepOutput().GetState().String(), + step.GetWaitStepOutput().GetCurrent(), + step.GetWaitStepOutput().GetTarget(), + ) + } + + if v1.WorkflowFinished(workflow) { + log.Printf("Workflow reached end state - step name: %s %s workflow state: %s runtime: %v\n", + step.GetName(), + stepDetails, + workflow.GetState().String(), + runtime, + ) + } else { + log.Printf("Waiting for workflow to finish - step name: %s %s workflow state: %s runtime: %v\n", + step.GetName(), + stepDetails, + workflow.GetState().String(), + runtime, + ) + } +} diff --git a/examples/ethereum/create-workflow/main.go b/examples/ethereum/create-workflow/main.go new file mode 100644 index 0000000..ef48fe5 --- /dev/null +++ b/examples/ethereum/create-workflow/main.go @@ -0,0 +1,67 @@ +/* + * This example code, demonstrates creating an Ethereum Partial ETH (<32 ETH) workflow, the fundamental process handler for an E2E staking experience. + */ + +package main + +import ( + "context" + "fmt" + "log" + + "github.com/coinbase/staking-client-library-go/auth" + "github.com/coinbase/staking-client-library-go/client" + "github.com/coinbase/staking-client-library-go/client/options" + stakingpb "github.com/coinbase/staking-client-library-go/gen/go/coinbase/staking/orchestration/v1" +) + +func main() { + // TODO: Add your project ID found at cloud.coinbase.com or in your API key. + projectID := "" + + ctx := context.Background() + + apiKey, err := auth.NewAPIKey(auth.WithLoadAPIKeyFromFile(true)) + if err != nil { + log.Fatalf("error loading API key: %s", err.Error()) + } + + // Create a staking client. + stakingClient, err := client.New(ctx, options.WithAPIKey(apiKey)) + if err != nil { + log.Fatalf("error instantiating staking client: %s", err.Error()) + } + + if projectID == "" { + log.Fatalf("projectID must be set") + } + + req := &stakingpb.CreateWorkflowRequest{ + Parent: fmt.Sprintf("projects/%s", projectID), + Workflow: &stakingpb.Workflow{ + Action: "protocols/ethereum_kiln/networks/holesky/actions/stake", + StakingParameters: &stakingpb.Workflow_EthereumKilnStakingParameters{ + EthereumKilnStakingParameters: &stakingpb.EthereumKilnStakingParameters{ + Parameters: &stakingpb.EthereumKilnStakingParameters_StakeParameters{ + StakeParameters: &stakingpb.EthereumKilnStakeParameters{ + StakerAddress: "0xdb816889F2a7362EF242E5a717dfD5B38Ae849FE", + IntegratorContractAddress: "0xA55416de5DE61A0AC1aa8970a280E04388B1dE4b", + Amount: &stakingpb.Amount{ + Value: "20", + Currency: "ETH", + }, + }, + }, + }, + }, + SkipBroadcast: true, + }, + } + + workflow, err := stakingClient.Orchestration.CreateWorkflow(ctx, req) + if err != nil { + log.Fatalf("couldn't create workflow: %s", err.Error()) + } + + log.Printf("Workflow created: %s", workflow.Name) +} diff --git a/examples/ethereum/list-rewards/main.go b/examples/ethereum/list-rewards/main.go new file mode 100644 index 0000000..a4a150c --- /dev/null +++ b/examples/ethereum/list-rewards/main.go @@ -0,0 +1,66 @@ +/* + * This example code demonstrates rewards client library usage for listing rewards + */ + +package main + +import ( + "context" + "encoding/json" + "errors" + "fmt" + "log" + "time" + + "google.golang.org/api/iterator" + + "github.com/coinbase/staking-client-library-go/auth" + "github.com/coinbase/staking-client-library-go/client" + "github.com/coinbase/staking-client-library-go/client/options" + rewardsV1 "github.com/coinbase/staking-client-library-go/client/rewards/v1" + rewardspb "github.com/coinbase/staking-client-library-go/gen/go/coinbase/staking/rewards/v1" +) + +func main() { + ctx := context.Background() + + // Loads the API key from the default location. + apiKey, err := auth.NewAPIKey(auth.WithLoadAPIKeyFromFile(true)) + if err != nil { + log.Fatalf("error loading API key: %s", err.Error()) + } + + // Creates the Coinbase Staking API client + stakingClient, err := client.New(ctx, options.WithAPIKey(apiKey)) + if err != nil { + log.Fatalf("error instantiating staking client: %s", err.Error()) + } + + // Lists the rewards for the given address for the previous last 2 days, aggregated by day. + rewardsIter := stakingClient.Rewards.ListRewards(ctx, &rewardspb.ListRewardsRequest{ + Parent: rewardspb.ProtocolResourceName{Protocol: "ethereum"}.String(), + PageSize: 200, + Filter: rewardsV1.WithAddress().Eq("0xac53512c39d0081ca4437c285305eb423f474e6153693c12fbba4a3df78bcaa3422b31d800c5bea71c1b017168a60474"). + And(rewardsV1.WithPeriodEndTime().Gte(time.Now().AddDate(0, 0, -2))). + And(rewardsV1.WithPeriodEndTime().Lt(time.Now())).String(), + }) + + // Iterates through the rewards and print them. + for { + reward, err := rewardsIter.Next() + if errors.Is(err, iterator.Done) { + break + } + + if err != nil { + log.Fatalf("error listing rewards: %s", err.Error()) + } + + marshaled, err := json.MarshalIndent(reward, "", " ") + if err != nil { + log.Fatalf("error marshaling reward: %s", err.Error()) + } + + fmt.Printf(string(marshaled)) + } +} diff --git a/examples/ethereum/list-stakes/main.go b/examples/ethereum/list-stakes/main.go new file mode 100644 index 0000000..dcefdaf --- /dev/null +++ b/examples/ethereum/list-stakes/main.go @@ -0,0 +1,65 @@ +/* + * This example code demonstrates rewards client library usage for listing staking balances + */ + +package main + +import ( + "context" + "errors" + "log" + + "google.golang.org/api/iterator" + "google.golang.org/protobuf/encoding/protojson" + + "github.com/coinbase/staking-client-library-go/auth" + "github.com/coinbase/staking-client-library-go/client" + "github.com/coinbase/staking-client-library-go/client/options" + rewardspb "github.com/coinbase/staking-client-library-go/gen/go/coinbase/staking/rewards/v1" +) + +// An example function to demonstrate how to use the staking client libraries. +func main() { + ctx := context.Background() + + apiKey, err := auth.NewAPIKey(auth.WithLoadAPIKeyFromFile(true)) + if err != nil { + log.Fatalf("error loading API key: %s", err.Error()) + } + + authOpt := options.WithAPIKey(apiKey) + + // Create a staking client. + stakingClient, err := client.New(ctx, authOpt) + if err != nil { + log.Fatalf("error instantiating staking client: %s", err.Error()) + } + + // List all rewards for the given address, aggregated by epoch, for epochs that ended in the last 30 days. + + rewardsIter := stakingClient.Rewards.ListStakes(ctx, &rewardspb.ListStakesRequest{ + Parent: rewardspb.ProtocolResourceName{Protocol: "ethereum"}.String(), + PageSize: 200, + Filter: `address='0xac53512c39d0081ca4437c285305eb423f474e6153693c12fbba4a3df78bcaa3422b31d800c5bea71c1b017168a60474' AND evaluation_time>='2023-12-12T07:25:11-04:00' AND evaluation_time<='2023-12-12T08:20:50-04:00'`, + }) + + count := 0 + for { + reward, err := rewardsIter.Next() + if errors.Is(err, iterator.Done) { + break + } + + if err != nil { + log.Fatalf("error listing rewards: %s", err.Error()) + } + + d, err := protojson.Marshal(reward) + if err != nil { + log.Fatalf("error marshalling reward object: %s", err.Error()) + } + + log.Printf("[%d] Reward details: %s", count, d) + count += 1 + } +} diff --git a/examples/hello-world/main.go b/examples/hello-world/main.go new file mode 100644 index 0000000..7c32adf --- /dev/null +++ b/examples/hello-world/main.go @@ -0,0 +1,98 @@ +/* + * This example code, demonstrates staking client library usage for listing supported Protocols, Networks and Actions. + */ + +package main + +import ( + "context" + "errors" + "log" + + "google.golang.org/api/iterator" + + "github.com/coinbase/staking-client-library-go/auth" + "github.com/coinbase/staking-client-library-go/client" + "github.com/coinbase/staking-client-library-go/client/options" + stakingpb "github.com/coinbase/staking-client-library-go/gen/go/coinbase/staking/orchestration/v1" +) + +// An example function that verifies the API key has been configured correctly and you can connect to the Coinbase Staking API. +func main() { + ctx := context.Background() + + apiKey, err := auth.NewAPIKey(auth.WithLoadAPIKeyFromFile(true)) + if err != nil { + log.Fatalf("error loading API key: %s", err.Error()) + } + + authOpt := options.WithAPIKey(apiKey) + + // Create a staking client. + stakingClient, err := client.New(ctx, authOpt) + if err != nil { + log.Fatalf("error instantiating staking client: %s", err.Error()) + } + + // List all protocols. + protocols, err := stakingClient.Orchestration.ListProtocols(ctx, &stakingpb.ListProtocolsRequest{}) + if err != nil { + log.Fatalf("error listing protocols: %s", err.Error()) + } + + for _, protocol := range protocols.Protocols { + log.Printf("got protocol: %s", protocol.Name) + } + + protocol := "protocols/ethereum_kiln" + + // List all networks for a supported protocol. + networks, err := stakingClient.Orchestration.ListNetworks(ctx, &stakingpb.ListNetworksRequest{ + Parent: protocol, + }) + if err != nil { + log.Fatalf("error listing networks: %s", err.Error()) + } + + for _, network := range networks.Networks { + log.Printf("got network: %s", network.Name) + } + + network := "protocols/ethereum_kiln/networks/holesky" + + // List all actions for a supported network. + actions, err := stakingClient.Orchestration.ListActions(ctx, &stakingpb.ListActionsRequest{ + Parent: network, + }) + if err != nil { + log.Fatalf("error listing actions: %s", err.Error()) + } + + for _, action := range actions.Actions { + log.Printf("got action: %s", action.Name) + } + + // List all staking targets for a supported network. + iter := stakingClient.Orchestration.ListStakingTargets(ctx, &stakingpb.ListStakingTargetsRequest{ + Parent: network, + }) + + for { + stakingTarget, err := iter.Next() + if errors.Is(err, iterator.Done) { + break + } + + if err != nil { + log.Fatalf("error listing staking targets: %s", err.Error()) + } + + switch stakingTarget.GetStakingTargets().(type) { + case *stakingpb.StakingTarget_Validator: + log.Printf("got validator: %s", stakingTarget.GetValidator().String()) + case *stakingpb.StakingTarget_Contract: + log.Printf("got contract: %s", stakingTarget.GetContract().String()) + } + + } +} diff --git a/examples/list-workflows/main.go b/examples/list-workflows/main.go new file mode 100644 index 0000000..ab51516 --- /dev/null +++ b/examples/list-workflows/main.go @@ -0,0 +1,64 @@ +/* + * This example code, demonstrates staking client library usage for listing supported Protocols, Networks and Actions. + */ + +package main + +import ( + "context" + "errors" + "fmt" + "log" + + "google.golang.org/api/iterator" + + "github.com/coinbase/staking-client-library-go/auth" + "github.com/coinbase/staking-client-library-go/client" + "github.com/coinbase/staking-client-library-go/client/options" + stakingpb "github.com/coinbase/staking-client-library-go/gen/go/coinbase/staking/orchestration/v1" +) + +const ( + // TODO: Replace with your project ID. + projectID = "" +) + +// An example function to demonstrate how to use the staking client libraries. +func main() { + ctx := context.Background() + + apiKey, err := auth.NewAPIKey(auth.WithLoadAPIKeyFromFile(true)) + if err != nil { + log.Fatalf("error loading API key: %s", err.Error()) + } + + authOpt := options.WithAPIKey(apiKey) + + // Create a staking client. + stakingClient, err := client.New(ctx, authOpt) + if err != nil { + log.Fatalf("error instantiating staking client: %s", err.Error()) + } + + if projectID == "" { + log.Fatalf("projectID must be set") + } + + // List all workflows for a given project. + workflowIter := stakingClient.Orchestration.ListWorkflows(ctx, &stakingpb.ListWorkflowsRequest{ + Parent: fmt.Sprintf("projects/%s", projectID), + }) + + for { + workflow, err := workflowIter.Next() + if errors.Is(err, iterator.Done) { + break + } + + if err != nil { + log.Fatalf("error listing workflows: %s", err.Error()) + } + + log.Println("workflow name:", workflow.GetName()) + } +} diff --git a/examples/solana/create-workflow/main.go b/examples/solana/create-workflow/main.go new file mode 100644 index 0000000..3699a4e --- /dev/null +++ b/examples/solana/create-workflow/main.go @@ -0,0 +1,158 @@ +/* + * This example code, demonstrates staking client library usage for performing e2e staking on Solana. + */ + +package main + +import ( + "context" + "fmt" + "log" + "os" + "time" + + "github.com/coinbase/staking-client-library-go/auth" + "github.com/coinbase/staking-client-library-go/client" + stakingerrors "github.com/coinbase/staking-client-library-go/client/errors" + "github.com/coinbase/staking-client-library-go/client/options" + "github.com/coinbase/staking-client-library-go/client/orchestration/v1" + stakingpb "github.com/coinbase/staking-client-library-go/gen/go/coinbase/staking/orchestration/v1" +) + +const ( + // TODO: Replace with your project ID. + projectID = "" + + // TODO: Replace with your wallet addresses and amount. + walletAddress = "" + validatorAddress = "GkqYQysEGmuL6V2AJoNnWZUz2ZBGWhzQXsJiXm2CLKAN" + amount = "100000000" + currency = "SOL" +) + +// An example function to demonstrate how to use the staking client libraries. +func main() { + ctx := context.Background() + + apiKey, err := auth.NewAPIKey(auth.WithLoadAPIKeyFromFile(true)) + if err != nil { + log.Fatalf("error loading API key: %s", err.Error()) + } + + authOpt := options.WithAPIKey(apiKey) + + // Create a staking client. + stakingClient, err := client.New(ctx, authOpt) + if err != nil { + log.Fatalf("error instantiating staking client: %s", err.Error()) + } + + if projectID == "" || walletAddress == "" { + log.Fatalf("projectID and walletAddress must be set") + } + + req := &stakingpb.CreateWorkflowRequest{ + Parent: fmt.Sprintf("projects/%s", projectID), + Workflow: &stakingpb.Workflow{ + Action: "protocols/solana/networks/testnet/actions/stake", + StakingParameters: &stakingpb.Workflow_SolanaStakingParameters{ + SolanaStakingParameters: &stakingpb.SolanaStakingParameters{ + Parameters: &stakingpb.SolanaStakingParameters_StakeParameters{ + StakeParameters: &stakingpb.SolanaStakeParameters{ + WalletAddress: walletAddress, + ValidatorAddress: validatorAddress, + Amount: &stakingpb.Amount{ + Value: amount, + Currency: currency, + }, + }, + }, + }, + }, + SkipBroadcast: true, + }, + } + + workflow, err := stakingClient.Orchestration.CreateWorkflow(ctx, req) + if err != nil { + sae := stakingerrors.FromError(err) + _ = sae.Print() + os.Exit(1) + } + + log.Printf("Workflow created %s ...\n", workflow.Name) + + // Run loop until workflow reaches a terminal state + for { + // Get the latest workflow state + workflow, err = stakingClient.Orchestration.GetWorkflow(ctx, &stakingpb.GetWorkflowRequest{Name: workflow.Name}) + if err != nil { + log.Fatalf(fmt.Errorf("error getting workflow: %w", err).Error()) + } + + printWorkflowProgressDetails(workflow) + + // If workflow is in WAITING_FOR_SIGNING state, sign the transaction and update the workflow + if v1.WorkflowWaitingForSigning(workflow) { + unsignedTx := workflow.Steps[workflow.GetCurrentStepId()].GetTxStepOutput().GetUnsignedTx() + + fmt.Printf("Please sign this unsigned tx and return back the signed tx via the PerformWorkflowStep API : %s\n", unsignedTx) + break + } else if v1.WorkflowWaitingForExternalBroadcast(workflow) { + unsignedTx := workflow.Steps[workflow.GetCurrentStepId()].GetTxStepOutput().GetUnsignedTx() + + fmt.Printf("Please sign and broadcast this unsigned tx externally and return back the tx hash via the PerformWorkflowStep API : %s\n", unsignedTx) + break + } else if v1.WorkflowFinished(workflow) { + break + } + + // Sleep for 5 seconds before polling for workflow status again + time.Sleep(5 * time.Second) + } +} + +func printWorkflowProgressDetails(workflow *stakingpb.Workflow) { + if len(workflow.GetSteps()) <= 0 { + fmt.Println("Waiting for steps to be created ...") + time.Sleep(2 * time.Second) + } + + step := workflow.Steps[workflow.GetCurrentStepId()] + + createTime := workflow.GetCreateTime().AsTime() + updateTime := workflow.GetUpdateTime().AsTime() + runtime := updateTime.Sub(createTime) + + var stepDetails string + + switch step.GetOutput().(type) { + case *stakingpb.WorkflowStep_TxStepOutput: + stepDetails = fmt.Sprintf("state: %s tx hash: %s", + step.GetTxStepOutput().GetState().String(), + step.GetTxStepOutput().GetTxHash(), + ) + case *stakingpb.WorkflowStep_WaitStepOutput: + stepDetails = fmt.Sprintf("state: %s current: %d target: %d", + step.GetWaitStepOutput().GetState().String(), + step.GetWaitStepOutput().GetCurrent(), + step.GetWaitStepOutput().GetTarget(), + ) + } + + if v1.WorkflowFinished(workflow) { + log.Printf("Workflow reached end state - step name: %s %s workflow state: %s runtime: %v\n", + step.GetName(), + stepDetails, + workflow.GetState().String(), + runtime, + ) + } else { + log.Printf("Waiting for workflow to finish - step name: %s %s workflow state: %s runtime: %v\n", + step.GetName(), + stepDetails, + workflow.GetState().String(), + runtime, + ) + } +} diff --git a/examples/solana/list-rewards/main.go b/examples/solana/list-rewards/main.go new file mode 100644 index 0000000..6a92c68 --- /dev/null +++ b/examples/solana/list-rewards/main.go @@ -0,0 +1,76 @@ +/* + * This example code, demonstrates rewards client library usage for listing rewards + */ + +package main + +import ( + "context" + "errors" + "log" + "time" + + "google.golang.org/api/iterator" + "google.golang.org/protobuf/encoding/protojson" + + "github.com/coinbase/staking-client-library-go/auth" + "github.com/coinbase/staking-client-library-go/client" + "github.com/coinbase/staking-client-library-go/client/options" + rewardsV1 "github.com/coinbase/staking-client-library-go/client/rewards/v1" + rewardspb "github.com/coinbase/staking-client-library-go/gen/go/coinbase/staking/rewards/v1" +) + +const ( + // TODO: Replace address as per your requirement. + address = "beefKGBWeSpHzYBHZXwp5So7wdQGX6mu4ZHCsH3uTar" +) + +// An example function to demonstrate how to use the staking client libraries. +func main() { + ctx := context.Background() + + apiKey, err := auth.NewAPIKey(auth.WithLoadAPIKeyFromFile(true)) + if err != nil { + log.Fatalf("error loading API key: %s", err.Error()) + } + + authOpt := options.WithAPIKey(apiKey) + + // Create a staking client. + stakingClient, err := client.New(ctx, authOpt) + if err != nil { + log.Fatalf("error instantiating staking client: %s", err.Error()) + } + + // List all rewards for the given address, aggregated by epoch, for epochs that ended in the last 30 days. + now := time.Now() + thirtyDaysAgo := now.AddDate(0, 0, -30) + + rewardsIter := stakingClient.Rewards.ListRewards(ctx, &rewardspb.ListRewardsRequest{ + Parent: rewardspb.ProtocolResourceName{Protocol: "solana"}.String(), + PageSize: 20, + Filter: rewardsV1.WithAddress().Eq(address). + And(rewardsV1.WithPeriodEndTime().Gte(thirtyDaysAgo)). + And(rewardsV1.WithPeriodEndTime().Lt(now)).String(), + }) + + count := 0 + for { + reward, err := rewardsIter.Next() + if errors.Is(err, iterator.Done) { + break + } + + if err != nil { + log.Fatalf("error listing rewards: %s", err.Error()) + } + + d, err := protojson.Marshal(reward) + if err != nil { + log.Fatalf("error marshalling reward object: %s", err.Error()) + } + + log.Printf("[%d] Reward details: %s", count, d) + count += 1 + } +} diff --git a/gen/client/coinbase/staking/orchestration/v1/doc.go b/gen/client/coinbase/staking/orchestration/v1/doc.go new file mode 100644 index 0000000..82cde6d --- /dev/null +++ b/gen/client/coinbase/staking/orchestration/v1/doc.go @@ -0,0 +1,177 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by protoc-gen-go_gapic. DO NOT EDIT. + +// +// General documentation +// +// For information about setting deadlines, reusing contexts, and more +// please visit https://pkg.go.dev/cloud.google.com/go. +// +// Example usage +// +// To get started with this package, create a client. +// ctx := context.Background() +// // This snippet has been automatically generated and should be regarded as a code template only. +// // It will require modifications to work: +// // - It may require correct/in-range values for request initialization. +// // - It may require specifying regional endpoints when creating the service client as shown in: +// // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options +// c, err := v1.NewStakingClient(ctx) +// if err != nil { +// // TODO: Handle error. +// } +// defer c.Close() +// +// The client will use your default application credentials. Clients should be reused instead of created as needed. +// The methods of Client are safe for concurrent use by multiple goroutines. +// The returned client must be Closed when it is done being used. +// +// Using the Client +// +// The following is an example of making an API call with the newly created client. +// +// ctx := context.Background() +// // This snippet has been automatically generated and should be regarded as a code template only. +// // It will require modifications to work: +// // - It may require correct/in-range values for request initialization. +// // - It may require specifying regional endpoints when creating the service client as shown in: +// // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options +// c, err := v1.NewStakingClient(ctx) +// if err != nil { +// // TODO: Handle error. +// } +// defer c.Close() +// +// req := &stakingpb.ListProtocolsRequest{ +// // TODO: Fill request struct fields. +// // See https://pkg.go.dev/github.com/coinbase/staking-client-library-go/gen/go/coinbase/staking/orchestration/v1#ListProtocolsRequest. +// } +// resp, err := c.ListProtocols(ctx, req) +// if err != nil { +// // TODO: Handle error. +// } +// // TODO: Use resp. +// _ = resp +// +// Use of Context +// +// The ctx passed to NewStakingClient is used for authentication requests and +// for creating the underlying connection, but is not used for subsequent calls. +// Individual methods on the client use the ctx given to them. +// +// To close the open connection, use the Close() method. +package v1 // import "github.com/coinbase/staking-client-library-go/gen/client/coinbase/staking/orchestration/v1" + +import ( + "context" + "fmt" + "net/http" + "runtime" + "strings" + "unicode" + + "google.golang.org/api/option" + "google.golang.org/grpc/metadata" +) + +// For more information on implementing a client constructor hook, see +// https://github.com/googleapis/google-cloud-go/wiki/Customizing-constructors. +type clientHookParams struct{} +type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) + +var versionClient string + +func getVersionClient() string { + if versionClient == "" { + return "UNKNOWN" + } + return versionClient +} + +func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { + out, _ := metadata.FromOutgoingContext(ctx) + out = out.Copy() + for _, md := range mds { + for k, v := range md { + out[k] = append(out[k], v...) + } + } + return metadata.NewOutgoingContext(ctx, out) +} + +// DefaultAuthScopes reports the default set of authentication scopes to use with this package. +func DefaultAuthScopes() []string { + return []string{ + "", + } +} + +// versionGo returns the Go runtime version. The returned string +// has no whitespace, suitable for reporting in header. +func versionGo() string { + const develPrefix = "devel +" + + s := runtime.Version() + if strings.HasPrefix(s, develPrefix) { + s = s[len(develPrefix):] + if p := strings.IndexFunc(s, unicode.IsSpace); p >= 0 { + s = s[:p] + } + return s + } + + notSemverRune := func(r rune) bool { + return !strings.ContainsRune("0123456789.", r) + } + + if strings.HasPrefix(s, "go1") { + s = s[2:] + var prerelease string + if p := strings.IndexFunc(s, notSemverRune); p >= 0 { + s, prerelease = s[:p], s[p:] + } + if strings.HasSuffix(s, ".") { + s += "0" + } else if strings.Count(s, ".") < 2 { + s += ".0" + } + if prerelease != "" { + s += "-" + prerelease + } + return s + } + return "UNKNOWN" +} + +// maybeUnknownEnum wraps the given proto-JSON parsing error if it is the result +// of receiving an unknown enum value. +func maybeUnknownEnum(err error) error { + if strings.Contains(err.Error(), "invalid value for enum type") { + err = fmt.Errorf("received an unknown enum value; a later version of the library may support it: %w", err) + } + return err +} + +// buildHeaders extracts metadata from the outgoing context, joins it with any other +// given metadata, and converts them into a http.Header. +func buildHeaders(ctx context.Context, mds ...metadata.MD) http.Header { + if cmd, ok := metadata.FromOutgoingContext(ctx); ok { + mds = append(mds, cmd) + } + md := metadata.Join(mds...) + return http.Header(md) +} + diff --git a/gen/client/coinbase/staking/orchestration/v1/staking_client.go b/gen/client/coinbase/staking/orchestration/v1/staking_client.go new file mode 100644 index 0000000..c14db70 --- /dev/null +++ b/gen/client/coinbase/staking/orchestration/v1/staking_client.go @@ -0,0 +1,1207 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by protoc-gen-go_gapic. DO NOT EDIT. + + +package v1 + +import ( + "bytes" + "context" + "fmt" + "io/ioutil" + "math" + "net/http" + "net/url" + + stakingpb "github.com/coinbase/staking-client-library-go/gen/go/coinbase/staking/orchestration/v1" + gax "github.com/googleapis/gax-go/v2" + "google.golang.org/api/googleapi" + "google.golang.org/api/iterator" + "google.golang.org/api/option" + "google.golang.org/api/option/internaloption" + gtransport "google.golang.org/api/transport/grpc" + httptransport "google.golang.org/api/transport/http" + "google.golang.org/grpc" + "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/encoding/protojson" + "google.golang.org/protobuf/proto" +) + +var newStakingClientHook clientHook + +// StakingCallOptions contains the retry settings for each method of StakingClient. +type StakingCallOptions struct { + ListProtocols []gax.CallOption + ListNetworks []gax.CallOption + ListStakingTargets []gax.CallOption + ListActions []gax.CallOption + CreateWorkflow []gax.CallOption + GetWorkflow []gax.CallOption + ListWorkflows []gax.CallOption + PerformWorkflowStep []gax.CallOption + ViewStakingContext []gax.CallOption +} + +func defaultStakingGRPCClientOptions() []option.ClientOption { + return []option.ClientOption{ + internaloption.WithDefaultEndpoint("api.developer.coinbase.com:443"), + internaloption.WithDefaultMTLSEndpoint("api.developer.coinbase.com:443"), + internaloption.WithDefaultAudience("https://api.developer.coinbase.com/"), + internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), + option.WithGRPCDialOption(grpc.WithDefaultCallOptions( + grpc.MaxCallRecvMsgSize(math.MaxInt32))), + } +} + +func defaultStakingCallOptions() *StakingCallOptions { + return &StakingCallOptions{ + ListProtocols: []gax.CallOption{ + }, + ListNetworks: []gax.CallOption{ + }, + ListStakingTargets: []gax.CallOption{ + }, + ListActions: []gax.CallOption{ + }, + CreateWorkflow: []gax.CallOption{ + }, + GetWorkflow: []gax.CallOption{ + }, + ListWorkflows: []gax.CallOption{ + }, + PerformWorkflowStep: []gax.CallOption{ + }, + ViewStakingContext: []gax.CallOption{ + }, + } +} + +func defaultStakingRESTCallOptions() *StakingCallOptions { + return &StakingCallOptions{ + ListProtocols: []gax.CallOption{ + }, + ListNetworks: []gax.CallOption{ + }, + ListStakingTargets: []gax.CallOption{ + }, + ListActions: []gax.CallOption{ + }, + CreateWorkflow: []gax.CallOption{ + }, + GetWorkflow: []gax.CallOption{ + }, + ListWorkflows: []gax.CallOption{ + }, + PerformWorkflowStep: []gax.CallOption{ + }, + ViewStakingContext: []gax.CallOption{ + }, + } +} + +// internalStakingClient is an interface that defines the methods available from . +type internalStakingClient interface { + Close() error + setGoogleClientInfo(...string) + Connection() *grpc.ClientConn + ListProtocols(context.Context, *stakingpb.ListProtocolsRequest, ...gax.CallOption) (*stakingpb.ListProtocolsResponse, error) + ListNetworks(context.Context, *stakingpb.ListNetworksRequest, ...gax.CallOption) (*stakingpb.ListNetworksResponse, error) + ListStakingTargets(context.Context, *stakingpb.ListStakingTargetsRequest, ...gax.CallOption) *StakingTargetIterator + ListActions(context.Context, *stakingpb.ListActionsRequest, ...gax.CallOption) (*stakingpb.ListActionsResponse, error) + CreateWorkflow(context.Context, *stakingpb.CreateWorkflowRequest, ...gax.CallOption) (*stakingpb.Workflow, error) + GetWorkflow(context.Context, *stakingpb.GetWorkflowRequest, ...gax.CallOption) (*stakingpb.Workflow, error) + ListWorkflows(context.Context, *stakingpb.ListWorkflowsRequest, ...gax.CallOption) *WorkflowIterator + PerformWorkflowStep(context.Context, *stakingpb.PerformWorkflowStepRequest, ...gax.CallOption) (*stakingpb.Workflow, error) + ViewStakingContext(context.Context, *stakingpb.ViewStakingContextRequest, ...gax.CallOption) (*stakingpb.ViewStakingContextResponse, error) +} + +// StakingClient is a client for interacting with . +// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. +// +// StakingService manages staking related resources such as protocols, networks, validators and workflows. +type StakingClient struct { + // The internal transport-dependent client. + internalClient internalStakingClient + + // The call options for this service. + CallOptions *StakingCallOptions + +} + +// Wrapper methods routed to the internal client. + +// Close closes the connection to the API service. The user should invoke this when +// the client is no longer required. +func (c *StakingClient) Close() error { + return c.internalClient.Close() +} + +// setGoogleClientInfo sets the name and version of the application in +// the `x-goog-api-client` header passed on each request. Intended for +// use by Google-written clients. +func (c *StakingClient) setGoogleClientInfo(keyval ...string) { + c.internalClient.setGoogleClientInfo(keyval...) +} + +// Connection returns a connection to the API service. +// +// Deprecated: Connections are now pooled so this method does not always +// return the same resource. +func (c *StakingClient) Connection() *grpc.ClientConn { + return c.internalClient.Connection() +} + +// ListProtocols list supported protocols. +func (c *StakingClient) ListProtocols(ctx context.Context, req *stakingpb.ListProtocolsRequest, opts ...gax.CallOption) (*stakingpb.ListProtocolsResponse, error) { + return c.internalClient.ListProtocols(ctx, req, opts...) +} + +// ListNetworks list supported staking networks for a given protocol. +func (c *StakingClient) ListNetworks(ctx context.Context, req *stakingpb.ListNetworksRequest, opts ...gax.CallOption) (*stakingpb.ListNetworksResponse, error) { + return c.internalClient.ListNetworks(ctx, req, opts...) +} + +// ListStakingTargets list supported staking targets for a given protocol and network. +func (c *StakingClient) ListStakingTargets(ctx context.Context, req *stakingpb.ListStakingTargetsRequest, opts ...gax.CallOption) *StakingTargetIterator { + return c.internalClient.ListStakingTargets(ctx, req, opts...) +} + +// ListActions list supported actions for a given protocol and network. +func (c *StakingClient) ListActions(ctx context.Context, req *stakingpb.ListActionsRequest, opts ...gax.CallOption) (*stakingpb.ListActionsResponse, error) { + return c.internalClient.ListActions(ctx, req, opts...) +} + +// CreateWorkflow create a workflow to perform an action. +func (c *StakingClient) CreateWorkflow(ctx context.Context, req *stakingpb.CreateWorkflowRequest, opts ...gax.CallOption) (*stakingpb.Workflow, error) { + return c.internalClient.CreateWorkflow(ctx, req, opts...) +} + +// GetWorkflow get the current state of an active workflow. +func (c *StakingClient) GetWorkflow(ctx context.Context, req *stakingpb.GetWorkflowRequest, opts ...gax.CallOption) (*stakingpb.Workflow, error) { + return c.internalClient.GetWorkflow(ctx, req, opts...) +} + +// ListWorkflows list all workflows in a project. +func (c *StakingClient) ListWorkflows(ctx context.Context, req *stakingpb.ListWorkflowsRequest, opts ...gax.CallOption) *WorkflowIterator { + return c.internalClient.ListWorkflows(ctx, req, opts...) +} + +// PerformWorkflowStep perform the next step in a workflow. +func (c *StakingClient) PerformWorkflowStep(ctx context.Context, req *stakingpb.PerformWorkflowStepRequest, opts ...gax.CallOption) (*stakingpb.Workflow, error) { + return c.internalClient.PerformWorkflowStep(ctx, req, opts...) +} + +// ViewStakingContext view Staking context information given a specific network address. +func (c *StakingClient) ViewStakingContext(ctx context.Context, req *stakingpb.ViewStakingContextRequest, opts ...gax.CallOption) (*stakingpb.ViewStakingContextResponse, error) { + return c.internalClient.ViewStakingContext(ctx, req, opts...) +} + +// stakingGRPCClient is a client for interacting with over gRPC transport. +// +// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. +type stakingGRPCClient struct { + // Connection pool of gRPC connections to the service. + connPool gtransport.ConnPool + + // Points back to the CallOptions field of the containing StakingClient + CallOptions **StakingCallOptions + + // The gRPC API client. + stakingClient stakingpb.StakingServiceClient + + // The x-goog-* metadata to be sent with each request. + xGoogMetadata metadata.MD +} + +// NewStakingClient creates a new staking service client based on gRPC. +// The returned client must be Closed when it is done being used to clean up its underlying connections. +// +// StakingService manages staking related resources such as protocols, networks, validators and workflows. +func NewStakingClient(ctx context.Context, opts ...option.ClientOption) (*StakingClient, error) { + clientOpts := defaultStakingGRPCClientOptions() + if newStakingClientHook != nil { + hookOpts, err := newStakingClientHook(ctx, clientHookParams{}) + if err != nil { + return nil, err + } + clientOpts = append(clientOpts, hookOpts...) + } + + connPool, err := gtransport.DialPool(ctx, append(clientOpts, opts...)...) + if err != nil { + return nil, err + } + client := StakingClient{CallOptions: defaultStakingCallOptions()} + + c := &stakingGRPCClient{ + connPool: connPool, + stakingClient: stakingpb.NewStakingServiceClient(connPool), + CallOptions: &client.CallOptions, + + } + c.setGoogleClientInfo() + + client.internalClient = c + + return &client, nil +} + +// Connection returns a connection to the API service. +// +// Deprecated: Connections are now pooled so this method does not always +// return the same resource. +func (c *stakingGRPCClient) Connection() *grpc.ClientConn { + return c.connPool.Conn() +} + +// setGoogleClientInfo sets the name and version of the application in +// the `x-goog-api-client` header passed on each request. Intended for +// use by Google-written clients. +func (c *stakingGRPCClient) setGoogleClientInfo(keyval ...string) { + kv := append([]string{"gl-go", versionGo()}, keyval...) + kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "grpc", grpc.Version) + c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...)) +} + +// Close closes the connection to the API service. The user should invoke this when +// the client is no longer required. +func (c *stakingGRPCClient) Close() error { + return c.connPool.Close() +} + +// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. +type stakingRESTClient struct { + // The http endpoint to connect to. + endpoint string + + // The http client. + httpClient *http.Client + + // The x-goog-* metadata to be sent with each request. + xGoogMetadata metadata.MD + + // Points back to the CallOptions field of the containing StakingClient + CallOptions **StakingCallOptions +} + +// NewStakingRESTClient creates a new staking service rest client. +// +// StakingService manages staking related resources such as protocols, networks, validators and workflows. +func NewStakingRESTClient(ctx context.Context, opts ...option.ClientOption) (*StakingClient, error) { + clientOpts := append(defaultStakingRESTClientOptions(), opts...) + httpClient, endpoint, err := httptransport.NewClient(ctx, clientOpts...) + if err != nil { + return nil, err + } + + callOpts := defaultStakingRESTCallOptions() + c := &stakingRESTClient{ + endpoint: endpoint, + httpClient: httpClient, + CallOptions: &callOpts, + } + c.setGoogleClientInfo() + + return &StakingClient{internalClient: c, CallOptions: callOpts}, nil +} + +func defaultStakingRESTClientOptions() []option.ClientOption { + return []option.ClientOption{ + internaloption.WithDefaultEndpoint("https://api.developer.coinbase.com"), + internaloption.WithDefaultMTLSEndpoint("https://api.developer.coinbase.com"), + internaloption.WithDefaultAudience("https://api.developer.coinbase.com/"), + internaloption.WithDefaultScopes(DefaultAuthScopes()...), + } +} +// setGoogleClientInfo sets the name and version of the application in +// the `x-goog-api-client` header passed on each request. Intended for +// use by Google-written clients. +func (c *stakingRESTClient) setGoogleClientInfo(keyval ...string) { + kv := append([]string{"gl-go", versionGo()}, keyval...) + kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "rest", "UNKNOWN") + c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...)) +} + +// Close closes the connection to the API service. The user should invoke this when +// the client is no longer required. +func (c *stakingRESTClient) Close() error { + // Replace httpClient with nil to force cleanup. + c.httpClient = nil + return nil +} + +// Connection returns a connection to the API service. +// +// Deprecated: This method always returns nil. +func (c *stakingRESTClient) Connection() *grpc.ClientConn { + return nil +} +func (c *stakingGRPCClient) ListProtocols(ctx context.Context, req *stakingpb.ListProtocolsRequest, opts ...gax.CallOption) (*stakingpb.ListProtocolsResponse, error) { + ctx = insertMetadata(ctx, c.xGoogMetadata) + opts = append((*c.CallOptions).ListProtocols[0:len((*c.CallOptions).ListProtocols):len((*c.CallOptions).ListProtocols)], opts...) + var resp *stakingpb.ListProtocolsResponse + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.stakingClient.ListProtocols(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *stakingGRPCClient) ListNetworks(ctx context.Context, req *stakingpb.ListNetworksRequest, opts ...gax.CallOption) (*stakingpb.ListNetworksResponse, error) { + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))) + + ctx = insertMetadata(ctx, c.xGoogMetadata, md) + opts = append((*c.CallOptions).ListNetworks[0:len((*c.CallOptions).ListNetworks):len((*c.CallOptions).ListNetworks)], opts...) + var resp *stakingpb.ListNetworksResponse + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.stakingClient.ListNetworks(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *stakingGRPCClient) ListStakingTargets(ctx context.Context, req *stakingpb.ListStakingTargetsRequest, opts ...gax.CallOption) *StakingTargetIterator { + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))) + + ctx = insertMetadata(ctx, c.xGoogMetadata, md) + opts = append((*c.CallOptions).ListStakingTargets[0:len((*c.CallOptions).ListStakingTargets):len((*c.CallOptions).ListStakingTargets)], opts...) + it := &StakingTargetIterator{} + req = proto.Clone(req).(*stakingpb.ListStakingTargetsRequest) + it.InternalFetch = func(pageSize int, pageToken string) ([]*stakingpb.StakingTarget, string, error) { + resp := &stakingpb.ListStakingTargetsResponse{} + if pageToken != "" { + req.PageToken = pageToken + } + if pageSize > math.MaxInt32 { + req.PageSize = math.MaxInt32 + } else if pageSize != 0 { + req.PageSize = int32(pageSize) + } + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.stakingClient.ListStakingTargets(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, "", err + } + + it.Response = resp + return resp.GetStakingTargets(), resp.GetNextPageToken(), nil + } + fetch := func(pageSize int, pageToken string) (string, error) { + items, nextPageToken, err := it.InternalFetch(pageSize, pageToken) + if err != nil { + return "", err + } + it.items = append(it.items, items...) + return nextPageToken, nil + } + + it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf) + it.pageInfo.MaxSize = int(req.GetPageSize()) + it.pageInfo.Token = req.GetPageToken() + + return it +} + +func (c *stakingGRPCClient) ListActions(ctx context.Context, req *stakingpb.ListActionsRequest, opts ...gax.CallOption) (*stakingpb.ListActionsResponse, error) { + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))) + + ctx = insertMetadata(ctx, c.xGoogMetadata, md) + opts = append((*c.CallOptions).ListActions[0:len((*c.CallOptions).ListActions):len((*c.CallOptions).ListActions)], opts...) + var resp *stakingpb.ListActionsResponse + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.stakingClient.ListActions(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *stakingGRPCClient) CreateWorkflow(ctx context.Context, req *stakingpb.CreateWorkflowRequest, opts ...gax.CallOption) (*stakingpb.Workflow, error) { + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))) + + ctx = insertMetadata(ctx, c.xGoogMetadata, md) + opts = append((*c.CallOptions).CreateWorkflow[0:len((*c.CallOptions).CreateWorkflow):len((*c.CallOptions).CreateWorkflow)], opts...) + var resp *stakingpb.Workflow + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.stakingClient.CreateWorkflow(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *stakingGRPCClient) GetWorkflow(ctx context.Context, req *stakingpb.GetWorkflowRequest, opts ...gax.CallOption) (*stakingpb.Workflow, error) { + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))) + + ctx = insertMetadata(ctx, c.xGoogMetadata, md) + opts = append((*c.CallOptions).GetWorkflow[0:len((*c.CallOptions).GetWorkflow):len((*c.CallOptions).GetWorkflow)], opts...) + var resp *stakingpb.Workflow + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.stakingClient.GetWorkflow(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *stakingGRPCClient) ListWorkflows(ctx context.Context, req *stakingpb.ListWorkflowsRequest, opts ...gax.CallOption) *WorkflowIterator { + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))) + + ctx = insertMetadata(ctx, c.xGoogMetadata, md) + opts = append((*c.CallOptions).ListWorkflows[0:len((*c.CallOptions).ListWorkflows):len((*c.CallOptions).ListWorkflows)], opts...) + it := &WorkflowIterator{} + req = proto.Clone(req).(*stakingpb.ListWorkflowsRequest) + it.InternalFetch = func(pageSize int, pageToken string) ([]*stakingpb.Workflow, string, error) { + resp := &stakingpb.ListWorkflowsResponse{} + if pageToken != "" { + req.PageToken = pageToken + } + if pageSize > math.MaxInt32 { + req.PageSize = math.MaxInt32 + } else if pageSize != 0 { + req.PageSize = int32(pageSize) + } + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.stakingClient.ListWorkflows(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, "", err + } + + it.Response = resp + return resp.GetWorkflows(), resp.GetNextPageToken(), nil + } + fetch := func(pageSize int, pageToken string) (string, error) { + items, nextPageToken, err := it.InternalFetch(pageSize, pageToken) + if err != nil { + return "", err + } + it.items = append(it.items, items...) + return nextPageToken, nil + } + + it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf) + it.pageInfo.MaxSize = int(req.GetPageSize()) + it.pageInfo.Token = req.GetPageToken() + + return it +} + +func (c *stakingGRPCClient) PerformWorkflowStep(ctx context.Context, req *stakingpb.PerformWorkflowStepRequest, opts ...gax.CallOption) (*stakingpb.Workflow, error) { + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))) + + ctx = insertMetadata(ctx, c.xGoogMetadata, md) + opts = append((*c.CallOptions).PerformWorkflowStep[0:len((*c.CallOptions).PerformWorkflowStep):len((*c.CallOptions).PerformWorkflowStep)], opts...) + var resp *stakingpb.Workflow + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.stakingClient.PerformWorkflowStep(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *stakingGRPCClient) ViewStakingContext(ctx context.Context, req *stakingpb.ViewStakingContextRequest, opts ...gax.CallOption) (*stakingpb.ViewStakingContextResponse, error) { + ctx = insertMetadata(ctx, c.xGoogMetadata) + opts = append((*c.CallOptions).ViewStakingContext[0:len((*c.CallOptions).ViewStakingContext):len((*c.CallOptions).ViewStakingContext)], opts...) + var resp *stakingpb.ViewStakingContextResponse + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.stakingClient.ViewStakingContext(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + +// ListProtocols list supported protocols. +func (c *stakingRESTClient) ListProtocols(ctx context.Context, req *stakingpb.ListProtocolsRequest, opts ...gax.CallOption) (*stakingpb.ListProtocolsResponse, error) { + baseUrl, err := url.Parse(c.endpoint) + if err != nil { + return nil, err + } + baseUrl.Path += fmt.Sprintf("/v1/protocols") + + // Build HTTP headers from client and context metadata. + headers := buildHeaders(ctx, c.xGoogMetadata, metadata.Pairs("Content-Type", "application/json")) + opts = append((*c.CallOptions).ListProtocols[0:len((*c.CallOptions).ListProtocols):len((*c.CallOptions).ListProtocols)], opts...) + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + resp := &stakingpb.ListProtocolsResponse{} + e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + if settings.Path != "" { + baseUrl.Path = settings.Path + } + httpReq, err := http.NewRequest("GET", baseUrl.String(), nil) + if err != nil { + return err + } + httpReq = httpReq.WithContext(ctx) + httpReq.Header = headers + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil{ + return err + } + defer httpRsp.Body.Close() + + if err = googleapi.CheckResponse(httpRsp); err != nil { + return err + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return err + } + + if err := unm.Unmarshal(buf, resp); err != nil { + return maybeUnknownEnum(err) + } + + return nil + }, opts...) + if e != nil { + return nil, e + } + return resp, nil +} +// ListNetworks list supported staking networks for a given protocol. +func (c *stakingRESTClient) ListNetworks(ctx context.Context, req *stakingpb.ListNetworksRequest, opts ...gax.CallOption) (*stakingpb.ListNetworksResponse, error) { + baseUrl, err := url.Parse(c.endpoint) + if err != nil { + return nil, err + } + baseUrl.Path += fmt.Sprintf("/v1/%v/networks", req.GetParent()) + + // Build HTTP headers from client and context metadata. + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))) + + headers := buildHeaders(ctx, c.xGoogMetadata, md, metadata.Pairs("Content-Type", "application/json")) + opts = append((*c.CallOptions).ListNetworks[0:len((*c.CallOptions).ListNetworks):len((*c.CallOptions).ListNetworks)], opts...) + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + resp := &stakingpb.ListNetworksResponse{} + e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + if settings.Path != "" { + baseUrl.Path = settings.Path + } + httpReq, err := http.NewRequest("GET", baseUrl.String(), nil) + if err != nil { + return err + } + httpReq = httpReq.WithContext(ctx) + httpReq.Header = headers + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil{ + return err + } + defer httpRsp.Body.Close() + + if err = googleapi.CheckResponse(httpRsp); err != nil { + return err + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return err + } + + if err := unm.Unmarshal(buf, resp); err != nil { + return maybeUnknownEnum(err) + } + + return nil + }, opts...) + if e != nil { + return nil, e + } + return resp, nil +} +// ListStakingTargets list supported staking targets for a given protocol and network. +func (c *stakingRESTClient) ListStakingTargets(ctx context.Context, req *stakingpb.ListStakingTargetsRequest, opts ...gax.CallOption) *StakingTargetIterator { + it := &StakingTargetIterator{} + req = proto.Clone(req).(*stakingpb.ListStakingTargetsRequest) + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + it.InternalFetch = func(pageSize int, pageToken string) ([]*stakingpb.StakingTarget, string, error) { + resp := &stakingpb.ListStakingTargetsResponse{} + if pageToken != "" { + req.PageToken = pageToken + } + if pageSize > math.MaxInt32 { + req.PageSize = math.MaxInt32 + } else if pageSize != 0 { + req.PageSize = int32(pageSize) + } + baseUrl, err := url.Parse(c.endpoint) + if err != nil { + return nil, "", err + } + baseUrl.Path += fmt.Sprintf("/v1/%v/stakingTargets", req.GetParent()) + + params := url.Values{} + if req.GetPageSize() != 0 { + params.Add("pageSize", fmt.Sprintf("%v", req.GetPageSize())) + } + if req.GetPageToken() != "" { + params.Add("pageToken", fmt.Sprintf("%v", req.GetPageToken())) + } + + baseUrl.RawQuery = params.Encode() + + // Build HTTP headers from client and context metadata. + headers := buildHeaders(ctx, c.xGoogMetadata, metadata.Pairs("Content-Type", "application/json")) + e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + if settings.Path != "" { + baseUrl.Path = settings.Path + } + httpReq, err := http.NewRequest("GET", baseUrl.String(), nil) + if err != nil { + return err + } + httpReq.Header = headers + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil{ + return err + } + defer httpRsp.Body.Close() + + if err = googleapi.CheckResponse(httpRsp); err != nil { + return err + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return err + } + + if err := unm.Unmarshal(buf, resp); err != nil { + return maybeUnknownEnum(err) + } + + return nil + }, opts...) + if e != nil { + return nil, "", e + } + it.Response = resp + return resp.GetStakingTargets(), resp.GetNextPageToken(), nil + } + + fetch := func(pageSize int, pageToken string) (string, error) { + items, nextPageToken, err := it.InternalFetch(pageSize, pageToken) + if err != nil { + return "", err + } + it.items = append(it.items, items...) + return nextPageToken, nil + } + + it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf) + it.pageInfo.MaxSize = int(req.GetPageSize()) + it.pageInfo.Token = req.GetPageToken() + + return it +} +// ListActions list supported actions for a given protocol and network. +func (c *stakingRESTClient) ListActions(ctx context.Context, req *stakingpb.ListActionsRequest, opts ...gax.CallOption) (*stakingpb.ListActionsResponse, error) { + baseUrl, err := url.Parse(c.endpoint) + if err != nil { + return nil, err + } + baseUrl.Path += fmt.Sprintf("/v1/%v/actions", req.GetParent()) + + // Build HTTP headers from client and context metadata. + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))) + + headers := buildHeaders(ctx, c.xGoogMetadata, md, metadata.Pairs("Content-Type", "application/json")) + opts = append((*c.CallOptions).ListActions[0:len((*c.CallOptions).ListActions):len((*c.CallOptions).ListActions)], opts...) + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + resp := &stakingpb.ListActionsResponse{} + e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + if settings.Path != "" { + baseUrl.Path = settings.Path + } + httpReq, err := http.NewRequest("GET", baseUrl.String(), nil) + if err != nil { + return err + } + httpReq = httpReq.WithContext(ctx) + httpReq.Header = headers + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil{ + return err + } + defer httpRsp.Body.Close() + + if err = googleapi.CheckResponse(httpRsp); err != nil { + return err + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return err + } + + if err := unm.Unmarshal(buf, resp); err != nil { + return maybeUnknownEnum(err) + } + + return nil + }, opts...) + if e != nil { + return nil, e + } + return resp, nil +} +// CreateWorkflow create a workflow to perform an action. +func (c *stakingRESTClient) CreateWorkflow(ctx context.Context, req *stakingpb.CreateWorkflowRequest, opts ...gax.CallOption) (*stakingpb.Workflow, error) { + m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true} + body := req.GetWorkflow() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, err := url.Parse(c.endpoint) + if err != nil { + return nil, err + } + baseUrl.Path += fmt.Sprintf("/v1/%v/workflows", req.GetParent()) + + // Build HTTP headers from client and context metadata. + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))) + + headers := buildHeaders(ctx, c.xGoogMetadata, md, metadata.Pairs("Content-Type", "application/json")) + opts = append((*c.CallOptions).CreateWorkflow[0:len((*c.CallOptions).CreateWorkflow):len((*c.CallOptions).CreateWorkflow)], opts...) + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + resp := &stakingpb.Workflow{} + e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + if settings.Path != "" { + baseUrl.Path = settings.Path + } + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return err + } + httpReq = httpReq.WithContext(ctx) + httpReq.Header = headers + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil{ + return err + } + defer httpRsp.Body.Close() + + if err = googleapi.CheckResponse(httpRsp); err != nil { + return err + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return err + } + + if err := unm.Unmarshal(buf, resp); err != nil { + return maybeUnknownEnum(err) + } + + return nil + }, opts...) + if e != nil { + return nil, e + } + return resp, nil +} +// GetWorkflow get the current state of an active workflow. +func (c *stakingRESTClient) GetWorkflow(ctx context.Context, req *stakingpb.GetWorkflowRequest, opts ...gax.CallOption) (*stakingpb.Workflow, error) { + baseUrl, err := url.Parse(c.endpoint) + if err != nil { + return nil, err + } + baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetName()) + + // Build HTTP headers from client and context metadata. + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))) + + headers := buildHeaders(ctx, c.xGoogMetadata, md, metadata.Pairs("Content-Type", "application/json")) + opts = append((*c.CallOptions).GetWorkflow[0:len((*c.CallOptions).GetWorkflow):len((*c.CallOptions).GetWorkflow)], opts...) + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + resp := &stakingpb.Workflow{} + e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + if settings.Path != "" { + baseUrl.Path = settings.Path + } + httpReq, err := http.NewRequest("GET", baseUrl.String(), nil) + if err != nil { + return err + } + httpReq = httpReq.WithContext(ctx) + httpReq.Header = headers + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil{ + return err + } + defer httpRsp.Body.Close() + + if err = googleapi.CheckResponse(httpRsp); err != nil { + return err + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return err + } + + if err := unm.Unmarshal(buf, resp); err != nil { + return maybeUnknownEnum(err) + } + + return nil + }, opts...) + if e != nil { + return nil, e + } + return resp, nil +} +// ListWorkflows list all workflows in a project. +func (c *stakingRESTClient) ListWorkflows(ctx context.Context, req *stakingpb.ListWorkflowsRequest, opts ...gax.CallOption) *WorkflowIterator { + it := &WorkflowIterator{} + req = proto.Clone(req).(*stakingpb.ListWorkflowsRequest) + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + it.InternalFetch = func(pageSize int, pageToken string) ([]*stakingpb.Workflow, string, error) { + resp := &stakingpb.ListWorkflowsResponse{} + if pageToken != "" { + req.PageToken = pageToken + } + if pageSize > math.MaxInt32 { + req.PageSize = math.MaxInt32 + } else if pageSize != 0 { + req.PageSize = int32(pageSize) + } + baseUrl, err := url.Parse(c.endpoint) + if err != nil { + return nil, "", err + } + baseUrl.Path += fmt.Sprintf("/v1/%v/workflows", req.GetParent()) + + params := url.Values{} + if req.GetFilter() != "" { + params.Add("filter", fmt.Sprintf("%v", req.GetFilter())) + } + if req.GetPageSize() != 0 { + params.Add("pageSize", fmt.Sprintf("%v", req.GetPageSize())) + } + if req.GetPageToken() != "" { + params.Add("pageToken", fmt.Sprintf("%v", req.GetPageToken())) + } + + baseUrl.RawQuery = params.Encode() + + // Build HTTP headers from client and context metadata. + headers := buildHeaders(ctx, c.xGoogMetadata, metadata.Pairs("Content-Type", "application/json")) + e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + if settings.Path != "" { + baseUrl.Path = settings.Path + } + httpReq, err := http.NewRequest("GET", baseUrl.String(), nil) + if err != nil { + return err + } + httpReq.Header = headers + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil{ + return err + } + defer httpRsp.Body.Close() + + if err = googleapi.CheckResponse(httpRsp); err != nil { + return err + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return err + } + + if err := unm.Unmarshal(buf, resp); err != nil { + return maybeUnknownEnum(err) + } + + return nil + }, opts...) + if e != nil { + return nil, "", e + } + it.Response = resp + return resp.GetWorkflows(), resp.GetNextPageToken(), nil + } + + fetch := func(pageSize int, pageToken string) (string, error) { + items, nextPageToken, err := it.InternalFetch(pageSize, pageToken) + if err != nil { + return "", err + } + it.items = append(it.items, items...) + return nextPageToken, nil + } + + it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf) + it.pageInfo.MaxSize = int(req.GetPageSize()) + it.pageInfo.Token = req.GetPageToken() + + return it +} +// PerformWorkflowStep perform the next step in a workflow. +func (c *stakingRESTClient) PerformWorkflowStep(ctx context.Context, req *stakingpb.PerformWorkflowStepRequest, opts ...gax.CallOption) (*stakingpb.Workflow, error) { + m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, err := url.Parse(c.endpoint) + if err != nil { + return nil, err + } + baseUrl.Path += fmt.Sprintf("/v1/%v/step", req.GetName()) + + // Build HTTP headers from client and context metadata. + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))) + + headers := buildHeaders(ctx, c.xGoogMetadata, md, metadata.Pairs("Content-Type", "application/json")) + opts = append((*c.CallOptions).PerformWorkflowStep[0:len((*c.CallOptions).PerformWorkflowStep):len((*c.CallOptions).PerformWorkflowStep)], opts...) + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + resp := &stakingpb.Workflow{} + e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + if settings.Path != "" { + baseUrl.Path = settings.Path + } + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return err + } + httpReq = httpReq.WithContext(ctx) + httpReq.Header = headers + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil{ + return err + } + defer httpRsp.Body.Close() + + if err = googleapi.CheckResponse(httpRsp); err != nil { + return err + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return err + } + + if err := unm.Unmarshal(buf, resp); err != nil { + return maybeUnknownEnum(err) + } + + return nil + }, opts...) + if e != nil { + return nil, e + } + return resp, nil +} +// ViewStakingContext view Staking context information given a specific network address. +func (c *stakingRESTClient) ViewStakingContext(ctx context.Context, req *stakingpb.ViewStakingContextRequest, opts ...gax.CallOption) (*stakingpb.ViewStakingContextResponse, error) { + baseUrl, err := url.Parse(c.endpoint) + if err != nil { + return nil, err + } + baseUrl.Path += fmt.Sprintf("/v1/viewStakingContext:view") + + params := url.Values{} + params.Add("address", fmt.Sprintf("%v", req.GetAddress())) + if req.GetEthereumKilnStakingContextParameters().GetIntegratorContractAddress() != "" { + params.Add("ethereumKilnStakingContextParameters.integratorContractAddress", fmt.Sprintf("%v", req.GetEthereumKilnStakingContextParameters().GetIntegratorContractAddress())) + } + params.Add("network", fmt.Sprintf("%v", req.GetNetwork())) + + baseUrl.RawQuery = params.Encode() + + // Build HTTP headers from client and context metadata. + headers := buildHeaders(ctx, c.xGoogMetadata, metadata.Pairs("Content-Type", "application/json")) + opts = append((*c.CallOptions).ViewStakingContext[0:len((*c.CallOptions).ViewStakingContext):len((*c.CallOptions).ViewStakingContext)], opts...) + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + resp := &stakingpb.ViewStakingContextResponse{} + e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + if settings.Path != "" { + baseUrl.Path = settings.Path + } + httpReq, err := http.NewRequest("GET", baseUrl.String(), nil) + if err != nil { + return err + } + httpReq = httpReq.WithContext(ctx) + httpReq.Header = headers + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil{ + return err + } + defer httpRsp.Body.Close() + + if err = googleapi.CheckResponse(httpRsp); err != nil { + return err + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return err + } + + if err := unm.Unmarshal(buf, resp); err != nil { + return maybeUnknownEnum(err) + } + + return nil + }, opts...) + if e != nil { + return nil, e + } + return resp, nil +} +// StakingTargetIterator manages a stream of *stakingpb.StakingTarget. +type StakingTargetIterator struct { + items []*stakingpb.StakingTarget + pageInfo *iterator.PageInfo + nextFunc func() error + + // Response is the raw response for the current page. + // It must be cast to the RPC response type. + // Calling Next() or InternalFetch() updates this value. + Response interface{} + + // InternalFetch is for use by the Google Cloud Libraries only. + // It is not part of the stable interface of this package. + // + // InternalFetch returns results from a single call to the underlying RPC. + // The number of results is no greater than pageSize. + // If there are no more results, nextPageToken is empty and err is nil. + InternalFetch func(pageSize int, pageToken string) (results []*stakingpb.StakingTarget, nextPageToken string, err error) +} + +// PageInfo supports pagination. See the google.golang.org/api/iterator package for details. +func (it *StakingTargetIterator) PageInfo() *iterator.PageInfo { + return it.pageInfo +} + +// Next returns the next result. Its second return value is iterator.Done if there are no more +// results. Once Next returns Done, all subsequent calls will return Done. +func (it *StakingTargetIterator) Next() (*stakingpb.StakingTarget, error) { + var item *stakingpb.StakingTarget + if err := it.nextFunc(); err != nil { + return item, err + } + item = it.items[0] + it.items = it.items[1:] + return item, nil +} + +func (it *StakingTargetIterator) bufLen() int { + return len(it.items) +} + +func (it *StakingTargetIterator) takeBuf() interface{} { + b := it.items + it.items = nil + return b +} + +// WorkflowIterator manages a stream of *stakingpb.Workflow. +type WorkflowIterator struct { + items []*stakingpb.Workflow + pageInfo *iterator.PageInfo + nextFunc func() error + + // Response is the raw response for the current page. + // It must be cast to the RPC response type. + // Calling Next() or InternalFetch() updates this value. + Response interface{} + + // InternalFetch is for use by the Google Cloud Libraries only. + // It is not part of the stable interface of this package. + // + // InternalFetch returns results from a single call to the underlying RPC. + // The number of results is no greater than pageSize. + // If there are no more results, nextPageToken is empty and err is nil. + InternalFetch func(pageSize int, pageToken string) (results []*stakingpb.Workflow, nextPageToken string, err error) +} + +// PageInfo supports pagination. See the google.golang.org/api/iterator package for details. +func (it *WorkflowIterator) PageInfo() *iterator.PageInfo { + return it.pageInfo +} + +// Next returns the next result. Its second return value is iterator.Done if there are no more +// results. Once Next returns Done, all subsequent calls will return Done. +func (it *WorkflowIterator) Next() (*stakingpb.Workflow, error) { + var item *stakingpb.Workflow + if err := it.nextFunc(); err != nil { + return item, err + } + item = it.items[0] + it.items = it.items[1:] + return item, nil +} + +func (it *WorkflowIterator) bufLen() int { + return len(it.items) +} + +func (it *WorkflowIterator) takeBuf() interface{} { + b := it.items + it.items = nil + return b +} diff --git a/gen/client/coinbase/staking/rewards/v1/doc.go b/gen/client/coinbase/staking/rewards/v1/doc.go new file mode 100644 index 0000000..811df79 --- /dev/null +++ b/gen/client/coinbase/staking/rewards/v1/doc.go @@ -0,0 +1,185 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by protoc-gen-go_gapic. DO NOT EDIT. + +// +// NOTE: This package is in alpha. It is not stable, and is likely to change. +// +// General documentation +// +// For information about setting deadlines, reusing contexts, and more +// please visit https://pkg.go.dev/cloud.google.com/go. +// +// Example usage +// +// To get started with this package, create a client. +// ctx := context.Background() +// // This snippet has been automatically generated and should be regarded as a code template only. +// // It will require modifications to work: +// // - It may require correct/in-range values for request initialization. +// // - It may require specifying regional endpoints when creating the service client as shown in: +// // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options +// c, err := v1.NewRewardClient(ctx) +// if err != nil { +// // TODO: Handle error. +// } +// defer c.Close() +// +// The client will use your default application credentials. Clients should be reused instead of created as needed. +// The methods of Client are safe for concurrent use by multiple goroutines. +// The returned client must be Closed when it is done being used. +// +// Using the Client +// +// The following is an example of making an API call with the newly created client. +// +// ctx := context.Background() +// // This snippet has been automatically generated and should be regarded as a code template only. +// // It will require modifications to work: +// // - It may require correct/in-range values for request initialization. +// // - It may require specifying regional endpoints when creating the service client as shown in: +// // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options +// c, err := v1.NewRewardRESTClient(ctx) +// if err != nil { +// // TODO: Handle error. +// } +// defer c.Close() +// +// req := &rewardpb.ListRewardsRequest{ +// // TODO: Fill request struct fields. +// // See https://pkg.go.dev/github.com/coinbase/staking-client-library-go/gen/go/coinbase/staking/rewards/v1#ListRewardsRequest. +// } +// it := c.ListRewards(ctx, req) +// for { +// resp, err := it.Next() +// if err == iterator.Done { +// break +// } +// if err != nil { +// // TODO: Handle error. +// } +// // TODO: Use resp. +// _ = resp +// } +// +// Use of Context +// +// The ctx passed to NewRewardClient is used for authentication requests and +// for creating the underlying connection, but is not used for subsequent calls. +// Individual methods on the client use the ctx given to them. +// +// To close the open connection, use the Close() method. +package v1 // import "github.com/coinbase/staking-client-library-go/gen/client/coinbase/staking/rewards/v1" + +import ( + "context" + "fmt" + "net/http" + "runtime" + "strings" + "unicode" + + "google.golang.org/api/option" + "google.golang.org/grpc/metadata" +) + +// For more information on implementing a client constructor hook, see +// https://github.com/googleapis/google-cloud-go/wiki/Customizing-constructors. +type clientHookParams struct{} +type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) + +var versionClient string + +func getVersionClient() string { + if versionClient == "" { + return "UNKNOWN" + } + return versionClient +} + +func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { + out, _ := metadata.FromOutgoingContext(ctx) + out = out.Copy() + for _, md := range mds { + for k, v := range md { + out[k] = append(out[k], v...) + } + } + return metadata.NewOutgoingContext(ctx, out) +} + +// DefaultAuthScopes reports the default set of authentication scopes to use with this package. +func DefaultAuthScopes() []string { + return []string{ + "", + } +} + +// versionGo returns the Go runtime version. The returned string +// has no whitespace, suitable for reporting in header. +func versionGo() string { + const develPrefix = "devel +" + + s := runtime.Version() + if strings.HasPrefix(s, develPrefix) { + s = s[len(develPrefix):] + if p := strings.IndexFunc(s, unicode.IsSpace); p >= 0 { + s = s[:p] + } + return s + } + + notSemverRune := func(r rune) bool { + return !strings.ContainsRune("0123456789.", r) + } + + if strings.HasPrefix(s, "go1") { + s = s[2:] + var prerelease string + if p := strings.IndexFunc(s, notSemverRune); p >= 0 { + s, prerelease = s[:p], s[p:] + } + if strings.HasSuffix(s, ".") { + s += "0" + } else if strings.Count(s, ".") < 2 { + s += ".0" + } + if prerelease != "" { + s += "-" + prerelease + } + return s + } + return "UNKNOWN" +} + +// maybeUnknownEnum wraps the given proto-JSON parsing error if it is the result +// of receiving an unknown enum value. +func maybeUnknownEnum(err error) error { + if strings.Contains(err.Error(), "invalid value for enum type") { + err = fmt.Errorf("received an unknown enum value; a later version of the library may support it: %w", err) + } + return err +} + +// buildHeaders extracts metadata from the outgoing context, joins it with any other +// given metadata, and converts them into a http.Header. +func buildHeaders(ctx context.Context, mds ...metadata.MD) http.Header { + if cmd, ok := metadata.FromOutgoingContext(ctx); ok { + mds = append(mds, cmd) + } + md := metadata.Join(mds...) + return http.Header(md) +} + diff --git a/gen/client/coinbase/staking/rewards/v1/reward_client.go b/gen/client/coinbase/staking/rewards/v1/reward_client.go new file mode 100644 index 0000000..283ace1 --- /dev/null +++ b/gen/client/coinbase/staking/rewards/v1/reward_client.go @@ -0,0 +1,450 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by protoc-gen-go_gapic. DO NOT EDIT. + + +package v1 + +import ( + "context" + "fmt" + "io/ioutil" + "math" + "net/http" + "net/url" + + rewardpb "github.com/coinbase/staking-client-library-go/gen/go/coinbase/staking/rewards/v1" + gax "github.com/googleapis/gax-go/v2" + "google.golang.org/api/googleapi" + "google.golang.org/api/iterator" + "google.golang.org/api/option" + "google.golang.org/api/option/internaloption" + httptransport "google.golang.org/api/transport/http" + "google.golang.org/grpc" + "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/encoding/protojson" + "google.golang.org/protobuf/proto" +) + +var newRewardClientHook clientHook + +// RewardCallOptions contains the retry settings for each method of RewardClient. +type RewardCallOptions struct { + ListRewards []gax.CallOption + ListStakes []gax.CallOption +} + +func defaultRewardRESTCallOptions() *RewardCallOptions { + return &RewardCallOptions{ + ListRewards: []gax.CallOption{ + }, + ListStakes: []gax.CallOption{ + }, + } +} + +// internalRewardClient is an interface that defines the methods available from . +type internalRewardClient interface { + Close() error + setGoogleClientInfo(...string) + Connection() *grpc.ClientConn + ListRewards(context.Context, *rewardpb.ListRewardsRequest, ...gax.CallOption) *RewardIterator + ListStakes(context.Context, *rewardpb.ListStakesRequest, ...gax.CallOption) *StakeIterator +} + +// RewardClient is a client for interacting with . +// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. +// +// RewardService exposes publicly available onchain staking-related rewards data across all supported protocols. +type RewardClient struct { + // The internal transport-dependent client. + internalClient internalRewardClient + + // The call options for this service. + CallOptions *RewardCallOptions + +} + +// Wrapper methods routed to the internal client. + +// Close closes the connection to the API service. The user should invoke this when +// the client is no longer required. +func (c *RewardClient) Close() error { + return c.internalClient.Close() +} + +// setGoogleClientInfo sets the name and version of the application in +// the `x-goog-api-client` header passed on each request. Intended for +// use by Google-written clients. +func (c *RewardClient) setGoogleClientInfo(keyval ...string) { + c.internalClient.setGoogleClientInfo(keyval...) +} + +// Connection returns a connection to the API service. +// +// Deprecated: Connections are now pooled so this method does not always +// return the same resource. +func (c *RewardClient) Connection() *grpc.ClientConn { + return c.internalClient.Connection() +} + +// ListRewards list rewards for a given protocol. +func (c *RewardClient) ListRewards(ctx context.Context, req *rewardpb.ListRewardsRequest, opts ...gax.CallOption) *RewardIterator { + return c.internalClient.ListRewards(ctx, req, opts...) +} + +// ListStakes list staking activities for a given protocol. +func (c *RewardClient) ListStakes(ctx context.Context, req *rewardpb.ListStakesRequest, opts ...gax.CallOption) *StakeIterator { + return c.internalClient.ListStakes(ctx, req, opts...) +} + +// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. +type rewardRESTClient struct { + // The http endpoint to connect to. + endpoint string + + // The http client. + httpClient *http.Client + + // The x-goog-* metadata to be sent with each request. + xGoogMetadata metadata.MD + + // Points back to the CallOptions field of the containing RewardClient + CallOptions **RewardCallOptions +} + +// NewRewardRESTClient creates a new reward service rest client. +// +// RewardService exposes publicly available onchain staking-related rewards data across all supported protocols. +func NewRewardRESTClient(ctx context.Context, opts ...option.ClientOption) (*RewardClient, error) { + clientOpts := append(defaultRewardRESTClientOptions(), opts...) + httpClient, endpoint, err := httptransport.NewClient(ctx, clientOpts...) + if err != nil { + return nil, err + } + + callOpts := defaultRewardRESTCallOptions() + c := &rewardRESTClient{ + endpoint: endpoint, + httpClient: httpClient, + CallOptions: &callOpts, + } + c.setGoogleClientInfo() + + return &RewardClient{internalClient: c, CallOptions: callOpts}, nil +} + +func defaultRewardRESTClientOptions() []option.ClientOption { + return []option.ClientOption{ + internaloption.WithDefaultEndpoint("https://api.developer.coinbase.com"), + internaloption.WithDefaultMTLSEndpoint("https://api.developer.coinbase.com"), + internaloption.WithDefaultAudience("https://api.developer.coinbase.com/"), + internaloption.WithDefaultScopes(DefaultAuthScopes()...), + } +} +// setGoogleClientInfo sets the name and version of the application in +// the `x-goog-api-client` header passed on each request. Intended for +// use by Google-written clients. +func (c *rewardRESTClient) setGoogleClientInfo(keyval ...string) { + kv := append([]string{"gl-go", versionGo()}, keyval...) + kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "rest", "UNKNOWN") + c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...)) +} + +// Close closes the connection to the API service. The user should invoke this when +// the client is no longer required. +func (c *rewardRESTClient) Close() error { + // Replace httpClient with nil to force cleanup. + c.httpClient = nil + return nil +} + +// Connection returns a connection to the API service. +// +// Deprecated: This method always returns nil. +func (c *rewardRESTClient) Connection() *grpc.ClientConn { + return nil +} +// ListRewards list rewards for a given protocol. +func (c *rewardRESTClient) ListRewards(ctx context.Context, req *rewardpb.ListRewardsRequest, opts ...gax.CallOption) *RewardIterator { + it := &RewardIterator{} + req = proto.Clone(req).(*rewardpb.ListRewardsRequest) + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + it.InternalFetch = func(pageSize int, pageToken string) ([]*rewardpb.Reward, string, error) { + resp := &rewardpb.ListRewardsResponse{} + if pageToken != "" { + req.PageToken = pageToken + } + if pageSize > math.MaxInt32 { + req.PageSize = math.MaxInt32 + } else if pageSize != 0 { + req.PageSize = int32(pageSize) + } + baseUrl, err := url.Parse(c.endpoint) + if err != nil { + return nil, "", err + } + baseUrl.Path += fmt.Sprintf("/v1/%v/rewards", req.GetParent()) + + params := url.Values{} + if req.GetFilter() != "" { + params.Add("filter", fmt.Sprintf("%v", req.GetFilter())) + } + if req.GetPageSize() != 0 { + params.Add("pageSize", fmt.Sprintf("%v", req.GetPageSize())) + } + if req.GetPageToken() != "" { + params.Add("pageToken", fmt.Sprintf("%v", req.GetPageToken())) + } + + baseUrl.RawQuery = params.Encode() + + // Build HTTP headers from client and context metadata. + headers := buildHeaders(ctx, c.xGoogMetadata, metadata.Pairs("Content-Type", "application/json")) + e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + if settings.Path != "" { + baseUrl.Path = settings.Path + } + httpReq, err := http.NewRequest("GET", baseUrl.String(), nil) + if err != nil { + return err + } + httpReq.Header = headers + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil{ + return err + } + defer httpRsp.Body.Close() + + if err = googleapi.CheckResponse(httpRsp); err != nil { + return err + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return err + } + + if err := unm.Unmarshal(buf, resp); err != nil { + return maybeUnknownEnum(err) + } + + return nil + }, opts...) + if e != nil { + return nil, "", e + } + it.Response = resp + return resp.GetRewards(), resp.GetNextPageToken(), nil + } + + fetch := func(pageSize int, pageToken string) (string, error) { + items, nextPageToken, err := it.InternalFetch(pageSize, pageToken) + if err != nil { + return "", err + } + it.items = append(it.items, items...) + return nextPageToken, nil + } + + it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf) + it.pageInfo.MaxSize = int(req.GetPageSize()) + it.pageInfo.Token = req.GetPageToken() + + return it +} +// ListStakes list staking activities for a given protocol. +func (c *rewardRESTClient) ListStakes(ctx context.Context, req *rewardpb.ListStakesRequest, opts ...gax.CallOption) *StakeIterator { + it := &StakeIterator{} + req = proto.Clone(req).(*rewardpb.ListStakesRequest) + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + it.InternalFetch = func(pageSize int, pageToken string) ([]*rewardpb.Stake, string, error) { + resp := &rewardpb.ListStakesResponse{} + if pageToken != "" { + req.PageToken = pageToken + } + if pageSize > math.MaxInt32 { + req.PageSize = math.MaxInt32 + } else if pageSize != 0 { + req.PageSize = int32(pageSize) + } + baseUrl, err := url.Parse(c.endpoint) + if err != nil { + return nil, "", err + } + baseUrl.Path += fmt.Sprintf("/v1/%v/stakes", req.GetParent()) + + params := url.Values{} + if req.GetFilter() != "" { + params.Add("filter", fmt.Sprintf("%v", req.GetFilter())) + } + if req.GetPageSize() != 0 { + params.Add("pageSize", fmt.Sprintf("%v", req.GetPageSize())) + } + if req.GetPageToken() != "" { + params.Add("pageToken", fmt.Sprintf("%v", req.GetPageToken())) + } + + baseUrl.RawQuery = params.Encode() + + // Build HTTP headers from client and context metadata. + headers := buildHeaders(ctx, c.xGoogMetadata, metadata.Pairs("Content-Type", "application/json")) + e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + if settings.Path != "" { + baseUrl.Path = settings.Path + } + httpReq, err := http.NewRequest("GET", baseUrl.String(), nil) + if err != nil { + return err + } + httpReq.Header = headers + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil{ + return err + } + defer httpRsp.Body.Close() + + if err = googleapi.CheckResponse(httpRsp); err != nil { + return err + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return err + } + + if err := unm.Unmarshal(buf, resp); err != nil { + return maybeUnknownEnum(err) + } + + return nil + }, opts...) + if e != nil { + return nil, "", e + } + it.Response = resp + return resp.GetStakes(), resp.GetNextPageToken(), nil + } + + fetch := func(pageSize int, pageToken string) (string, error) { + items, nextPageToken, err := it.InternalFetch(pageSize, pageToken) + if err != nil { + return "", err + } + it.items = append(it.items, items...) + return nextPageToken, nil + } + + it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf) + it.pageInfo.MaxSize = int(req.GetPageSize()) + it.pageInfo.Token = req.GetPageToken() + + return it +} +// RewardIterator manages a stream of *rewardpb.Reward. +type RewardIterator struct { + items []*rewardpb.Reward + pageInfo *iterator.PageInfo + nextFunc func() error + + // Response is the raw response for the current page. + // It must be cast to the RPC response type. + // Calling Next() or InternalFetch() updates this value. + Response interface{} + + // InternalFetch is for use by the Google Cloud Libraries only. + // It is not part of the stable interface of this package. + // + // InternalFetch returns results from a single call to the underlying RPC. + // The number of results is no greater than pageSize. + // If there are no more results, nextPageToken is empty and err is nil. + InternalFetch func(pageSize int, pageToken string) (results []*rewardpb.Reward, nextPageToken string, err error) +} + +// PageInfo supports pagination. See the google.golang.org/api/iterator package for details. +func (it *RewardIterator) PageInfo() *iterator.PageInfo { + return it.pageInfo +} + +// Next returns the next result. Its second return value is iterator.Done if there are no more +// results. Once Next returns Done, all subsequent calls will return Done. +func (it *RewardIterator) Next() (*rewardpb.Reward, error) { + var item *rewardpb.Reward + if err := it.nextFunc(); err != nil { + return item, err + } + item = it.items[0] + it.items = it.items[1:] + return item, nil +} + +func (it *RewardIterator) bufLen() int { + return len(it.items) +} + +func (it *RewardIterator) takeBuf() interface{} { + b := it.items + it.items = nil + return b +} + +// StakeIterator manages a stream of *rewardpb.Stake. +type StakeIterator struct { + items []*rewardpb.Stake + pageInfo *iterator.PageInfo + nextFunc func() error + + // Response is the raw response for the current page. + // It must be cast to the RPC response type. + // Calling Next() or InternalFetch() updates this value. + Response interface{} + + // InternalFetch is for use by the Google Cloud Libraries only. + // It is not part of the stable interface of this package. + // + // InternalFetch returns results from a single call to the underlying RPC. + // The number of results is no greater than pageSize. + // If there are no more results, nextPageToken is empty and err is nil. + InternalFetch func(pageSize int, pageToken string) (results []*rewardpb.Stake, nextPageToken string, err error) +} + +// PageInfo supports pagination. See the google.golang.org/api/iterator package for details. +func (it *StakeIterator) PageInfo() *iterator.PageInfo { + return it.pageInfo +} + +// Next returns the next result. Its second return value is iterator.Done if there are no more +// results. Once Next returns Done, all subsequent calls will return Done. +func (it *StakeIterator) Next() (*rewardpb.Stake, error) { + var item *rewardpb.Stake + if err := it.nextFunc(); err != nil { + return item, err + } + item = it.items[0] + it.items = it.items[1:] + return item, nil +} + +func (it *StakeIterator) bufLen() int { + return len(it.items) +} + +func (it *StakeIterator) takeBuf() interface{} { + b := it.items + it.items = nil + return b +} diff --git a/gen/go/coinbase/staking/orchestration/v1/action.pb.go b/gen/go/coinbase/staking/orchestration/v1/action.pb.go new file mode 100644 index 0000000..3d4a2c8 --- /dev/null +++ b/gen/go/coinbase/staking/orchestration/v1/action.pb.go @@ -0,0 +1,303 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.30.0 +// protoc (unknown) +// source: coinbase/staking/orchestration/v1/action.proto + +package v1 + +import ( + _ "google.golang.org/genproto/googleapis/api/annotations" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// An Action resource represents an action you may take on a network (e.g. stake, unstake). +type Action struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The resource name of the Action. + // Format: protocols/{protocolName}/networks/{networkName}/actions/{actionName} + // Ex: protocols/ethereum_kiln/networks/holesky/validators/stake + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` +} + +func (x *Action) Reset() { + *x = Action{} + if protoimpl.UnsafeEnabled { + mi := &file_coinbase_staking_orchestration_v1_action_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Action) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Action) ProtoMessage() {} + +func (x *Action) ProtoReflect() protoreflect.Message { + mi := &file_coinbase_staking_orchestration_v1_action_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Action.ProtoReflect.Descriptor instead. +func (*Action) Descriptor() ([]byte, []int) { + return file_coinbase_staking_orchestration_v1_action_proto_rawDescGZIP(), []int{0} +} + +func (x *Action) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +// The request message for ListActions. +type ListActionsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The resource name of the parent that owns + // the collection of actions. + // Format: protocols/{protocol}/networks/{network} + Parent string `protobuf:"bytes,1,opt,name=parent,proto3" json:"parent,omitempty"` +} + +func (x *ListActionsRequest) Reset() { + *x = ListActionsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_coinbase_staking_orchestration_v1_action_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListActionsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListActionsRequest) ProtoMessage() {} + +func (x *ListActionsRequest) ProtoReflect() protoreflect.Message { + mi := &file_coinbase_staking_orchestration_v1_action_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListActionsRequest.ProtoReflect.Descriptor instead. +func (*ListActionsRequest) Descriptor() ([]byte, []int) { + return file_coinbase_staking_orchestration_v1_action_proto_rawDescGZIP(), []int{1} +} + +func (x *ListActionsRequest) GetParent() string { + if x != nil { + return x.Parent + } + return "" +} + +// The response message for ListActions. +type ListActionsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The list of actions. + Actions []*Action `protobuf:"bytes,1,rep,name=actions,proto3" json:"actions,omitempty"` +} + +func (x *ListActionsResponse) Reset() { + *x = ListActionsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_coinbase_staking_orchestration_v1_action_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListActionsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListActionsResponse) ProtoMessage() {} + +func (x *ListActionsResponse) ProtoReflect() protoreflect.Message { + mi := &file_coinbase_staking_orchestration_v1_action_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListActionsResponse.ProtoReflect.Descriptor instead. +func (*ListActionsResponse) Descriptor() ([]byte, []int) { + return file_coinbase_staking_orchestration_v1_action_proto_rawDescGZIP(), []int{2} +} + +func (x *ListActionsResponse) GetActions() []*Action { + if x != nil { + return x.Actions + } + return nil +} + +var File_coinbase_staking_orchestration_v1_action_proto protoreflect.FileDescriptor + +var file_coinbase_staking_orchestration_v1_action_proto_rawDesc = []byte{ + 0x0a, 0x2e, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x73, 0x74, 0x61, 0x6b, 0x69, + 0x6e, 0x67, 0x2f, 0x6f, 0x72, 0x63, 0x68, 0x65, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x12, 0x21, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, + 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x63, 0x68, 0x65, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x2e, 0x76, 0x31, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, + 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x62, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, + 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, + 0x89, 0x01, 0x0a, 0x06, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x3a, 0x6b, + 0xea, 0x41, 0x68, 0x0a, 0x1b, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x63, 0x6f, 0x69, + 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x12, 0x38, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x73, 0x2f, 0x7b, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x7d, 0x2f, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x2f, + 0x7b, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x7d, 0x2f, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x2f, 0x7b, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x7d, 0x2a, 0x07, 0x61, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x32, 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x51, 0x0a, 0x12, 0x4c, + 0x69, 0x73, 0x74, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x3b, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x42, 0x23, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x1d, 0x12, 0x1b, 0x73, 0x74, 0x61, 0x6b, 0x69, + 0x6e, 0x67, 0x2e, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x22, 0x5a, + 0x0a, 0x13, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x43, 0x0a, 0x07, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, + 0x65, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x63, 0x68, 0x65, 0x73, + 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x52, 0x07, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x42, 0x58, 0x5a, 0x56, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, + 0x65, 0x2f, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2d, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, + 0x2d, 0x6c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x2d, 0x67, 0x6f, 0x2f, 0x67, 0x65, 0x6e, 0x2f, + 0x67, 0x6f, 0x2f, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x73, 0x74, 0x61, 0x6b, + 0x69, 0x6e, 0x67, 0x2f, 0x6f, 0x72, 0x63, 0x68, 0x65, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_coinbase_staking_orchestration_v1_action_proto_rawDescOnce sync.Once + file_coinbase_staking_orchestration_v1_action_proto_rawDescData = file_coinbase_staking_orchestration_v1_action_proto_rawDesc +) + +func file_coinbase_staking_orchestration_v1_action_proto_rawDescGZIP() []byte { + file_coinbase_staking_orchestration_v1_action_proto_rawDescOnce.Do(func() { + file_coinbase_staking_orchestration_v1_action_proto_rawDescData = protoimpl.X.CompressGZIP(file_coinbase_staking_orchestration_v1_action_proto_rawDescData) + }) + return file_coinbase_staking_orchestration_v1_action_proto_rawDescData +} + +var file_coinbase_staking_orchestration_v1_action_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_coinbase_staking_orchestration_v1_action_proto_goTypes = []interface{}{ + (*Action)(nil), // 0: coinbase.staking.orchestration.v1.Action + (*ListActionsRequest)(nil), // 1: coinbase.staking.orchestration.v1.ListActionsRequest + (*ListActionsResponse)(nil), // 2: coinbase.staking.orchestration.v1.ListActionsResponse +} +var file_coinbase_staking_orchestration_v1_action_proto_depIdxs = []int32{ + 0, // 0: coinbase.staking.orchestration.v1.ListActionsResponse.actions:type_name -> coinbase.staking.orchestration.v1.Action + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_coinbase_staking_orchestration_v1_action_proto_init() } +func file_coinbase_staking_orchestration_v1_action_proto_init() { + if File_coinbase_staking_orchestration_v1_action_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_coinbase_staking_orchestration_v1_action_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Action); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_coinbase_staking_orchestration_v1_action_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListActionsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_coinbase_staking_orchestration_v1_action_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListActionsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_coinbase_staking_orchestration_v1_action_proto_rawDesc, + NumEnums: 0, + NumMessages: 3, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_coinbase_staking_orchestration_v1_action_proto_goTypes, + DependencyIndexes: file_coinbase_staking_orchestration_v1_action_proto_depIdxs, + MessageInfos: file_coinbase_staking_orchestration_v1_action_proto_msgTypes, + }.Build() + File_coinbase_staking_orchestration_v1_action_proto = out.File + file_coinbase_staking_orchestration_v1_action_proto_rawDesc = nil + file_coinbase_staking_orchestration_v1_action_proto_goTypes = nil + file_coinbase_staking_orchestration_v1_action_proto_depIdxs = nil +} diff --git a/gen/go/coinbase/staking/orchestration/v1/action_aip.go b/gen/go/coinbase/staking/orchestration/v1/action_aip.go new file mode 100644 index 0000000..a008935 --- /dev/null +++ b/gen/go/coinbase/staking/orchestration/v1/action_aip.go @@ -0,0 +1,106 @@ +// Code generated by protoc-gen-go-aip. DO NOT EDIT. +// +// versions: +// protoc-gen-go-aip development +// protoc (unknown) +// source: coinbase/staking/orchestration/v1/action.proto + +package v1 + +import ( + fmt "fmt" + resourcename "go.einride.tech/aip/resourcename" + strings "strings" +) + +type ActionResourceName struct { + Protocol string + Network string + Action string +} + +func (n ProtocolResourceName) ActionResourceName( + network string, + action string, +) ActionResourceName { + return ActionResourceName{ + Protocol: n.Protocol, + Network: network, + Action: action, + } +} + +func (n NetworkResourceName) ActionResourceName( + action string, +) ActionResourceName { + return ActionResourceName{ + Protocol: n.Protocol, + Network: n.Network, + Action: action, + } +} + +func (n ActionResourceName) Validate() error { + if n.Protocol == "" { + return fmt.Errorf("protocol: empty") + } + if strings.IndexByte(n.Protocol, '/') != -1 { + return fmt.Errorf("protocol: contains illegal character '/'") + } + if n.Network == "" { + return fmt.Errorf("network: empty") + } + if strings.IndexByte(n.Network, '/') != -1 { + return fmt.Errorf("network: contains illegal character '/'") + } + if n.Action == "" { + return fmt.Errorf("action: empty") + } + if strings.IndexByte(n.Action, '/') != -1 { + return fmt.Errorf("action: contains illegal character '/'") + } + return nil +} + +func (n ActionResourceName) ContainsWildcard() bool { + return false || n.Protocol == "-" || n.Network == "-" || n.Action == "-" +} + +func (n ActionResourceName) String() string { + return resourcename.Sprint( + "protocols/{protocol}/networks/{network}/actions/{action}", + n.Protocol, + n.Network, + n.Action, + ) +} + +func (n ActionResourceName) MarshalString() (string, error) { + if err := n.Validate(); err != nil { + return "", err + } + return n.String(), nil +} + +func (n *ActionResourceName) UnmarshalString(name string) error { + return resourcename.Sscan( + name, + "protocols/{protocol}/networks/{network}/actions/{action}", + &n.Protocol, + &n.Network, + &n.Action, + ) +} + +func (n ActionResourceName) ProtocolResourceName() ProtocolResourceName { + return ProtocolResourceName{ + Protocol: n.Protocol, + } +} + +func (n ActionResourceName) NetworkResourceName() NetworkResourceName { + return NetworkResourceName{ + Protocol: n.Protocol, + Network: n.Network, + } +} diff --git a/gen/go/coinbase/staking/orchestration/v1/api.pb.go b/gen/go/coinbase/staking/orchestration/v1/api.pb.go new file mode 100644 index 0000000..dd37ceb --- /dev/null +++ b/gen/go/coinbase/staking/orchestration/v1/api.pb.go @@ -0,0 +1,357 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.30.0 +// protoc (unknown) +// source: coinbase/staking/orchestration/v1/api.proto + +package v1 + +import ( + _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" + _ "google.golang.org/genproto/googleapis/api/annotations" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +var File_coinbase_staking_orchestration_v1_api_proto protoreflect.FileDescriptor + +var file_coinbase_staking_orchestration_v1_api_proto_rawDesc = []byte{ + 0x0a, 0x2b, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x73, 0x74, 0x61, 0x6b, 0x69, + 0x6e, 0x67, 0x2f, 0x6f, 0x72, 0x63, 0x68, 0x65, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x21, 0x63, + 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, + 0x6f, 0x72, 0x63, 0x68, 0x65, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, + 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, + 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6c, 0x69, 0x65, 0x6e, + 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, + 0x67, 0x65, 0x6e, 0x2d, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x6f, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x30, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, + 0x65, 0x2f, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2f, 0x6f, 0x72, 0x63, 0x68, 0x65, 0x73, + 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x63, 0x6f, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2f, 0x63, 0x6f, 0x69, 0x6e, 0x62, + 0x61, 0x73, 0x65, 0x2f, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2f, 0x6f, 0x72, 0x63, 0x68, + 0x65, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x6e, 0x65, 0x74, + 0x77, 0x6f, 0x72, 0x6b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2e, 0x63, 0x6f, 0x69, 0x6e, + 0x62, 0x61, 0x73, 0x65, 0x2f, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2f, 0x6f, 0x72, 0x63, + 0x68, 0x65, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x36, 0x63, 0x6f, 0x69, 0x6e, + 0x62, 0x61, 0x73, 0x65, 0x2f, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2f, 0x6f, 0x72, 0x63, + 0x68, 0x65, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x74, + 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x5f, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x1a, 0x30, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x73, 0x74, 0x61, + 0x6b, 0x69, 0x6e, 0x67, 0x2f, 0x6f, 0x72, 0x63, 0x68, 0x65, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x77, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x37, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x73, + 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2f, 0x6f, 0x72, 0x63, 0x68, 0x65, 0x73, 0x74, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x5f, + 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x32, 0x86, 0x14, + 0x0a, 0x0e, 0x53, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x12, 0xf9, 0x01, 0x0a, 0x0d, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, + 0x6c, 0x73, 0x12, 0x37, 0x2e, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, + 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x63, 0x68, 0x65, 0x73, 0x74, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, + 0x63, 0x6f, 0x6c, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x38, 0x2e, 0x63, 0x6f, + 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x6f, + 0x72, 0x63, 0x68, 0x65, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, + 0x4c, 0x69, 0x73, 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x75, 0x92, 0x41, 0x5a, 0x0a, 0x08, 0x50, 0x72, 0x6f, 0x74, + 0x6f, 0x63, 0x6f, 0x6c, 0x12, 0x18, 0x4c, 0x69, 0x73, 0x74, 0x20, 0x73, 0x75, 0x70, 0x70, 0x6f, + 0x72, 0x74, 0x65, 0x64, 0x20, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x73, 0x1a, 0x18, + 0x4c, 0x69, 0x73, 0x74, 0x20, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x20, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x73, 0x2a, 0x0d, 0x6c, 0x69, 0x73, 0x74, 0x50, 0x72, + 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x73, 0x4a, 0x0b, 0x0a, 0x03, 0x32, 0x30, 0x30, 0x12, 0x04, + 0x0a, 0x02, 0x4f, 0x4b, 0xda, 0x41, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0f, 0x12, 0x0d, 0x2f, + 0x76, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x73, 0x12, 0x8d, 0x02, 0x0a, + 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x12, 0x36, 0x2e, + 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, + 0x2e, 0x6f, 0x72, 0x63, 0x68, 0x65, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, + 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x37, 0x2e, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, + 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x63, 0x68, 0x65, 0x73, 0x74, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4e, 0x65, + 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x8b, + 0x01, 0x92, 0x41, 0x56, 0x0a, 0x07, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x12, 0x17, 0x4c, + 0x69, 0x73, 0x74, 0x20, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x20, 0x6e, 0x65, + 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x1a, 0x17, 0x4c, 0x69, 0x73, 0x74, 0x20, 0x73, 0x75, 0x70, + 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x20, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x2a, + 0x0c, 0x6c, 0x69, 0x73, 0x74, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x4a, 0x0b, 0x0a, + 0x03, 0x32, 0x30, 0x30, 0x12, 0x04, 0x0a, 0x02, 0x4f, 0x4b, 0xda, 0x41, 0x06, 0x70, 0x61, 0x72, + 0x65, 0x6e, 0x74, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x23, 0x12, 0x21, 0x2f, 0x76, 0x31, 0x2f, 0x7b, + 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x3d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x73, + 0x2f, 0x2a, 0x7d, 0x2f, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x12, 0xca, 0x02, 0x0a, + 0x12, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x54, 0x61, 0x72, 0x67, + 0x65, 0x74, 0x73, 0x12, 0x3c, 0x2e, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, + 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x63, 0x68, 0x65, 0x73, 0x74, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x74, 0x61, 0x6b, + 0x69, 0x6e, 0x67, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x3d, 0x2e, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x61, + 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x63, 0x68, 0x65, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x74, 0x61, 0x6b, 0x69, 0x6e, + 0x67, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0xb6, 0x01, 0x92, 0x41, 0x70, 0x0a, 0x0d, 0x53, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x54, + 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x1e, 0x4c, 0x69, 0x73, 0x74, 0x20, 0x73, 0x75, 0x70, 0x70, + 0x6f, 0x72, 0x74, 0x65, 0x64, 0x20, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x20, 0x74, 0x61, + 0x72, 0x67, 0x65, 0x74, 0x73, 0x1a, 0x1e, 0x4c, 0x69, 0x73, 0x74, 0x20, 0x73, 0x75, 0x70, 0x70, + 0x6f, 0x72, 0x74, 0x65, 0x64, 0x20, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x20, 0x74, 0x61, + 0x72, 0x67, 0x65, 0x74, 0x73, 0x2a, 0x12, 0x6c, 0x69, 0x73, 0x74, 0x53, 0x74, 0x61, 0x6b, 0x69, + 0x6e, 0x67, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x4a, 0x0b, 0x0a, 0x03, 0x32, 0x30, 0x30, + 0x12, 0x04, 0x0a, 0x02, 0x4f, 0x4b, 0xda, 0x41, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x34, 0x12, 0x32, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x70, 0x61, 0x72, 0x65, + 0x6e, 0x74, 0x3d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x73, 0x2f, 0x2a, 0x2f, 0x6e, + 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x73, 0x74, 0x61, 0x6b, 0x69, + 0x6e, 0x67, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x12, 0x90, 0x02, 0x0a, 0x0b, 0x4c, 0x69, + 0x73, 0x74, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x35, 0x2e, 0x63, 0x6f, 0x69, 0x6e, + 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x63, + 0x68, 0x65, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, + 0x73, 0x74, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x36, 0x2e, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x61, 0x6b, + 0x69, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x63, 0x68, 0x65, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x91, 0x01, 0x92, 0x41, 0x52, 0x0a, 0x06, + 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x4c, 0x69, 0x73, 0x74, 0x20, 0x73, 0x75, 0x70, + 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x20, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0x16, + 0x4c, 0x69, 0x73, 0x74, 0x20, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x20, 0x61, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2a, 0x0b, 0x6c, 0x69, 0x73, 0x74, 0x41, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x4a, 0x0b, 0x0a, 0x03, 0x32, 0x30, 0x30, 0x12, 0x04, 0x0a, 0x02, 0x4f, 0x4b, + 0xda, 0x41, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2d, 0x12, + 0x2b, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x3d, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x73, 0x2f, 0x2a, 0x2f, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, + 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0xfa, 0x01, 0x0a, + 0x0e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x12, + 0x38, 0x2e, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, + 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x63, 0x68, 0x65, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, + 0x6f, 0x77, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x63, 0x6f, 0x69, 0x6e, + 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x63, + 0x68, 0x65, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x6f, + 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x22, 0x80, 0x01, 0x92, 0x41, 0x38, 0x0a, 0x08, 0x57, 0x6f, + 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x12, 0x0f, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x20, 0x77, + 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x2a, 0x0e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x57, + 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x4a, 0x0b, 0x0a, 0x03, 0x32, 0x30, 0x30, 0x12, 0x04, + 0x0a, 0x02, 0x4f, 0x4b, 0xda, 0x41, 0x0f, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x2c, 0x77, 0x6f, + 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2d, 0x3a, 0x08, 0x77, 0x6f, + 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x22, 0x21, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x70, 0x61, 0x72, + 0x65, 0x6e, 0x74, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, + 0x77, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x73, 0x12, 0xd8, 0x01, 0x0a, 0x0b, 0x47, 0x65, + 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x12, 0x35, 0x2e, 0x63, 0x6f, 0x69, 0x6e, + 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x63, + 0x68, 0x65, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, + 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x2b, 0x2e, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x61, 0x6b, + 0x69, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x63, 0x68, 0x65, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x22, 0x65, 0x92, + 0x41, 0x32, 0x0a, 0x08, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x12, 0x0c, 0x47, 0x65, + 0x74, 0x20, 0x77, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x2a, 0x0b, 0x67, 0x65, 0x74, 0x57, + 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x4a, 0x0b, 0x0a, 0x03, 0x32, 0x30, 0x30, 0x12, 0x04, + 0x0a, 0x02, 0x4f, 0x4b, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x23, 0x12, 0x21, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x70, 0x72, 0x6f, + 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x77, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, + 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0xf9, 0x01, 0x0a, 0x0d, 0x4c, 0x69, 0x73, 0x74, 0x57, 0x6f, 0x72, + 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x73, 0x12, 0x37, 0x2e, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, + 0x65, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x63, 0x68, 0x65, 0x73, + 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x57, + 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x38, 0x2e, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, + 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x63, 0x68, 0x65, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x75, 0x92, 0x41, 0x40, 0x0a, 0x08, + 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x12, 0x18, 0x4c, 0x69, 0x73, 0x74, 0x20, 0x73, + 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x20, 0x77, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, + 0x77, 0x73, 0x2a, 0x0d, 0x6c, 0x69, 0x73, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, + 0x73, 0x4a, 0x0b, 0x0a, 0x03, 0x32, 0x30, 0x30, 0x12, 0x04, 0x0a, 0x02, 0x4f, 0x4b, 0xda, 0x41, + 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x23, 0x12, 0x21, 0x2f, + 0x76, 0x31, 0x2f, 0x7b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, + 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x77, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x73, + 0x12, 0xa9, 0x02, 0x0a, 0x13, 0x50, 0x65, 0x72, 0x66, 0x6f, 0x72, 0x6d, 0x57, 0x6f, 0x72, 0x6b, + 0x66, 0x6c, 0x6f, 0x77, 0x53, 0x74, 0x65, 0x70, 0x12, 0x3d, 0x2e, 0x63, 0x6f, 0x69, 0x6e, 0x62, + 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x63, 0x68, + 0x65, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x65, 0x72, + 0x66, 0x6f, 0x72, 0x6d, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x53, 0x74, 0x65, 0x70, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, + 0x73, 0x65, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x63, 0x68, 0x65, + 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x6f, 0x72, 0x6b, + 0x66, 0x6c, 0x6f, 0x77, 0x22, 0xa5, 0x01, 0x92, 0x41, 0x71, 0x0a, 0x08, 0x57, 0x6f, 0x72, 0x6b, + 0x66, 0x6c, 0x6f, 0x77, 0x12, 0x23, 0x50, 0x65, 0x72, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x74, 0x68, + 0x65, 0x20, 0x6e, 0x65, 0x78, 0x74, 0x20, 0x73, 0x74, 0x65, 0x70, 0x20, 0x69, 0x6e, 0x20, 0x61, + 0x20, 0x77, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x1a, 0x23, 0x50, 0x65, 0x72, 0x66, 0x6f, + 0x72, 0x6d, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6e, 0x65, 0x78, 0x74, 0x20, 0x73, 0x74, 0x65, 0x70, + 0x20, 0x69, 0x6e, 0x20, 0x61, 0x20, 0x77, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x2a, 0x0e, + 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x4a, 0x0b, + 0x0a, 0x03, 0x32, 0x30, 0x30, 0x12, 0x04, 0x0a, 0x02, 0x4f, 0x4b, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x2b, 0x3a, 0x01, 0x2a, 0x22, 0x26, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, + 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x77, 0x6f, 0x72, 0x6b, 0x66, + 0x6c, 0x6f, 0x77, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x73, 0x74, 0x65, 0x70, 0x12, 0xe8, 0x02, 0x0a, + 0x12, 0x56, 0x69, 0x65, 0x77, 0x53, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6e, 0x74, + 0x65, 0x78, 0x74, 0x12, 0x3c, 0x2e, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, + 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x63, 0x68, 0x65, 0x73, 0x74, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x69, 0x65, 0x77, 0x53, 0x74, 0x61, 0x6b, + 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x3d, 0x2e, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x61, + 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x63, 0x68, 0x65, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x69, 0x65, 0x77, 0x53, 0x74, 0x61, 0x6b, 0x69, 0x6e, + 0x67, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0xd4, 0x01, 0x92, 0x41, 0xad, 0x01, 0x0a, 0x0e, 0x53, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, + 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x12, 0x3c, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x73, + 0x20, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x2d, 0x69, 0x6e, 0x2d, 0x74, 0x69, 0x6d, 0x65, 0x20, 0x63, + 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, + 0x67, 0x20, 0x64, 0x61, 0x74, 0x61, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x61, 0x6e, 0x20, 0x61, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x1a, 0x3c, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x73, 0x20, 0x70, + 0x6f, 0x69, 0x6e, 0x74, 0x2d, 0x69, 0x6e, 0x2d, 0x74, 0x69, 0x6d, 0x65, 0x20, 0x63, 0x6f, 0x6e, + 0x74, 0x65, 0x78, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x20, + 0x64, 0x61, 0x74, 0x61, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x61, 0x6e, 0x20, 0x61, 0x64, 0x64, 0x72, + 0x65, 0x73, 0x73, 0x2a, 0x12, 0x56, 0x69, 0x65, 0x77, 0x53, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, + 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x4a, 0x0b, 0x0a, 0x03, 0x32, 0x30, 0x30, 0x12, 0x04, + 0x0a, 0x02, 0x4f, 0x4b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x12, 0x1b, 0x2f, 0x76, 0x31, 0x2f, + 0x76, 0x69, 0x65, 0x77, 0x53, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6e, 0x74, 0x65, + 0x78, 0x74, 0x3a, 0x76, 0x69, 0x65, 0x77, 0x1a, 0x1d, 0xca, 0x41, 0x1a, 0x61, 0x70, 0x69, 0x2e, + 0x64, 0x65, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x72, 0x2e, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, + 0x73, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x42, 0xf5, 0x07, 0x92, 0x41, 0x99, 0x07, 0x12, 0x65, 0x0a, + 0x15, 0x4f, 0x72, 0x63, 0x68, 0x65, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x53, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x48, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x20, + 0x74, 0x68, 0x61, 0x74, 0x20, 0x63, 0x61, 0x6e, 0x20, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x20, 0x6e, + 0x6f, 0x6e, 0x2d, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x64, 0x69, 0x61, 0x6c, 0x20, 0x73, 0x74, 0x61, + 0x6b, 0x69, 0x6e, 0x67, 0x20, 0x65, 0x78, 0x70, 0x65, 0x72, 0x69, 0x65, 0x6e, 0x63, 0x65, 0x73, + 0x20, 0x66, 0x6f, 0x72, 0x20, 0x79, 0x6f, 0x75, 0x72, 0x20, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2e, + 0x32, 0x02, 0x76, 0x31, 0x1a, 0x1a, 0x61, 0x70, 0x69, 0x2e, 0x64, 0x65, 0x76, 0x65, 0x6c, 0x6f, + 0x70, 0x65, 0x72, 0x2e, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x63, 0x6f, 0x6d, + 0x22, 0x08, 0x2f, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2a, 0x01, 0x02, 0x32, 0x10, 0x61, + 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, + 0x10, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6a, 0x73, 0x6f, + 0x6e, 0x52, 0x52, 0x0a, 0x03, 0x34, 0x30, 0x30, 0x12, 0x4b, 0x0a, 0x2c, 0x54, 0x68, 0x65, 0x20, + 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x20, 0x61, 0x74, 0x74, 0x65, 0x6d, 0x70, 0x74, 0x65, + 0x64, 0x20, 0x68, 0x61, 0x73, 0x20, 0x69, 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x20, 0x70, 0x61, + 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x12, 0x1b, 0x0a, 0x19, 0x1a, 0x17, 0x23, 0x2f, + 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x72, 0x70, 0x63, 0x53, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x57, 0x0a, 0x03, 0x34, 0x30, 0x31, 0x12, 0x50, 0x0a, 0x31, + 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x65, 0x64, 0x20, 0x69, 0x66, 0x20, 0x61, 0x75, 0x74, 0x68, + 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x69, 0x6e, 0x66, 0x6f, 0x72, + 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x69, 0x73, 0x20, 0x69, 0x6e, 0x76, 0x61, 0x6c, 0x69, + 0x64, 0x12, 0x1b, 0x0a, 0x19, 0x1a, 0x17, 0x23, 0x2f, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x72, 0x70, 0x63, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x64, + 0x0a, 0x03, 0x34, 0x30, 0x33, 0x12, 0x5d, 0x0a, 0x3e, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x65, + 0x64, 0x20, 0x77, 0x68, 0x65, 0x6e, 0x20, 0x61, 0x20, 0x75, 0x73, 0x65, 0x72, 0x20, 0x64, 0x6f, + 0x65, 0x73, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x68, 0x61, 0x76, 0x65, 0x20, 0x70, 0x65, 0x72, 0x6d, + 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x74, 0x6f, 0x20, 0x74, 0x68, 0x65, 0x20, 0x72, 0x65, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x12, 0x1b, 0x0a, 0x19, 0x1a, 0x17, 0x23, 0x2f, 0x64, + 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x72, 0x70, 0x63, 0x53, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x52, 0x4c, 0x0a, 0x03, 0x34, 0x30, 0x34, 0x12, 0x45, 0x0a, 0x26, 0x52, + 0x65, 0x74, 0x75, 0x72, 0x6e, 0x65, 0x64, 0x20, 0x77, 0x68, 0x65, 0x6e, 0x20, 0x61, 0x20, 0x72, + 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x20, 0x69, 0x73, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x66, + 0x6f, 0x75, 0x6e, 0x64, 0x2e, 0x12, 0x1b, 0x0a, 0x19, 0x1a, 0x17, 0x23, 0x2f, 0x64, 0x65, 0x66, + 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x72, 0x70, 0x63, 0x53, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x52, 0x56, 0x0a, 0x03, 0x34, 0x32, 0x39, 0x12, 0x4f, 0x0a, 0x30, 0x52, 0x65, 0x74, + 0x75, 0x72, 0x6e, 0x65, 0x64, 0x20, 0x77, 0x68, 0x65, 0x6e, 0x20, 0x61, 0x20, 0x72, 0x65, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x20, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x20, 0x68, 0x61, 0x73, 0x20, + 0x62, 0x65, 0x65, 0x6e, 0x20, 0x72, 0x65, 0x61, 0x63, 0x68, 0x65, 0x64, 0x2e, 0x12, 0x1b, 0x0a, + 0x19, 0x1a, 0x17, 0x23, 0x2f, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x2f, 0x72, 0x70, 0x63, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x55, 0x0a, 0x03, 0x35, 0x30, + 0x30, 0x12, 0x4e, 0x0a, 0x2f, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x65, 0x64, 0x20, 0x77, 0x68, + 0x65, 0x6e, 0x20, 0x61, 0x6e, 0x20, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x20, 0x73, + 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x20, 0x68, 0x61, 0x70, 0x70, + 0x65, 0x6e, 0x73, 0x2e, 0x12, 0x1b, 0x0a, 0x19, 0x1a, 0x17, 0x23, 0x2f, 0x64, 0x65, 0x66, 0x69, + 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x72, 0x70, 0x63, 0x53, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x6a, 0x1d, 0x0a, 0x08, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x12, 0x11, 0x50, + 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x73, 0x20, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, + 0x6a, 0x1b, 0x0a, 0x07, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x12, 0x10, 0x4e, 0x65, 0x74, + 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x20, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x6a, 0x19, 0x0a, + 0x06, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0f, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x20, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x6a, 0x28, 0x0a, 0x0d, 0x53, 0x74, 0x61, 0x6b, + 0x69, 0x6e, 0x67, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x17, 0x53, 0x74, 0x61, 0x6b, 0x69, + 0x6e, 0x67, 0x20, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x20, 0x64, 0x65, 0x74, 0x61, 0x69, + 0x6c, 0x73, 0x6a, 0x29, 0x0a, 0x0e, 0x53, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6e, + 0x74, 0x65, 0x78, 0x74, 0x12, 0x17, 0x53, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x20, 0x63, 0x6f, + 0x6e, 0x74, 0x65, 0x78, 0x74, 0x20, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x6a, 0x27, 0x0a, + 0x08, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x12, 0x1b, 0x57, 0x6f, 0x72, 0x6b, 0x66, + 0x6c, 0x6f, 0x77, 0x20, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x64, + 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x5a, 0x56, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, + 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x73, 0x74, 0x61, 0x6b, + 0x69, 0x6e, 0x67, 0x2d, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2d, 0x6c, 0x69, 0x62, 0x72, 0x61, + 0x72, 0x79, 0x2d, 0x67, 0x6f, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x67, 0x6f, 0x2f, 0x63, 0x6f, 0x69, + 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2f, 0x6f, 0x72, + 0x63, 0x68, 0x65, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var file_coinbase_staking_orchestration_v1_api_proto_goTypes = []interface{}{ + (*ListProtocolsRequest)(nil), // 0: coinbase.staking.orchestration.v1.ListProtocolsRequest + (*ListNetworksRequest)(nil), // 1: coinbase.staking.orchestration.v1.ListNetworksRequest + (*ListStakingTargetsRequest)(nil), // 2: coinbase.staking.orchestration.v1.ListStakingTargetsRequest + (*ListActionsRequest)(nil), // 3: coinbase.staking.orchestration.v1.ListActionsRequest + (*CreateWorkflowRequest)(nil), // 4: coinbase.staking.orchestration.v1.CreateWorkflowRequest + (*GetWorkflowRequest)(nil), // 5: coinbase.staking.orchestration.v1.GetWorkflowRequest + (*ListWorkflowsRequest)(nil), // 6: coinbase.staking.orchestration.v1.ListWorkflowsRequest + (*PerformWorkflowStepRequest)(nil), // 7: coinbase.staking.orchestration.v1.PerformWorkflowStepRequest + (*ViewStakingContextRequest)(nil), // 8: coinbase.staking.orchestration.v1.ViewStakingContextRequest + (*ListProtocolsResponse)(nil), // 9: coinbase.staking.orchestration.v1.ListProtocolsResponse + (*ListNetworksResponse)(nil), // 10: coinbase.staking.orchestration.v1.ListNetworksResponse + (*ListStakingTargetsResponse)(nil), // 11: coinbase.staking.orchestration.v1.ListStakingTargetsResponse + (*ListActionsResponse)(nil), // 12: coinbase.staking.orchestration.v1.ListActionsResponse + (*Workflow)(nil), // 13: coinbase.staking.orchestration.v1.Workflow + (*ListWorkflowsResponse)(nil), // 14: coinbase.staking.orchestration.v1.ListWorkflowsResponse + (*ViewStakingContextResponse)(nil), // 15: coinbase.staking.orchestration.v1.ViewStakingContextResponse +} +var file_coinbase_staking_orchestration_v1_api_proto_depIdxs = []int32{ + 0, // 0: coinbase.staking.orchestration.v1.StakingService.ListProtocols:input_type -> coinbase.staking.orchestration.v1.ListProtocolsRequest + 1, // 1: coinbase.staking.orchestration.v1.StakingService.ListNetworks:input_type -> coinbase.staking.orchestration.v1.ListNetworksRequest + 2, // 2: coinbase.staking.orchestration.v1.StakingService.ListStakingTargets:input_type -> coinbase.staking.orchestration.v1.ListStakingTargetsRequest + 3, // 3: coinbase.staking.orchestration.v1.StakingService.ListActions:input_type -> coinbase.staking.orchestration.v1.ListActionsRequest + 4, // 4: coinbase.staking.orchestration.v1.StakingService.CreateWorkflow:input_type -> coinbase.staking.orchestration.v1.CreateWorkflowRequest + 5, // 5: coinbase.staking.orchestration.v1.StakingService.GetWorkflow:input_type -> coinbase.staking.orchestration.v1.GetWorkflowRequest + 6, // 6: coinbase.staking.orchestration.v1.StakingService.ListWorkflows:input_type -> coinbase.staking.orchestration.v1.ListWorkflowsRequest + 7, // 7: coinbase.staking.orchestration.v1.StakingService.PerformWorkflowStep:input_type -> coinbase.staking.orchestration.v1.PerformWorkflowStepRequest + 8, // 8: coinbase.staking.orchestration.v1.StakingService.ViewStakingContext:input_type -> coinbase.staking.orchestration.v1.ViewStakingContextRequest + 9, // 9: coinbase.staking.orchestration.v1.StakingService.ListProtocols:output_type -> coinbase.staking.orchestration.v1.ListProtocolsResponse + 10, // 10: coinbase.staking.orchestration.v1.StakingService.ListNetworks:output_type -> coinbase.staking.orchestration.v1.ListNetworksResponse + 11, // 11: coinbase.staking.orchestration.v1.StakingService.ListStakingTargets:output_type -> coinbase.staking.orchestration.v1.ListStakingTargetsResponse + 12, // 12: coinbase.staking.orchestration.v1.StakingService.ListActions:output_type -> coinbase.staking.orchestration.v1.ListActionsResponse + 13, // 13: coinbase.staking.orchestration.v1.StakingService.CreateWorkflow:output_type -> coinbase.staking.orchestration.v1.Workflow + 13, // 14: coinbase.staking.orchestration.v1.StakingService.GetWorkflow:output_type -> coinbase.staking.orchestration.v1.Workflow + 14, // 15: coinbase.staking.orchestration.v1.StakingService.ListWorkflows:output_type -> coinbase.staking.orchestration.v1.ListWorkflowsResponse + 13, // 16: coinbase.staking.orchestration.v1.StakingService.PerformWorkflowStep:output_type -> coinbase.staking.orchestration.v1.Workflow + 15, // 17: coinbase.staking.orchestration.v1.StakingService.ViewStakingContext:output_type -> coinbase.staking.orchestration.v1.ViewStakingContextResponse + 9, // [9:18] is the sub-list for method output_type + 0, // [0:9] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_coinbase_staking_orchestration_v1_api_proto_init() } +func file_coinbase_staking_orchestration_v1_api_proto_init() { + if File_coinbase_staking_orchestration_v1_api_proto != nil { + return + } + file_coinbase_staking_orchestration_v1_protocol_proto_init() + file_coinbase_staking_orchestration_v1_network_proto_init() + file_coinbase_staking_orchestration_v1_action_proto_init() + file_coinbase_staking_orchestration_v1_staking_target_proto_init() + file_coinbase_staking_orchestration_v1_workflow_proto_init() + file_coinbase_staking_orchestration_v1_staking_context_proto_init() + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_coinbase_staking_orchestration_v1_api_proto_rawDesc, + NumEnums: 0, + NumMessages: 0, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_coinbase_staking_orchestration_v1_api_proto_goTypes, + DependencyIndexes: file_coinbase_staking_orchestration_v1_api_proto_depIdxs, + }.Build() + File_coinbase_staking_orchestration_v1_api_proto = out.File + file_coinbase_staking_orchestration_v1_api_proto_rawDesc = nil + file_coinbase_staking_orchestration_v1_api_proto_goTypes = nil + file_coinbase_staking_orchestration_v1_api_proto_depIdxs = nil +} diff --git a/gen/go/coinbase/staking/orchestration/v1/api.pb.gw.go b/gen/go/coinbase/staking/orchestration/v1/api.pb.gw.go new file mode 100644 index 0000000..644a627 --- /dev/null +++ b/gen/go/coinbase/staking/orchestration/v1/api.pb.gw.go @@ -0,0 +1,1031 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: coinbase/staking/orchestration/v1/api.proto + +/* +Package v1 is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package v1 + +import ( + "context" + "io" + "net/http" + + "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" + "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" + "google.golang.org/protobuf/proto" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = metadata.Join + +func request_StakingService_ListProtocols_0(ctx context.Context, marshaler runtime.Marshaler, client StakingServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ListProtocolsRequest + var metadata runtime.ServerMetadata + + msg, err := client.ListProtocols(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_StakingService_ListProtocols_0(ctx context.Context, marshaler runtime.Marshaler, server StakingServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ListProtocolsRequest + var metadata runtime.ServerMetadata + + msg, err := server.ListProtocols(ctx, &protoReq) + return msg, metadata, err + +} + +func request_StakingService_ListNetworks_0(ctx context.Context, marshaler runtime.Marshaler, client StakingServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ListNetworksRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["parent"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "parent") + } + + protoReq.Parent, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "parent", err) + } + + msg, err := client.ListNetworks(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_StakingService_ListNetworks_0(ctx context.Context, marshaler runtime.Marshaler, server StakingServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ListNetworksRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["parent"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "parent") + } + + protoReq.Parent, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "parent", err) + } + + msg, err := server.ListNetworks(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_StakingService_ListStakingTargets_0 = &utilities.DoubleArray{Encoding: map[string]int{"parent": 0}, Base: []int{1, 2, 0, 0}, Check: []int{0, 1, 2, 2}} +) + +func request_StakingService_ListStakingTargets_0(ctx context.Context, marshaler runtime.Marshaler, client StakingServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ListStakingTargetsRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["parent"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "parent") + } + + protoReq.Parent, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "parent", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_StakingService_ListStakingTargets_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.ListStakingTargets(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_StakingService_ListStakingTargets_0(ctx context.Context, marshaler runtime.Marshaler, server StakingServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ListStakingTargetsRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["parent"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "parent") + } + + protoReq.Parent, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "parent", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_StakingService_ListStakingTargets_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.ListStakingTargets(ctx, &protoReq) + return msg, metadata, err + +} + +func request_StakingService_ListActions_0(ctx context.Context, marshaler runtime.Marshaler, client StakingServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ListActionsRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["parent"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "parent") + } + + protoReq.Parent, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "parent", err) + } + + msg, err := client.ListActions(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_StakingService_ListActions_0(ctx context.Context, marshaler runtime.Marshaler, server StakingServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ListActionsRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["parent"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "parent") + } + + protoReq.Parent, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "parent", err) + } + + msg, err := server.ListActions(ctx, &protoReq) + return msg, metadata, err + +} + +func request_StakingService_CreateWorkflow_0(ctx context.Context, marshaler runtime.Marshaler, client StakingServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq CreateWorkflowRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Workflow); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["parent"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "parent") + } + + protoReq.Parent, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "parent", err) + } + + msg, err := client.CreateWorkflow(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_StakingService_CreateWorkflow_0(ctx context.Context, marshaler runtime.Marshaler, server StakingServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq CreateWorkflowRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Workflow); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["parent"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "parent") + } + + protoReq.Parent, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "parent", err) + } + + msg, err := server.CreateWorkflow(ctx, &protoReq) + return msg, metadata, err + +} + +func request_StakingService_GetWorkflow_0(ctx context.Context, marshaler runtime.Marshaler, client StakingServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetWorkflowRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["name"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") + } + + protoReq.Name, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) + } + + msg, err := client.GetWorkflow(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_StakingService_GetWorkflow_0(ctx context.Context, marshaler runtime.Marshaler, server StakingServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetWorkflowRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["name"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") + } + + protoReq.Name, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) + } + + msg, err := server.GetWorkflow(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_StakingService_ListWorkflows_0 = &utilities.DoubleArray{Encoding: map[string]int{"parent": 0}, Base: []int{1, 2, 0, 0}, Check: []int{0, 1, 2, 2}} +) + +func request_StakingService_ListWorkflows_0(ctx context.Context, marshaler runtime.Marshaler, client StakingServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ListWorkflowsRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["parent"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "parent") + } + + protoReq.Parent, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "parent", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_StakingService_ListWorkflows_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.ListWorkflows(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_StakingService_ListWorkflows_0(ctx context.Context, marshaler runtime.Marshaler, server StakingServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ListWorkflowsRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["parent"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "parent") + } + + protoReq.Parent, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "parent", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_StakingService_ListWorkflows_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.ListWorkflows(ctx, &protoReq) + return msg, metadata, err + +} + +func request_StakingService_PerformWorkflowStep_0(ctx context.Context, marshaler runtime.Marshaler, client StakingServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq PerformWorkflowStepRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["name"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") + } + + protoReq.Name, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) + } + + msg, err := client.PerformWorkflowStep(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_StakingService_PerformWorkflowStep_0(ctx context.Context, marshaler runtime.Marshaler, server StakingServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq PerformWorkflowStepRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["name"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") + } + + protoReq.Name, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) + } + + msg, err := server.PerformWorkflowStep(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_StakingService_ViewStakingContext_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_StakingService_ViewStakingContext_0(ctx context.Context, marshaler runtime.Marshaler, client StakingServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ViewStakingContextRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_StakingService_ViewStakingContext_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.ViewStakingContext(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_StakingService_ViewStakingContext_0(ctx context.Context, marshaler runtime.Marshaler, server StakingServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ViewStakingContextRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_StakingService_ViewStakingContext_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.ViewStakingContext(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterStakingServiceHandlerServer registers the http handlers for service StakingService to "mux". +// UnaryRPC :call StakingServiceServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterStakingServiceHandlerFromEndpoint instead. +func RegisterStakingServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server StakingServiceServer) error { + + mux.Handle("GET", pattern_StakingService_ListProtocols_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/coinbase.staking.orchestration.v1.StakingService/ListProtocols", runtime.WithHTTPPathPattern("/v1/protocols")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_StakingService_ListProtocols_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_StakingService_ListProtocols_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_StakingService_ListNetworks_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/coinbase.staking.orchestration.v1.StakingService/ListNetworks", runtime.WithHTTPPathPattern("/v1/{parent=protocols/*}/networks")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_StakingService_ListNetworks_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_StakingService_ListNetworks_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_StakingService_ListStakingTargets_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/coinbase.staking.orchestration.v1.StakingService/ListStakingTargets", runtime.WithHTTPPathPattern("/v1/{parent=protocols/*/networks/*}/stakingTargets")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_StakingService_ListStakingTargets_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_StakingService_ListStakingTargets_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_StakingService_ListActions_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/coinbase.staking.orchestration.v1.StakingService/ListActions", runtime.WithHTTPPathPattern("/v1/{parent=protocols/*/networks/*}/actions")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_StakingService_ListActions_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_StakingService_ListActions_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_StakingService_CreateWorkflow_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/coinbase.staking.orchestration.v1.StakingService/CreateWorkflow", runtime.WithHTTPPathPattern("/v1/{parent=projects/*}/workflows")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_StakingService_CreateWorkflow_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_StakingService_CreateWorkflow_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_StakingService_GetWorkflow_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/coinbase.staking.orchestration.v1.StakingService/GetWorkflow", runtime.WithHTTPPathPattern("/v1/{name=projects/*/workflows/*}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_StakingService_GetWorkflow_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_StakingService_GetWorkflow_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_StakingService_ListWorkflows_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/coinbase.staking.orchestration.v1.StakingService/ListWorkflows", runtime.WithHTTPPathPattern("/v1/{parent=projects/*}/workflows")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_StakingService_ListWorkflows_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_StakingService_ListWorkflows_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_StakingService_PerformWorkflowStep_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/coinbase.staking.orchestration.v1.StakingService/PerformWorkflowStep", runtime.WithHTTPPathPattern("/v1/{name=projects/*/workflows/*}/step")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_StakingService_PerformWorkflowStep_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_StakingService_PerformWorkflowStep_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_StakingService_ViewStakingContext_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/coinbase.staking.orchestration.v1.StakingService/ViewStakingContext", runtime.WithHTTPPathPattern("/v1/viewStakingContext:view")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_StakingService_ViewStakingContext_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_StakingService_ViewStakingContext_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterStakingServiceHandlerFromEndpoint is same as RegisterStakingServiceHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterStakingServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.DialContext(ctx, endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterStakingServiceHandler(ctx, mux, conn) +} + +// RegisterStakingServiceHandler registers the http handlers for service StakingService to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterStakingServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterStakingServiceHandlerClient(ctx, mux, NewStakingServiceClient(conn)) +} + +// RegisterStakingServiceHandlerClient registers the http handlers for service StakingService +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "StakingServiceClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "StakingServiceClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "StakingServiceClient" to call the correct interceptors. +func RegisterStakingServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client StakingServiceClient) error { + + mux.Handle("GET", pattern_StakingService_ListProtocols_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/coinbase.staking.orchestration.v1.StakingService/ListProtocols", runtime.WithHTTPPathPattern("/v1/protocols")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_StakingService_ListProtocols_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_StakingService_ListProtocols_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_StakingService_ListNetworks_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/coinbase.staking.orchestration.v1.StakingService/ListNetworks", runtime.WithHTTPPathPattern("/v1/{parent=protocols/*}/networks")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_StakingService_ListNetworks_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_StakingService_ListNetworks_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_StakingService_ListStakingTargets_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/coinbase.staking.orchestration.v1.StakingService/ListStakingTargets", runtime.WithHTTPPathPattern("/v1/{parent=protocols/*/networks/*}/stakingTargets")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_StakingService_ListStakingTargets_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_StakingService_ListStakingTargets_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_StakingService_ListActions_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/coinbase.staking.orchestration.v1.StakingService/ListActions", runtime.WithHTTPPathPattern("/v1/{parent=protocols/*/networks/*}/actions")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_StakingService_ListActions_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_StakingService_ListActions_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_StakingService_CreateWorkflow_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/coinbase.staking.orchestration.v1.StakingService/CreateWorkflow", runtime.WithHTTPPathPattern("/v1/{parent=projects/*}/workflows")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_StakingService_CreateWorkflow_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_StakingService_CreateWorkflow_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_StakingService_GetWorkflow_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/coinbase.staking.orchestration.v1.StakingService/GetWorkflow", runtime.WithHTTPPathPattern("/v1/{name=projects/*/workflows/*}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_StakingService_GetWorkflow_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_StakingService_GetWorkflow_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_StakingService_ListWorkflows_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/coinbase.staking.orchestration.v1.StakingService/ListWorkflows", runtime.WithHTTPPathPattern("/v1/{parent=projects/*}/workflows")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_StakingService_ListWorkflows_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_StakingService_ListWorkflows_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_StakingService_PerformWorkflowStep_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/coinbase.staking.orchestration.v1.StakingService/PerformWorkflowStep", runtime.WithHTTPPathPattern("/v1/{name=projects/*/workflows/*}/step")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_StakingService_PerformWorkflowStep_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_StakingService_PerformWorkflowStep_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_StakingService_ViewStakingContext_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/coinbase.staking.orchestration.v1.StakingService/ViewStakingContext", runtime.WithHTTPPathPattern("/v1/viewStakingContext:view")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_StakingService_ViewStakingContext_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_StakingService_ViewStakingContext_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_StakingService_ListProtocols_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "protocols"}, "")) + + pattern_StakingService_ListNetworks_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 2, 5, 2, 2, 3}, []string{"v1", "protocols", "parent", "networks"}, "")) + + pattern_StakingService_ListStakingTargets_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 2, 2, 1, 0, 4, 4, 5, 3, 2, 4}, []string{"v1", "protocols", "networks", "parent", "stakingTargets"}, "")) + + pattern_StakingService_ListActions_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 2, 2, 1, 0, 4, 4, 5, 3, 2, 4}, []string{"v1", "protocols", "networks", "parent", "actions"}, "")) + + pattern_StakingService_CreateWorkflow_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 2, 5, 2, 2, 3}, []string{"v1", "projects", "parent", "workflows"}, "")) + + pattern_StakingService_GetWorkflow_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 2, 2, 1, 0, 4, 4, 5, 3}, []string{"v1", "projects", "workflows", "name"}, "")) + + pattern_StakingService_ListWorkflows_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 2, 5, 2, 2, 3}, []string{"v1", "projects", "parent", "workflows"}, "")) + + pattern_StakingService_PerformWorkflowStep_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 2, 2, 1, 0, 4, 4, 5, 3, 2, 4}, []string{"v1", "projects", "workflows", "name", "step"}, "")) + + pattern_StakingService_ViewStakingContext_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "viewStakingContext"}, "view")) +) + +var ( + forward_StakingService_ListProtocols_0 = runtime.ForwardResponseMessage + + forward_StakingService_ListNetworks_0 = runtime.ForwardResponseMessage + + forward_StakingService_ListStakingTargets_0 = runtime.ForwardResponseMessage + + forward_StakingService_ListActions_0 = runtime.ForwardResponseMessage + + forward_StakingService_CreateWorkflow_0 = runtime.ForwardResponseMessage + + forward_StakingService_GetWorkflow_0 = runtime.ForwardResponseMessage + + forward_StakingService_ListWorkflows_0 = runtime.ForwardResponseMessage + + forward_StakingService_PerformWorkflowStep_0 = runtime.ForwardResponseMessage + + forward_StakingService_ViewStakingContext_0 = runtime.ForwardResponseMessage +) diff --git a/gen/go/coinbase/staking/orchestration/v1/api_grpc.pb.go b/gen/go/coinbase/staking/orchestration/v1/api_grpc.pb.go new file mode 100644 index 0000000..672788c --- /dev/null +++ b/gen/go/coinbase/staking/orchestration/v1/api_grpc.pb.go @@ -0,0 +1,423 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc (unknown) +// source: coinbase/staking/orchestration/v1/api.proto + +package v1 + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + StakingService_ListProtocols_FullMethodName = "/coinbase.staking.orchestration.v1.StakingService/ListProtocols" + StakingService_ListNetworks_FullMethodName = "/coinbase.staking.orchestration.v1.StakingService/ListNetworks" + StakingService_ListStakingTargets_FullMethodName = "/coinbase.staking.orchestration.v1.StakingService/ListStakingTargets" + StakingService_ListActions_FullMethodName = "/coinbase.staking.orchestration.v1.StakingService/ListActions" + StakingService_CreateWorkflow_FullMethodName = "/coinbase.staking.orchestration.v1.StakingService/CreateWorkflow" + StakingService_GetWorkflow_FullMethodName = "/coinbase.staking.orchestration.v1.StakingService/GetWorkflow" + StakingService_ListWorkflows_FullMethodName = "/coinbase.staking.orchestration.v1.StakingService/ListWorkflows" + StakingService_PerformWorkflowStep_FullMethodName = "/coinbase.staking.orchestration.v1.StakingService/PerformWorkflowStep" + StakingService_ViewStakingContext_FullMethodName = "/coinbase.staking.orchestration.v1.StakingService/ViewStakingContext" +) + +// StakingServiceClient is the client API for StakingService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type StakingServiceClient interface { + // List supported protocols. + ListProtocols(ctx context.Context, in *ListProtocolsRequest, opts ...grpc.CallOption) (*ListProtocolsResponse, error) + // List supported staking networks for a given protocol. + ListNetworks(ctx context.Context, in *ListNetworksRequest, opts ...grpc.CallOption) (*ListNetworksResponse, error) + // List supported staking targets for a given protocol and network. + ListStakingTargets(ctx context.Context, in *ListStakingTargetsRequest, opts ...grpc.CallOption) (*ListStakingTargetsResponse, error) + // List supported actions for a given protocol and network. + ListActions(ctx context.Context, in *ListActionsRequest, opts ...grpc.CallOption) (*ListActionsResponse, error) + // Create a workflow to perform an action. + CreateWorkflow(ctx context.Context, in *CreateWorkflowRequest, opts ...grpc.CallOption) (*Workflow, error) + // Get the current state of an active workflow. + GetWorkflow(ctx context.Context, in *GetWorkflowRequest, opts ...grpc.CallOption) (*Workflow, error) + // List all workflows in a project. + ListWorkflows(ctx context.Context, in *ListWorkflowsRequest, opts ...grpc.CallOption) (*ListWorkflowsResponse, error) + // Perform the next step in a workflow. + PerformWorkflowStep(ctx context.Context, in *PerformWorkflowStepRequest, opts ...grpc.CallOption) (*Workflow, error) + // View Staking context information given a specific network address. + ViewStakingContext(ctx context.Context, in *ViewStakingContextRequest, opts ...grpc.CallOption) (*ViewStakingContextResponse, error) +} + +type stakingServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewStakingServiceClient(cc grpc.ClientConnInterface) StakingServiceClient { + return &stakingServiceClient{cc} +} + +func (c *stakingServiceClient) ListProtocols(ctx context.Context, in *ListProtocolsRequest, opts ...grpc.CallOption) (*ListProtocolsResponse, error) { + out := new(ListProtocolsResponse) + err := c.cc.Invoke(ctx, StakingService_ListProtocols_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *stakingServiceClient) ListNetworks(ctx context.Context, in *ListNetworksRequest, opts ...grpc.CallOption) (*ListNetworksResponse, error) { + out := new(ListNetworksResponse) + err := c.cc.Invoke(ctx, StakingService_ListNetworks_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *stakingServiceClient) ListStakingTargets(ctx context.Context, in *ListStakingTargetsRequest, opts ...grpc.CallOption) (*ListStakingTargetsResponse, error) { + out := new(ListStakingTargetsResponse) + err := c.cc.Invoke(ctx, StakingService_ListStakingTargets_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *stakingServiceClient) ListActions(ctx context.Context, in *ListActionsRequest, opts ...grpc.CallOption) (*ListActionsResponse, error) { + out := new(ListActionsResponse) + err := c.cc.Invoke(ctx, StakingService_ListActions_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *stakingServiceClient) CreateWorkflow(ctx context.Context, in *CreateWorkflowRequest, opts ...grpc.CallOption) (*Workflow, error) { + out := new(Workflow) + err := c.cc.Invoke(ctx, StakingService_CreateWorkflow_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *stakingServiceClient) GetWorkflow(ctx context.Context, in *GetWorkflowRequest, opts ...grpc.CallOption) (*Workflow, error) { + out := new(Workflow) + err := c.cc.Invoke(ctx, StakingService_GetWorkflow_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *stakingServiceClient) ListWorkflows(ctx context.Context, in *ListWorkflowsRequest, opts ...grpc.CallOption) (*ListWorkflowsResponse, error) { + out := new(ListWorkflowsResponse) + err := c.cc.Invoke(ctx, StakingService_ListWorkflows_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *stakingServiceClient) PerformWorkflowStep(ctx context.Context, in *PerformWorkflowStepRequest, opts ...grpc.CallOption) (*Workflow, error) { + out := new(Workflow) + err := c.cc.Invoke(ctx, StakingService_PerformWorkflowStep_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *stakingServiceClient) ViewStakingContext(ctx context.Context, in *ViewStakingContextRequest, opts ...grpc.CallOption) (*ViewStakingContextResponse, error) { + out := new(ViewStakingContextResponse) + err := c.cc.Invoke(ctx, StakingService_ViewStakingContext_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// StakingServiceServer is the server API for StakingService service. +// All implementations must embed UnimplementedStakingServiceServer +// for forward compatibility +type StakingServiceServer interface { + // List supported protocols. + ListProtocols(context.Context, *ListProtocolsRequest) (*ListProtocolsResponse, error) + // List supported staking networks for a given protocol. + ListNetworks(context.Context, *ListNetworksRequest) (*ListNetworksResponse, error) + // List supported staking targets for a given protocol and network. + ListStakingTargets(context.Context, *ListStakingTargetsRequest) (*ListStakingTargetsResponse, error) + // List supported actions for a given protocol and network. + ListActions(context.Context, *ListActionsRequest) (*ListActionsResponse, error) + // Create a workflow to perform an action. + CreateWorkflow(context.Context, *CreateWorkflowRequest) (*Workflow, error) + // Get the current state of an active workflow. + GetWorkflow(context.Context, *GetWorkflowRequest) (*Workflow, error) + // List all workflows in a project. + ListWorkflows(context.Context, *ListWorkflowsRequest) (*ListWorkflowsResponse, error) + // Perform the next step in a workflow. + PerformWorkflowStep(context.Context, *PerformWorkflowStepRequest) (*Workflow, error) + // View Staking context information given a specific network address. + ViewStakingContext(context.Context, *ViewStakingContextRequest) (*ViewStakingContextResponse, error) + mustEmbedUnimplementedStakingServiceServer() +} + +// UnimplementedStakingServiceServer must be embedded to have forward compatible implementations. +type UnimplementedStakingServiceServer struct { +} + +func (UnimplementedStakingServiceServer) ListProtocols(context.Context, *ListProtocolsRequest) (*ListProtocolsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListProtocols not implemented") +} +func (UnimplementedStakingServiceServer) ListNetworks(context.Context, *ListNetworksRequest) (*ListNetworksResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListNetworks not implemented") +} +func (UnimplementedStakingServiceServer) ListStakingTargets(context.Context, *ListStakingTargetsRequest) (*ListStakingTargetsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListStakingTargets not implemented") +} +func (UnimplementedStakingServiceServer) ListActions(context.Context, *ListActionsRequest) (*ListActionsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListActions not implemented") +} +func (UnimplementedStakingServiceServer) CreateWorkflow(context.Context, *CreateWorkflowRequest) (*Workflow, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateWorkflow not implemented") +} +func (UnimplementedStakingServiceServer) GetWorkflow(context.Context, *GetWorkflowRequest) (*Workflow, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetWorkflow not implemented") +} +func (UnimplementedStakingServiceServer) ListWorkflows(context.Context, *ListWorkflowsRequest) (*ListWorkflowsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListWorkflows not implemented") +} +func (UnimplementedStakingServiceServer) PerformWorkflowStep(context.Context, *PerformWorkflowStepRequest) (*Workflow, error) { + return nil, status.Errorf(codes.Unimplemented, "method PerformWorkflowStep not implemented") +} +func (UnimplementedStakingServiceServer) ViewStakingContext(context.Context, *ViewStakingContextRequest) (*ViewStakingContextResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ViewStakingContext not implemented") +} +func (UnimplementedStakingServiceServer) mustEmbedUnimplementedStakingServiceServer() {} + +// UnsafeStakingServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to StakingServiceServer will +// result in compilation errors. +type UnsafeStakingServiceServer interface { + mustEmbedUnimplementedStakingServiceServer() +} + +func RegisterStakingServiceServer(s grpc.ServiceRegistrar, srv StakingServiceServer) { + s.RegisterService(&StakingService_ServiceDesc, srv) +} + +func _StakingService_ListProtocols_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListProtocolsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StakingServiceServer).ListProtocols(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: StakingService_ListProtocols_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StakingServiceServer).ListProtocols(ctx, req.(*ListProtocolsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _StakingService_ListNetworks_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListNetworksRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StakingServiceServer).ListNetworks(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: StakingService_ListNetworks_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StakingServiceServer).ListNetworks(ctx, req.(*ListNetworksRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _StakingService_ListStakingTargets_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListStakingTargetsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StakingServiceServer).ListStakingTargets(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: StakingService_ListStakingTargets_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StakingServiceServer).ListStakingTargets(ctx, req.(*ListStakingTargetsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _StakingService_ListActions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListActionsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StakingServiceServer).ListActions(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: StakingService_ListActions_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StakingServiceServer).ListActions(ctx, req.(*ListActionsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _StakingService_CreateWorkflow_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateWorkflowRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StakingServiceServer).CreateWorkflow(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: StakingService_CreateWorkflow_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StakingServiceServer).CreateWorkflow(ctx, req.(*CreateWorkflowRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _StakingService_GetWorkflow_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetWorkflowRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StakingServiceServer).GetWorkflow(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: StakingService_GetWorkflow_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StakingServiceServer).GetWorkflow(ctx, req.(*GetWorkflowRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _StakingService_ListWorkflows_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListWorkflowsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StakingServiceServer).ListWorkflows(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: StakingService_ListWorkflows_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StakingServiceServer).ListWorkflows(ctx, req.(*ListWorkflowsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _StakingService_PerformWorkflowStep_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(PerformWorkflowStepRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StakingServiceServer).PerformWorkflowStep(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: StakingService_PerformWorkflowStep_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StakingServiceServer).PerformWorkflowStep(ctx, req.(*PerformWorkflowStepRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _StakingService_ViewStakingContext_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ViewStakingContextRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StakingServiceServer).ViewStakingContext(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: StakingService_ViewStakingContext_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StakingServiceServer).ViewStakingContext(ctx, req.(*ViewStakingContextRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// StakingService_ServiceDesc is the grpc.ServiceDesc for StakingService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var StakingService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "coinbase.staking.orchestration.v1.StakingService", + HandlerType: (*StakingServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ListProtocols", + Handler: _StakingService_ListProtocols_Handler, + }, + { + MethodName: "ListNetworks", + Handler: _StakingService_ListNetworks_Handler, + }, + { + MethodName: "ListStakingTargets", + Handler: _StakingService_ListStakingTargets_Handler, + }, + { + MethodName: "ListActions", + Handler: _StakingService_ListActions_Handler, + }, + { + MethodName: "CreateWorkflow", + Handler: _StakingService_CreateWorkflow_Handler, + }, + { + MethodName: "GetWorkflow", + Handler: _StakingService_GetWorkflow_Handler, + }, + { + MethodName: "ListWorkflows", + Handler: _StakingService_ListWorkflows_Handler, + }, + { + MethodName: "PerformWorkflowStep", + Handler: _StakingService_PerformWorkflowStep_Handler, + }, + { + MethodName: "ViewStakingContext", + Handler: _StakingService_ViewStakingContext_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "coinbase/staking/orchestration/v1/api.proto", +} diff --git a/gen/go/coinbase/staking/orchestration/v1/common.pb.go b/gen/go/coinbase/staking/orchestration/v1/common.pb.go new file mode 100644 index 0000000..cf91781 --- /dev/null +++ b/gen/go/coinbase/staking/orchestration/v1/common.pb.go @@ -0,0 +1,170 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.30.0 +// protoc (unknown) +// source: coinbase/staking/orchestration/v1/common.proto + +package v1 + +import ( + _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// The amount of a token you wish to perform an action +// with. +type Amount struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The total value of the token. + Value string `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` + // The name of the token. + Currency string `protobuf:"bytes,2,opt,name=currency,proto3" json:"currency,omitempty"` +} + +func (x *Amount) Reset() { + *x = Amount{} + if protoimpl.UnsafeEnabled { + mi := &file_coinbase_staking_orchestration_v1_common_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Amount) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Amount) ProtoMessage() {} + +func (x *Amount) ProtoReflect() protoreflect.Message { + mi := &file_coinbase_staking_orchestration_v1_common_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Amount.ProtoReflect.Descriptor instead. +func (*Amount) Descriptor() ([]byte, []int) { + return file_coinbase_staking_orchestration_v1_common_proto_rawDescGZIP(), []int{0} +} + +func (x *Amount) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + +func (x *Amount) GetCurrency() string { + if x != nil { + return x.Currency + } + return "" +} + +var File_coinbase_staking_orchestration_v1_common_proto protoreflect.FileDescriptor + +var file_coinbase_staking_orchestration_v1_common_proto_rawDesc = []byte{ + 0x0a, 0x2e, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x73, 0x74, 0x61, 0x6b, 0x69, + 0x6e, 0x67, 0x2f, 0x6f, 0x72, 0x63, 0x68, 0x65, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x12, 0x21, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, + 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x63, 0x68, 0x65, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x2e, 0x76, 0x31, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, + 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x22, 0x5a, 0x0a, 0x06, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x14, 0x0a, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x12, 0x3a, 0x0a, 0x08, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x1e, 0x92, 0x41, 0x1b, 0x32, 0x19, 0x54, 0x68, 0x65, 0x20, + 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, + 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x08, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, 0x42, + 0x58, 0x5a, 0x56, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, + 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2d, 0x63, + 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2d, 0x6c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x2d, 0x67, 0x6f, + 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x67, 0x6f, 0x2f, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, + 0x2f, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2f, 0x6f, 0x72, 0x63, 0x68, 0x65, 0x73, 0x74, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, +} + +var ( + file_coinbase_staking_orchestration_v1_common_proto_rawDescOnce sync.Once + file_coinbase_staking_orchestration_v1_common_proto_rawDescData = file_coinbase_staking_orchestration_v1_common_proto_rawDesc +) + +func file_coinbase_staking_orchestration_v1_common_proto_rawDescGZIP() []byte { + file_coinbase_staking_orchestration_v1_common_proto_rawDescOnce.Do(func() { + file_coinbase_staking_orchestration_v1_common_proto_rawDescData = protoimpl.X.CompressGZIP(file_coinbase_staking_orchestration_v1_common_proto_rawDescData) + }) + return file_coinbase_staking_orchestration_v1_common_proto_rawDescData +} + +var file_coinbase_staking_orchestration_v1_common_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_coinbase_staking_orchestration_v1_common_proto_goTypes = []interface{}{ + (*Amount)(nil), // 0: coinbase.staking.orchestration.v1.Amount +} +var file_coinbase_staking_orchestration_v1_common_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_coinbase_staking_orchestration_v1_common_proto_init() } +func file_coinbase_staking_orchestration_v1_common_proto_init() { + if File_coinbase_staking_orchestration_v1_common_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_coinbase_staking_orchestration_v1_common_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Amount); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_coinbase_staking_orchestration_v1_common_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_coinbase_staking_orchestration_v1_common_proto_goTypes, + DependencyIndexes: file_coinbase_staking_orchestration_v1_common_proto_depIdxs, + MessageInfos: file_coinbase_staking_orchestration_v1_common_proto_msgTypes, + }.Build() + File_coinbase_staking_orchestration_v1_common_proto = out.File + file_coinbase_staking_orchestration_v1_common_proto_rawDesc = nil + file_coinbase_staking_orchestration_v1_common_proto_goTypes = nil + file_coinbase_staking_orchestration_v1_common_proto_depIdxs = nil +} diff --git a/gen/go/coinbase/staking/orchestration/v1/ethereum_kiln.pb.go b/gen/go/coinbase/staking/orchestration/v1/ethereum_kiln.pb.go new file mode 100644 index 0000000..2d79b55 --- /dev/null +++ b/gen/go/coinbase/staking/orchestration/v1/ethereum_kiln.pb.go @@ -0,0 +1,761 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.30.0 +// protoc (unknown) +// source: coinbase/staking/orchestration/v1/ethereum_kiln.proto + +package v1 + +import ( + _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" + _ "google.golang.org/genproto/googleapis/api/annotations" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// The parameters required for the stake action on Ethereum Kiln. +type EthereumKilnStakeParameters struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The address you wish to stake from. + StakerAddress string `protobuf:"bytes,1,opt,name=staker_address,json=stakerAddress,proto3" json:"staker_address,omitempty"` + // The address of the integrator contract. + IntegratorContractAddress string `protobuf:"bytes,2,opt,name=integrator_contract_address,json=integratorContractAddress,proto3" json:"integrator_contract_address,omitempty"` + // The amount of Ethereum to stake in wei. + Amount *Amount `protobuf:"bytes,3,opt,name=amount,proto3" json:"amount,omitempty"` +} + +func (x *EthereumKilnStakeParameters) Reset() { + *x = EthereumKilnStakeParameters{} + if protoimpl.UnsafeEnabled { + mi := &file_coinbase_staking_orchestration_v1_ethereum_kiln_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EthereumKilnStakeParameters) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EthereumKilnStakeParameters) ProtoMessage() {} + +func (x *EthereumKilnStakeParameters) ProtoReflect() protoreflect.Message { + mi := &file_coinbase_staking_orchestration_v1_ethereum_kiln_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EthereumKilnStakeParameters.ProtoReflect.Descriptor instead. +func (*EthereumKilnStakeParameters) Descriptor() ([]byte, []int) { + return file_coinbase_staking_orchestration_v1_ethereum_kiln_proto_rawDescGZIP(), []int{0} +} + +func (x *EthereumKilnStakeParameters) GetStakerAddress() string { + if x != nil { + return x.StakerAddress + } + return "" +} + +func (x *EthereumKilnStakeParameters) GetIntegratorContractAddress() string { + if x != nil { + return x.IntegratorContractAddress + } + return "" +} + +func (x *EthereumKilnStakeParameters) GetAmount() *Amount { + if x != nil { + return x.Amount + } + return nil +} + +// The parameters required for the unstake action on Ethereum Kiln. +type EthereumKilnUnstakeParameters struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The address you wish to unstake from. + StakerAddress string `protobuf:"bytes,1,opt,name=staker_address,json=stakerAddress,proto3" json:"staker_address,omitempty"` + // The address of the integrator contract. + IntegratorContractAddress string `protobuf:"bytes,2,opt,name=integrator_contract_address,json=integratorContractAddress,proto3" json:"integrator_contract_address,omitempty"` + // The amount of Ethereum to unstake in wei. + Amount *Amount `protobuf:"bytes,3,opt,name=amount,proto3" json:"amount,omitempty"` +} + +func (x *EthereumKilnUnstakeParameters) Reset() { + *x = EthereumKilnUnstakeParameters{} + if protoimpl.UnsafeEnabled { + mi := &file_coinbase_staking_orchestration_v1_ethereum_kiln_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EthereumKilnUnstakeParameters) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EthereumKilnUnstakeParameters) ProtoMessage() {} + +func (x *EthereumKilnUnstakeParameters) ProtoReflect() protoreflect.Message { + mi := &file_coinbase_staking_orchestration_v1_ethereum_kiln_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EthereumKilnUnstakeParameters.ProtoReflect.Descriptor instead. +func (*EthereumKilnUnstakeParameters) Descriptor() ([]byte, []int) { + return file_coinbase_staking_orchestration_v1_ethereum_kiln_proto_rawDescGZIP(), []int{1} +} + +func (x *EthereumKilnUnstakeParameters) GetStakerAddress() string { + if x != nil { + return x.StakerAddress + } + return "" +} + +func (x *EthereumKilnUnstakeParameters) GetIntegratorContractAddress() string { + if x != nil { + return x.IntegratorContractAddress + } + return "" +} + +func (x *EthereumKilnUnstakeParameters) GetAmount() *Amount { + if x != nil { + return x.Amount + } + return nil +} + +// The parameters required for the claim stake action on Ethereum Kiln. +type EthereumKilnClaimStakeParameters struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The address you wish to claim stake for. + StakerAddress string `protobuf:"bytes,1,opt,name=staker_address,json=stakerAddress,proto3" json:"staker_address,omitempty"` + // The address of the integrator contract + IntegratorContractAddress string `protobuf:"bytes,2,opt,name=integrator_contract_address,json=integratorContractAddress,proto3" json:"integrator_contract_address,omitempty"` +} + +func (x *EthereumKilnClaimStakeParameters) Reset() { + *x = EthereumKilnClaimStakeParameters{} + if protoimpl.UnsafeEnabled { + mi := &file_coinbase_staking_orchestration_v1_ethereum_kiln_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EthereumKilnClaimStakeParameters) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EthereumKilnClaimStakeParameters) ProtoMessage() {} + +func (x *EthereumKilnClaimStakeParameters) ProtoReflect() protoreflect.Message { + mi := &file_coinbase_staking_orchestration_v1_ethereum_kiln_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EthereumKilnClaimStakeParameters.ProtoReflect.Descriptor instead. +func (*EthereumKilnClaimStakeParameters) Descriptor() ([]byte, []int) { + return file_coinbase_staking_orchestration_v1_ethereum_kiln_proto_rawDescGZIP(), []int{2} +} + +func (x *EthereumKilnClaimStakeParameters) GetStakerAddress() string { + if x != nil { + return x.StakerAddress + } + return "" +} + +func (x *EthereumKilnClaimStakeParameters) GetIntegratorContractAddress() string { + if x != nil { + return x.IntegratorContractAddress + } + return "" +} + +// The parameters needed for staking on Ethereum via Kiln. +type EthereumKilnStakingParameters struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Parameters: + // + // *EthereumKilnStakingParameters_StakeParameters + // *EthereumKilnStakingParameters_UnstakeParameters + // *EthereumKilnStakingParameters_ClaimStakeParameters + Parameters isEthereumKilnStakingParameters_Parameters `protobuf_oneof:"parameters"` +} + +func (x *EthereumKilnStakingParameters) Reset() { + *x = EthereumKilnStakingParameters{} + if protoimpl.UnsafeEnabled { + mi := &file_coinbase_staking_orchestration_v1_ethereum_kiln_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EthereumKilnStakingParameters) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EthereumKilnStakingParameters) ProtoMessage() {} + +func (x *EthereumKilnStakingParameters) ProtoReflect() protoreflect.Message { + mi := &file_coinbase_staking_orchestration_v1_ethereum_kiln_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EthereumKilnStakingParameters.ProtoReflect.Descriptor instead. +func (*EthereumKilnStakingParameters) Descriptor() ([]byte, []int) { + return file_coinbase_staking_orchestration_v1_ethereum_kiln_proto_rawDescGZIP(), []int{3} +} + +func (m *EthereumKilnStakingParameters) GetParameters() isEthereumKilnStakingParameters_Parameters { + if m != nil { + return m.Parameters + } + return nil +} + +func (x *EthereumKilnStakingParameters) GetStakeParameters() *EthereumKilnStakeParameters { + if x, ok := x.GetParameters().(*EthereumKilnStakingParameters_StakeParameters); ok { + return x.StakeParameters + } + return nil +} + +func (x *EthereumKilnStakingParameters) GetUnstakeParameters() *EthereumKilnUnstakeParameters { + if x, ok := x.GetParameters().(*EthereumKilnStakingParameters_UnstakeParameters); ok { + return x.UnstakeParameters + } + return nil +} + +func (x *EthereumKilnStakingParameters) GetClaimStakeParameters() *EthereumKilnClaimStakeParameters { + if x, ok := x.GetParameters().(*EthereumKilnStakingParameters_ClaimStakeParameters); ok { + return x.ClaimStakeParameters + } + return nil +} + +type isEthereumKilnStakingParameters_Parameters interface { + isEthereumKilnStakingParameters_Parameters() +} + +type EthereumKilnStakingParameters_StakeParameters struct { + // The parameters for stake action on Ethereum Kiln. + StakeParameters *EthereumKilnStakeParameters `protobuf:"bytes,1,opt,name=stake_parameters,json=stakeParameters,proto3,oneof"` +} + +type EthereumKilnStakingParameters_UnstakeParameters struct { + // The parameters for unstake action on Ethereum Kiln. + UnstakeParameters *EthereumKilnUnstakeParameters `protobuf:"bytes,2,opt,name=unstake_parameters,json=unstakeParameters,proto3,oneof"` +} + +type EthereumKilnStakingParameters_ClaimStakeParameters struct { + // The parameters for claim stake action on Ethereum Kiln. + ClaimStakeParameters *EthereumKilnClaimStakeParameters `protobuf:"bytes,4,opt,name=claim_stake_parameters,json=claimStakeParameters,proto3,oneof"` +} + +func (*EthereumKilnStakingParameters_StakeParameters) isEthereumKilnStakingParameters_Parameters() {} + +func (*EthereumKilnStakingParameters_UnstakeParameters) isEthereumKilnStakingParameters_Parameters() { +} + +func (*EthereumKilnStakingParameters_ClaimStakeParameters) isEthereumKilnStakingParameters_Parameters() { +} + +// The protocol specific parameters required for fetching a staking context. +type EthereumKilnStakingContextParameters struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Integrator contract address. + IntegratorContractAddress string `protobuf:"bytes,1,opt,name=integrator_contract_address,json=integratorContractAddress,proto3" json:"integrator_contract_address,omitempty"` +} + +func (x *EthereumKilnStakingContextParameters) Reset() { + *x = EthereumKilnStakingContextParameters{} + if protoimpl.UnsafeEnabled { + mi := &file_coinbase_staking_orchestration_v1_ethereum_kiln_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EthereumKilnStakingContextParameters) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EthereumKilnStakingContextParameters) ProtoMessage() {} + +func (x *EthereumKilnStakingContextParameters) ProtoReflect() protoreflect.Message { + mi := &file_coinbase_staking_orchestration_v1_ethereum_kiln_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EthereumKilnStakingContextParameters.ProtoReflect.Descriptor instead. +func (*EthereumKilnStakingContextParameters) Descriptor() ([]byte, []int) { + return file_coinbase_staking_orchestration_v1_ethereum_kiln_proto_rawDescGZIP(), []int{4} +} + +func (x *EthereumKilnStakingContextParameters) GetIntegratorContractAddress() string { + if x != nil { + return x.IntegratorContractAddress + } + return "" +} + +// The protocol specific details for an Ethereum Kiln staking context. +type EthereumKilnStakingContextDetails struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The Ethereum balance of the address. + // This can be used to gate the stake action to make sure the requested stake amount + // is less than ethereum_balance. + EthereumBalance *Amount `protobuf:"bytes,1,opt,name=ethereum_balance,json=ethereumBalance,proto3" json:"ethereum_balance,omitempty"` + // The number of integrator shares owned by the address. + IntegratorShareBalance *Amount `protobuf:"bytes,2,opt,name=integrator_share_balance,json=integratorShareBalance,proto3" json:"integrator_share_balance,omitempty"` + // The total Ethereum you can exchange for your integrator shares. + // This can be used to gate the unstake action to make sure the requested unstake amount + // is less than integrator_share_underlying_balance + IntegratorShareUnderlyingBalance *Amount `protobuf:"bytes,3,opt,name=integrator_share_underlying_balance,json=integratorShareUnderlyingBalance,proto3" json:"integrator_share_underlying_balance,omitempty"` + // The total amount of Ethereum you can redeem for all non-claimed vPool shares. + // This along with the condition total_shares_pending_exit == fulfillable_share_count + // can be used to gate the claim_stake action. + TotalExitableEth *Amount `protobuf:"bytes,4,opt,name=total_exitable_eth,json=totalExitableEth,proto3" json:"total_exitable_eth,omitempty"` + // The number of vPool shares are eligible to receive now or at a later point in time. + TotalSharesPendingExit *Amount `protobuf:"bytes,5,opt,name=total_shares_pending_exit,json=totalSharesPendingExit,proto3" json:"total_shares_pending_exit,omitempty"` + // The number of vPool shares you are able to claim now. + FulfillableShareCount *Amount `protobuf:"bytes,6,opt,name=fulfillable_share_count,json=fulfillableShareCount,proto3" json:"fulfillable_share_count,omitempty"` +} + +func (x *EthereumKilnStakingContextDetails) Reset() { + *x = EthereumKilnStakingContextDetails{} + if protoimpl.UnsafeEnabled { + mi := &file_coinbase_staking_orchestration_v1_ethereum_kiln_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EthereumKilnStakingContextDetails) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EthereumKilnStakingContextDetails) ProtoMessage() {} + +func (x *EthereumKilnStakingContextDetails) ProtoReflect() protoreflect.Message { + mi := &file_coinbase_staking_orchestration_v1_ethereum_kiln_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EthereumKilnStakingContextDetails.ProtoReflect.Descriptor instead. +func (*EthereumKilnStakingContextDetails) Descriptor() ([]byte, []int) { + return file_coinbase_staking_orchestration_v1_ethereum_kiln_proto_rawDescGZIP(), []int{5} +} + +func (x *EthereumKilnStakingContextDetails) GetEthereumBalance() *Amount { + if x != nil { + return x.EthereumBalance + } + return nil +} + +func (x *EthereumKilnStakingContextDetails) GetIntegratorShareBalance() *Amount { + if x != nil { + return x.IntegratorShareBalance + } + return nil +} + +func (x *EthereumKilnStakingContextDetails) GetIntegratorShareUnderlyingBalance() *Amount { + if x != nil { + return x.IntegratorShareUnderlyingBalance + } + return nil +} + +func (x *EthereumKilnStakingContextDetails) GetTotalExitableEth() *Amount { + if x != nil { + return x.TotalExitableEth + } + return nil +} + +func (x *EthereumKilnStakingContextDetails) GetTotalSharesPendingExit() *Amount { + if x != nil { + return x.TotalSharesPendingExit + } + return nil +} + +func (x *EthereumKilnStakingContextDetails) GetFulfillableShareCount() *Amount { + if x != nil { + return x.FulfillableShareCount + } + return nil +} + +var File_coinbase_staking_orchestration_v1_ethereum_kiln_proto protoreflect.FileDescriptor + +var file_coinbase_staking_orchestration_v1_ethereum_kiln_proto_rawDesc = []byte{ + 0x0a, 0x35, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x73, 0x74, 0x61, 0x6b, 0x69, + 0x6e, 0x67, 0x2f, 0x6f, 0x72, 0x63, 0x68, 0x65, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x2f, 0x76, 0x31, 0x2f, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x5f, 0x6b, 0x69, 0x6c, + 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x21, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, + 0x65, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x63, 0x68, 0x65, 0x73, + 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x1a, 0x2e, 0x63, 0x6f, 0x69, 0x6e, + 0x62, 0x61, 0x73, 0x65, 0x2f, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2f, 0x6f, 0x72, 0x63, + 0x68, 0x65, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, + 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, + 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x62, 0x65, 0x68, + 0x61, 0x76, 0x69, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xfd, 0x01, 0x0a, 0x1b, + 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x4b, 0x69, 0x6c, 0x6e, 0x53, 0x74, 0x61, 0x6b, + 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x12, 0x2a, 0x0a, 0x0e, 0x73, + 0x74, 0x61, 0x6b, 0x65, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x0d, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x72, + 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x43, 0x0a, 0x1b, 0x69, 0x6e, 0x74, 0x65, 0x67, + 0x72, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x5f, 0x61, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, + 0x02, 0x52, 0x19, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x43, 0x6f, 0x6e, + 0x74, 0x72, 0x61, 0x63, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x46, 0x0a, 0x06, + 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x63, + 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, + 0x6f, 0x72, 0x63, 0x68, 0x65, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, + 0x2e, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x06, 0x61, 0x6d, + 0x6f, 0x75, 0x6e, 0x74, 0x3a, 0x25, 0x92, 0x41, 0x22, 0x0a, 0x20, 0x2a, 0x1e, 0x45, 0x74, 0x68, + 0x65, 0x72, 0x65, 0x75, 0x6d, 0x4b, 0x69, 0x6c, 0x6e, 0x3a, 0x20, 0x53, 0x74, 0x61, 0x6b, 0x65, + 0x20, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x22, 0x81, 0x02, 0x0a, 0x1d, + 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x4b, 0x69, 0x6c, 0x6e, 0x55, 0x6e, 0x73, 0x74, + 0x61, 0x6b, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x12, 0x2a, 0x0a, + 0x0e, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x0d, 0x73, 0x74, 0x61, 0x6b, + 0x65, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x43, 0x0a, 0x1b, 0x69, 0x6e, 0x74, + 0x65, 0x67, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, + 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, + 0xe0, 0x41, 0x02, 0x52, 0x19, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x43, + 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x46, + 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, + 0x2e, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, + 0x67, 0x2e, 0x6f, 0x72, 0x63, 0x68, 0x65, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, + 0x76, 0x31, 0x2e, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x06, + 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x3a, 0x27, 0x92, 0x41, 0x24, 0x0a, 0x22, 0x2a, 0x20, 0x45, + 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x4b, 0x69, 0x6c, 0x6e, 0x3a, 0x20, 0x55, 0x6e, 0x73, + 0x74, 0x61, 0x6b, 0x65, 0x20, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x22, + 0xc0, 0x01, 0x0a, 0x20, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x4b, 0x69, 0x6c, 0x6e, + 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, + 0x74, 0x65, 0x72, 0x73, 0x12, 0x2a, 0x0a, 0x0e, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x72, 0x5f, 0x61, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, + 0x02, 0x52, 0x0d, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x12, 0x43, 0x0a, 0x1b, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x63, + 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x19, 0x69, 0x6e, 0x74, 0x65, + 0x67, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x41, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x3a, 0x2b, 0x92, 0x41, 0x28, 0x0a, 0x26, 0x2a, 0x24, 0x45, 0x74, + 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x4b, 0x69, 0x6c, 0x6e, 0x3a, 0x20, 0x43, 0x6c, 0x61, 0x69, + 0x6d, 0x20, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x20, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, + 0x72, 0x73, 0x22, 0xb9, 0x03, 0x0a, 0x1d, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x4b, + 0x69, 0x6c, 0x6e, 0x53, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, + 0x74, 0x65, 0x72, 0x73, 0x12, 0x6b, 0x0a, 0x10, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x5f, 0x70, 0x61, + 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3e, + 0x2e, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, + 0x67, 0x2e, 0x6f, 0x72, 0x63, 0x68, 0x65, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, + 0x76, 0x31, 0x2e, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x4b, 0x69, 0x6c, 0x6e, 0x53, + 0x74, 0x61, 0x6b, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x48, 0x00, + 0x52, 0x0f, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, + 0x73, 0x12, 0x71, 0x0a, 0x12, 0x75, 0x6e, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x5f, 0x70, 0x61, 0x72, + 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x40, 0x2e, + 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, + 0x2e, 0x6f, 0x72, 0x63, 0x68, 0x65, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, + 0x31, 0x2e, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x4b, 0x69, 0x6c, 0x6e, 0x55, 0x6e, + 0x73, 0x74, 0x61, 0x6b, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x48, + 0x00, 0x52, 0x11, 0x75, 0x6e, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, + 0x74, 0x65, 0x72, 0x73, 0x12, 0x7b, 0x0a, 0x16, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x5f, 0x73, 0x74, + 0x61, 0x6b, 0x65, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x43, 0x2e, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2e, + 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x63, 0x68, 0x65, 0x73, 0x74, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, + 0x6d, 0x4b, 0x69, 0x6c, 0x6e, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x50, + 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x48, 0x00, 0x52, 0x14, 0x63, 0x6c, 0x61, + 0x69, 0x6d, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, + 0x73, 0x3a, 0x27, 0x92, 0x41, 0x24, 0x0a, 0x22, 0x2a, 0x20, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, + 0x75, 0x6d, 0x4b, 0x69, 0x6c, 0x6e, 0x3a, 0x20, 0x53, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x20, + 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x42, 0x0c, 0x0a, 0x0a, 0x70, 0x61, + 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x4a, 0x04, 0x08, 0x03, 0x10, 0x04, 0x22, 0x97, + 0x01, 0x0a, 0x24, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x4b, 0x69, 0x6c, 0x6e, 0x53, + 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x50, 0x61, 0x72, + 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x12, 0x3e, 0x0a, 0x1b, 0x69, 0x6e, 0x74, 0x65, 0x67, + 0x72, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x5f, 0x61, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x19, 0x69, 0x6e, + 0x74, 0x65, 0x67, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, + 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x3a, 0x2f, 0x92, 0x41, 0x2c, 0x0a, 0x2a, 0x2a, 0x28, + 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x4b, 0x69, 0x6c, 0x6e, 0x3a, 0x20, 0x53, 0x74, + 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x20, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x20, 0x50, 0x61, + 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x22, 0xa8, 0x05, 0x0a, 0x21, 0x45, 0x74, 0x68, + 0x65, 0x72, 0x65, 0x75, 0x6d, 0x4b, 0x69, 0x6c, 0x6e, 0x53, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, + 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x12, 0x54, + 0x0a, 0x10, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x5f, 0x62, 0x61, 0x6c, 0x61, 0x6e, + 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x63, 0x6f, 0x69, 0x6e, 0x62, + 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x63, 0x68, + 0x65, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x6d, 0x6f, + 0x75, 0x6e, 0x74, 0x52, 0x0f, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x42, 0x61, 0x6c, + 0x61, 0x6e, 0x63, 0x65, 0x12, 0x63, 0x0a, 0x18, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x74, + 0x6f, 0x72, 0x5f, 0x73, 0x68, 0x61, 0x72, 0x65, 0x5f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, + 0x65, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x63, 0x68, 0x65, 0x73, + 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x6d, 0x6f, 0x75, 0x6e, + 0x74, 0x52, 0x16, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x53, 0x68, 0x61, + 0x72, 0x65, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x78, 0x0a, 0x23, 0x69, 0x6e, 0x74, + 0x65, 0x67, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x73, 0x68, 0x61, 0x72, 0x65, 0x5f, 0x75, 0x6e, + 0x64, 0x65, 0x72, 0x6c, 0x79, 0x69, 0x6e, 0x67, 0x5f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, + 0x65, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x63, 0x68, 0x65, 0x73, + 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x6d, 0x6f, 0x75, 0x6e, + 0x74, 0x52, 0x20, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x53, 0x68, 0x61, + 0x72, 0x65, 0x55, 0x6e, 0x64, 0x65, 0x72, 0x6c, 0x79, 0x69, 0x6e, 0x67, 0x42, 0x61, 0x6c, 0x61, + 0x6e, 0x63, 0x65, 0x12, 0x57, 0x0a, 0x12, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x65, 0x78, 0x69, + 0x74, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x65, 0x74, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x29, 0x2e, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, + 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x63, 0x68, 0x65, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x10, 0x74, 0x6f, 0x74, 0x61, + 0x6c, 0x45, 0x78, 0x69, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x45, 0x74, 0x68, 0x12, 0x64, 0x0a, 0x19, + 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x73, 0x68, 0x61, 0x72, 0x65, 0x73, 0x5f, 0x70, 0x65, 0x6e, + 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x65, 0x78, 0x69, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x29, 0x2e, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, + 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x63, 0x68, 0x65, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x16, 0x74, 0x6f, 0x74, 0x61, + 0x6c, 0x53, 0x68, 0x61, 0x72, 0x65, 0x73, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x45, 0x78, + 0x69, 0x74, 0x12, 0x61, 0x0a, 0x17, 0x66, 0x75, 0x6c, 0x66, 0x69, 0x6c, 0x6c, 0x61, 0x62, 0x6c, + 0x65, 0x5f, 0x73, 0x68, 0x61, 0x72, 0x65, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x06, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, + 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x63, 0x68, 0x65, 0x73, 0x74, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x15, + 0x66, 0x75, 0x6c, 0x66, 0x69, 0x6c, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x53, 0x68, 0x61, 0x72, 0x65, + 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x3a, 0x2c, 0x92, 0x41, 0x29, 0x0a, 0x27, 0x2a, 0x25, 0x45, 0x74, + 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x4b, 0x69, 0x6c, 0x6e, 0x3a, 0x20, 0x53, 0x74, 0x61, 0x6b, + 0x69, 0x6e, 0x67, 0x20, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x20, 0x64, 0x65, 0x74, 0x61, + 0x69, 0x6c, 0x73, 0x42, 0x58, 0x5a, 0x56, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x6d, 0x2f, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x73, 0x74, 0x61, 0x6b, 0x69, + 0x6e, 0x67, 0x2d, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2d, 0x6c, 0x69, 0x62, 0x72, 0x61, 0x72, + 0x79, 0x2d, 0x67, 0x6f, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x67, 0x6f, 0x2f, 0x63, 0x6f, 0x69, 0x6e, + 0x62, 0x61, 0x73, 0x65, 0x2f, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2f, 0x6f, 0x72, 0x63, + 0x68, 0x65, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_coinbase_staking_orchestration_v1_ethereum_kiln_proto_rawDescOnce sync.Once + file_coinbase_staking_orchestration_v1_ethereum_kiln_proto_rawDescData = file_coinbase_staking_orchestration_v1_ethereum_kiln_proto_rawDesc +) + +func file_coinbase_staking_orchestration_v1_ethereum_kiln_proto_rawDescGZIP() []byte { + file_coinbase_staking_orchestration_v1_ethereum_kiln_proto_rawDescOnce.Do(func() { + file_coinbase_staking_orchestration_v1_ethereum_kiln_proto_rawDescData = protoimpl.X.CompressGZIP(file_coinbase_staking_orchestration_v1_ethereum_kiln_proto_rawDescData) + }) + return file_coinbase_staking_orchestration_v1_ethereum_kiln_proto_rawDescData +} + +var file_coinbase_staking_orchestration_v1_ethereum_kiln_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_coinbase_staking_orchestration_v1_ethereum_kiln_proto_goTypes = []interface{}{ + (*EthereumKilnStakeParameters)(nil), // 0: coinbase.staking.orchestration.v1.EthereumKilnStakeParameters + (*EthereumKilnUnstakeParameters)(nil), // 1: coinbase.staking.orchestration.v1.EthereumKilnUnstakeParameters + (*EthereumKilnClaimStakeParameters)(nil), // 2: coinbase.staking.orchestration.v1.EthereumKilnClaimStakeParameters + (*EthereumKilnStakingParameters)(nil), // 3: coinbase.staking.orchestration.v1.EthereumKilnStakingParameters + (*EthereumKilnStakingContextParameters)(nil), // 4: coinbase.staking.orchestration.v1.EthereumKilnStakingContextParameters + (*EthereumKilnStakingContextDetails)(nil), // 5: coinbase.staking.orchestration.v1.EthereumKilnStakingContextDetails + (*Amount)(nil), // 6: coinbase.staking.orchestration.v1.Amount +} +var file_coinbase_staking_orchestration_v1_ethereum_kiln_proto_depIdxs = []int32{ + 6, // 0: coinbase.staking.orchestration.v1.EthereumKilnStakeParameters.amount:type_name -> coinbase.staking.orchestration.v1.Amount + 6, // 1: coinbase.staking.orchestration.v1.EthereumKilnUnstakeParameters.amount:type_name -> coinbase.staking.orchestration.v1.Amount + 0, // 2: coinbase.staking.orchestration.v1.EthereumKilnStakingParameters.stake_parameters:type_name -> coinbase.staking.orchestration.v1.EthereumKilnStakeParameters + 1, // 3: coinbase.staking.orchestration.v1.EthereumKilnStakingParameters.unstake_parameters:type_name -> coinbase.staking.orchestration.v1.EthereumKilnUnstakeParameters + 2, // 4: coinbase.staking.orchestration.v1.EthereumKilnStakingParameters.claim_stake_parameters:type_name -> coinbase.staking.orchestration.v1.EthereumKilnClaimStakeParameters + 6, // 5: coinbase.staking.orchestration.v1.EthereumKilnStakingContextDetails.ethereum_balance:type_name -> coinbase.staking.orchestration.v1.Amount + 6, // 6: coinbase.staking.orchestration.v1.EthereumKilnStakingContextDetails.integrator_share_balance:type_name -> coinbase.staking.orchestration.v1.Amount + 6, // 7: coinbase.staking.orchestration.v1.EthereumKilnStakingContextDetails.integrator_share_underlying_balance:type_name -> coinbase.staking.orchestration.v1.Amount + 6, // 8: coinbase.staking.orchestration.v1.EthereumKilnStakingContextDetails.total_exitable_eth:type_name -> coinbase.staking.orchestration.v1.Amount + 6, // 9: coinbase.staking.orchestration.v1.EthereumKilnStakingContextDetails.total_shares_pending_exit:type_name -> coinbase.staking.orchestration.v1.Amount + 6, // 10: coinbase.staking.orchestration.v1.EthereumKilnStakingContextDetails.fulfillable_share_count:type_name -> coinbase.staking.orchestration.v1.Amount + 11, // [11:11] is the sub-list for method output_type + 11, // [11:11] is the sub-list for method input_type + 11, // [11:11] is the sub-list for extension type_name + 11, // [11:11] is the sub-list for extension extendee + 0, // [0:11] is the sub-list for field type_name +} + +func init() { file_coinbase_staking_orchestration_v1_ethereum_kiln_proto_init() } +func file_coinbase_staking_orchestration_v1_ethereum_kiln_proto_init() { + if File_coinbase_staking_orchestration_v1_ethereum_kiln_proto != nil { + return + } + file_coinbase_staking_orchestration_v1_common_proto_init() + if !protoimpl.UnsafeEnabled { + file_coinbase_staking_orchestration_v1_ethereum_kiln_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EthereumKilnStakeParameters); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_coinbase_staking_orchestration_v1_ethereum_kiln_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EthereumKilnUnstakeParameters); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_coinbase_staking_orchestration_v1_ethereum_kiln_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EthereumKilnClaimStakeParameters); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_coinbase_staking_orchestration_v1_ethereum_kiln_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EthereumKilnStakingParameters); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_coinbase_staking_orchestration_v1_ethereum_kiln_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EthereumKilnStakingContextParameters); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_coinbase_staking_orchestration_v1_ethereum_kiln_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EthereumKilnStakingContextDetails); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_coinbase_staking_orchestration_v1_ethereum_kiln_proto_msgTypes[3].OneofWrappers = []interface{}{ + (*EthereumKilnStakingParameters_StakeParameters)(nil), + (*EthereumKilnStakingParameters_UnstakeParameters)(nil), + (*EthereumKilnStakingParameters_ClaimStakeParameters)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_coinbase_staking_orchestration_v1_ethereum_kiln_proto_rawDesc, + NumEnums: 0, + NumMessages: 6, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_coinbase_staking_orchestration_v1_ethereum_kiln_proto_goTypes, + DependencyIndexes: file_coinbase_staking_orchestration_v1_ethereum_kiln_proto_depIdxs, + MessageInfos: file_coinbase_staking_orchestration_v1_ethereum_kiln_proto_msgTypes, + }.Build() + File_coinbase_staking_orchestration_v1_ethereum_kiln_proto = out.File + file_coinbase_staking_orchestration_v1_ethereum_kiln_proto_rawDesc = nil + file_coinbase_staking_orchestration_v1_ethereum_kiln_proto_goTypes = nil + file_coinbase_staking_orchestration_v1_ethereum_kiln_proto_depIdxs = nil +} diff --git a/gen/go/coinbase/staking/orchestration/v1/network.pb.go b/gen/go/coinbase/staking/orchestration/v1/network.pb.go new file mode 100644 index 0000000..0150098 --- /dev/null +++ b/gen/go/coinbase/staking/orchestration/v1/network.pb.go @@ -0,0 +1,303 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.30.0 +// protoc (unknown) +// source: coinbase/staking/orchestration/v1/network.proto + +package v1 + +import ( + _ "google.golang.org/genproto/googleapis/api/annotations" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// A Network resource represents a blockchain network e.g. mainnet, testnet, etc. +type Network struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The resource name of the Network. + // Format: protocols/{protocolName}/networks/{networkName} + // Ex: protocols/ethereum_kiln/networks/holesky + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` +} + +func (x *Network) Reset() { + *x = Network{} + if protoimpl.UnsafeEnabled { + mi := &file_coinbase_staking_orchestration_v1_network_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Network) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Network) ProtoMessage() {} + +func (x *Network) ProtoReflect() protoreflect.Message { + mi := &file_coinbase_staking_orchestration_v1_network_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Network.ProtoReflect.Descriptor instead. +func (*Network) Descriptor() ([]byte, []int) { + return file_coinbase_staking_orchestration_v1_network_proto_rawDescGZIP(), []int{0} +} + +func (x *Network) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +// The request message for ListNetworks. +type ListNetworksRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The resource name of the parent that owns + // the collection of networks. + // Format: protocols/{protocol} + Parent string `protobuf:"bytes,1,opt,name=parent,proto3" json:"parent,omitempty"` +} + +func (x *ListNetworksRequest) Reset() { + *x = ListNetworksRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_coinbase_staking_orchestration_v1_network_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListNetworksRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListNetworksRequest) ProtoMessage() {} + +func (x *ListNetworksRequest) ProtoReflect() protoreflect.Message { + mi := &file_coinbase_staking_orchestration_v1_network_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListNetworksRequest.ProtoReflect.Descriptor instead. +func (*ListNetworksRequest) Descriptor() ([]byte, []int) { + return file_coinbase_staking_orchestration_v1_network_proto_rawDescGZIP(), []int{1} +} + +func (x *ListNetworksRequest) GetParent() string { + if x != nil { + return x.Parent + } + return "" +} + +// The response message for ListNetworks. +type ListNetworksResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The list of networks. + Networks []*Network `protobuf:"bytes,1,rep,name=networks,proto3" json:"networks,omitempty"` +} + +func (x *ListNetworksResponse) Reset() { + *x = ListNetworksResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_coinbase_staking_orchestration_v1_network_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListNetworksResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListNetworksResponse) ProtoMessage() {} + +func (x *ListNetworksResponse) ProtoReflect() protoreflect.Message { + mi := &file_coinbase_staking_orchestration_v1_network_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListNetworksResponse.ProtoReflect.Descriptor instead. +func (*ListNetworksResponse) Descriptor() ([]byte, []int) { + return file_coinbase_staking_orchestration_v1_network_proto_rawDescGZIP(), []int{2} +} + +func (x *ListNetworksResponse) GetNetworks() []*Network { + if x != nil { + return x.Networks + } + return nil +} + +var File_coinbase_staking_orchestration_v1_network_proto protoreflect.FileDescriptor + +var file_coinbase_staking_orchestration_v1_network_proto_rawDesc = []byte{ + 0x0a, 0x2f, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x73, 0x74, 0x61, 0x6b, 0x69, + 0x6e, 0x67, 0x2f, 0x6f, 0x72, 0x63, 0x68, 0x65, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x2f, 0x76, 0x31, 0x2f, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x12, 0x21, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x61, 0x6b, + 0x69, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x63, 0x68, 0x65, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x2e, 0x76, 0x31, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, + 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x62, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, + 0x69, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x22, 0x82, 0x01, 0x0a, 0x07, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x12, 0x12, 0x0a, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x3a, 0x5d, 0xea, 0x41, 0x5a, 0x0a, 0x1c, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x63, + 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x4e, 0x65, 0x74, 0x77, + 0x6f, 0x72, 0x6b, 0x12, 0x27, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x73, 0x2f, 0x7b, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x7d, 0x2f, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, + 0x6b, 0x73, 0x2f, 0x7b, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x7d, 0x2a, 0x08, 0x6e, 0x65, + 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x32, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x4a, + 0x04, 0x08, 0x02, 0x10, 0x03, 0x22, 0x53, 0x0a, 0x13, 0x4c, 0x69, 0x73, 0x74, 0x4e, 0x65, 0x74, + 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3c, 0x0a, 0x06, + 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x24, 0xe0, 0x41, + 0x02, 0xfa, 0x41, 0x1e, 0x12, 0x1c, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x63, 0x6f, + 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x4e, 0x65, 0x74, 0x77, 0x6f, + 0x72, 0x6b, 0x52, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x22, 0x5e, 0x0a, 0x14, 0x4c, 0x69, + 0x73, 0x74, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x46, 0x0a, 0x08, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2e, + 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x63, 0x68, 0x65, 0x73, 0x74, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, + 0x52, 0x08, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x42, 0x58, 0x5a, 0x56, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, + 0x65, 0x2f, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2d, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, + 0x2d, 0x6c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x2d, 0x67, 0x6f, 0x2f, 0x67, 0x65, 0x6e, 0x2f, + 0x67, 0x6f, 0x2f, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x73, 0x74, 0x61, 0x6b, + 0x69, 0x6e, 0x67, 0x2f, 0x6f, 0x72, 0x63, 0x68, 0x65, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_coinbase_staking_orchestration_v1_network_proto_rawDescOnce sync.Once + file_coinbase_staking_orchestration_v1_network_proto_rawDescData = file_coinbase_staking_orchestration_v1_network_proto_rawDesc +) + +func file_coinbase_staking_orchestration_v1_network_proto_rawDescGZIP() []byte { + file_coinbase_staking_orchestration_v1_network_proto_rawDescOnce.Do(func() { + file_coinbase_staking_orchestration_v1_network_proto_rawDescData = protoimpl.X.CompressGZIP(file_coinbase_staking_orchestration_v1_network_proto_rawDescData) + }) + return file_coinbase_staking_orchestration_v1_network_proto_rawDescData +} + +var file_coinbase_staking_orchestration_v1_network_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_coinbase_staking_orchestration_v1_network_proto_goTypes = []interface{}{ + (*Network)(nil), // 0: coinbase.staking.orchestration.v1.Network + (*ListNetworksRequest)(nil), // 1: coinbase.staking.orchestration.v1.ListNetworksRequest + (*ListNetworksResponse)(nil), // 2: coinbase.staking.orchestration.v1.ListNetworksResponse +} +var file_coinbase_staking_orchestration_v1_network_proto_depIdxs = []int32{ + 0, // 0: coinbase.staking.orchestration.v1.ListNetworksResponse.networks:type_name -> coinbase.staking.orchestration.v1.Network + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_coinbase_staking_orchestration_v1_network_proto_init() } +func file_coinbase_staking_orchestration_v1_network_proto_init() { + if File_coinbase_staking_orchestration_v1_network_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_coinbase_staking_orchestration_v1_network_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Network); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_coinbase_staking_orchestration_v1_network_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListNetworksRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_coinbase_staking_orchestration_v1_network_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListNetworksResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_coinbase_staking_orchestration_v1_network_proto_rawDesc, + NumEnums: 0, + NumMessages: 3, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_coinbase_staking_orchestration_v1_network_proto_goTypes, + DependencyIndexes: file_coinbase_staking_orchestration_v1_network_proto_depIdxs, + MessageInfos: file_coinbase_staking_orchestration_v1_network_proto_msgTypes, + }.Build() + File_coinbase_staking_orchestration_v1_network_proto = out.File + file_coinbase_staking_orchestration_v1_network_proto_rawDesc = nil + file_coinbase_staking_orchestration_v1_network_proto_goTypes = nil + file_coinbase_staking_orchestration_v1_network_proto_depIdxs = nil +} diff --git a/gen/go/coinbase/staking/orchestration/v1/network_aip.go b/gen/go/coinbase/staking/orchestration/v1/network_aip.go new file mode 100644 index 0000000..684b698 --- /dev/null +++ b/gen/go/coinbase/staking/orchestration/v1/network_aip.go @@ -0,0 +1,78 @@ +// Code generated by protoc-gen-go-aip. DO NOT EDIT. +// +// versions: +// protoc-gen-go-aip development +// protoc (unknown) +// source: coinbase/staking/orchestration/v1/network.proto + +package v1 + +import ( + fmt "fmt" + resourcename "go.einride.tech/aip/resourcename" + strings "strings" +) + +type NetworkResourceName struct { + Protocol string + Network string +} + +func (n ProtocolResourceName) NetworkResourceName( + network string, +) NetworkResourceName { + return NetworkResourceName{ + Protocol: n.Protocol, + Network: network, + } +} + +func (n NetworkResourceName) Validate() error { + if n.Protocol == "" { + return fmt.Errorf("protocol: empty") + } + if strings.IndexByte(n.Protocol, '/') != -1 { + return fmt.Errorf("protocol: contains illegal character '/'") + } + if n.Network == "" { + return fmt.Errorf("network: empty") + } + if strings.IndexByte(n.Network, '/') != -1 { + return fmt.Errorf("network: contains illegal character '/'") + } + return nil +} + +func (n NetworkResourceName) ContainsWildcard() bool { + return false || n.Protocol == "-" || n.Network == "-" +} + +func (n NetworkResourceName) String() string { + return resourcename.Sprint( + "protocols/{protocol}/networks/{network}", + n.Protocol, + n.Network, + ) +} + +func (n NetworkResourceName) MarshalString() (string, error) { + if err := n.Validate(); err != nil { + return "", err + } + return n.String(), nil +} + +func (n *NetworkResourceName) UnmarshalString(name string) error { + return resourcename.Sscan( + name, + "protocols/{protocol}/networks/{network}", + &n.Protocol, + &n.Network, + ) +} + +func (n NetworkResourceName) ProtocolResourceName() ProtocolResourceName { + return ProtocolResourceName{ + Protocol: n.Protocol, + } +} diff --git a/gen/go/coinbase/staking/orchestration/v1/protocol.pb.go b/gen/go/coinbase/staking/orchestration/v1/protocol.pb.go new file mode 100644 index 0000000..b1e8add --- /dev/null +++ b/gen/go/coinbase/staking/orchestration/v1/protocol.pb.go @@ -0,0 +1,284 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.30.0 +// protoc (unknown) +// source: coinbase/staking/orchestration/v1/protocol.proto + +package v1 + +import ( + _ "google.golang.org/genproto/googleapis/api/annotations" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// A Protocol resource (e.g. ethereum_kiln, solana etc.). +type Protocol struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The resource name of the Protocol. + // Format: protocols/{protocolName} + // Ex: protocols/ethereum_kiln + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` +} + +func (x *Protocol) Reset() { + *x = Protocol{} + if protoimpl.UnsafeEnabled { + mi := &file_coinbase_staking_orchestration_v1_protocol_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Protocol) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Protocol) ProtoMessage() {} + +func (x *Protocol) ProtoReflect() protoreflect.Message { + mi := &file_coinbase_staking_orchestration_v1_protocol_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Protocol.ProtoReflect.Descriptor instead. +func (*Protocol) Descriptor() ([]byte, []int) { + return file_coinbase_staking_orchestration_v1_protocol_proto_rawDescGZIP(), []int{0} +} + +func (x *Protocol) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +// The request message for ListProtocols. +type ListProtocolsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *ListProtocolsRequest) Reset() { + *x = ListProtocolsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_coinbase_staking_orchestration_v1_protocol_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListProtocolsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListProtocolsRequest) ProtoMessage() {} + +func (x *ListProtocolsRequest) ProtoReflect() protoreflect.Message { + mi := &file_coinbase_staking_orchestration_v1_protocol_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListProtocolsRequest.ProtoReflect.Descriptor instead. +func (*ListProtocolsRequest) Descriptor() ([]byte, []int) { + return file_coinbase_staking_orchestration_v1_protocol_proto_rawDescGZIP(), []int{1} +} + +// The response message for ListProtocols. +type ListProtocolsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The list of protocols. + Protocols []*Protocol `protobuf:"bytes,1,rep,name=protocols,proto3" json:"protocols,omitempty"` +} + +func (x *ListProtocolsResponse) Reset() { + *x = ListProtocolsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_coinbase_staking_orchestration_v1_protocol_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListProtocolsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListProtocolsResponse) ProtoMessage() {} + +func (x *ListProtocolsResponse) ProtoReflect() protoreflect.Message { + mi := &file_coinbase_staking_orchestration_v1_protocol_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListProtocolsResponse.ProtoReflect.Descriptor instead. +func (*ListProtocolsResponse) Descriptor() ([]byte, []int) { + return file_coinbase_staking_orchestration_v1_protocol_proto_rawDescGZIP(), []int{2} +} + +func (x *ListProtocolsResponse) GetProtocols() []*Protocol { + if x != nil { + return x.Protocols + } + return nil +} + +var File_coinbase_staking_orchestration_v1_protocol_proto protoreflect.FileDescriptor + +var file_coinbase_staking_orchestration_v1_protocol_proto_rawDesc = []byte{ + 0x0a, 0x30, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x73, 0x74, 0x61, 0x6b, 0x69, + 0x6e, 0x67, 0x2f, 0x6f, 0x72, 0x63, 0x68, 0x65, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x12, 0x21, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x61, + 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x63, 0x68, 0x65, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x1a, 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, + 0x69, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x22, 0x6d, 0x0a, 0x08, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x12, 0x12, 0x0a, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x3a, 0x4d, 0xea, 0x41, 0x4a, 0x0a, 0x1d, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x63, + 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x50, 0x72, 0x6f, 0x74, + 0x6f, 0x63, 0x6f, 0x6c, 0x12, 0x14, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x73, 0x2f, + 0x7b, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x7d, 0x2a, 0x09, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x63, 0x6f, 0x6c, 0x73, 0x32, 0x08, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x22, + 0x16, 0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x73, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x62, 0x0a, 0x15, 0x4c, 0x69, 0x73, 0x74, 0x50, + 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x49, 0x0a, 0x09, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x73, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, + 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x63, 0x68, 0x65, 0x73, 0x74, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, + 0x52, 0x09, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x73, 0x42, 0x58, 0x5a, 0x56, 0x67, + 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, + 0x73, 0x65, 0x2f, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2d, 0x63, 0x6c, 0x69, 0x65, 0x6e, + 0x74, 0x2d, 0x6c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x2d, 0x67, 0x6f, 0x2f, 0x67, 0x65, 0x6e, + 0x2f, 0x67, 0x6f, 0x2f, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x73, 0x74, 0x61, + 0x6b, 0x69, 0x6e, 0x67, 0x2f, 0x6f, 0x72, 0x63, 0x68, 0x65, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_coinbase_staking_orchestration_v1_protocol_proto_rawDescOnce sync.Once + file_coinbase_staking_orchestration_v1_protocol_proto_rawDescData = file_coinbase_staking_orchestration_v1_protocol_proto_rawDesc +) + +func file_coinbase_staking_orchestration_v1_protocol_proto_rawDescGZIP() []byte { + file_coinbase_staking_orchestration_v1_protocol_proto_rawDescOnce.Do(func() { + file_coinbase_staking_orchestration_v1_protocol_proto_rawDescData = protoimpl.X.CompressGZIP(file_coinbase_staking_orchestration_v1_protocol_proto_rawDescData) + }) + return file_coinbase_staking_orchestration_v1_protocol_proto_rawDescData +} + +var file_coinbase_staking_orchestration_v1_protocol_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_coinbase_staking_orchestration_v1_protocol_proto_goTypes = []interface{}{ + (*Protocol)(nil), // 0: coinbase.staking.orchestration.v1.Protocol + (*ListProtocolsRequest)(nil), // 1: coinbase.staking.orchestration.v1.ListProtocolsRequest + (*ListProtocolsResponse)(nil), // 2: coinbase.staking.orchestration.v1.ListProtocolsResponse +} +var file_coinbase_staking_orchestration_v1_protocol_proto_depIdxs = []int32{ + 0, // 0: coinbase.staking.orchestration.v1.ListProtocolsResponse.protocols:type_name -> coinbase.staking.orchestration.v1.Protocol + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_coinbase_staking_orchestration_v1_protocol_proto_init() } +func file_coinbase_staking_orchestration_v1_protocol_proto_init() { + if File_coinbase_staking_orchestration_v1_protocol_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_coinbase_staking_orchestration_v1_protocol_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Protocol); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_coinbase_staking_orchestration_v1_protocol_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListProtocolsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_coinbase_staking_orchestration_v1_protocol_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListProtocolsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_coinbase_staking_orchestration_v1_protocol_proto_rawDesc, + NumEnums: 0, + NumMessages: 3, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_coinbase_staking_orchestration_v1_protocol_proto_goTypes, + DependencyIndexes: file_coinbase_staking_orchestration_v1_protocol_proto_depIdxs, + MessageInfos: file_coinbase_staking_orchestration_v1_protocol_proto_msgTypes, + }.Build() + File_coinbase_staking_orchestration_v1_protocol_proto = out.File + file_coinbase_staking_orchestration_v1_protocol_proto_rawDesc = nil + file_coinbase_staking_orchestration_v1_protocol_proto_goTypes = nil + file_coinbase_staking_orchestration_v1_protocol_proto_depIdxs = nil +} diff --git a/gen/go/coinbase/staking/orchestration/v1/protocol_aip.go b/gen/go/coinbase/staking/orchestration/v1/protocol_aip.go new file mode 100644 index 0000000..302c422 --- /dev/null +++ b/gen/go/coinbase/staking/orchestration/v1/protocol_aip.go @@ -0,0 +1,54 @@ +// Code generated by protoc-gen-go-aip. DO NOT EDIT. +// +// versions: +// protoc-gen-go-aip development +// protoc (unknown) +// source: coinbase/staking/orchestration/v1/protocol.proto + +package v1 + +import ( + fmt "fmt" + resourcename "go.einride.tech/aip/resourcename" + strings "strings" +) + +type ProtocolResourceName struct { + Protocol string +} + +func (n ProtocolResourceName) Validate() error { + if n.Protocol == "" { + return fmt.Errorf("protocol: empty") + } + if strings.IndexByte(n.Protocol, '/') != -1 { + return fmt.Errorf("protocol: contains illegal character '/'") + } + return nil +} + +func (n ProtocolResourceName) ContainsWildcard() bool { + return false || n.Protocol == "-" +} + +func (n ProtocolResourceName) String() string { + return resourcename.Sprint( + "protocols/{protocol}", + n.Protocol, + ) +} + +func (n ProtocolResourceName) MarshalString() (string, error) { + if err := n.Validate(); err != nil { + return "", err + } + return n.String(), nil +} + +func (n *ProtocolResourceName) UnmarshalString(name string) error { + return resourcename.Sscan( + name, + "protocols/{protocol}", + &n.Protocol, + ) +} diff --git a/gen/go/coinbase/staking/orchestration/v1/solana.pb.go b/gen/go/coinbase/staking/orchestration/v1/solana.pb.go new file mode 100644 index 0000000..24b9d04 --- /dev/null +++ b/gen/go/coinbase/staking/orchestration/v1/solana.pb.go @@ -0,0 +1,1039 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.30.0 +// protoc (unknown) +// source: coinbase/staking/orchestration/v1/solana.proto + +package v1 + +import ( + _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" + _ "google.golang.org/genproto/googleapis/api/annotations" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// Represents the different states a stake account balance can have. +// Used to check to see if stake is actively earning rewards or ready to be withdrawn. +type StakeAccount_BalanceState int32 + +const ( + // The balance is not known. + StakeAccount_BALANCE_STATE_UNSPECIFIED StakeAccount_BalanceState = 0 + // The balance is not actively staking. + StakeAccount_BALANCE_STATE_INACTIVE StakeAccount_BalanceState = 1 + // The balance is in a warm up period and will activate in the next epoch. + StakeAccount_BALANCE_STATE_ACTIVATING StakeAccount_BalanceState = 2 + // The balance is actively staking and earning rewards. + StakeAccount_BALANCE_STATE_ACTIVE StakeAccount_BalanceState = 3 + // The balance is in a cool down period and will be deactivated in the next epoch. + StakeAccount_BALANCE_STATE_DEACTIVATING StakeAccount_BalanceState = 4 +) + +// Enum value maps for StakeAccount_BalanceState. +var ( + StakeAccount_BalanceState_name = map[int32]string{ + 0: "BALANCE_STATE_UNSPECIFIED", + 1: "BALANCE_STATE_INACTIVE", + 2: "BALANCE_STATE_ACTIVATING", + 3: "BALANCE_STATE_ACTIVE", + 4: "BALANCE_STATE_DEACTIVATING", + } + StakeAccount_BalanceState_value = map[string]int32{ + "BALANCE_STATE_UNSPECIFIED": 0, + "BALANCE_STATE_INACTIVE": 1, + "BALANCE_STATE_ACTIVATING": 2, + "BALANCE_STATE_ACTIVE": 3, + "BALANCE_STATE_DEACTIVATING": 4, + } +) + +func (x StakeAccount_BalanceState) Enum() *StakeAccount_BalanceState { + p := new(StakeAccount_BalanceState) + *p = x + return p +} + +func (x StakeAccount_BalanceState) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (StakeAccount_BalanceState) Descriptor() protoreflect.EnumDescriptor { + return file_coinbase_staking_orchestration_v1_solana_proto_enumTypes[0].Descriptor() +} + +func (StakeAccount_BalanceState) Type() protoreflect.EnumType { + return &file_coinbase_staking_orchestration_v1_solana_proto_enumTypes[0] +} + +func (x StakeAccount_BalanceState) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use StakeAccount_BalanceState.Descriptor instead. +func (StakeAccount_BalanceState) EnumDescriptor() ([]byte, []int) { + return file_coinbase_staking_orchestration_v1_solana_proto_rawDescGZIP(), []int{6, 0} +} + +// A prioritization fee that can be added to a Solana transaction. +type PriorityFee struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The maximum number of compute units a transaction is allowed to consume. + ComputeUnitLimit int64 `protobuf:"varint,1,opt,name=compute_unit_limit,json=computeUnitLimit,proto3" json:"compute_unit_limit,omitempty"` + // The price to pay per compute unit. + UnitPrice int64 `protobuf:"varint,2,opt,name=unit_price,json=unitPrice,proto3" json:"unit_price,omitempty"` +} + +func (x *PriorityFee) Reset() { + *x = PriorityFee{} + if protoimpl.UnsafeEnabled { + mi := &file_coinbase_staking_orchestration_v1_solana_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PriorityFee) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PriorityFee) ProtoMessage() {} + +func (x *PriorityFee) ProtoReflect() protoreflect.Message { + mi := &file_coinbase_staking_orchestration_v1_solana_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PriorityFee.ProtoReflect.Descriptor instead. +func (*PriorityFee) Descriptor() ([]byte, []int) { + return file_coinbase_staking_orchestration_v1_solana_proto_rawDescGZIP(), []int{0} +} + +func (x *PriorityFee) GetComputeUnitLimit() int64 { + if x != nil { + return x.ComputeUnitLimit + } + return 0 +} + +func (x *PriorityFee) GetUnitPrice() int64 { + if x != nil { + return x.UnitPrice + } + return 0 +} + +// The parameters required to perform a stake operation on Solana. +type SolanaStakeParameters struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The address where the funds are coming from to stake. + WalletAddress string `protobuf:"bytes,1,opt,name=wallet_address,json=walletAddress,proto3" json:"wallet_address,omitempty"` + // The address of the validator. + ValidatorAddress string `protobuf:"bytes,2,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"` + // The amount of Solana to stake in lamports. (1 lamport = 0.000000001 SOL) + Amount *Amount `protobuf:"bytes,3,opt,name=amount,proto3" json:"amount,omitempty"` + // The option to set a priority fee for the transaction. + PriorityFee *PriorityFee `protobuf:"bytes,4,opt,name=priority_fee,json=priorityFee,proto3" json:"priority_fee,omitempty"` +} + +func (x *SolanaStakeParameters) Reset() { + *x = SolanaStakeParameters{} + if protoimpl.UnsafeEnabled { + mi := &file_coinbase_staking_orchestration_v1_solana_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SolanaStakeParameters) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SolanaStakeParameters) ProtoMessage() {} + +func (x *SolanaStakeParameters) ProtoReflect() protoreflect.Message { + mi := &file_coinbase_staking_orchestration_v1_solana_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SolanaStakeParameters.ProtoReflect.Descriptor instead. +func (*SolanaStakeParameters) Descriptor() ([]byte, []int) { + return file_coinbase_staking_orchestration_v1_solana_proto_rawDescGZIP(), []int{1} +} + +func (x *SolanaStakeParameters) GetWalletAddress() string { + if x != nil { + return x.WalletAddress + } + return "" +} + +func (x *SolanaStakeParameters) GetValidatorAddress() string { + if x != nil { + return x.ValidatorAddress + } + return "" +} + +func (x *SolanaStakeParameters) GetAmount() *Amount { + if x != nil { + return x.Amount + } + return nil +} + +func (x *SolanaStakeParameters) GetPriorityFee() *PriorityFee { + if x != nil { + return x.PriorityFee + } + return nil +} + +// The parameters required to perform a unstake operation on Solana. +type SolanaUnstakeParameters struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The address which is the signing authority to unstake. + WalletAddress string `protobuf:"bytes,1,opt,name=wallet_address,json=walletAddress,proto3" json:"wallet_address,omitempty"` + // The address of the stake account to unstake from. + StakeAccountAddress string `protobuf:"bytes,2,opt,name=stake_account_address,json=stakeAccountAddress,proto3" json:"stake_account_address,omitempty"` + // The amount of Solana to unstake in lamports. (1 lamport = 0.000000001 SOL) + Amount *Amount `protobuf:"bytes,3,opt,name=amount,proto3" json:"amount,omitempty"` + // The option to set a priority fee for the transaction. + PriorityFee *PriorityFee `protobuf:"bytes,4,opt,name=priority_fee,json=priorityFee,proto3" json:"priority_fee,omitempty"` +} + +func (x *SolanaUnstakeParameters) Reset() { + *x = SolanaUnstakeParameters{} + if protoimpl.UnsafeEnabled { + mi := &file_coinbase_staking_orchestration_v1_solana_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SolanaUnstakeParameters) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SolanaUnstakeParameters) ProtoMessage() {} + +func (x *SolanaUnstakeParameters) ProtoReflect() protoreflect.Message { + mi := &file_coinbase_staking_orchestration_v1_solana_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SolanaUnstakeParameters.ProtoReflect.Descriptor instead. +func (*SolanaUnstakeParameters) Descriptor() ([]byte, []int) { + return file_coinbase_staking_orchestration_v1_solana_proto_rawDescGZIP(), []int{2} +} + +func (x *SolanaUnstakeParameters) GetWalletAddress() string { + if x != nil { + return x.WalletAddress + } + return "" +} + +func (x *SolanaUnstakeParameters) GetStakeAccountAddress() string { + if x != nil { + return x.StakeAccountAddress + } + return "" +} + +func (x *SolanaUnstakeParameters) GetAmount() *Amount { + if x != nil { + return x.Amount + } + return nil +} + +func (x *SolanaUnstakeParameters) GetPriorityFee() *PriorityFee { + if x != nil { + return x.PriorityFee + } + return nil +} + +// The parameters required to perform a claim stake operation on Solana. +type SolanaClaimStakeParameters struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The address which is the signing authority to claim stake. + WalletAddress string `protobuf:"bytes,1,opt,name=wallet_address,json=walletAddress,proto3" json:"wallet_address,omitempty"` + // The address of the stake account to claim stake from. + StakeAccountAddress string `protobuf:"bytes,2,opt,name=stake_account_address,json=stakeAccountAddress,proto3" json:"stake_account_address,omitempty"` + // The option to set a priority fee for the transaction. + PriorityFee *PriorityFee `protobuf:"bytes,3,opt,name=priority_fee,json=priorityFee,proto3" json:"priority_fee,omitempty"` +} + +func (x *SolanaClaimStakeParameters) Reset() { + *x = SolanaClaimStakeParameters{} + if protoimpl.UnsafeEnabled { + mi := &file_coinbase_staking_orchestration_v1_solana_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SolanaClaimStakeParameters) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SolanaClaimStakeParameters) ProtoMessage() {} + +func (x *SolanaClaimStakeParameters) ProtoReflect() protoreflect.Message { + mi := &file_coinbase_staking_orchestration_v1_solana_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SolanaClaimStakeParameters.ProtoReflect.Descriptor instead. +func (*SolanaClaimStakeParameters) Descriptor() ([]byte, []int) { + return file_coinbase_staking_orchestration_v1_solana_proto_rawDescGZIP(), []int{3} +} + +func (x *SolanaClaimStakeParameters) GetWalletAddress() string { + if x != nil { + return x.WalletAddress + } + return "" +} + +func (x *SolanaClaimStakeParameters) GetStakeAccountAddress() string { + if x != nil { + return x.StakeAccountAddress + } + return "" +} + +func (x *SolanaClaimStakeParameters) GetPriorityFee() *PriorityFee { + if x != nil { + return x.PriorityFee + } + return nil +} + +// The protocol specific parameters required for fetching a staking context. +type SolanaStakingContextParameters struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *SolanaStakingContextParameters) Reset() { + *x = SolanaStakingContextParameters{} + if protoimpl.UnsafeEnabled { + mi := &file_coinbase_staking_orchestration_v1_solana_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SolanaStakingContextParameters) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SolanaStakingContextParameters) ProtoMessage() {} + +func (x *SolanaStakingContextParameters) ProtoReflect() protoreflect.Message { + mi := &file_coinbase_staking_orchestration_v1_solana_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SolanaStakingContextParameters.ProtoReflect.Descriptor instead. +func (*SolanaStakingContextParameters) Descriptor() ([]byte, []int) { + return file_coinbase_staking_orchestration_v1_solana_proto_rawDescGZIP(), []int{4} +} + +// The protocol specific details for a Solana staking context. +type SolanaStakingContextDetails struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The total balance of the main wallet address (system account). + // Used to check the balance for any future staking or transaction to send. + Balance *Amount `protobuf:"bytes,1,opt,name=balance,proto3" json:"balance,omitempty"` + // The current epoch that the Solana blockchain is in. + // Used as a frame of reference for future stake activations and deactivations. + CurrentEpoch int64 `protobuf:"varint,2,opt,name=current_epoch,json=currentEpoch,proto3" json:"current_epoch,omitempty"` + // How much of the epoch has passed as a percentage. + // Used to inform how much time is left before a stake is activated or deactivated. + EpochCompletionPercentage string `protobuf:"bytes,3,opt,name=epoch_completion_percentage,json=epochCompletionPercentage,proto3" json:"epoch_completion_percentage,omitempty"` + // The list of staking accounts that are linked to the main wallet address (system account). + // Used to check for statuses and balances of all stake accounts related to the main wallet address that + // they're linked to. + StakeAccounts []*StakeAccount `protobuf:"bytes,4,rep,name=stake_accounts,json=stakeAccounts,proto3" json:"stake_accounts,omitempty"` +} + +func (x *SolanaStakingContextDetails) Reset() { + *x = SolanaStakingContextDetails{} + if protoimpl.UnsafeEnabled { + mi := &file_coinbase_staking_orchestration_v1_solana_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SolanaStakingContextDetails) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SolanaStakingContextDetails) ProtoMessage() {} + +func (x *SolanaStakingContextDetails) ProtoReflect() protoreflect.Message { + mi := &file_coinbase_staking_orchestration_v1_solana_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SolanaStakingContextDetails.ProtoReflect.Descriptor instead. +func (*SolanaStakingContextDetails) Descriptor() ([]byte, []int) { + return file_coinbase_staking_orchestration_v1_solana_proto_rawDescGZIP(), []int{5} +} + +func (x *SolanaStakingContextDetails) GetBalance() *Amount { + if x != nil { + return x.Balance + } + return nil +} + +func (x *SolanaStakingContextDetails) GetCurrentEpoch() int64 { + if x != nil { + return x.CurrentEpoch + } + return 0 +} + +func (x *SolanaStakingContextDetails) GetEpochCompletionPercentage() string { + if x != nil { + return x.EpochCompletionPercentage + } + return "" +} + +func (x *SolanaStakingContextDetails) GetStakeAccounts() []*StakeAccount { + if x != nil { + return x.StakeAccounts + } + return nil +} + +// The balance information for a stake account. +type StakeAccount struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The address of the stake account. + // Used to hold the staked funds transferred over from the main wallet. + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + // The bonded balance in lamports on the stake account (rent is not included in bonded amount). + // Used to check the amount that is currently staked. + BondedStake *Amount `protobuf:"bytes,2,opt,name=bonded_stake,json=bondedStake,proto3" json:"bonded_stake,omitempty"` + // The rent amount for the stake account in lamports. + // Used to highlight the amount used as the rent to maintain the address on the Solana blockchain. + RentReserve *Amount `protobuf:"bytes,3,opt,name=rent_reserve,json=rentReserve,proto3" json:"rent_reserve,omitempty"` + // The total balance on the address in lamports. + // Used to check the total balance for the stake account. + Balance *Amount `protobuf:"bytes,4,opt,name=balance,proto3" json:"balance,omitempty"` + // The balance state of the stake account. + // Used to show what state the currently staked funds are in. + BalanceState StakeAccount_BalanceState `protobuf:"varint,5,opt,name=balance_state,json=balanceState,proto3,enum=coinbase.staking.orchestration.v1.StakeAccount_BalanceState" json:"balance_state,omitempty"` + // The validator (vote account) that the stake account is assigned to stake to. + // Used to show where the staked funds are staked to. + Validator string `protobuf:"bytes,6,opt,name=validator,proto3" json:"validator,omitempty"` +} + +func (x *StakeAccount) Reset() { + *x = StakeAccount{} + if protoimpl.UnsafeEnabled { + mi := &file_coinbase_staking_orchestration_v1_solana_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StakeAccount) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StakeAccount) ProtoMessage() {} + +func (x *StakeAccount) ProtoReflect() protoreflect.Message { + mi := &file_coinbase_staking_orchestration_v1_solana_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use StakeAccount.ProtoReflect.Descriptor instead. +func (*StakeAccount) Descriptor() ([]byte, []int) { + return file_coinbase_staking_orchestration_v1_solana_proto_rawDescGZIP(), []int{6} +} + +func (x *StakeAccount) GetAddress() string { + if x != nil { + return x.Address + } + return "" +} + +func (x *StakeAccount) GetBondedStake() *Amount { + if x != nil { + return x.BondedStake + } + return nil +} + +func (x *StakeAccount) GetRentReserve() *Amount { + if x != nil { + return x.RentReserve + } + return nil +} + +func (x *StakeAccount) GetBalance() *Amount { + if x != nil { + return x.Balance + } + return nil +} + +func (x *StakeAccount) GetBalanceState() StakeAccount_BalanceState { + if x != nil { + return x.BalanceState + } + return StakeAccount_BALANCE_STATE_UNSPECIFIED +} + +func (x *StakeAccount) GetValidator() string { + if x != nil { + return x.Validator + } + return "" +} + +// The parameters needed for staking on Solana. +type SolanaStakingParameters struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Parameters: + // + // *SolanaStakingParameters_StakeParameters + // *SolanaStakingParameters_UnstakeParameters + // *SolanaStakingParameters_ClaimStakeParameters + Parameters isSolanaStakingParameters_Parameters `protobuf_oneof:"parameters"` +} + +func (x *SolanaStakingParameters) Reset() { + *x = SolanaStakingParameters{} + if protoimpl.UnsafeEnabled { + mi := &file_coinbase_staking_orchestration_v1_solana_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SolanaStakingParameters) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SolanaStakingParameters) ProtoMessage() {} + +func (x *SolanaStakingParameters) ProtoReflect() protoreflect.Message { + mi := &file_coinbase_staking_orchestration_v1_solana_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SolanaStakingParameters.ProtoReflect.Descriptor instead. +func (*SolanaStakingParameters) Descriptor() ([]byte, []int) { + return file_coinbase_staking_orchestration_v1_solana_proto_rawDescGZIP(), []int{7} +} + +func (m *SolanaStakingParameters) GetParameters() isSolanaStakingParameters_Parameters { + if m != nil { + return m.Parameters + } + return nil +} + +func (x *SolanaStakingParameters) GetStakeParameters() *SolanaStakeParameters { + if x, ok := x.GetParameters().(*SolanaStakingParameters_StakeParameters); ok { + return x.StakeParameters + } + return nil +} + +func (x *SolanaStakingParameters) GetUnstakeParameters() *SolanaUnstakeParameters { + if x, ok := x.GetParameters().(*SolanaStakingParameters_UnstakeParameters); ok { + return x.UnstakeParameters + } + return nil +} + +func (x *SolanaStakingParameters) GetClaimStakeParameters() *SolanaClaimStakeParameters { + if x, ok := x.GetParameters().(*SolanaStakingParameters_ClaimStakeParameters); ok { + return x.ClaimStakeParameters + } + return nil +} + +type isSolanaStakingParameters_Parameters interface { + isSolanaStakingParameters_Parameters() +} + +type SolanaStakingParameters_StakeParameters struct { + // The parameters for stake action on Solana. + StakeParameters *SolanaStakeParameters `protobuf:"bytes,7,opt,name=stake_parameters,json=stakeParameters,proto3,oneof"` +} + +type SolanaStakingParameters_UnstakeParameters struct { + // The parameters for unstake action on Solana. + UnstakeParameters *SolanaUnstakeParameters `protobuf:"bytes,8,opt,name=unstake_parameters,json=unstakeParameters,proto3,oneof"` +} + +type SolanaStakingParameters_ClaimStakeParameters struct { + // The parameters for claim stake action on Solana. + ClaimStakeParameters *SolanaClaimStakeParameters `protobuf:"bytes,9,opt,name=claim_stake_parameters,json=claimStakeParameters,proto3,oneof"` +} + +func (*SolanaStakingParameters_StakeParameters) isSolanaStakingParameters_Parameters() {} + +func (*SolanaStakingParameters_UnstakeParameters) isSolanaStakingParameters_Parameters() {} + +func (*SolanaStakingParameters_ClaimStakeParameters) isSolanaStakingParameters_Parameters() {} + +var File_coinbase_staking_orchestration_v1_solana_proto protoreflect.FileDescriptor + +var file_coinbase_staking_orchestration_v1_solana_proto_rawDesc = []byte{ + 0x0a, 0x2e, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x73, 0x74, 0x61, 0x6b, 0x69, + 0x6e, 0x67, 0x2f, 0x6f, 0x72, 0x63, 0x68, 0x65, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x6f, 0x6c, 0x61, 0x6e, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x12, 0x21, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, + 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x63, 0x68, 0x65, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x2e, 0x76, 0x31, 0x1a, 0x2e, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x73, 0x74, + 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2f, 0x6f, 0x72, 0x63, 0x68, 0x65, 0x73, 0x74, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, + 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x62, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, + 0x2d, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x5a, 0x0a, 0x0b, 0x50, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, + 0x46, 0x65, 0x65, 0x12, 0x2c, 0x0a, 0x12, 0x63, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x5f, 0x75, + 0x6e, 0x69, 0x74, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x10, 0x63, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x55, 0x6e, 0x69, 0x74, 0x4c, 0x69, 0x6d, 0x69, + 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x75, 0x6e, 0x69, 0x74, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x75, 0x6e, 0x69, 0x74, 0x50, 0x72, 0x69, 0x63, 0x65, + 0x22, 0xa2, 0x02, 0x0a, 0x15, 0x53, 0x6f, 0x6c, 0x61, 0x6e, 0x61, 0x53, 0x74, 0x61, 0x6b, 0x65, + 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x12, 0x25, 0x0a, 0x0e, 0x77, 0x61, + 0x6c, 0x6c, 0x65, 0x74, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0d, 0x77, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x12, 0x2b, 0x0a, 0x11, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x76, 0x61, + 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x41, + 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, + 0x2e, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, + 0x67, 0x2e, 0x6f, 0x72, 0x63, 0x68, 0x65, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, + 0x76, 0x31, 0x2e, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, + 0x74, 0x12, 0x51, 0x0a, 0x0c, 0x70, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x5f, 0x66, 0x65, + 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, + 0x73, 0x65, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x63, 0x68, 0x65, + 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x69, 0x6f, + 0x72, 0x69, 0x74, 0x79, 0x46, 0x65, 0x65, 0x52, 0x0b, 0x70, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, + 0x79, 0x46, 0x65, 0x65, 0x3a, 0x1f, 0x92, 0x41, 0x1c, 0x0a, 0x1a, 0x2a, 0x18, 0x53, 0x6f, 0x6c, + 0x61, 0x6e, 0x61, 0x3a, 0x20, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x20, 0x50, 0x61, 0x72, 0x61, 0x6d, + 0x65, 0x74, 0x65, 0x72, 0x73, 0x22, 0xad, 0x02, 0x0a, 0x17, 0x53, 0x6f, 0x6c, 0x61, 0x6e, 0x61, + 0x55, 0x6e, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, + 0x73, 0x12, 0x25, 0x0a, 0x0e, 0x77, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x5f, 0x61, 0x64, 0x64, 0x72, + 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x77, 0x61, 0x6c, 0x6c, 0x65, + 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x32, 0x0a, 0x15, 0x73, 0x74, 0x61, 0x6b, + 0x65, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x13, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x41, 0x63, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x41, 0x0a, 0x06, + 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x63, + 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, + 0x6f, 0x72, 0x63, 0x68, 0x65, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, + 0x2e, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, + 0x51, 0x0a, 0x0c, 0x70, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x5f, 0x66, 0x65, 0x65, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, + 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x63, 0x68, 0x65, 0x73, 0x74, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x69, 0x6f, 0x72, 0x69, + 0x74, 0x79, 0x46, 0x65, 0x65, 0x52, 0x0b, 0x70, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x46, + 0x65, 0x65, 0x3a, 0x21, 0x92, 0x41, 0x1e, 0x0a, 0x1c, 0x2a, 0x1a, 0x53, 0x6f, 0x6c, 0x61, 0x6e, + 0x61, 0x3a, 0x20, 0x55, 0x6e, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x20, 0x50, 0x61, 0x72, 0x61, 0x6d, + 0x65, 0x74, 0x65, 0x72, 0x73, 0x22, 0xf1, 0x01, 0x0a, 0x1a, 0x53, 0x6f, 0x6c, 0x61, 0x6e, 0x61, + 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, + 0x74, 0x65, 0x72, 0x73, 0x12, 0x25, 0x0a, 0x0e, 0x77, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x5f, 0x61, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x77, 0x61, + 0x6c, 0x6c, 0x65, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x32, 0x0a, 0x15, 0x73, + 0x74, 0x61, 0x6b, 0x65, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x61, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x13, 0x73, 0x74, 0x61, 0x6b, + 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, + 0x51, 0x0a, 0x0c, 0x70, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x5f, 0x66, 0x65, 0x65, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, + 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x63, 0x68, 0x65, 0x73, 0x74, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x69, 0x6f, 0x72, 0x69, + 0x74, 0x79, 0x46, 0x65, 0x65, 0x52, 0x0b, 0x70, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x46, + 0x65, 0x65, 0x3a, 0x25, 0x92, 0x41, 0x22, 0x0a, 0x20, 0x2a, 0x1e, 0x53, 0x6f, 0x6c, 0x61, 0x6e, + 0x61, 0x3a, 0x20, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x20, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x20, 0x50, + 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x22, 0x4b, 0x0a, 0x1e, 0x53, 0x6f, 0x6c, + 0x61, 0x6e, 0x61, 0x53, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, + 0x74, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x3a, 0x29, 0x92, 0x41, 0x26, + 0x0a, 0x24, 0x2a, 0x22, 0x53, 0x6f, 0x6c, 0x61, 0x6e, 0x61, 0x3a, 0x20, 0x53, 0x74, 0x61, 0x6b, + 0x69, 0x6e, 0x67, 0x20, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x20, 0x50, 0x61, 0x72, 0x61, + 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x22, 0xc7, 0x02, 0x0a, 0x1b, 0x53, 0x6f, 0x6c, 0x61, 0x6e, + 0x61, 0x53, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x44, + 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x12, 0x43, 0x0a, 0x07, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, + 0x73, 0x65, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x63, 0x68, 0x65, + 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x6d, 0x6f, 0x75, + 0x6e, 0x74, 0x52, 0x07, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x63, + 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x0c, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x45, 0x70, 0x6f, 0x63, 0x68, + 0x12, 0x3e, 0x0a, 0x1b, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, + 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x61, 0x67, 0x65, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x19, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x43, 0x6f, 0x6d, 0x70, + 0x6c, 0x65, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x61, 0x67, 0x65, + 0x12, 0x56, 0x0a, 0x0e, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x63, 0x6f, 0x69, 0x6e, 0x62, + 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x63, 0x68, + 0x65, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x61, + 0x6b, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x0d, 0x73, 0x74, 0x61, 0x6b, 0x65, + 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x3a, 0x26, 0x92, 0x41, 0x23, 0x0a, 0x21, 0x2a, + 0x1f, 0x53, 0x6f, 0x6c, 0x61, 0x6e, 0x61, 0x3a, 0x20, 0x53, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, + 0x20, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x20, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, + 0x22, 0xb3, 0x04, 0x0a, 0x0c, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x4c, 0x0a, 0x0c, 0x62, + 0x6f, 0x6e, 0x64, 0x65, 0x64, 0x5f, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x29, 0x2e, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x61, + 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x63, 0x68, 0x65, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x0b, 0x62, 0x6f, + 0x6e, 0x64, 0x65, 0x64, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x12, 0x4c, 0x0a, 0x0c, 0x72, 0x65, 0x6e, + 0x74, 0x5f, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x29, 0x2e, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, + 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x63, 0x68, 0x65, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x0b, 0x72, 0x65, 0x6e, 0x74, + 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x12, 0x43, 0x0a, 0x07, 0x62, 0x61, 0x6c, 0x61, 0x6e, + 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x63, 0x6f, 0x69, 0x6e, 0x62, + 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x63, 0x68, + 0x65, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x6d, 0x6f, + 0x75, 0x6e, 0x74, 0x52, 0x07, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x66, 0x0a, 0x0d, + 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x0e, 0x32, 0x3c, 0x2e, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, + 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x63, 0x68, 0x65, 0x73, 0x74, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x41, 0x63, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x2e, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x53, 0x74, 0x61, 0x74, + 0x65, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0c, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x53, + 0x74, 0x61, 0x74, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, + 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, + 0x6f, 0x72, 0x22, 0xa1, 0x01, 0x0a, 0x0c, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x53, 0x74, + 0x61, 0x74, 0x65, 0x12, 0x1d, 0x0a, 0x19, 0x42, 0x41, 0x4c, 0x41, 0x4e, 0x43, 0x45, 0x5f, 0x53, + 0x54, 0x41, 0x54, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, + 0x10, 0x00, 0x12, 0x1a, 0x0a, 0x16, 0x42, 0x41, 0x4c, 0x41, 0x4e, 0x43, 0x45, 0x5f, 0x53, 0x54, + 0x41, 0x54, 0x45, 0x5f, 0x49, 0x4e, 0x41, 0x43, 0x54, 0x49, 0x56, 0x45, 0x10, 0x01, 0x12, 0x1c, + 0x0a, 0x18, 0x42, 0x41, 0x4c, 0x41, 0x4e, 0x43, 0x45, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, + 0x41, 0x43, 0x54, 0x49, 0x56, 0x41, 0x54, 0x49, 0x4e, 0x47, 0x10, 0x02, 0x12, 0x18, 0x0a, 0x14, + 0x42, 0x41, 0x4c, 0x41, 0x4e, 0x43, 0x45, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, 0x41, 0x43, + 0x54, 0x49, 0x56, 0x45, 0x10, 0x03, 0x12, 0x1e, 0x0a, 0x1a, 0x42, 0x41, 0x4c, 0x41, 0x4e, 0x43, + 0x45, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, 0x44, 0x45, 0x41, 0x43, 0x54, 0x49, 0x56, 0x41, + 0x54, 0x49, 0x4e, 0x47, 0x10, 0x04, 0x22, 0xb7, 0x04, 0x0a, 0x17, 0x53, 0x6f, 0x6c, 0x61, 0x6e, + 0x61, 0x53, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, + 0x72, 0x73, 0x12, 0x65, 0x0a, 0x10, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x5f, 0x70, 0x61, 0x72, 0x61, + 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x38, 0x2e, 0x63, + 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, + 0x6f, 0x72, 0x63, 0x68, 0x65, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, + 0x2e, 0x53, 0x6f, 0x6c, 0x61, 0x6e, 0x61, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x50, 0x61, 0x72, 0x61, + 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x48, 0x00, 0x52, 0x0f, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x50, + 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x12, 0x6b, 0x0a, 0x12, 0x75, 0x6e, 0x73, + 0x74, 0x61, 0x6b, 0x65, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x18, + 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3a, 0x2e, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, + 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x63, 0x68, 0x65, 0x73, 0x74, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x6f, 0x6c, 0x61, 0x6e, 0x61, + 0x55, 0x6e, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, + 0x73, 0x48, 0x00, 0x52, 0x11, 0x75, 0x6e, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x50, 0x61, 0x72, 0x61, + 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x12, 0x75, 0x0a, 0x16, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x5f, + 0x73, 0x74, 0x61, 0x6b, 0x65, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, + 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3d, 0x2e, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, + 0x65, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x63, 0x68, 0x65, 0x73, + 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x6f, 0x6c, 0x61, 0x6e, + 0x61, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, + 0x65, 0x74, 0x65, 0x72, 0x73, 0x48, 0x00, 0x52, 0x14, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x53, 0x74, + 0x61, 0x6b, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x3a, 0x21, 0x92, + 0x41, 0x1e, 0x0a, 0x1c, 0x2a, 0x1a, 0x53, 0x6f, 0x6c, 0x61, 0x6e, 0x61, 0x3a, 0x20, 0x53, 0x74, + 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x20, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, + 0x42, 0x0c, 0x0a, 0x0a, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x4a, 0x04, + 0x08, 0x01, 0x10, 0x07, 0x52, 0x17, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x73, 0x74, 0x61, + 0x6b, 0x65, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x52, 0x19, 0x64, + 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x5f, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x5f, 0x70, 0x61, + 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x52, 0x1b, 0x64, 0x65, 0x61, 0x63, 0x74, 0x69, + 0x76, 0x61, 0x74, 0x65, 0x5f, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, + 0x65, 0x74, 0x65, 0x72, 0x73, 0x52, 0x19, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x5f, + 0x73, 0x74, 0x61, 0x6b, 0x65, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, + 0x52, 0x16, 0x73, 0x70, 0x6c, 0x69, 0x74, 0x5f, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x5f, 0x70, 0x61, + 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x52, 0x16, 0x6d, 0x65, 0x72, 0x67, 0x65, 0x5f, + 0x73, 0x74, 0x61, 0x6b, 0x65, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, + 0x42, 0x58, 0x5a, 0x56, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, + 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2d, + 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2d, 0x6c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x2d, 0x67, + 0x6f, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x67, 0x6f, 0x2f, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, + 0x65, 0x2f, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2f, 0x6f, 0x72, 0x63, 0x68, 0x65, 0x73, + 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, +} + +var ( + file_coinbase_staking_orchestration_v1_solana_proto_rawDescOnce sync.Once + file_coinbase_staking_orchestration_v1_solana_proto_rawDescData = file_coinbase_staking_orchestration_v1_solana_proto_rawDesc +) + +func file_coinbase_staking_orchestration_v1_solana_proto_rawDescGZIP() []byte { + file_coinbase_staking_orchestration_v1_solana_proto_rawDescOnce.Do(func() { + file_coinbase_staking_orchestration_v1_solana_proto_rawDescData = protoimpl.X.CompressGZIP(file_coinbase_staking_orchestration_v1_solana_proto_rawDescData) + }) + return file_coinbase_staking_orchestration_v1_solana_proto_rawDescData +} + +var file_coinbase_staking_orchestration_v1_solana_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_coinbase_staking_orchestration_v1_solana_proto_msgTypes = make([]protoimpl.MessageInfo, 8) +var file_coinbase_staking_orchestration_v1_solana_proto_goTypes = []interface{}{ + (StakeAccount_BalanceState)(0), // 0: coinbase.staking.orchestration.v1.StakeAccount.BalanceState + (*PriorityFee)(nil), // 1: coinbase.staking.orchestration.v1.PriorityFee + (*SolanaStakeParameters)(nil), // 2: coinbase.staking.orchestration.v1.SolanaStakeParameters + (*SolanaUnstakeParameters)(nil), // 3: coinbase.staking.orchestration.v1.SolanaUnstakeParameters + (*SolanaClaimStakeParameters)(nil), // 4: coinbase.staking.orchestration.v1.SolanaClaimStakeParameters + (*SolanaStakingContextParameters)(nil), // 5: coinbase.staking.orchestration.v1.SolanaStakingContextParameters + (*SolanaStakingContextDetails)(nil), // 6: coinbase.staking.orchestration.v1.SolanaStakingContextDetails + (*StakeAccount)(nil), // 7: coinbase.staking.orchestration.v1.StakeAccount + (*SolanaStakingParameters)(nil), // 8: coinbase.staking.orchestration.v1.SolanaStakingParameters + (*Amount)(nil), // 9: coinbase.staking.orchestration.v1.Amount +} +var file_coinbase_staking_orchestration_v1_solana_proto_depIdxs = []int32{ + 9, // 0: coinbase.staking.orchestration.v1.SolanaStakeParameters.amount:type_name -> coinbase.staking.orchestration.v1.Amount + 1, // 1: coinbase.staking.orchestration.v1.SolanaStakeParameters.priority_fee:type_name -> coinbase.staking.orchestration.v1.PriorityFee + 9, // 2: coinbase.staking.orchestration.v1.SolanaUnstakeParameters.amount:type_name -> coinbase.staking.orchestration.v1.Amount + 1, // 3: coinbase.staking.orchestration.v1.SolanaUnstakeParameters.priority_fee:type_name -> coinbase.staking.orchestration.v1.PriorityFee + 1, // 4: coinbase.staking.orchestration.v1.SolanaClaimStakeParameters.priority_fee:type_name -> coinbase.staking.orchestration.v1.PriorityFee + 9, // 5: coinbase.staking.orchestration.v1.SolanaStakingContextDetails.balance:type_name -> coinbase.staking.orchestration.v1.Amount + 7, // 6: coinbase.staking.orchestration.v1.SolanaStakingContextDetails.stake_accounts:type_name -> coinbase.staking.orchestration.v1.StakeAccount + 9, // 7: coinbase.staking.orchestration.v1.StakeAccount.bonded_stake:type_name -> coinbase.staking.orchestration.v1.Amount + 9, // 8: coinbase.staking.orchestration.v1.StakeAccount.rent_reserve:type_name -> coinbase.staking.orchestration.v1.Amount + 9, // 9: coinbase.staking.orchestration.v1.StakeAccount.balance:type_name -> coinbase.staking.orchestration.v1.Amount + 0, // 10: coinbase.staking.orchestration.v1.StakeAccount.balance_state:type_name -> coinbase.staking.orchestration.v1.StakeAccount.BalanceState + 2, // 11: coinbase.staking.orchestration.v1.SolanaStakingParameters.stake_parameters:type_name -> coinbase.staking.orchestration.v1.SolanaStakeParameters + 3, // 12: coinbase.staking.orchestration.v1.SolanaStakingParameters.unstake_parameters:type_name -> coinbase.staking.orchestration.v1.SolanaUnstakeParameters + 4, // 13: coinbase.staking.orchestration.v1.SolanaStakingParameters.claim_stake_parameters:type_name -> coinbase.staking.orchestration.v1.SolanaClaimStakeParameters + 14, // [14:14] is the sub-list for method output_type + 14, // [14:14] is the sub-list for method input_type + 14, // [14:14] is the sub-list for extension type_name + 14, // [14:14] is the sub-list for extension extendee + 0, // [0:14] is the sub-list for field type_name +} + +func init() { file_coinbase_staking_orchestration_v1_solana_proto_init() } +func file_coinbase_staking_orchestration_v1_solana_proto_init() { + if File_coinbase_staking_orchestration_v1_solana_proto != nil { + return + } + file_coinbase_staking_orchestration_v1_common_proto_init() + if !protoimpl.UnsafeEnabled { + file_coinbase_staking_orchestration_v1_solana_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PriorityFee); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_coinbase_staking_orchestration_v1_solana_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SolanaStakeParameters); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_coinbase_staking_orchestration_v1_solana_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SolanaUnstakeParameters); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_coinbase_staking_orchestration_v1_solana_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SolanaClaimStakeParameters); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_coinbase_staking_orchestration_v1_solana_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SolanaStakingContextParameters); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_coinbase_staking_orchestration_v1_solana_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SolanaStakingContextDetails); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_coinbase_staking_orchestration_v1_solana_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StakeAccount); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_coinbase_staking_orchestration_v1_solana_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SolanaStakingParameters); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_coinbase_staking_orchestration_v1_solana_proto_msgTypes[7].OneofWrappers = []interface{}{ + (*SolanaStakingParameters_StakeParameters)(nil), + (*SolanaStakingParameters_UnstakeParameters)(nil), + (*SolanaStakingParameters_ClaimStakeParameters)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_coinbase_staking_orchestration_v1_solana_proto_rawDesc, + NumEnums: 1, + NumMessages: 8, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_coinbase_staking_orchestration_v1_solana_proto_goTypes, + DependencyIndexes: file_coinbase_staking_orchestration_v1_solana_proto_depIdxs, + EnumInfos: file_coinbase_staking_orchestration_v1_solana_proto_enumTypes, + MessageInfos: file_coinbase_staking_orchestration_v1_solana_proto_msgTypes, + }.Build() + File_coinbase_staking_orchestration_v1_solana_proto = out.File + file_coinbase_staking_orchestration_v1_solana_proto_rawDesc = nil + file_coinbase_staking_orchestration_v1_solana_proto_goTypes = nil + file_coinbase_staking_orchestration_v1_solana_proto_depIdxs = nil +} diff --git a/gen/go/coinbase/staking/orchestration/v1/staking_context.pb.go b/gen/go/coinbase/staking/orchestration/v1/staking_context.pb.go new file mode 100644 index 0000000..4373746 --- /dev/null +++ b/gen/go/coinbase/staking/orchestration/v1/staking_context.pb.go @@ -0,0 +1,397 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.30.0 +// protoc (unknown) +// source: coinbase/staking/orchestration/v1/staking_context.proto + +package v1 + +import ( + _ "google.golang.org/genproto/googleapis/api/annotations" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// The request message for the ViewStakingContext request. +type ViewStakingContextRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The address to fetch staking context for. + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + // The network to fetch staking context for. + Network string `protobuf:"bytes,2,opt,name=network,proto3" json:"network,omitempty"` + // The protocol specific parameters needed to fetch a staking context. + // + // Types that are assignable to StakingContextParameters: + // + // *ViewStakingContextRequest_EthereumKilnStakingContextParameters + // *ViewStakingContextRequest_SolanaStakingContextParameters + StakingContextParameters isViewStakingContextRequest_StakingContextParameters `protobuf_oneof:"staking_context_parameters"` +} + +func (x *ViewStakingContextRequest) Reset() { + *x = ViewStakingContextRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_coinbase_staking_orchestration_v1_staking_context_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ViewStakingContextRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ViewStakingContextRequest) ProtoMessage() {} + +func (x *ViewStakingContextRequest) ProtoReflect() protoreflect.Message { + mi := &file_coinbase_staking_orchestration_v1_staking_context_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ViewStakingContextRequest.ProtoReflect.Descriptor instead. +func (*ViewStakingContextRequest) Descriptor() ([]byte, []int) { + return file_coinbase_staking_orchestration_v1_staking_context_proto_rawDescGZIP(), []int{0} +} + +func (x *ViewStakingContextRequest) GetAddress() string { + if x != nil { + return x.Address + } + return "" +} + +func (x *ViewStakingContextRequest) GetNetwork() string { + if x != nil { + return x.Network + } + return "" +} + +func (m *ViewStakingContextRequest) GetStakingContextParameters() isViewStakingContextRequest_StakingContextParameters { + if m != nil { + return m.StakingContextParameters + } + return nil +} + +func (x *ViewStakingContextRequest) GetEthereumKilnStakingContextParameters() *EthereumKilnStakingContextParameters { + if x, ok := x.GetStakingContextParameters().(*ViewStakingContextRequest_EthereumKilnStakingContextParameters); ok { + return x.EthereumKilnStakingContextParameters + } + return nil +} + +func (x *ViewStakingContextRequest) GetSolanaStakingContextParameters() *SolanaStakingContextParameters { + if x, ok := x.GetStakingContextParameters().(*ViewStakingContextRequest_SolanaStakingContextParameters); ok { + return x.SolanaStakingContextParameters + } + return nil +} + +type isViewStakingContextRequest_StakingContextParameters interface { + isViewStakingContextRequest_StakingContextParameters() +} + +type ViewStakingContextRequest_EthereumKilnStakingContextParameters struct { + // EthereumKiln staking context parameters. + EthereumKilnStakingContextParameters *EthereumKilnStakingContextParameters `protobuf:"bytes,3,opt,name=ethereum_kiln_staking_context_parameters,json=ethereumKilnStakingContextParameters,proto3,oneof"` +} + +type ViewStakingContextRequest_SolanaStakingContextParameters struct { + // Solana staking context parameters. + SolanaStakingContextParameters *SolanaStakingContextParameters `protobuf:"bytes,4,opt,name=solana_staking_context_parameters,json=solanaStakingContextParameters,proto3,oneof"` +} + +func (*ViewStakingContextRequest_EthereumKilnStakingContextParameters) isViewStakingContextRequest_StakingContextParameters() { +} + +func (*ViewStakingContextRequest_SolanaStakingContextParameters) isViewStakingContextRequest_StakingContextParameters() { +} + +// The response message for the ViewStakingContext request. +type ViewStakingContextResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The address you are getting a staking context for. + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + // The protocol specific details of the staking context. + // + // Types that are assignable to StakingContextDetails: + // + // *ViewStakingContextResponse_EthereumKilnStakingContextDetails + // *ViewStakingContextResponse_SolanaStakingContextDetails + StakingContextDetails isViewStakingContextResponse_StakingContextDetails `protobuf_oneof:"staking_context_details"` +} + +func (x *ViewStakingContextResponse) Reset() { + *x = ViewStakingContextResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_coinbase_staking_orchestration_v1_staking_context_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ViewStakingContextResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ViewStakingContextResponse) ProtoMessage() {} + +func (x *ViewStakingContextResponse) ProtoReflect() protoreflect.Message { + mi := &file_coinbase_staking_orchestration_v1_staking_context_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ViewStakingContextResponse.ProtoReflect.Descriptor instead. +func (*ViewStakingContextResponse) Descriptor() ([]byte, []int) { + return file_coinbase_staking_orchestration_v1_staking_context_proto_rawDescGZIP(), []int{1} +} + +func (x *ViewStakingContextResponse) GetAddress() string { + if x != nil { + return x.Address + } + return "" +} + +func (m *ViewStakingContextResponse) GetStakingContextDetails() isViewStakingContextResponse_StakingContextDetails { + if m != nil { + return m.StakingContextDetails + } + return nil +} + +func (x *ViewStakingContextResponse) GetEthereumKilnStakingContextDetails() *EthereumKilnStakingContextDetails { + if x, ok := x.GetStakingContextDetails().(*ViewStakingContextResponse_EthereumKilnStakingContextDetails); ok { + return x.EthereumKilnStakingContextDetails + } + return nil +} + +func (x *ViewStakingContextResponse) GetSolanaStakingContextDetails() *SolanaStakingContextDetails { + if x, ok := x.GetStakingContextDetails().(*ViewStakingContextResponse_SolanaStakingContextDetails); ok { + return x.SolanaStakingContextDetails + } + return nil +} + +type isViewStakingContextResponse_StakingContextDetails interface { + isViewStakingContextResponse_StakingContextDetails() +} + +type ViewStakingContextResponse_EthereumKilnStakingContextDetails struct { + // EthereumKiln staking context details. + EthereumKilnStakingContextDetails *EthereumKilnStakingContextDetails `protobuf:"bytes,2,opt,name=ethereum_kiln_staking_context_details,json=ethereumKilnStakingContextDetails,proto3,oneof"` +} + +type ViewStakingContextResponse_SolanaStakingContextDetails struct { + // Solana staking context details. + SolanaStakingContextDetails *SolanaStakingContextDetails `protobuf:"bytes,3,opt,name=solana_staking_context_details,json=solanaStakingContextDetails,proto3,oneof"` +} + +func (*ViewStakingContextResponse_EthereumKilnStakingContextDetails) isViewStakingContextResponse_StakingContextDetails() { +} + +func (*ViewStakingContextResponse_SolanaStakingContextDetails) isViewStakingContextResponse_StakingContextDetails() { +} + +var File_coinbase_staking_orchestration_v1_staking_context_proto protoreflect.FileDescriptor + +var file_coinbase_staking_orchestration_v1_staking_context_proto_rawDesc = []byte{ + 0x0a, 0x37, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x73, 0x74, 0x61, 0x6b, 0x69, + 0x6e, 0x67, 0x2f, 0x6f, 0x72, 0x63, 0x68, 0x65, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x5f, 0x63, 0x6f, 0x6e, 0x74, + 0x65, 0x78, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x21, 0x63, 0x6f, 0x69, 0x6e, 0x62, + 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x63, 0x68, + 0x65, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x1a, 0x1f, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x62, + 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x35, 0x63, + 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2f, + 0x6f, 0x72, 0x63, 0x68, 0x65, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x31, + 0x2f, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x5f, 0x6b, 0x69, 0x6c, 0x6e, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2e, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x73, + 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2f, 0x6f, 0x72, 0x63, 0x68, 0x65, 0x73, 0x74, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x6f, 0x6c, 0x61, 0x6e, 0x61, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xb6, 0x03, 0x0a, 0x19, 0x56, 0x69, 0x65, 0x77, 0x53, 0x74, 0x61, + 0x6b, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x12, 0x1d, 0x0a, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, + 0x12, 0xa6, 0x01, 0x0a, 0x28, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x5f, 0x6b, 0x69, + 0x6c, 0x6e, 0x5f, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, + 0x78, 0x74, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x47, 0x2e, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, + 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x63, 0x68, 0x65, 0x73, 0x74, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, + 0x4b, 0x69, 0x6c, 0x6e, 0x53, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6e, 0x74, 0x65, + 0x78, 0x74, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x42, 0x03, 0xe0, 0x41, + 0x02, 0x48, 0x00, 0x52, 0x24, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x4b, 0x69, 0x6c, + 0x6e, 0x53, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x50, + 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x12, 0x93, 0x01, 0x0a, 0x21, 0x73, 0x6f, + 0x6c, 0x61, 0x6e, 0x61, 0x5f, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x5f, 0x63, 0x6f, 0x6e, + 0x74, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x41, 0x2e, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, + 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x63, 0x68, 0x65, 0x73, 0x74, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x6f, 0x6c, 0x61, 0x6e, 0x61, + 0x53, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x50, 0x61, + 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x48, 0x00, 0x52, + 0x1e, 0x73, 0x6f, 0x6c, 0x61, 0x6e, 0x61, 0x53, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x43, 0x6f, + 0x6e, 0x74, 0x65, 0x78, 0x74, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x42, + 0x1c, 0x0a, 0x1a, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, + 0x78, 0x74, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x22, 0x83, 0x03, + 0x0a, 0x1a, 0x56, 0x69, 0x65, 0x77, 0x53, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6e, + 0x74, 0x65, 0x78, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1d, 0x0a, 0x07, + 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, + 0x41, 0x02, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x9d, 0x01, 0x0a, 0x25, + 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x5f, 0x6b, 0x69, 0x6c, 0x6e, 0x5f, 0x73, 0x74, + 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x5f, 0x64, 0x65, + 0x74, 0x61, 0x69, 0x6c, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x44, 0x2e, 0x63, 0x6f, + 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x6f, + 0x72, 0x63, 0x68, 0x65, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, + 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x4b, 0x69, 0x6c, 0x6e, 0x53, 0x74, 0x61, 0x6b, + 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, + 0x73, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x48, 0x00, 0x52, 0x21, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, + 0x75, 0x6d, 0x4b, 0x69, 0x6c, 0x6e, 0x53, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6e, + 0x74, 0x65, 0x78, 0x74, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x12, 0x8a, 0x01, 0x0a, 0x1e, + 0x73, 0x6f, 0x6c, 0x61, 0x6e, 0x61, 0x5f, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x5f, 0x63, + 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x5f, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3e, 0x2e, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2e, + 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x63, 0x68, 0x65, 0x73, 0x74, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x6f, 0x6c, 0x61, 0x6e, 0x61, 0x53, + 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x44, 0x65, 0x74, + 0x61, 0x69, 0x6c, 0x73, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x48, 0x00, 0x52, 0x1b, 0x73, 0x6f, 0x6c, + 0x61, 0x6e, 0x61, 0x53, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, + 0x74, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x42, 0x19, 0x0a, 0x17, 0x73, 0x74, 0x61, 0x6b, + 0x69, 0x6e, 0x67, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x5f, 0x64, 0x65, 0x74, 0x61, + 0x69, 0x6c, 0x73, 0x42, 0x58, 0x5a, 0x56, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x6d, 0x2f, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x73, 0x74, 0x61, 0x6b, 0x69, + 0x6e, 0x67, 0x2d, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2d, 0x6c, 0x69, 0x62, 0x72, 0x61, 0x72, + 0x79, 0x2d, 0x67, 0x6f, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x67, 0x6f, 0x2f, 0x63, 0x6f, 0x69, 0x6e, + 0x62, 0x61, 0x73, 0x65, 0x2f, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2f, 0x6f, 0x72, 0x63, + 0x68, 0x65, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_coinbase_staking_orchestration_v1_staking_context_proto_rawDescOnce sync.Once + file_coinbase_staking_orchestration_v1_staking_context_proto_rawDescData = file_coinbase_staking_orchestration_v1_staking_context_proto_rawDesc +) + +func file_coinbase_staking_orchestration_v1_staking_context_proto_rawDescGZIP() []byte { + file_coinbase_staking_orchestration_v1_staking_context_proto_rawDescOnce.Do(func() { + file_coinbase_staking_orchestration_v1_staking_context_proto_rawDescData = protoimpl.X.CompressGZIP(file_coinbase_staking_orchestration_v1_staking_context_proto_rawDescData) + }) + return file_coinbase_staking_orchestration_v1_staking_context_proto_rawDescData +} + +var file_coinbase_staking_orchestration_v1_staking_context_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_coinbase_staking_orchestration_v1_staking_context_proto_goTypes = []interface{}{ + (*ViewStakingContextRequest)(nil), // 0: coinbase.staking.orchestration.v1.ViewStakingContextRequest + (*ViewStakingContextResponse)(nil), // 1: coinbase.staking.orchestration.v1.ViewStakingContextResponse + (*EthereumKilnStakingContextParameters)(nil), // 2: coinbase.staking.orchestration.v1.EthereumKilnStakingContextParameters + (*SolanaStakingContextParameters)(nil), // 3: coinbase.staking.orchestration.v1.SolanaStakingContextParameters + (*EthereumKilnStakingContextDetails)(nil), // 4: coinbase.staking.orchestration.v1.EthereumKilnStakingContextDetails + (*SolanaStakingContextDetails)(nil), // 5: coinbase.staking.orchestration.v1.SolanaStakingContextDetails +} +var file_coinbase_staking_orchestration_v1_staking_context_proto_depIdxs = []int32{ + 2, // 0: coinbase.staking.orchestration.v1.ViewStakingContextRequest.ethereum_kiln_staking_context_parameters:type_name -> coinbase.staking.orchestration.v1.EthereumKilnStakingContextParameters + 3, // 1: coinbase.staking.orchestration.v1.ViewStakingContextRequest.solana_staking_context_parameters:type_name -> coinbase.staking.orchestration.v1.SolanaStakingContextParameters + 4, // 2: coinbase.staking.orchestration.v1.ViewStakingContextResponse.ethereum_kiln_staking_context_details:type_name -> coinbase.staking.orchestration.v1.EthereumKilnStakingContextDetails + 5, // 3: coinbase.staking.orchestration.v1.ViewStakingContextResponse.solana_staking_context_details:type_name -> coinbase.staking.orchestration.v1.SolanaStakingContextDetails + 4, // [4:4] is the sub-list for method output_type + 4, // [4:4] is the sub-list for method input_type + 4, // [4:4] is the sub-list for extension type_name + 4, // [4:4] is the sub-list for extension extendee + 0, // [0:4] is the sub-list for field type_name +} + +func init() { file_coinbase_staking_orchestration_v1_staking_context_proto_init() } +func file_coinbase_staking_orchestration_v1_staking_context_proto_init() { + if File_coinbase_staking_orchestration_v1_staking_context_proto != nil { + return + } + file_coinbase_staking_orchestration_v1_ethereum_kiln_proto_init() + file_coinbase_staking_orchestration_v1_solana_proto_init() + if !protoimpl.UnsafeEnabled { + file_coinbase_staking_orchestration_v1_staking_context_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ViewStakingContextRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_coinbase_staking_orchestration_v1_staking_context_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ViewStakingContextResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_coinbase_staking_orchestration_v1_staking_context_proto_msgTypes[0].OneofWrappers = []interface{}{ + (*ViewStakingContextRequest_EthereumKilnStakingContextParameters)(nil), + (*ViewStakingContextRequest_SolanaStakingContextParameters)(nil), + } + file_coinbase_staking_orchestration_v1_staking_context_proto_msgTypes[1].OneofWrappers = []interface{}{ + (*ViewStakingContextResponse_EthereumKilnStakingContextDetails)(nil), + (*ViewStakingContextResponse_SolanaStakingContextDetails)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_coinbase_staking_orchestration_v1_staking_context_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_coinbase_staking_orchestration_v1_staking_context_proto_goTypes, + DependencyIndexes: file_coinbase_staking_orchestration_v1_staking_context_proto_depIdxs, + MessageInfos: file_coinbase_staking_orchestration_v1_staking_context_proto_msgTypes, + }.Build() + File_coinbase_staking_orchestration_v1_staking_context_proto = out.File + file_coinbase_staking_orchestration_v1_staking_context_proto_rawDesc = nil + file_coinbase_staking_orchestration_v1_staking_context_proto_goTypes = nil + file_coinbase_staking_orchestration_v1_staking_context_proto_depIdxs = nil +} diff --git a/gen/go/coinbase/staking/orchestration/v1/staking_target.pb.go b/gen/go/coinbase/staking/orchestration/v1/staking_target.pb.go new file mode 100644 index 0000000..fdcb476 --- /dev/null +++ b/gen/go/coinbase/staking/orchestration/v1/staking_target.pb.go @@ -0,0 +1,574 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.30.0 +// protoc (unknown) +// source: coinbase/staking/orchestration/v1/staking_target.proto + +package v1 + +import ( + _ "google.golang.org/genproto/googleapis/api/annotations" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// A Validator resource represents an active validator for the given protocol network. +type Validator struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The resource name of the Validator. + // Format: protocols/{protocolName}/networks/{networkName}/stakingTargets/{validatorName} + // Ex: protocols/solana/networks/testnet/stakingTargets/GkqYQysEGmuL6V2AJoNnWZUz2ZBGWhzQXsJiXm2CLKAN + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // The public address of the validator. + Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` + // The rate of commission for the validator + CommissionRate float32 `protobuf:"fixed32,3,opt,name=commission_rate,json=commissionRate,proto3" json:"commission_rate,omitempty"` +} + +func (x *Validator) Reset() { + *x = Validator{} + if protoimpl.UnsafeEnabled { + mi := &file_coinbase_staking_orchestration_v1_staking_target_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Validator) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Validator) ProtoMessage() {} + +func (x *Validator) ProtoReflect() protoreflect.Message { + mi := &file_coinbase_staking_orchestration_v1_staking_target_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Validator.ProtoReflect.Descriptor instead. +func (*Validator) Descriptor() ([]byte, []int) { + return file_coinbase_staking_orchestration_v1_staking_target_proto_rawDescGZIP(), []int{0} +} + +func (x *Validator) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Validator) GetAddress() string { + if x != nil { + return x.Address + } + return "" +} + +func (x *Validator) GetCommissionRate() float32 { + if x != nil { + return x.CommissionRate + } + return 0 +} + +// A Contract resource, which represents an active contract +// for the given protocol network which you can submit an action +// to. +type Contract struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The resource name of the Contract Address. + // Format: protocols/{protocolName}/networks/{networkName}/stakingTargets/{contractName} + // Ex: protocols/ethereum_kiln/networks/holesky/stakingTargets/0xA55416de5DE61A0AC1aa8970a280E04388B1dE4b + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // The contract address you may submit actions to. + Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` +} + +func (x *Contract) Reset() { + *x = Contract{} + if protoimpl.UnsafeEnabled { + mi := &file_coinbase_staking_orchestration_v1_staking_target_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Contract) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Contract) ProtoMessage() {} + +func (x *Contract) ProtoReflect() protoreflect.Message { + mi := &file_coinbase_staking_orchestration_v1_staking_target_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Contract.ProtoReflect.Descriptor instead. +func (*Contract) Descriptor() ([]byte, []int) { + return file_coinbase_staking_orchestration_v1_staking_target_proto_rawDescGZIP(), []int{1} +} + +func (x *Contract) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Contract) GetAddress() string { + if x != nil { + return x.Address + } + return "" +} + +// A Staking Target represents a destination that you perform an action on related to staking. +type StakingTarget struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to StakingTargets: + // + // *StakingTarget_Validator + // *StakingTarget_Contract + StakingTargets isStakingTarget_StakingTargets `protobuf_oneof:"staking_targets"` +} + +func (x *StakingTarget) Reset() { + *x = StakingTarget{} + if protoimpl.UnsafeEnabled { + mi := &file_coinbase_staking_orchestration_v1_staking_target_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StakingTarget) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StakingTarget) ProtoMessage() {} + +func (x *StakingTarget) ProtoReflect() protoreflect.Message { + mi := &file_coinbase_staking_orchestration_v1_staking_target_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use StakingTarget.ProtoReflect.Descriptor instead. +func (*StakingTarget) Descriptor() ([]byte, []int) { + return file_coinbase_staking_orchestration_v1_staking_target_proto_rawDescGZIP(), []int{2} +} + +func (m *StakingTarget) GetStakingTargets() isStakingTarget_StakingTargets { + if m != nil { + return m.StakingTargets + } + return nil +} + +func (x *StakingTarget) GetValidator() *Validator { + if x, ok := x.GetStakingTargets().(*StakingTarget_Validator); ok { + return x.Validator + } + return nil +} + +func (x *StakingTarget) GetContract() *Contract { + if x, ok := x.GetStakingTargets().(*StakingTarget_Contract); ok { + return x.Contract + } + return nil +} + +type isStakingTarget_StakingTargets interface { + isStakingTarget_StakingTargets() +} + +type StakingTarget_Validator struct { + // A validator to stake to. + Validator *Validator `protobuf:"bytes,1,opt,name=validator,proto3,oneof"` +} + +type StakingTarget_Contract struct { + // A contract to send a staking action to. + Contract *Contract `protobuf:"bytes,2,opt,name=contract,proto3,oneof"` +} + +func (*StakingTarget_Validator) isStakingTarget_StakingTargets() {} + +func (*StakingTarget_Contract) isStakingTarget_StakingTargets() {} + +// The request message for ListStakingTargets. +type ListStakingTargetsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The resource name of the parent that owns + // the collection of staking targets. + // Format: protocols/{protocol}/networks/{network} + Parent string `protobuf:"bytes,1,opt,name=parent,proto3" json:"parent,omitempty"` + // The maximum number of staking targets to return. The service may + // return fewer than this value. + // + // If unspecified, 100 staking targets will be returned. + // The maximum value is 1000; values over 1000 will be floored to 1000. + PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` + // A page token as part of the response of a previous call. + // Provide this to retrieve the next page. + // + // When paginating, all other parameters must match the previous + // request to list resources. + PageToken string `protobuf:"bytes,3,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"` +} + +func (x *ListStakingTargetsRequest) Reset() { + *x = ListStakingTargetsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_coinbase_staking_orchestration_v1_staking_target_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListStakingTargetsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListStakingTargetsRequest) ProtoMessage() {} + +func (x *ListStakingTargetsRequest) ProtoReflect() protoreflect.Message { + mi := &file_coinbase_staking_orchestration_v1_staking_target_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListStakingTargetsRequest.ProtoReflect.Descriptor instead. +func (*ListStakingTargetsRequest) Descriptor() ([]byte, []int) { + return file_coinbase_staking_orchestration_v1_staking_target_proto_rawDescGZIP(), []int{3} +} + +func (x *ListStakingTargetsRequest) GetParent() string { + if x != nil { + return x.Parent + } + return "" +} + +func (x *ListStakingTargetsRequest) GetPageSize() int32 { + if x != nil { + return x.PageSize + } + return 0 +} + +func (x *ListStakingTargetsRequest) GetPageToken() string { + if x != nil { + return x.PageToken + } + return "" +} + +// The response message for ListStakingTargets. +type ListStakingTargetsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The list of staking targets. + StakingTargets []*StakingTarget `protobuf:"bytes,1,rep,name=staking_targets,json=stakingTargets,proto3" json:"staking_targets,omitempty"` + // A token which can be provided as `page_token` to retrieve the next page. + // If this field is omitted, there are no additional pages. + NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"` +} + +func (x *ListStakingTargetsResponse) Reset() { + *x = ListStakingTargetsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_coinbase_staking_orchestration_v1_staking_target_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListStakingTargetsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListStakingTargetsResponse) ProtoMessage() {} + +func (x *ListStakingTargetsResponse) ProtoReflect() protoreflect.Message { + mi := &file_coinbase_staking_orchestration_v1_staking_target_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListStakingTargetsResponse.ProtoReflect.Descriptor instead. +func (*ListStakingTargetsResponse) Descriptor() ([]byte, []int) { + return file_coinbase_staking_orchestration_v1_staking_target_proto_rawDescGZIP(), []int{4} +} + +func (x *ListStakingTargetsResponse) GetStakingTargets() []*StakingTarget { + if x != nil { + return x.StakingTargets + } + return nil +} + +func (x *ListStakingTargetsResponse) GetNextPageToken() string { + if x != nil { + return x.NextPageToken + } + return "" +} + +var File_coinbase_staking_orchestration_v1_staking_target_proto protoreflect.FileDescriptor + +var file_coinbase_staking_orchestration_v1_staking_target_proto_rawDesc = []byte{ + 0x0a, 0x36, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x73, 0x74, 0x61, 0x6b, 0x69, + 0x6e, 0x67, 0x2f, 0x6f, 0x72, 0x63, 0x68, 0x65, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x5f, 0x74, 0x61, 0x72, 0x67, + 0x65, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x21, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, + 0x73, 0x65, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x63, 0x68, 0x65, + 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x62, 0x65, + 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xe2, 0x01, 0x0a, 0x09, 0x56, 0x61, 0x6c, 0x69, + 0x64, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, + 0x65, 0x73, 0x73, 0x12, 0x27, 0x0a, 0x0f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, + 0x6e, 0x5f, 0x72, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x02, 0x52, 0x0e, 0x63, 0x6f, + 0x6d, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x61, 0x74, 0x65, 0x3a, 0x7e, 0xea, 0x41, + 0x7b, 0x0a, 0x1e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x63, 0x6f, 0x69, 0x6e, 0x62, + 0x61, 0x73, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, + 0x72, 0x12, 0x42, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x73, 0x2f, 0x7b, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x7d, 0x2f, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x73, + 0x2f, 0x7b, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x7d, 0x2f, 0x73, 0x74, 0x61, 0x6b, 0x69, + 0x6e, 0x67, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x2f, 0x7b, 0x76, 0x61, 0x6c, 0x69, 0x64, + 0x61, 0x74, 0x6f, 0x72, 0x7d, 0x2a, 0x0a, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, + 0x73, 0x32, 0x09, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x22, 0xb4, 0x01, 0x0a, + 0x08, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, + 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, + 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x3a, 0x7a, 0xea, 0x41, 0x77, 0x0a, 0x1d, 0x73, 0x74, + 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x63, + 0x6f, 0x6d, 0x2f, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x12, 0x41, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x73, 0x2f, 0x7b, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, + 0x7d, 0x2f, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x2f, 0x7b, 0x6e, 0x65, 0x74, 0x77, + 0x6f, 0x72, 0x6b, 0x7d, 0x2f, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x54, 0x61, 0x72, 0x67, + 0x65, 0x74, 0x73, 0x2f, 0x7b, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x7d, 0x2a, 0x09, + 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x73, 0x32, 0x08, 0x63, 0x6f, 0x6e, 0x74, 0x72, + 0x61, 0x63, 0x74, 0x22, 0xbb, 0x01, 0x0a, 0x0d, 0x53, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x54, + 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x4c, 0x0a, 0x09, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, + 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x63, 0x6f, 0x69, 0x6e, 0x62, + 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x63, 0x68, + 0x65, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x61, 0x6c, + 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x48, 0x00, 0x52, 0x09, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, + 0x74, 0x6f, 0x72, 0x12, 0x49, 0x0a, 0x08, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, + 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x63, 0x68, 0x65, 0x73, 0x74, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, + 0x63, 0x74, 0x48, 0x00, 0x52, 0x08, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x42, 0x11, + 0x0a, 0x0f, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x5f, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, + 0x73, 0x22, 0xa5, 0x01, 0x0a, 0x19, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x74, 0x61, 0x6b, 0x69, 0x6e, + 0x67, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x42, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, + 0x2a, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x24, 0x12, 0x22, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, + 0x2e, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x53, 0x74, + 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x06, 0x70, 0x61, 0x72, + 0x65, 0x6e, 0x74, 0x12, 0x20, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x08, 0x70, 0x61, 0x67, + 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x22, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, + 0x6b, 0x65, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x09, + 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x9f, 0x01, 0x0a, 0x1a, 0x4c, 0x69, + 0x73, 0x74, 0x53, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x59, 0x0a, 0x0f, 0x73, 0x74, 0x61, 0x6b, + 0x69, 0x6e, 0x67, 0x5f, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x30, 0x2e, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x61, + 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x63, 0x68, 0x65, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x54, 0x61, 0x72, + 0x67, 0x65, 0x74, 0x52, 0x0e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x54, 0x61, 0x72, 0x67, + 0x65, 0x74, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, + 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, + 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x42, 0x58, 0x5a, 0x56, 0x67, + 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, + 0x73, 0x65, 0x2f, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2d, 0x63, 0x6c, 0x69, 0x65, 0x6e, + 0x74, 0x2d, 0x6c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x2d, 0x67, 0x6f, 0x2f, 0x67, 0x65, 0x6e, + 0x2f, 0x67, 0x6f, 0x2f, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x73, 0x74, 0x61, + 0x6b, 0x69, 0x6e, 0x67, 0x2f, 0x6f, 0x72, 0x63, 0x68, 0x65, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_coinbase_staking_orchestration_v1_staking_target_proto_rawDescOnce sync.Once + file_coinbase_staking_orchestration_v1_staking_target_proto_rawDescData = file_coinbase_staking_orchestration_v1_staking_target_proto_rawDesc +) + +func file_coinbase_staking_orchestration_v1_staking_target_proto_rawDescGZIP() []byte { + file_coinbase_staking_orchestration_v1_staking_target_proto_rawDescOnce.Do(func() { + file_coinbase_staking_orchestration_v1_staking_target_proto_rawDescData = protoimpl.X.CompressGZIP(file_coinbase_staking_orchestration_v1_staking_target_proto_rawDescData) + }) + return file_coinbase_staking_orchestration_v1_staking_target_proto_rawDescData +} + +var file_coinbase_staking_orchestration_v1_staking_target_proto_msgTypes = make([]protoimpl.MessageInfo, 5) +var file_coinbase_staking_orchestration_v1_staking_target_proto_goTypes = []interface{}{ + (*Validator)(nil), // 0: coinbase.staking.orchestration.v1.Validator + (*Contract)(nil), // 1: coinbase.staking.orchestration.v1.Contract + (*StakingTarget)(nil), // 2: coinbase.staking.orchestration.v1.StakingTarget + (*ListStakingTargetsRequest)(nil), // 3: coinbase.staking.orchestration.v1.ListStakingTargetsRequest + (*ListStakingTargetsResponse)(nil), // 4: coinbase.staking.orchestration.v1.ListStakingTargetsResponse +} +var file_coinbase_staking_orchestration_v1_staking_target_proto_depIdxs = []int32{ + 0, // 0: coinbase.staking.orchestration.v1.StakingTarget.validator:type_name -> coinbase.staking.orchestration.v1.Validator + 1, // 1: coinbase.staking.orchestration.v1.StakingTarget.contract:type_name -> coinbase.staking.orchestration.v1.Contract + 2, // 2: coinbase.staking.orchestration.v1.ListStakingTargetsResponse.staking_targets:type_name -> coinbase.staking.orchestration.v1.StakingTarget + 3, // [3:3] is the sub-list for method output_type + 3, // [3:3] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name +} + +func init() { file_coinbase_staking_orchestration_v1_staking_target_proto_init() } +func file_coinbase_staking_orchestration_v1_staking_target_proto_init() { + if File_coinbase_staking_orchestration_v1_staking_target_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_coinbase_staking_orchestration_v1_staking_target_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Validator); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_coinbase_staking_orchestration_v1_staking_target_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Contract); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_coinbase_staking_orchestration_v1_staking_target_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StakingTarget); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_coinbase_staking_orchestration_v1_staking_target_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListStakingTargetsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_coinbase_staking_orchestration_v1_staking_target_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListStakingTargetsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_coinbase_staking_orchestration_v1_staking_target_proto_msgTypes[2].OneofWrappers = []interface{}{ + (*StakingTarget_Validator)(nil), + (*StakingTarget_Contract)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_coinbase_staking_orchestration_v1_staking_target_proto_rawDesc, + NumEnums: 0, + NumMessages: 5, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_coinbase_staking_orchestration_v1_staking_target_proto_goTypes, + DependencyIndexes: file_coinbase_staking_orchestration_v1_staking_target_proto_depIdxs, + MessageInfos: file_coinbase_staking_orchestration_v1_staking_target_proto_msgTypes, + }.Build() + File_coinbase_staking_orchestration_v1_staking_target_proto = out.File + file_coinbase_staking_orchestration_v1_staking_target_proto_rawDesc = nil + file_coinbase_staking_orchestration_v1_staking_target_proto_goTypes = nil + file_coinbase_staking_orchestration_v1_staking_target_proto_depIdxs = nil +} diff --git a/gen/go/coinbase/staking/orchestration/v1/staking_target_aip.go b/gen/go/coinbase/staking/orchestration/v1/staking_target_aip.go new file mode 100644 index 0000000..a0ab564 --- /dev/null +++ b/gen/go/coinbase/staking/orchestration/v1/staking_target_aip.go @@ -0,0 +1,198 @@ +// Code generated by protoc-gen-go-aip. DO NOT EDIT. +// +// versions: +// protoc-gen-go-aip development +// protoc (unknown) +// source: coinbase/staking/orchestration/v1/staking_target.proto + +package v1 + +import ( + fmt "fmt" + resourcename "go.einride.tech/aip/resourcename" + strings "strings" +) + +type ValidatorResourceName struct { + Protocol string + Network string + Validator string +} + +func (n ProtocolResourceName) ValidatorResourceName( + network string, + validator string, +) ValidatorResourceName { + return ValidatorResourceName{ + Protocol: n.Protocol, + Network: network, + Validator: validator, + } +} + +func (n NetworkResourceName) ValidatorResourceName( + validator string, +) ValidatorResourceName { + return ValidatorResourceName{ + Protocol: n.Protocol, + Network: n.Network, + Validator: validator, + } +} + +func (n ValidatorResourceName) Validate() error { + if n.Protocol == "" { + return fmt.Errorf("protocol: empty") + } + if strings.IndexByte(n.Protocol, '/') != -1 { + return fmt.Errorf("protocol: contains illegal character '/'") + } + if n.Network == "" { + return fmt.Errorf("network: empty") + } + if strings.IndexByte(n.Network, '/') != -1 { + return fmt.Errorf("network: contains illegal character '/'") + } + if n.Validator == "" { + return fmt.Errorf("validator: empty") + } + if strings.IndexByte(n.Validator, '/') != -1 { + return fmt.Errorf("validator: contains illegal character '/'") + } + return nil +} + +func (n ValidatorResourceName) ContainsWildcard() bool { + return false || n.Protocol == "-" || n.Network == "-" || n.Validator == "-" +} + +func (n ValidatorResourceName) String() string { + return resourcename.Sprint( + "protocols/{protocol}/networks/{network}/stakingTargets/{validator}", + n.Protocol, + n.Network, + n.Validator, + ) +} + +func (n ValidatorResourceName) MarshalString() (string, error) { + if err := n.Validate(); err != nil { + return "", err + } + return n.String(), nil +} + +func (n *ValidatorResourceName) UnmarshalString(name string) error { + return resourcename.Sscan( + name, + "protocols/{protocol}/networks/{network}/stakingTargets/{validator}", + &n.Protocol, + &n.Network, + &n.Validator, + ) +} + +func (n ValidatorResourceName) ProtocolResourceName() ProtocolResourceName { + return ProtocolResourceName{ + Protocol: n.Protocol, + } +} + +func (n ValidatorResourceName) NetworkResourceName() NetworkResourceName { + return NetworkResourceName{ + Protocol: n.Protocol, + Network: n.Network, + } +} + +type ContractResourceName struct { + Protocol string + Network string + Contract string +} + +func (n ProtocolResourceName) ContractResourceName( + network string, + contract string, +) ContractResourceName { + return ContractResourceName{ + Protocol: n.Protocol, + Network: network, + Contract: contract, + } +} + +func (n NetworkResourceName) ContractResourceName( + contract string, +) ContractResourceName { + return ContractResourceName{ + Protocol: n.Protocol, + Network: n.Network, + Contract: contract, + } +} + +func (n ContractResourceName) Validate() error { + if n.Protocol == "" { + return fmt.Errorf("protocol: empty") + } + if strings.IndexByte(n.Protocol, '/') != -1 { + return fmt.Errorf("protocol: contains illegal character '/'") + } + if n.Network == "" { + return fmt.Errorf("network: empty") + } + if strings.IndexByte(n.Network, '/') != -1 { + return fmt.Errorf("network: contains illegal character '/'") + } + if n.Contract == "" { + return fmt.Errorf("contract: empty") + } + if strings.IndexByte(n.Contract, '/') != -1 { + return fmt.Errorf("contract: contains illegal character '/'") + } + return nil +} + +func (n ContractResourceName) ContainsWildcard() bool { + return false || n.Protocol == "-" || n.Network == "-" || n.Contract == "-" +} + +func (n ContractResourceName) String() string { + return resourcename.Sprint( + "protocols/{protocol}/networks/{network}/stakingTargets/{contract}", + n.Protocol, + n.Network, + n.Contract, + ) +} + +func (n ContractResourceName) MarshalString() (string, error) { + if err := n.Validate(); err != nil { + return "", err + } + return n.String(), nil +} + +func (n *ContractResourceName) UnmarshalString(name string) error { + return resourcename.Sscan( + name, + "protocols/{protocol}/networks/{network}/stakingTargets/{contract}", + &n.Protocol, + &n.Network, + &n.Contract, + ) +} + +func (n ContractResourceName) ProtocolResourceName() ProtocolResourceName { + return ProtocolResourceName{ + Protocol: n.Protocol, + } +} + +func (n ContractResourceName) NetworkResourceName() NetworkResourceName { + return NetworkResourceName{ + Protocol: n.Protocol, + Network: n.Network, + } +} diff --git a/gen/go/coinbase/staking/orchestration/v1/workflow.pb.go b/gen/go/coinbase/staking/orchestration/v1/workflow.pb.go new file mode 100644 index 0000000..b41b778 --- /dev/null +++ b/gen/go/coinbase/staking/orchestration/v1/workflow.pb.go @@ -0,0 +1,1497 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.30.0 +// protoc (unknown) +// source: coinbase/staking/orchestration/v1/workflow.proto + +package v1 + +import ( + _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" + _ "google.golang.org/genproto/googleapis/api/annotations" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// State defines an enumeration of states for a staking transaction. +type TxStepOutput_State int32 + +const ( + // Unspecified transaction state, this is for backwards compatibility. + TxStepOutput_STATE_UNSPECIFIED TxStepOutput_State = 0 + // Tx has not yet been constructed in the backend. + TxStepOutput_STATE_NOT_CONSTRUCTED TxStepOutput_State = 1 + // Tx construction is over in the backend. + TxStepOutput_STATE_CONSTRUCTED TxStepOutput_State = 2 + // Tx is waiting to be signed. + TxStepOutput_STATE_PENDING_SIGNING TxStepOutput_State = 3 + // Tx has been signed and returned to the backend. + TxStepOutput_STATE_SIGNED TxStepOutput_State = 4 + // Tx is being broadcasted to the network. + TxStepOutput_STATE_BROADCASTING TxStepOutput_State = 5 + // Tx is waiting for confirmation. + TxStepOutput_STATE_CONFIRMING TxStepOutput_State = 6 + // Tx has been confirmed to be included in a block. + TxStepOutput_STATE_CONFIRMED TxStepOutput_State = 7 + // Tx has been finalized. + TxStepOutput_STATE_FINALIZED TxStepOutput_State = 8 + // Tx construction or broadcasting failed. + TxStepOutput_STATE_FAILED TxStepOutput_State = 9 + // Tx has been successfully executed. + TxStepOutput_STATE_SUCCESS TxStepOutput_State = 10 + // Tx is waiting to be externally broadcasted by the customer. + TxStepOutput_STATE_PENDING_EXT_BROADCAST TxStepOutput_State = 16 +) + +// Enum value maps for TxStepOutput_State. +var ( + TxStepOutput_State_name = map[int32]string{ + 0: "STATE_UNSPECIFIED", + 1: "STATE_NOT_CONSTRUCTED", + 2: "STATE_CONSTRUCTED", + 3: "STATE_PENDING_SIGNING", + 4: "STATE_SIGNED", + 5: "STATE_BROADCASTING", + 6: "STATE_CONFIRMING", + 7: "STATE_CONFIRMED", + 8: "STATE_FINALIZED", + 9: "STATE_FAILED", + 10: "STATE_SUCCESS", + 16: "STATE_PENDING_EXT_BROADCAST", + } + TxStepOutput_State_value = map[string]int32{ + "STATE_UNSPECIFIED": 0, + "STATE_NOT_CONSTRUCTED": 1, + "STATE_CONSTRUCTED": 2, + "STATE_PENDING_SIGNING": 3, + "STATE_SIGNED": 4, + "STATE_BROADCASTING": 5, + "STATE_CONFIRMING": 6, + "STATE_CONFIRMED": 7, + "STATE_FINALIZED": 8, + "STATE_FAILED": 9, + "STATE_SUCCESS": 10, + "STATE_PENDING_EXT_BROADCAST": 16, + } +) + +func (x TxStepOutput_State) Enum() *TxStepOutput_State { + p := new(TxStepOutput_State) + *p = x + return p +} + +func (x TxStepOutput_State) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (TxStepOutput_State) Descriptor() protoreflect.EnumDescriptor { + return file_coinbase_staking_orchestration_v1_workflow_proto_enumTypes[0].Descriptor() +} + +func (TxStepOutput_State) Type() protoreflect.EnumType { + return &file_coinbase_staking_orchestration_v1_workflow_proto_enumTypes[0] +} + +func (x TxStepOutput_State) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use TxStepOutput_State.Descriptor instead. +func (TxStepOutput_State) EnumDescriptor() ([]byte, []int) { + return file_coinbase_staking_orchestration_v1_workflow_proto_rawDescGZIP(), []int{0, 0} +} + +// The unit of wait time. +type WaitStepOutput_WaitUnit int32 + +const ( + // Unspecified wait time. + WaitStepOutput_WAIT_UNIT_UNSPECIFIED WaitStepOutput_WaitUnit = 0 + // Wait time measured in seconds. + WaitStepOutput_WAIT_UNIT_SECONDS WaitStepOutput_WaitUnit = 1 + // Wait time measured in blocks. + WaitStepOutput_WAIT_UNIT_BLOCKS WaitStepOutput_WaitUnit = 2 + // Wait time measured in epochs. + WaitStepOutput_WAIT_UNIT_EPOCHS WaitStepOutput_WaitUnit = 3 + // Wait time measured in checkpoints. + WaitStepOutput_WAIT_UNIT_CHECKPOINTS WaitStepOutput_WaitUnit = 4 +) + +// Enum value maps for WaitStepOutput_WaitUnit. +var ( + WaitStepOutput_WaitUnit_name = map[int32]string{ + 0: "WAIT_UNIT_UNSPECIFIED", + 1: "WAIT_UNIT_SECONDS", + 2: "WAIT_UNIT_BLOCKS", + 3: "WAIT_UNIT_EPOCHS", + 4: "WAIT_UNIT_CHECKPOINTS", + } + WaitStepOutput_WaitUnit_value = map[string]int32{ + "WAIT_UNIT_UNSPECIFIED": 0, + "WAIT_UNIT_SECONDS": 1, + "WAIT_UNIT_BLOCKS": 2, + "WAIT_UNIT_EPOCHS": 3, + "WAIT_UNIT_CHECKPOINTS": 4, + } +) + +func (x WaitStepOutput_WaitUnit) Enum() *WaitStepOutput_WaitUnit { + p := new(WaitStepOutput_WaitUnit) + *p = x + return p +} + +func (x WaitStepOutput_WaitUnit) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (WaitStepOutput_WaitUnit) Descriptor() protoreflect.EnumDescriptor { + return file_coinbase_staking_orchestration_v1_workflow_proto_enumTypes[1].Descriptor() +} + +func (WaitStepOutput_WaitUnit) Type() protoreflect.EnumType { + return &file_coinbase_staking_orchestration_v1_workflow_proto_enumTypes[1] +} + +func (x WaitStepOutput_WaitUnit) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use WaitStepOutput_WaitUnit.Descriptor instead. +func (WaitStepOutput_WaitUnit) EnumDescriptor() ([]byte, []int) { + return file_coinbase_staking_orchestration_v1_workflow_proto_rawDescGZIP(), []int{1, 0} +} + +// WaitStepState defines an enumeration of states for a wait step. +type WaitStepOutput_State int32 + +const ( + // Unspecified wait step state. + WaitStepOutput_STATE_UNSPECIFIED WaitStepOutput_State = 0 + // Wait step has not started. + WaitStepOutput_STATE_NOT_STARTED WaitStepOutput_State = 1 + // Wait step is in-progress. + WaitStepOutput_STATE_IN_PROGRESS WaitStepOutput_State = 2 + // Wait step completed. + WaitStepOutput_STATE_COMPLETED WaitStepOutput_State = 3 +) + +// Enum value maps for WaitStepOutput_State. +var ( + WaitStepOutput_State_name = map[int32]string{ + 0: "STATE_UNSPECIFIED", + 1: "STATE_NOT_STARTED", + 2: "STATE_IN_PROGRESS", + 3: "STATE_COMPLETED", + } + WaitStepOutput_State_value = map[string]int32{ + "STATE_UNSPECIFIED": 0, + "STATE_NOT_STARTED": 1, + "STATE_IN_PROGRESS": 2, + "STATE_COMPLETED": 3, + } +) + +func (x WaitStepOutput_State) Enum() *WaitStepOutput_State { + p := new(WaitStepOutput_State) + *p = x + return p +} + +func (x WaitStepOutput_State) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (WaitStepOutput_State) Descriptor() protoreflect.EnumDescriptor { + return file_coinbase_staking_orchestration_v1_workflow_proto_enumTypes[2].Descriptor() +} + +func (WaitStepOutput_State) Type() protoreflect.EnumType { + return &file_coinbase_staking_orchestration_v1_workflow_proto_enumTypes[2] +} + +func (x WaitStepOutput_State) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use WaitStepOutput_State.Descriptor instead. +func (WaitStepOutput_State) EnumDescriptor() ([]byte, []int) { + return file_coinbase_staking_orchestration_v1_workflow_proto_rawDescGZIP(), []int{1, 1} +} + +// The state of a workflow +type Workflow_State int32 + +const ( + // Unspecified workflow state, this is for backwards compatibility. + Workflow_STATE_UNSPECIFIED Workflow_State = 0 + // In Progress represents a workflow that is currently in progress. + Workflow_STATE_IN_PROGRESS Workflow_State = 1 + // Waiting for signing represents the workflow is waiting on the consumer to sign and return the corresponding signed tx. + Workflow_STATE_WAITING_FOR_SIGNING Workflow_State = 2 + // Completed represents the workflow has completed. + Workflow_STATE_COMPLETED Workflow_State = 3 + // Failed represents the workflow has failed. + Workflow_STATE_FAILED Workflow_State = 4 + // Waiting for external broadcast represents the workflow is waiting for the customer to broadcast a tx and return its corresponding tx hash. + Workflow_STATE_WAITING_FOR_EXT_BROADCAST Workflow_State = 9 +) + +// Enum value maps for Workflow_State. +var ( + Workflow_State_name = map[int32]string{ + 0: "STATE_UNSPECIFIED", + 1: "STATE_IN_PROGRESS", + 2: "STATE_WAITING_FOR_SIGNING", + 3: "STATE_COMPLETED", + 4: "STATE_FAILED", + 9: "STATE_WAITING_FOR_EXT_BROADCAST", + } + Workflow_State_value = map[string]int32{ + "STATE_UNSPECIFIED": 0, + "STATE_IN_PROGRESS": 1, + "STATE_WAITING_FOR_SIGNING": 2, + "STATE_COMPLETED": 3, + "STATE_FAILED": 4, + "STATE_WAITING_FOR_EXT_BROADCAST": 9, + } +) + +func (x Workflow_State) Enum() *Workflow_State { + p := new(Workflow_State) + *p = x + return p +} + +func (x Workflow_State) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Workflow_State) Descriptor() protoreflect.EnumDescriptor { + return file_coinbase_staking_orchestration_v1_workflow_proto_enumTypes[3].Descriptor() +} + +func (Workflow_State) Type() protoreflect.EnumType { + return &file_coinbase_staking_orchestration_v1_workflow_proto_enumTypes[3] +} + +func (x Workflow_State) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Workflow_State.Descriptor instead. +func (Workflow_State) EnumDescriptor() ([]byte, []int) { + return file_coinbase_staking_orchestration_v1_workflow_proto_rawDescGZIP(), []int{3, 0} +} + +// The details of a transaction being constructed and broadcasted to the network. +type TxStepOutput struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The unsigned transaction which was signed in order to be broadcasted. + UnsignedTx string `protobuf:"bytes,1,opt,name=unsigned_tx,json=unsignedTx,proto3" json:"unsigned_tx,omitempty"` + // The signed transaction which was asked to be broadcasted. + SignedTx string `protobuf:"bytes,2,opt,name=signed_tx,json=signedTx,proto3" json:"signed_tx,omitempty"` + // The hash of the broadcasted transaction. + TxHash string `protobuf:"bytes,3,opt,name=tx_hash,json=txHash,proto3" json:"tx_hash,omitempty"` + // The state of the transaction step. + State TxStepOutput_State `protobuf:"varint,4,opt,name=state,proto3,enum=coinbase.staking.orchestration.v1.TxStepOutput_State" json:"state,omitempty"` + // The error message if the transaction step failed. + ErrorMessage string `protobuf:"bytes,5,opt,name=error_message,json=errorMessage,proto3" json:"error_message,omitempty"` +} + +func (x *TxStepOutput) Reset() { + *x = TxStepOutput{} + if protoimpl.UnsafeEnabled { + mi := &file_coinbase_staking_orchestration_v1_workflow_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TxStepOutput) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TxStepOutput) ProtoMessage() {} + +func (x *TxStepOutput) ProtoReflect() protoreflect.Message { + mi := &file_coinbase_staking_orchestration_v1_workflow_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TxStepOutput.ProtoReflect.Descriptor instead. +func (*TxStepOutput) Descriptor() ([]byte, []int) { + return file_coinbase_staking_orchestration_v1_workflow_proto_rawDescGZIP(), []int{0} +} + +func (x *TxStepOutput) GetUnsignedTx() string { + if x != nil { + return x.UnsignedTx + } + return "" +} + +func (x *TxStepOutput) GetSignedTx() string { + if x != nil { + return x.SignedTx + } + return "" +} + +func (x *TxStepOutput) GetTxHash() string { + if x != nil { + return x.TxHash + } + return "" +} + +func (x *TxStepOutput) GetState() TxStepOutput_State { + if x != nil { + return x.State + } + return TxStepOutput_STATE_UNSPECIFIED +} + +func (x *TxStepOutput) GetErrorMessage() string { + if x != nil { + return x.ErrorMessage + } + return "" +} + +// The output details of a step where we wait for some kind of on-chain activity to finish like reaching a certain checkpoint, epoch or block. +type WaitStepOutput struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The beginning of wait period. + Start int64 `protobuf:"varint,1,opt,name=start,proto3" json:"start,omitempty"` + // The current wait progress. + Current int64 `protobuf:"varint,2,opt,name=current,proto3" json:"current,omitempty"` + // The target wait end point. + Target int64 `protobuf:"varint,3,opt,name=target,proto3" json:"target,omitempty"` + // The wait unit (like checkpoint, block, epoch etc). + Unit WaitStepOutput_WaitUnit `protobuf:"varint,4,opt,name=unit,proto3,enum=coinbase.staking.orchestration.v1.WaitStepOutput_WaitUnit" json:"unit,omitempty"` + // The state of the wait step. + State WaitStepOutput_State `protobuf:"varint,5,opt,name=state,proto3,enum=coinbase.staking.orchestration.v1.WaitStepOutput_State" json:"state,omitempty"` +} + +func (x *WaitStepOutput) Reset() { + *x = WaitStepOutput{} + if protoimpl.UnsafeEnabled { + mi := &file_coinbase_staking_orchestration_v1_workflow_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *WaitStepOutput) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*WaitStepOutput) ProtoMessage() {} + +func (x *WaitStepOutput) ProtoReflect() protoreflect.Message { + mi := &file_coinbase_staking_orchestration_v1_workflow_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use WaitStepOutput.ProtoReflect.Descriptor instead. +func (*WaitStepOutput) Descriptor() ([]byte, []int) { + return file_coinbase_staking_orchestration_v1_workflow_proto_rawDescGZIP(), []int{1} +} + +func (x *WaitStepOutput) GetStart() int64 { + if x != nil { + return x.Start + } + return 0 +} + +func (x *WaitStepOutput) GetCurrent() int64 { + if x != nil { + return x.Current + } + return 0 +} + +func (x *WaitStepOutput) GetTarget() int64 { + if x != nil { + return x.Target + } + return 0 +} + +func (x *WaitStepOutput) GetUnit() WaitStepOutput_WaitUnit { + if x != nil { + return x.Unit + } + return WaitStepOutput_WAIT_UNIT_UNSPECIFIED +} + +func (x *WaitStepOutput) GetState() WaitStepOutput_State { + if x != nil { + return x.State + } + return WaitStepOutput_STATE_UNSPECIFIED +} + +// The information for a step in the workflow. +type WorkflowStep struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The human readable name of the step. + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // The output of the current step. It can be of tx or wait type. + // + // Types that are assignable to Output: + // + // *WorkflowStep_TxStepOutput + // *WorkflowStep_WaitStepOutput + Output isWorkflowStep_Output `protobuf_oneof:"output"` +} + +func (x *WorkflowStep) Reset() { + *x = WorkflowStep{} + if protoimpl.UnsafeEnabled { + mi := &file_coinbase_staking_orchestration_v1_workflow_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *WorkflowStep) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*WorkflowStep) ProtoMessage() {} + +func (x *WorkflowStep) ProtoReflect() protoreflect.Message { + mi := &file_coinbase_staking_orchestration_v1_workflow_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use WorkflowStep.ProtoReflect.Descriptor instead. +func (*WorkflowStep) Descriptor() ([]byte, []int) { + return file_coinbase_staking_orchestration_v1_workflow_proto_rawDescGZIP(), []int{2} +} + +func (x *WorkflowStep) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (m *WorkflowStep) GetOutput() isWorkflowStep_Output { + if m != nil { + return m.Output + } + return nil +} + +func (x *WorkflowStep) GetTxStepOutput() *TxStepOutput { + if x, ok := x.GetOutput().(*WorkflowStep_TxStepOutput); ok { + return x.TxStepOutput + } + return nil +} + +func (x *WorkflowStep) GetWaitStepOutput() *WaitStepOutput { + if x, ok := x.GetOutput().(*WorkflowStep_WaitStepOutput); ok { + return x.WaitStepOutput + } + return nil +} + +type isWorkflowStep_Output interface { + isWorkflowStep_Output() +} + +type WorkflowStep_TxStepOutput struct { + // The tx step output (e.g. transaction metadata such as unsigned tx, signed tx etc). + TxStepOutput *TxStepOutput `protobuf:"bytes,2,opt,name=tx_step_output,json=txStepOutput,proto3,oneof"` +} + +type WorkflowStep_WaitStepOutput struct { + // The waiting details for any kind like how many checkpoints away for unbonding etc. + WaitStepOutput *WaitStepOutput `protobuf:"bytes,3,opt,name=wait_step_output,json=waitStepOutput,proto3,oneof"` +} + +func (*WorkflowStep_TxStepOutput) isWorkflowStep_Output() {} + +func (*WorkflowStep_WaitStepOutput) isWorkflowStep_Output() {} + +// A Workflow resource. +type Workflow struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The resource name of the workflow. + // Format: projects/{projectUUID}/workflows/{workflowUUID} + // Ex: projects/ 123e4567-e89b-12d3-a456-426614174000/workflows/123e4567-e89b-12d3-a456-426614174000 + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // The resource name of the action being + // performed. + // Format: protocols/{protocol}/networks/{network}/actions/{action} + Action string `protobuf:"bytes,2,opt,name=action,proto3" json:"action,omitempty"` + // The parameters of the action to take. + // + // Types that are assignable to StakingParameters: + // + // *Workflow_SolanaStakingParameters + // *Workflow_EthereumKilnStakingParameters + StakingParameters isWorkflow_StakingParameters `protobuf_oneof:"staking_parameters"` + // The current state of the workflow. + State Workflow_State `protobuf:"varint,4,opt,name=state,proto3,enum=coinbase.staking.orchestration.v1.Workflow_State" json:"state,omitempty"` + // The index of the current step. + CurrentStepId int32 `protobuf:"varint,5,opt,name=current_step_id,json=currentStepId,proto3" json:"current_step_id,omitempty"` + // The list of steps for this workflow. + Steps []*WorkflowStep `protobuf:"bytes,6,rep,name=steps,proto3" json:"steps,omitempty"` + // The timestamp the workflow was created. + CreateTime *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"` + // The timestamp the workflow was last updated. + UpdateTime *timestamppb.Timestamp `protobuf:"bytes,8,opt,name=update_time,json=updateTime,proto3" json:"update_time,omitempty"` + // Flag to skip tx broadcast to network on behalf of the user. Use this flag if you instead prefer to broadcast signed txs on your own. + SkipBroadcast bool `protobuf:"varint,11,opt,name=skip_broadcast,json=skipBroadcast,proto3" json:"skip_broadcast,omitempty"` + // The timestamp the workflow completed. + CompleteTime *timestamppb.Timestamp `protobuf:"bytes,12,opt,name=complete_time,json=completeTime,proto3" json:"complete_time,omitempty"` +} + +func (x *Workflow) Reset() { + *x = Workflow{} + if protoimpl.UnsafeEnabled { + mi := &file_coinbase_staking_orchestration_v1_workflow_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Workflow) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Workflow) ProtoMessage() {} + +func (x *Workflow) ProtoReflect() protoreflect.Message { + mi := &file_coinbase_staking_orchestration_v1_workflow_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Workflow.ProtoReflect.Descriptor instead. +func (*Workflow) Descriptor() ([]byte, []int) { + return file_coinbase_staking_orchestration_v1_workflow_proto_rawDescGZIP(), []int{3} +} + +func (x *Workflow) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Workflow) GetAction() string { + if x != nil { + return x.Action + } + return "" +} + +func (m *Workflow) GetStakingParameters() isWorkflow_StakingParameters { + if m != nil { + return m.StakingParameters + } + return nil +} + +func (x *Workflow) GetSolanaStakingParameters() *SolanaStakingParameters { + if x, ok := x.GetStakingParameters().(*Workflow_SolanaStakingParameters); ok { + return x.SolanaStakingParameters + } + return nil +} + +func (x *Workflow) GetEthereumKilnStakingParameters() *EthereumKilnStakingParameters { + if x, ok := x.GetStakingParameters().(*Workflow_EthereumKilnStakingParameters); ok { + return x.EthereumKilnStakingParameters + } + return nil +} + +func (x *Workflow) GetState() Workflow_State { + if x != nil { + return x.State + } + return Workflow_STATE_UNSPECIFIED +} + +func (x *Workflow) GetCurrentStepId() int32 { + if x != nil { + return x.CurrentStepId + } + return 0 +} + +func (x *Workflow) GetSteps() []*WorkflowStep { + if x != nil { + return x.Steps + } + return nil +} + +func (x *Workflow) GetCreateTime() *timestamppb.Timestamp { + if x != nil { + return x.CreateTime + } + return nil +} + +func (x *Workflow) GetUpdateTime() *timestamppb.Timestamp { + if x != nil { + return x.UpdateTime + } + return nil +} + +func (x *Workflow) GetSkipBroadcast() bool { + if x != nil { + return x.SkipBroadcast + } + return false +} + +func (x *Workflow) GetCompleteTime() *timestamppb.Timestamp { + if x != nil { + return x.CompleteTime + } + return nil +} + +type isWorkflow_StakingParameters interface { + isWorkflow_StakingParameters() +} + +type Workflow_SolanaStakingParameters struct { + // Solana staking parameters. + SolanaStakingParameters *SolanaStakingParameters `protobuf:"bytes,9,opt,name=solana_staking_parameters,json=solanaStakingParameters,proto3,oneof"` +} + +type Workflow_EthereumKilnStakingParameters struct { + // EthereumKiln staking parameters. + EthereumKilnStakingParameters *EthereumKilnStakingParameters `protobuf:"bytes,10,opt,name=ethereum_kiln_staking_parameters,json=ethereumKilnStakingParameters,proto3,oneof"` +} + +func (*Workflow_SolanaStakingParameters) isWorkflow_StakingParameters() {} + +func (*Workflow_EthereumKilnStakingParameters) isWorkflow_StakingParameters() {} + +// The request message for CreateWorkflow. +type CreateWorkflowRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The resource name of the parent that owns + // the workflow. + // Format: projects/{project} + Parent string `protobuf:"bytes,1,opt,name=parent,proto3" json:"parent,omitempty"` + // The workflow to create. + Workflow *Workflow `protobuf:"bytes,2,opt,name=workflow,proto3" json:"workflow,omitempty"` +} + +func (x *CreateWorkflowRequest) Reset() { + *x = CreateWorkflowRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_coinbase_staking_orchestration_v1_workflow_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateWorkflowRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateWorkflowRequest) ProtoMessage() {} + +func (x *CreateWorkflowRequest) ProtoReflect() protoreflect.Message { + mi := &file_coinbase_staking_orchestration_v1_workflow_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateWorkflowRequest.ProtoReflect.Descriptor instead. +func (*CreateWorkflowRequest) Descriptor() ([]byte, []int) { + return file_coinbase_staking_orchestration_v1_workflow_proto_rawDescGZIP(), []int{4} +} + +func (x *CreateWorkflowRequest) GetParent() string { + if x != nil { + return x.Parent + } + return "" +} + +func (x *CreateWorkflowRequest) GetWorkflow() *Workflow { + if x != nil { + return x.Workflow + } + return nil +} + +// The message for GetWorkflow. +type GetWorkflowRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The resource name of the workflow. + // Format: projects/{project}/workflows/{workflow} + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` +} + +func (x *GetWorkflowRequest) Reset() { + *x = GetWorkflowRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_coinbase_staking_orchestration_v1_workflow_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetWorkflowRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetWorkflowRequest) ProtoMessage() {} + +func (x *GetWorkflowRequest) ProtoReflect() protoreflect.Message { + mi := &file_coinbase_staking_orchestration_v1_workflow_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetWorkflowRequest.ProtoReflect.Descriptor instead. +func (*GetWorkflowRequest) Descriptor() ([]byte, []int) { + return file_coinbase_staking_orchestration_v1_workflow_proto_rawDescGZIP(), []int{5} +} + +func (x *GetWorkflowRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +// The message for ListWorkflows. +type ListWorkflowsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The resource name of the parent that owns + // the collection of networks. + // Format: projects/{project} + Parent string `protobuf:"bytes,1,opt,name=parent,proto3" json:"parent,omitempty"` + // [AIP-160](https://google.aip.dev/160) filter + // Supported fields: + // - string action: "stake", "unstake" + // - string protocol: "ethereum_kiln" + // - string network: "holesky", "mainnet" + Filter string `protobuf:"bytes,2,opt,name=filter,proto3" json:"filter,omitempty"` + // The maximum number of workflows to return. The service may + // + // return fewer than this value. + // + // If unspecified, 100 workflows will be returned. + // The maximum value is 1000; values over 1000 will be floored to 1000. + PageSize int32 `protobuf:"varint,3,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` + // A page token as part of the response of a previous call. + // Provide this to retrieve the next page. + // + // When paginating, all other parameters must match the previous + // request to list resources. + PageToken string `protobuf:"bytes,4,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"` +} + +func (x *ListWorkflowsRequest) Reset() { + *x = ListWorkflowsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_coinbase_staking_orchestration_v1_workflow_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListWorkflowsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListWorkflowsRequest) ProtoMessage() {} + +func (x *ListWorkflowsRequest) ProtoReflect() protoreflect.Message { + mi := &file_coinbase_staking_orchestration_v1_workflow_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListWorkflowsRequest.ProtoReflect.Descriptor instead. +func (*ListWorkflowsRequest) Descriptor() ([]byte, []int) { + return file_coinbase_staking_orchestration_v1_workflow_proto_rawDescGZIP(), []int{6} +} + +func (x *ListWorkflowsRequest) GetParent() string { + if x != nil { + return x.Parent + } + return "" +} + +func (x *ListWorkflowsRequest) GetFilter() string { + if x != nil { + return x.Filter + } + return "" +} + +func (x *ListWorkflowsRequest) GetPageSize() int32 { + if x != nil { + return x.PageSize + } + return 0 +} + +func (x *ListWorkflowsRequest) GetPageToken() string { + if x != nil { + return x.PageToken + } + return "" +} + +// The response message for ListWorkflows. +type ListWorkflowsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The list of workflows. + Workflows []*Workflow `protobuf:"bytes,1,rep,name=workflows,proto3" json:"workflows,omitempty"` + // A token which can be provided as `page_token` to retrieve the next page. + // If this field is omitted, there are no additional pages. + NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"` +} + +func (x *ListWorkflowsResponse) Reset() { + *x = ListWorkflowsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_coinbase_staking_orchestration_v1_workflow_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListWorkflowsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListWorkflowsResponse) ProtoMessage() {} + +func (x *ListWorkflowsResponse) ProtoReflect() protoreflect.Message { + mi := &file_coinbase_staking_orchestration_v1_workflow_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListWorkflowsResponse.ProtoReflect.Descriptor instead. +func (*ListWorkflowsResponse) Descriptor() ([]byte, []int) { + return file_coinbase_staking_orchestration_v1_workflow_proto_rawDescGZIP(), []int{7} +} + +func (x *ListWorkflowsResponse) GetWorkflows() []*Workflow { + if x != nil { + return x.Workflows + } + return nil +} + +func (x *ListWorkflowsResponse) GetNextPageToken() string { + if x != nil { + return x.NextPageToken + } + return "" +} + +// The request message for PerformWorkflowStep. +type PerformWorkflowStepRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The resource name of the workflow. + // Format: projects/{project}/workflows/{workflow} + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // The index of the step to be performed. + Step int32 `protobuf:"varint,2,opt,name=step,proto3" json:"step,omitempty"` + // Transaction metadata. This is either the signed transaction or transaction hash depending on the workflow's broadcast method. + Data string `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"` +} + +func (x *PerformWorkflowStepRequest) Reset() { + *x = PerformWorkflowStepRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_coinbase_staking_orchestration_v1_workflow_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PerformWorkflowStepRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PerformWorkflowStepRequest) ProtoMessage() {} + +func (x *PerformWorkflowStepRequest) ProtoReflect() protoreflect.Message { + mi := &file_coinbase_staking_orchestration_v1_workflow_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PerformWorkflowStepRequest.ProtoReflect.Descriptor instead. +func (*PerformWorkflowStepRequest) Descriptor() ([]byte, []int) { + return file_coinbase_staking_orchestration_v1_workflow_proto_rawDescGZIP(), []int{8} +} + +func (x *PerformWorkflowStepRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *PerformWorkflowStepRequest) GetStep() int32 { + if x != nil { + return x.Step + } + return 0 +} + +func (x *PerformWorkflowStepRequest) GetData() string { + if x != nil { + return x.Data + } + return "" +} + +var File_coinbase_staking_orchestration_v1_workflow_proto protoreflect.FileDescriptor + +var file_coinbase_staking_orchestration_v1_workflow_proto_rawDesc = []byte{ + 0x0a, 0x30, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x73, 0x74, 0x61, 0x6b, 0x69, + 0x6e, 0x67, 0x2f, 0x6f, 0x72, 0x63, 0x68, 0x65, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x2f, 0x76, 0x31, 0x2f, 0x77, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x12, 0x21, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x61, + 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x63, 0x68, 0x65, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x1a, 0x35, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2f, + 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2f, 0x6f, 0x72, 0x63, 0x68, 0x65, 0x73, 0x74, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, + 0x6d, 0x5f, 0x6b, 0x69, 0x6c, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2e, 0x63, 0x6f, + 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2f, 0x6f, + 0x72, 0x63, 0x68, 0x65, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x2f, + 0x73, 0x6f, 0x6c, 0x61, 0x6e, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x62, + 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, + 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, + 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xf6, 0x04, 0x0a, 0x0c, 0x54, 0x78, + 0x53, 0x74, 0x65, 0x70, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x12, 0x24, 0x0a, 0x0b, 0x75, 0x6e, + 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x5f, 0x74, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, + 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0a, 0x75, 0x6e, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x54, 0x78, + 0x12, 0x20, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x5f, 0x74, 0x78, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x08, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, + 0x54, 0x78, 0x12, 0x1c, 0x0a, 0x07, 0x74, 0x78, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x06, 0x74, 0x78, 0x48, 0x61, 0x73, 0x68, + 0x12, 0x50, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, + 0x35, 0x2e, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, + 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x63, 0x68, 0x65, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x78, 0x53, 0x74, 0x65, 0x70, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, + 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x05, 0x73, 0x74, 0x61, + 0x74, 0x65, 0x12, 0x28, 0x0a, 0x0d, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x6d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0c, + 0x65, 0x72, 0x72, 0x6f, 0x72, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x83, 0x03, 0x0a, + 0x05, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x15, 0x0a, 0x11, 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, + 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x19, 0x0a, + 0x15, 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x43, 0x4f, 0x4e, 0x53, 0x54, + 0x52, 0x55, 0x43, 0x54, 0x45, 0x44, 0x10, 0x01, 0x12, 0x15, 0x0a, 0x11, 0x53, 0x54, 0x41, 0x54, + 0x45, 0x5f, 0x43, 0x4f, 0x4e, 0x53, 0x54, 0x52, 0x55, 0x43, 0x54, 0x45, 0x44, 0x10, 0x02, 0x12, + 0x19, 0x0a, 0x15, 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, 0x50, 0x45, 0x4e, 0x44, 0x49, 0x4e, 0x47, + 0x5f, 0x53, 0x49, 0x47, 0x4e, 0x49, 0x4e, 0x47, 0x10, 0x03, 0x12, 0x10, 0x0a, 0x0c, 0x53, 0x54, + 0x41, 0x54, 0x45, 0x5f, 0x53, 0x49, 0x47, 0x4e, 0x45, 0x44, 0x10, 0x04, 0x12, 0x16, 0x0a, 0x12, + 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, 0x42, 0x52, 0x4f, 0x41, 0x44, 0x43, 0x41, 0x53, 0x54, 0x49, + 0x4e, 0x47, 0x10, 0x05, 0x12, 0x14, 0x0a, 0x10, 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, 0x43, 0x4f, + 0x4e, 0x46, 0x49, 0x52, 0x4d, 0x49, 0x4e, 0x47, 0x10, 0x06, 0x12, 0x13, 0x0a, 0x0f, 0x53, 0x54, + 0x41, 0x54, 0x45, 0x5f, 0x43, 0x4f, 0x4e, 0x46, 0x49, 0x52, 0x4d, 0x45, 0x44, 0x10, 0x07, 0x12, + 0x13, 0x0a, 0x0f, 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, 0x46, 0x49, 0x4e, 0x41, 0x4c, 0x49, 0x5a, + 0x45, 0x44, 0x10, 0x08, 0x12, 0x10, 0x0a, 0x0c, 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, 0x46, 0x41, + 0x49, 0x4c, 0x45, 0x44, 0x10, 0x09, 0x12, 0x11, 0x0a, 0x0d, 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, + 0x53, 0x55, 0x43, 0x43, 0x45, 0x53, 0x53, 0x10, 0x0a, 0x12, 0x1f, 0x0a, 0x1b, 0x53, 0x54, 0x41, + 0x54, 0x45, 0x5f, 0x50, 0x45, 0x4e, 0x44, 0x49, 0x4e, 0x47, 0x5f, 0x45, 0x58, 0x54, 0x5f, 0x42, + 0x52, 0x4f, 0x41, 0x44, 0x43, 0x41, 0x53, 0x54, 0x10, 0x10, 0x22, 0x04, 0x08, 0x0b, 0x10, 0x0f, + 0x2a, 0x0f, 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, 0x43, 0x41, 0x4e, 0x43, 0x45, 0x4c, 0x49, 0x4e, + 0x47, 0x2a, 0x0e, 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, 0x43, 0x41, 0x4e, 0x43, 0x45, 0x4c, 0x45, + 0x44, 0x2a, 0x13, 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, 0x43, 0x41, 0x4e, 0x43, 0x45, 0x4c, 0x5f, + 0x46, 0x41, 0x49, 0x4c, 0x45, 0x44, 0x2a, 0x18, 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, 0x46, 0x41, + 0x49, 0x4c, 0x45, 0x44, 0x5f, 0x52, 0x45, 0x46, 0x52, 0x45, 0x53, 0x48, 0x41, 0x42, 0x4c, 0x45, + 0x2a, 0x10, 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, 0x52, 0x45, 0x46, 0x52, 0x45, 0x53, 0x48, 0x49, + 0x4e, 0x47, 0x22, 0xf9, 0x03, 0x0a, 0x0e, 0x57, 0x61, 0x69, 0x74, 0x53, 0x74, 0x65, 0x70, 0x4f, + 0x75, 0x74, 0x70, 0x75, 0x74, 0x12, 0x19, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x03, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, + 0x12, 0x1d, 0x0a, 0x07, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x03, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x07, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x12, + 0x1b, 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x42, + 0x03, 0xe0, 0x41, 0x03, 0x52, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x53, 0x0a, 0x04, + 0x75, 0x6e, 0x69, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x3a, 0x2e, 0x63, 0x6f, 0x69, + 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x6f, 0x72, + 0x63, 0x68, 0x65, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x57, + 0x61, 0x69, 0x74, 0x53, 0x74, 0x65, 0x70, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x2e, 0x57, 0x61, + 0x69, 0x74, 0x55, 0x6e, 0x69, 0x74, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x04, 0x75, 0x6e, 0x69, + 0x74, 0x12, 0x52, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, + 0x32, 0x37, 0x2e, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x61, 0x6b, + 0x69, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x63, 0x68, 0x65, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x61, 0x69, 0x74, 0x53, 0x74, 0x65, 0x70, 0x4f, 0x75, 0x74, + 0x70, 0x75, 0x74, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x05, + 0x73, 0x74, 0x61, 0x74, 0x65, 0x22, 0x83, 0x01, 0x0a, 0x08, 0x57, 0x61, 0x69, 0x74, 0x55, 0x6e, + 0x69, 0x74, 0x12, 0x19, 0x0a, 0x15, 0x57, 0x41, 0x49, 0x54, 0x5f, 0x55, 0x4e, 0x49, 0x54, 0x5f, + 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x15, 0x0a, + 0x11, 0x57, 0x41, 0x49, 0x54, 0x5f, 0x55, 0x4e, 0x49, 0x54, 0x5f, 0x53, 0x45, 0x43, 0x4f, 0x4e, + 0x44, 0x53, 0x10, 0x01, 0x12, 0x14, 0x0a, 0x10, 0x57, 0x41, 0x49, 0x54, 0x5f, 0x55, 0x4e, 0x49, + 0x54, 0x5f, 0x42, 0x4c, 0x4f, 0x43, 0x4b, 0x53, 0x10, 0x02, 0x12, 0x14, 0x0a, 0x10, 0x57, 0x41, + 0x49, 0x54, 0x5f, 0x55, 0x4e, 0x49, 0x54, 0x5f, 0x45, 0x50, 0x4f, 0x43, 0x48, 0x53, 0x10, 0x03, + 0x12, 0x19, 0x0a, 0x15, 0x57, 0x41, 0x49, 0x54, 0x5f, 0x55, 0x4e, 0x49, 0x54, 0x5f, 0x43, 0x48, + 0x45, 0x43, 0x4b, 0x50, 0x4f, 0x49, 0x4e, 0x54, 0x53, 0x10, 0x04, 0x22, 0x61, 0x0a, 0x05, 0x53, + 0x74, 0x61, 0x74, 0x65, 0x12, 0x15, 0x0a, 0x11, 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, 0x55, 0x4e, + 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x15, 0x0a, 0x11, 0x53, + 0x54, 0x41, 0x54, 0x45, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x53, 0x54, 0x41, 0x52, 0x54, 0x45, 0x44, + 0x10, 0x01, 0x12, 0x15, 0x0a, 0x11, 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, 0x49, 0x4e, 0x5f, 0x50, + 0x52, 0x4f, 0x47, 0x52, 0x45, 0x53, 0x53, 0x10, 0x02, 0x12, 0x13, 0x0a, 0x0f, 0x53, 0x54, 0x41, + 0x54, 0x45, 0x5f, 0x43, 0x4f, 0x4d, 0x50, 0x4c, 0x45, 0x54, 0x45, 0x44, 0x10, 0x03, 0x22, 0xa6, + 0x02, 0x0a, 0x0c, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x53, 0x74, 0x65, 0x70, 0x12, + 0x17, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, + 0x41, 0x03, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x5c, 0x0a, 0x0e, 0x74, 0x78, 0x5f, 0x73, + 0x74, 0x65, 0x70, 0x5f, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x2f, 0x2e, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x61, 0x6b, + 0x69, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x63, 0x68, 0x65, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x78, 0x53, 0x74, 0x65, 0x70, 0x4f, 0x75, 0x74, 0x70, 0x75, + 0x74, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x48, 0x00, 0x52, 0x0c, 0x74, 0x78, 0x53, 0x74, 0x65, 0x70, + 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x12, 0x62, 0x0a, 0x10, 0x77, 0x61, 0x69, 0x74, 0x5f, 0x73, + 0x74, 0x65, 0x70, 0x5f, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x31, 0x2e, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x61, 0x6b, + 0x69, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x63, 0x68, 0x65, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x61, 0x69, 0x74, 0x53, 0x74, 0x65, 0x70, 0x4f, 0x75, 0x74, + 0x70, 0x75, 0x74, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x48, 0x00, 0x52, 0x0e, 0x77, 0x61, 0x69, 0x74, + 0x53, 0x74, 0x65, 0x70, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x3a, 0x31, 0x92, 0x41, 0x2e, 0x0a, + 0x2c, 0x2a, 0x2a, 0x54, 0x68, 0x65, 0x20, 0x69, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x61, 0x20, 0x73, 0x74, 0x65, 0x70, 0x20, 0x69, 0x6e, + 0x20, 0x74, 0x68, 0x65, 0x20, 0x77, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x42, 0x08, 0x0a, + 0x06, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x22, 0x86, 0x09, 0x0a, 0x08, 0x57, 0x6f, 0x72, 0x6b, + 0x66, 0x6c, 0x6f, 0x77, 0x12, 0x17, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1b, 0x0a, + 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, + 0x41, 0x02, 0x52, 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x7d, 0x0a, 0x19, 0x73, 0x6f, + 0x6c, 0x61, 0x6e, 0x61, 0x5f, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x5f, 0x70, 0x61, 0x72, + 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3a, 0x2e, + 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, + 0x2e, 0x6f, 0x72, 0x63, 0x68, 0x65, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, + 0x31, 0x2e, 0x53, 0x6f, 0x6c, 0x61, 0x6e, 0x61, 0x53, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x50, + 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x48, 0x00, + 0x52, 0x17, 0x73, 0x6f, 0x6c, 0x61, 0x6e, 0x61, 0x53, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x50, + 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x12, 0x90, 0x01, 0x0a, 0x20, 0x65, 0x74, + 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x5f, 0x6b, 0x69, 0x6c, 0x6e, 0x5f, 0x73, 0x74, 0x61, 0x6b, + 0x69, 0x6e, 0x67, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x18, 0x0a, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x40, 0x2e, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2e, + 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x63, 0x68, 0x65, 0x73, 0x74, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, + 0x6d, 0x4b, 0x69, 0x6c, 0x6e, 0x53, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x50, 0x61, 0x72, 0x61, + 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x48, 0x00, 0x52, 0x1d, 0x65, + 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x4b, 0x69, 0x6c, 0x6e, 0x53, 0x74, 0x61, 0x6b, 0x69, + 0x6e, 0x67, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x12, 0x4c, 0x0a, 0x05, + 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x31, 0x2e, 0x63, 0x6f, + 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x6f, + 0x72, 0x63, 0x68, 0x65, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, + 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x42, 0x03, + 0xe0, 0x41, 0x03, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x2b, 0x0a, 0x0f, 0x63, 0x75, + 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x74, 0x65, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x05, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0d, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, + 0x74, 0x53, 0x74, 0x65, 0x70, 0x49, 0x64, 0x12, 0x4a, 0x0a, 0x05, 0x73, 0x74, 0x65, 0x70, 0x73, + 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, + 0x65, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x63, 0x68, 0x65, 0x73, + 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x66, + 0x6c, 0x6f, 0x77, 0x53, 0x74, 0x65, 0x70, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x05, 0x73, 0x74, + 0x65, 0x70, 0x73, 0x12, 0x40, 0x0a, 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, + 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, + 0x74, 0x61, 0x6d, 0x70, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x40, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, + 0x74, 0x69, 0x6d, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, + 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0a, 0x75, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x2a, 0x0a, 0x0e, 0x73, 0x6b, 0x69, 0x70, 0x5f, + 0x62, 0x72, 0x6f, 0x61, 0x64, 0x63, 0x61, 0x73, 0x74, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x08, 0x42, + 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0d, 0x73, 0x6b, 0x69, 0x70, 0x42, 0x72, 0x6f, 0x61, 0x64, 0x63, + 0x61, 0x73, 0x74, 0x12, 0x44, 0x0a, 0x0d, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x5f, + 0x74, 0x69, 0x6d, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, + 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0c, 0x63, 0x6f, 0x6d, + 0x70, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x22, 0xf6, 0x01, 0x0a, 0x05, 0x53, 0x74, + 0x61, 0x74, 0x65, 0x12, 0x15, 0x0a, 0x11, 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, 0x55, 0x4e, 0x53, + 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x15, 0x0a, 0x11, 0x53, 0x54, + 0x41, 0x54, 0x45, 0x5f, 0x49, 0x4e, 0x5f, 0x50, 0x52, 0x4f, 0x47, 0x52, 0x45, 0x53, 0x53, 0x10, + 0x01, 0x12, 0x1d, 0x0a, 0x19, 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, 0x57, 0x41, 0x49, 0x54, 0x49, + 0x4e, 0x47, 0x5f, 0x46, 0x4f, 0x52, 0x5f, 0x53, 0x49, 0x47, 0x4e, 0x49, 0x4e, 0x47, 0x10, 0x02, + 0x12, 0x13, 0x0a, 0x0f, 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, 0x43, 0x4f, 0x4d, 0x50, 0x4c, 0x45, + 0x54, 0x45, 0x44, 0x10, 0x03, 0x12, 0x10, 0x0a, 0x0c, 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, 0x46, + 0x41, 0x49, 0x4c, 0x45, 0x44, 0x10, 0x04, 0x12, 0x23, 0x0a, 0x1f, 0x53, 0x54, 0x41, 0x54, 0x45, + 0x5f, 0x57, 0x41, 0x49, 0x54, 0x49, 0x4e, 0x47, 0x5f, 0x46, 0x4f, 0x52, 0x5f, 0x45, 0x58, 0x54, + 0x5f, 0x42, 0x52, 0x4f, 0x41, 0x44, 0x43, 0x41, 0x53, 0x54, 0x10, 0x09, 0x22, 0x04, 0x08, 0x05, + 0x10, 0x08, 0x2a, 0x0f, 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, 0x43, 0x41, 0x4e, 0x43, 0x45, 0x4c, + 0x49, 0x4e, 0x47, 0x2a, 0x0e, 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, 0x43, 0x41, 0x4e, 0x43, 0x45, + 0x4c, 0x45, 0x44, 0x2a, 0x13, 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, 0x43, 0x41, 0x4e, 0x43, 0x45, + 0x4c, 0x5f, 0x46, 0x41, 0x49, 0x4c, 0x45, 0x44, 0x2a, 0x18, 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, + 0x46, 0x41, 0x49, 0x4c, 0x45, 0x44, 0x5f, 0x52, 0x45, 0x46, 0x52, 0x45, 0x53, 0x48, 0x41, 0x42, + 0x4c, 0x45, 0x3a, 0x60, 0xea, 0x41, 0x5d, 0x0a, 0x1d, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, + 0x2e, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x57, 0x6f, + 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x12, 0x27, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, + 0x2f, 0x7b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x7d, 0x2f, 0x77, 0x6f, 0x72, 0x6b, 0x66, + 0x6c, 0x6f, 0x77, 0x73, 0x2f, 0x7b, 0x77, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x7d, 0x2a, + 0x09, 0x77, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x73, 0x32, 0x08, 0x77, 0x6f, 0x72, 0x6b, + 0x66, 0x6c, 0x6f, 0x77, 0x42, 0x14, 0x0a, 0x12, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x5f, + 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x4a, 0x04, 0x08, 0x03, 0x10, 0x04, + 0x22, 0xa4, 0x01, 0x0a, 0x15, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x66, + 0x6c, 0x6f, 0x77, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3d, 0x0a, 0x06, 0x70, 0x61, + 0x72, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x25, 0xe0, 0x41, 0x02, 0xfa, + 0x41, 0x1f, 0x12, 0x1d, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x63, 0x6f, 0x69, 0x6e, + 0x62, 0x61, 0x73, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, + 0x77, 0x52, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x12, 0x4c, 0x0a, 0x08, 0x77, 0x6f, 0x72, + 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x63, 0x6f, + 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x6f, + 0x72, 0x63, 0x68, 0x65, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, + 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x08, 0x77, + 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x22, 0x4f, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x57, 0x6f, + 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x39, 0x0a, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x25, 0xe0, 0x41, 0x02, + 0xfa, 0x41, 0x1f, 0x0a, 0x1d, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x63, 0x6f, 0x69, + 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, + 0x6f, 0x77, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0xb8, 0x01, 0x0a, 0x14, 0x4c, 0x69, 0x73, + 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x3d, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x42, 0x25, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x1f, 0x12, 0x1d, 0x73, 0x74, 0x61, 0x6b, 0x69, + 0x6e, 0x67, 0x2e, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x52, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, + 0x12, 0x1b, 0x0a, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x20, 0x0a, + 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, + 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, + 0x22, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, + 0x6b, 0x65, 0x6e, 0x22, 0x8a, 0x01, 0x0a, 0x15, 0x4c, 0x69, 0x73, 0x74, 0x57, 0x6f, 0x72, 0x6b, + 0x66, 0x6c, 0x6f, 0x77, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x49, 0x0a, + 0x09, 0x77, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x2b, 0x2e, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x61, 0x6b, + 0x69, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x63, 0x68, 0x65, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x52, 0x09, 0x77, + 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, + 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, + 0x22, 0x67, 0x0a, 0x1a, 0x50, 0x65, 0x72, 0x66, 0x6f, 0x72, 0x6d, 0x57, 0x6f, 0x72, 0x6b, 0x66, + 0x6c, 0x6f, 0x77, 0x53, 0x74, 0x65, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, + 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, + 0x02, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x17, 0x0a, 0x04, 0x73, 0x74, 0x65, 0x70, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x05, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x04, 0x73, 0x74, 0x65, 0x70, + 0x12, 0x17, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, + 0xe0, 0x41, 0x02, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x42, 0x58, 0x5a, 0x56, 0x67, 0x69, 0x74, + 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, + 0x2f, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2d, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2d, + 0x6c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x2d, 0x67, 0x6f, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x67, + 0x6f, 0x2f, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x73, 0x74, 0x61, 0x6b, 0x69, + 0x6e, 0x67, 0x2f, 0x6f, 0x72, 0x63, 0x68, 0x65, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_coinbase_staking_orchestration_v1_workflow_proto_rawDescOnce sync.Once + file_coinbase_staking_orchestration_v1_workflow_proto_rawDescData = file_coinbase_staking_orchestration_v1_workflow_proto_rawDesc +) + +func file_coinbase_staking_orchestration_v1_workflow_proto_rawDescGZIP() []byte { + file_coinbase_staking_orchestration_v1_workflow_proto_rawDescOnce.Do(func() { + file_coinbase_staking_orchestration_v1_workflow_proto_rawDescData = protoimpl.X.CompressGZIP(file_coinbase_staking_orchestration_v1_workflow_proto_rawDescData) + }) + return file_coinbase_staking_orchestration_v1_workflow_proto_rawDescData +} + +var file_coinbase_staking_orchestration_v1_workflow_proto_enumTypes = make([]protoimpl.EnumInfo, 4) +var file_coinbase_staking_orchestration_v1_workflow_proto_msgTypes = make([]protoimpl.MessageInfo, 9) +var file_coinbase_staking_orchestration_v1_workflow_proto_goTypes = []interface{}{ + (TxStepOutput_State)(0), // 0: coinbase.staking.orchestration.v1.TxStepOutput.State + (WaitStepOutput_WaitUnit)(0), // 1: coinbase.staking.orchestration.v1.WaitStepOutput.WaitUnit + (WaitStepOutput_State)(0), // 2: coinbase.staking.orchestration.v1.WaitStepOutput.State + (Workflow_State)(0), // 3: coinbase.staking.orchestration.v1.Workflow.State + (*TxStepOutput)(nil), // 4: coinbase.staking.orchestration.v1.TxStepOutput + (*WaitStepOutput)(nil), // 5: coinbase.staking.orchestration.v1.WaitStepOutput + (*WorkflowStep)(nil), // 6: coinbase.staking.orchestration.v1.WorkflowStep + (*Workflow)(nil), // 7: coinbase.staking.orchestration.v1.Workflow + (*CreateWorkflowRequest)(nil), // 8: coinbase.staking.orchestration.v1.CreateWorkflowRequest + (*GetWorkflowRequest)(nil), // 9: coinbase.staking.orchestration.v1.GetWorkflowRequest + (*ListWorkflowsRequest)(nil), // 10: coinbase.staking.orchestration.v1.ListWorkflowsRequest + (*ListWorkflowsResponse)(nil), // 11: coinbase.staking.orchestration.v1.ListWorkflowsResponse + (*PerformWorkflowStepRequest)(nil), // 12: coinbase.staking.orchestration.v1.PerformWorkflowStepRequest + (*SolanaStakingParameters)(nil), // 13: coinbase.staking.orchestration.v1.SolanaStakingParameters + (*EthereumKilnStakingParameters)(nil), // 14: coinbase.staking.orchestration.v1.EthereumKilnStakingParameters + (*timestamppb.Timestamp)(nil), // 15: google.protobuf.Timestamp +} +var file_coinbase_staking_orchestration_v1_workflow_proto_depIdxs = []int32{ + 0, // 0: coinbase.staking.orchestration.v1.TxStepOutput.state:type_name -> coinbase.staking.orchestration.v1.TxStepOutput.State + 1, // 1: coinbase.staking.orchestration.v1.WaitStepOutput.unit:type_name -> coinbase.staking.orchestration.v1.WaitStepOutput.WaitUnit + 2, // 2: coinbase.staking.orchestration.v1.WaitStepOutput.state:type_name -> coinbase.staking.orchestration.v1.WaitStepOutput.State + 4, // 3: coinbase.staking.orchestration.v1.WorkflowStep.tx_step_output:type_name -> coinbase.staking.orchestration.v1.TxStepOutput + 5, // 4: coinbase.staking.orchestration.v1.WorkflowStep.wait_step_output:type_name -> coinbase.staking.orchestration.v1.WaitStepOutput + 13, // 5: coinbase.staking.orchestration.v1.Workflow.solana_staking_parameters:type_name -> coinbase.staking.orchestration.v1.SolanaStakingParameters + 14, // 6: coinbase.staking.orchestration.v1.Workflow.ethereum_kiln_staking_parameters:type_name -> coinbase.staking.orchestration.v1.EthereumKilnStakingParameters + 3, // 7: coinbase.staking.orchestration.v1.Workflow.state:type_name -> coinbase.staking.orchestration.v1.Workflow.State + 6, // 8: coinbase.staking.orchestration.v1.Workflow.steps:type_name -> coinbase.staking.orchestration.v1.WorkflowStep + 15, // 9: coinbase.staking.orchestration.v1.Workflow.create_time:type_name -> google.protobuf.Timestamp + 15, // 10: coinbase.staking.orchestration.v1.Workflow.update_time:type_name -> google.protobuf.Timestamp + 15, // 11: coinbase.staking.orchestration.v1.Workflow.complete_time:type_name -> google.protobuf.Timestamp + 7, // 12: coinbase.staking.orchestration.v1.CreateWorkflowRequest.workflow:type_name -> coinbase.staking.orchestration.v1.Workflow + 7, // 13: coinbase.staking.orchestration.v1.ListWorkflowsResponse.workflows:type_name -> coinbase.staking.orchestration.v1.Workflow + 14, // [14:14] is the sub-list for method output_type + 14, // [14:14] is the sub-list for method input_type + 14, // [14:14] is the sub-list for extension type_name + 14, // [14:14] is the sub-list for extension extendee + 0, // [0:14] is the sub-list for field type_name +} + +func init() { file_coinbase_staking_orchestration_v1_workflow_proto_init() } +func file_coinbase_staking_orchestration_v1_workflow_proto_init() { + if File_coinbase_staking_orchestration_v1_workflow_proto != nil { + return + } + file_coinbase_staking_orchestration_v1_ethereum_kiln_proto_init() + file_coinbase_staking_orchestration_v1_solana_proto_init() + if !protoimpl.UnsafeEnabled { + file_coinbase_staking_orchestration_v1_workflow_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TxStepOutput); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_coinbase_staking_orchestration_v1_workflow_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*WaitStepOutput); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_coinbase_staking_orchestration_v1_workflow_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*WorkflowStep); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_coinbase_staking_orchestration_v1_workflow_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Workflow); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_coinbase_staking_orchestration_v1_workflow_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateWorkflowRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_coinbase_staking_orchestration_v1_workflow_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetWorkflowRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_coinbase_staking_orchestration_v1_workflow_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListWorkflowsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_coinbase_staking_orchestration_v1_workflow_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListWorkflowsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_coinbase_staking_orchestration_v1_workflow_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PerformWorkflowStepRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_coinbase_staking_orchestration_v1_workflow_proto_msgTypes[2].OneofWrappers = []interface{}{ + (*WorkflowStep_TxStepOutput)(nil), + (*WorkflowStep_WaitStepOutput)(nil), + } + file_coinbase_staking_orchestration_v1_workflow_proto_msgTypes[3].OneofWrappers = []interface{}{ + (*Workflow_SolanaStakingParameters)(nil), + (*Workflow_EthereumKilnStakingParameters)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_coinbase_staking_orchestration_v1_workflow_proto_rawDesc, + NumEnums: 4, + NumMessages: 9, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_coinbase_staking_orchestration_v1_workflow_proto_goTypes, + DependencyIndexes: file_coinbase_staking_orchestration_v1_workflow_proto_depIdxs, + EnumInfos: file_coinbase_staking_orchestration_v1_workflow_proto_enumTypes, + MessageInfos: file_coinbase_staking_orchestration_v1_workflow_proto_msgTypes, + }.Build() + File_coinbase_staking_orchestration_v1_workflow_proto = out.File + file_coinbase_staking_orchestration_v1_workflow_proto_rawDesc = nil + file_coinbase_staking_orchestration_v1_workflow_proto_goTypes = nil + file_coinbase_staking_orchestration_v1_workflow_proto_depIdxs = nil +} diff --git a/gen/go/coinbase/staking/orchestration/v1/workflow_aip.go b/gen/go/coinbase/staking/orchestration/v1/workflow_aip.go new file mode 100644 index 0000000..e2dad6f --- /dev/null +++ b/gen/go/coinbase/staking/orchestration/v1/workflow_aip.go @@ -0,0 +1,63 @@ +// Code generated by protoc-gen-go-aip. DO NOT EDIT. +// +// versions: +// protoc-gen-go-aip development +// protoc (unknown) +// source: coinbase/staking/orchestration/v1/workflow.proto + +package v1 + +import ( + fmt "fmt" + resourcename "go.einride.tech/aip/resourcename" + strings "strings" +) + +type WorkflowResourceName struct { + Project string + Workflow string +} + +func (n WorkflowResourceName) Validate() error { + if n.Project == "" { + return fmt.Errorf("project: empty") + } + if strings.IndexByte(n.Project, '/') != -1 { + return fmt.Errorf("project: contains illegal character '/'") + } + if n.Workflow == "" { + return fmt.Errorf("workflow: empty") + } + if strings.IndexByte(n.Workflow, '/') != -1 { + return fmt.Errorf("workflow: contains illegal character '/'") + } + return nil +} + +func (n WorkflowResourceName) ContainsWildcard() bool { + return false || n.Project == "-" || n.Workflow == "-" +} + +func (n WorkflowResourceName) String() string { + return resourcename.Sprint( + "projects/{project}/workflows/{workflow}", + n.Project, + n.Workflow, + ) +} + +func (n WorkflowResourceName) MarshalString() (string, error) { + if err := n.Validate(); err != nil { + return "", err + } + return n.String(), nil +} + +func (n *WorkflowResourceName) UnmarshalString(name string) error { + return resourcename.Sscan( + name, + "projects/{project}/workflows/{workflow}", + &n.Project, + &n.Workflow, + ) +} diff --git a/gen/go/coinbase/staking/rewards/v1/common.pb.go b/gen/go/coinbase/staking/rewards/v1/common.pb.go new file mode 100644 index 0000000..fbda09a --- /dev/null +++ b/gen/go/coinbase/staking/rewards/v1/common.pb.go @@ -0,0 +1,191 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.30.0 +// protoc (unknown) +// source: coinbase/staking/rewards/v1/common.proto + +package v1 + +import ( + _ "google.golang.org/genproto/googleapis/api/annotations" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// Amount encapsulation for a given asset. +type AssetAmount struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The amount of the asset in the most common denomination. + // Ex: ETH (converted from gwei) + // Ex: USD (converted from fractional pennies) + Amount string `protobuf:"bytes,1,opt,name=amount,proto3" json:"amount,omitempty"` + // The number of decimals needed to convert from the raw numeric value to the most + // common denomination. + Exp string `protobuf:"bytes,2,opt,name=exp,proto3" json:"exp,omitempty"` + // The ticker of this asset (ex: USD, ETH, SOL). + Ticker string `protobuf:"bytes,3,opt,name=ticker,proto3" json:"ticker,omitempty"` + // The raw, unadulterated numeric value. + // Ex: Wei (in Ethereum) and Lamports (in Solana). + RawNumeric string `protobuf:"bytes,4,opt,name=raw_numeric,json=rawNumeric,proto3" json:"raw_numeric,omitempty"` +} + +func (x *AssetAmount) Reset() { + *x = AssetAmount{} + if protoimpl.UnsafeEnabled { + mi := &file_coinbase_staking_rewards_v1_common_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AssetAmount) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AssetAmount) ProtoMessage() {} + +func (x *AssetAmount) ProtoReflect() protoreflect.Message { + mi := &file_coinbase_staking_rewards_v1_common_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AssetAmount.ProtoReflect.Descriptor instead. +func (*AssetAmount) Descriptor() ([]byte, []int) { + return file_coinbase_staking_rewards_v1_common_proto_rawDescGZIP(), []int{0} +} + +func (x *AssetAmount) GetAmount() string { + if x != nil { + return x.Amount + } + return "" +} + +func (x *AssetAmount) GetExp() string { + if x != nil { + return x.Exp + } + return "" +} + +func (x *AssetAmount) GetTicker() string { + if x != nil { + return x.Ticker + } + return "" +} + +func (x *AssetAmount) GetRawNumeric() string { + if x != nil { + return x.RawNumeric + } + return "" +} + +var File_coinbase_staking_rewards_v1_common_proto protoreflect.FileDescriptor + +var file_coinbase_staking_rewards_v1_common_proto_rawDesc = []byte{ + 0x0a, 0x28, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x73, 0x74, 0x61, 0x6b, 0x69, + 0x6e, 0x67, 0x2f, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, + 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1b, 0x63, 0x6f, 0x69, 0x6e, + 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x72, 0x65, 0x77, + 0x61, 0x72, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, + 0x61, 0x70, 0x69, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x62, 0x65, 0x68, 0x61, 0x76, 0x69, + 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x84, 0x01, 0x0a, 0x0b, 0x41, 0x73, 0x73, + 0x65, 0x74, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1b, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, + 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x06, 0x61, + 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x15, 0x0a, 0x03, 0x65, 0x78, 0x70, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x03, 0x65, 0x78, 0x70, 0x12, 0x1b, 0x0a, 0x06, + 0x74, 0x69, 0x63, 0x6b, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, + 0x03, 0x52, 0x06, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x72, 0x12, 0x24, 0x0a, 0x0b, 0x72, 0x61, 0x77, + 0x5f, 0x6e, 0x75, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, + 0xe0, 0x41, 0x03, 0x52, 0x0a, 0x72, 0x61, 0x77, 0x4e, 0x75, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x42, + 0x52, 0x5a, 0x50, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, + 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2d, 0x63, + 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2d, 0x6c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x2d, 0x67, 0x6f, + 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x67, 0x6f, 0x2f, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, + 0x2f, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2f, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, + 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_coinbase_staking_rewards_v1_common_proto_rawDescOnce sync.Once + file_coinbase_staking_rewards_v1_common_proto_rawDescData = file_coinbase_staking_rewards_v1_common_proto_rawDesc +) + +func file_coinbase_staking_rewards_v1_common_proto_rawDescGZIP() []byte { + file_coinbase_staking_rewards_v1_common_proto_rawDescOnce.Do(func() { + file_coinbase_staking_rewards_v1_common_proto_rawDescData = protoimpl.X.CompressGZIP(file_coinbase_staking_rewards_v1_common_proto_rawDescData) + }) + return file_coinbase_staking_rewards_v1_common_proto_rawDescData +} + +var file_coinbase_staking_rewards_v1_common_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_coinbase_staking_rewards_v1_common_proto_goTypes = []interface{}{ + (*AssetAmount)(nil), // 0: coinbase.staking.rewards.v1.AssetAmount +} +var file_coinbase_staking_rewards_v1_common_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_coinbase_staking_rewards_v1_common_proto_init() } +func file_coinbase_staking_rewards_v1_common_proto_init() { + if File_coinbase_staking_rewards_v1_common_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_coinbase_staking_rewards_v1_common_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AssetAmount); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_coinbase_staking_rewards_v1_common_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_coinbase_staking_rewards_v1_common_proto_goTypes, + DependencyIndexes: file_coinbase_staking_rewards_v1_common_proto_depIdxs, + MessageInfos: file_coinbase_staking_rewards_v1_common_proto_msgTypes, + }.Build() + File_coinbase_staking_rewards_v1_common_proto = out.File + file_coinbase_staking_rewards_v1_common_proto_rawDesc = nil + file_coinbase_staking_rewards_v1_common_proto_goTypes = nil + file_coinbase_staking_rewards_v1_common_proto_depIdxs = nil +} diff --git a/gen/go/coinbase/staking/rewards/v1/protocol.pb.go b/gen/go/coinbase/staking/rewards/v1/protocol.pb.go new file mode 100644 index 0000000..259dcb4 --- /dev/null +++ b/gen/go/coinbase/staking/rewards/v1/protocol.pb.go @@ -0,0 +1,161 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.30.0 +// protoc (unknown) +// source: coinbase/staking/rewards/v1/protocol.proto + +package v1 + +import ( + _ "google.golang.org/genproto/googleapis/api/annotations" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// A resource for a protocol. +type Protocol struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Name of the protocol (eg. ethereum, solana, cosmos, etc.). + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` +} + +func (x *Protocol) Reset() { + *x = Protocol{} + if protoimpl.UnsafeEnabled { + mi := &file_coinbase_staking_rewards_v1_protocol_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Protocol) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Protocol) ProtoMessage() {} + +func (x *Protocol) ProtoReflect() protoreflect.Message { + mi := &file_coinbase_staking_rewards_v1_protocol_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Protocol.ProtoReflect.Descriptor instead. +func (*Protocol) Descriptor() ([]byte, []int) { + return file_coinbase_staking_rewards_v1_protocol_proto_rawDescGZIP(), []int{0} +} + +func (x *Protocol) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +var File_coinbase_staking_rewards_v1_protocol_proto protoreflect.FileDescriptor + +var file_coinbase_staking_rewards_v1_protocol_proto_rawDesc = []byte{ + 0x0a, 0x2a, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x73, 0x74, 0x61, 0x6b, 0x69, + 0x6e, 0x67, 0x2f, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1b, 0x63, 0x6f, + 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x72, + 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x62, 0x65, 0x68, 0x61, + 0x76, 0x69, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x76, 0x0a, 0x08, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, + 0x6c, 0x12, 0x17, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, + 0x03, 0xe0, 0x41, 0x03, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x3a, 0x51, 0xea, 0x41, 0x4e, 0x0a, + 0x21, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, + 0x67, 0x2e, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x2f, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, + 0x6f, 0x6c, 0x12, 0x14, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x73, 0x2f, 0x7b, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x7d, 0x2a, 0x09, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, + 0x6f, 0x6c, 0x73, 0x32, 0x08, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x42, 0x52, 0x5a, + 0x50, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x69, 0x6e, + 0x62, 0x61, 0x73, 0x65, 0x2f, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2d, 0x63, 0x6c, 0x69, + 0x65, 0x6e, 0x74, 0x2d, 0x6c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x2d, 0x67, 0x6f, 0x2f, 0x67, + 0x65, 0x6e, 0x2f, 0x67, 0x6f, 0x2f, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x73, + 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2f, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x2f, 0x76, + 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_coinbase_staking_rewards_v1_protocol_proto_rawDescOnce sync.Once + file_coinbase_staking_rewards_v1_protocol_proto_rawDescData = file_coinbase_staking_rewards_v1_protocol_proto_rawDesc +) + +func file_coinbase_staking_rewards_v1_protocol_proto_rawDescGZIP() []byte { + file_coinbase_staking_rewards_v1_protocol_proto_rawDescOnce.Do(func() { + file_coinbase_staking_rewards_v1_protocol_proto_rawDescData = protoimpl.X.CompressGZIP(file_coinbase_staking_rewards_v1_protocol_proto_rawDescData) + }) + return file_coinbase_staking_rewards_v1_protocol_proto_rawDescData +} + +var file_coinbase_staking_rewards_v1_protocol_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_coinbase_staking_rewards_v1_protocol_proto_goTypes = []interface{}{ + (*Protocol)(nil), // 0: coinbase.staking.rewards.v1.Protocol +} +var file_coinbase_staking_rewards_v1_protocol_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_coinbase_staking_rewards_v1_protocol_proto_init() } +func file_coinbase_staking_rewards_v1_protocol_proto_init() { + if File_coinbase_staking_rewards_v1_protocol_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_coinbase_staking_rewards_v1_protocol_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Protocol); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_coinbase_staking_rewards_v1_protocol_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_coinbase_staking_rewards_v1_protocol_proto_goTypes, + DependencyIndexes: file_coinbase_staking_rewards_v1_protocol_proto_depIdxs, + MessageInfos: file_coinbase_staking_rewards_v1_protocol_proto_msgTypes, + }.Build() + File_coinbase_staking_rewards_v1_protocol_proto = out.File + file_coinbase_staking_rewards_v1_protocol_proto_rawDesc = nil + file_coinbase_staking_rewards_v1_protocol_proto_goTypes = nil + file_coinbase_staking_rewards_v1_protocol_proto_depIdxs = nil +} diff --git a/gen/go/coinbase/staking/rewards/v1/protocol_aip.go b/gen/go/coinbase/staking/rewards/v1/protocol_aip.go new file mode 100644 index 0000000..b8d4491 --- /dev/null +++ b/gen/go/coinbase/staking/rewards/v1/protocol_aip.go @@ -0,0 +1,54 @@ +// Code generated by protoc-gen-go-aip. DO NOT EDIT. +// +// versions: +// protoc-gen-go-aip development +// protoc (unknown) +// source: coinbase/staking/rewards/v1/protocol.proto + +package v1 + +import ( + fmt "fmt" + resourcename "go.einride.tech/aip/resourcename" + strings "strings" +) + +type ProtocolResourceName struct { + Protocol string +} + +func (n ProtocolResourceName) Validate() error { + if n.Protocol == "" { + return fmt.Errorf("protocol: empty") + } + if strings.IndexByte(n.Protocol, '/') != -1 { + return fmt.Errorf("protocol: contains illegal character '/'") + } + return nil +} + +func (n ProtocolResourceName) ContainsWildcard() bool { + return false || n.Protocol == "-" +} + +func (n ProtocolResourceName) String() string { + return resourcename.Sprint( + "protocols/{protocol}", + n.Protocol, + ) +} + +func (n ProtocolResourceName) MarshalString() (string, error) { + if err := n.Validate(); err != nil { + return "", err + } + return n.String(), nil +} + +func (n *ProtocolResourceName) UnmarshalString(name string) error { + return resourcename.Sscan( + name, + "protocols/{protocol}", + &n.Protocol, + ) +} diff --git a/gen/go/coinbase/staking/rewards/v1/reward.pb.go b/gen/go/coinbase/staking/rewards/v1/reward.pb.go new file mode 100644 index 0000000..5d0e614 --- /dev/null +++ b/gen/go/coinbase/staking/rewards/v1/reward.pb.go @@ -0,0 +1,788 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.30.0 +// protoc (unknown) +// source: coinbase/staking/rewards/v1/reward.proto + +package v1 + +import ( + _ "google.golang.org/genproto/googleapis/api/annotations" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// The unit of time that the reward events were aggregated by. +type AggregationUnit int32 + +const ( + // Aggregation unit is unknown or unspecified. + AggregationUnit_AGGREGATION_UNIT_UNSPECIFIED AggregationUnit = 0 + // Indicates the rewards are aggregated by epoch. This means there will be a 'epoch' field displaying the epoch on this resource. + AggregationUnit_EPOCH AggregationUnit = 1 + // Indicates the rewards are aggregated by day. This means there will be a 'date' field displaying the date on this resource. + AggregationUnit_DAY AggregationUnit = 2 +) + +// Enum value maps for AggregationUnit. +var ( + AggregationUnit_name = map[int32]string{ + 0: "AGGREGATION_UNIT_UNSPECIFIED", + 1: "EPOCH", + 2: "DAY", + } + AggregationUnit_value = map[string]int32{ + "AGGREGATION_UNIT_UNSPECIFIED": 0, + "EPOCH": 1, + "DAY": 2, + } +) + +func (x AggregationUnit) Enum() *AggregationUnit { + p := new(AggregationUnit) + *p = x + return p +} + +func (x AggregationUnit) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (AggregationUnit) Descriptor() protoreflect.EnumDescriptor { + return file_coinbase_staking_rewards_v1_reward_proto_enumTypes[0].Descriptor() +} + +func (AggregationUnit) Type() protoreflect.EnumType { + return &file_coinbase_staking_rewards_v1_reward_proto_enumTypes[0] +} + +func (x AggregationUnit) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use AggregationUnit.Descriptor instead. +func (AggregationUnit) EnumDescriptor() ([]byte, []int) { + return file_coinbase_staking_rewards_v1_reward_proto_rawDescGZIP(), []int{0} +} + +// The source of the USD price conversion. +type USDValue_Source int32 + +const ( + // The USD value source is unknown or unspecified. + USDValue_SOURCE_UNSPECIFIED USDValue_Source = 0 + // The USD value source is the Coinbase exchange. + USDValue_COINBASE_EXCHANGE USDValue_Source = 1 +) + +// Enum value maps for USDValue_Source. +var ( + USDValue_Source_name = map[int32]string{ + 0: "SOURCE_UNSPECIFIED", + 1: "COINBASE_EXCHANGE", + } + USDValue_Source_value = map[string]int32{ + "SOURCE_UNSPECIFIED": 0, + "COINBASE_EXCHANGE": 1, + } +) + +func (x USDValue_Source) Enum() *USDValue_Source { + p := new(USDValue_Source) + *p = x + return p +} + +func (x USDValue_Source) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (USDValue_Source) Descriptor() protoreflect.EnumDescriptor { + return file_coinbase_staking_rewards_v1_reward_proto_enumTypes[1].Descriptor() +} + +func (USDValue_Source) Type() protoreflect.EnumType { + return &file_coinbase_staking_rewards_v1_reward_proto_enumTypes[1] +} + +func (x USDValue_Source) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use USDValue_Source.Descriptor instead. +func (USDValue_Source) EnumDescriptor() ([]byte, []int) { + return file_coinbase_staking_rewards_v1_reward_proto_rawDescGZIP(), []int{1, 0} +} + +// Rewards earned within a particular period of time. +// (-- api-linter: core::0123::resource-name-field=disabled +// +// aip.dev/not-precedent: Not including a 'name' field till our data sources support a unique identifier --) +type Reward struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The address that earned this reward. + Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` + // The period identifier of this reward aggregation. ex: epoch number, date. + // + // Types that are assignable to PeriodIdentifier: + // + // *Reward_Epoch + // *Reward_Date + PeriodIdentifier isReward_PeriodIdentifier `protobuf_oneof:"period_identifier"` + // The unit of time that the reward events were rolled up by. + // Can be either "epoch" or "daily". + AggregationUnit AggregationUnit `protobuf:"varint,4,opt,name=aggregation_unit,json=aggregationUnit,proto3,enum=coinbase.staking.rewards.v1.AggregationUnit" json:"aggregation_unit,omitempty"` + // The starting time of this reward period. Returned when querying by epoch. + // Timestamps are in UTC, conforming to the RFC-3339 spec (e.g. 2024-11-13T19:38:36Z). + // Field currently unavailable. Coming soon. + PeriodStartTime *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=period_start_time,json=periodStartTime,proto3" json:"period_start_time,omitempty"` + // The ending time of this reward period. Returned when querying by epoch. + // Timestamps are in UTC, conforming to the RFC-3339 spec (e.g. 2024-11-13T19:38:36Z). + PeriodEndTime *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=period_end_time,json=periodEndTime,proto3" json:"period_end_time,omitempty"` + // The amount earned in this time period in the native unit of the protocol. + TotalEarnedNativeUnit *AssetAmount `protobuf:"bytes,7,opt,name=total_earned_native_unit,json=totalEarnedNativeUnit,proto3" json:"total_earned_native_unit,omitempty"` + // The amount earned in this time period in USD. Calculated by getting each individual reward of this + // time period and summing the USD value of each individual component. USD value is calculate at + // the time each component was earned. + TotalEarnedUsd []*USDValue `protobuf:"bytes,8,rep,name=total_earned_usd,json=totalEarnedUsd,proto3" json:"total_earned_usd,omitempty"` + // A snapshot of the staking balance the end of this period. + // Field currently unavailable. Coming soon. + EndingBalance *Stake `protobuf:"bytes,9,opt,name=ending_balance,json=endingBalance,proto3" json:"ending_balance,omitempty"` + // The protocol on which this reward was earned. + Protocol string `protobuf:"bytes,11,opt,name=protocol,proto3" json:"protocol,omitempty"` +} + +func (x *Reward) Reset() { + *x = Reward{} + if protoimpl.UnsafeEnabled { + mi := &file_coinbase_staking_rewards_v1_reward_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Reward) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Reward) ProtoMessage() {} + +func (x *Reward) ProtoReflect() protoreflect.Message { + mi := &file_coinbase_staking_rewards_v1_reward_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Reward.ProtoReflect.Descriptor instead. +func (*Reward) Descriptor() ([]byte, []int) { + return file_coinbase_staking_rewards_v1_reward_proto_rawDescGZIP(), []int{0} +} + +func (x *Reward) GetAddress() string { + if x != nil { + return x.Address + } + return "" +} + +func (m *Reward) GetPeriodIdentifier() isReward_PeriodIdentifier { + if m != nil { + return m.PeriodIdentifier + } + return nil +} + +func (x *Reward) GetEpoch() int64 { + if x, ok := x.GetPeriodIdentifier().(*Reward_Epoch); ok { + return x.Epoch + } + return 0 +} + +func (x *Reward) GetDate() string { + if x, ok := x.GetPeriodIdentifier().(*Reward_Date); ok { + return x.Date + } + return "" +} + +func (x *Reward) GetAggregationUnit() AggregationUnit { + if x != nil { + return x.AggregationUnit + } + return AggregationUnit_AGGREGATION_UNIT_UNSPECIFIED +} + +func (x *Reward) GetPeriodStartTime() *timestamppb.Timestamp { + if x != nil { + return x.PeriodStartTime + } + return nil +} + +func (x *Reward) GetPeriodEndTime() *timestamppb.Timestamp { + if x != nil { + return x.PeriodEndTime + } + return nil +} + +func (x *Reward) GetTotalEarnedNativeUnit() *AssetAmount { + if x != nil { + return x.TotalEarnedNativeUnit + } + return nil +} + +func (x *Reward) GetTotalEarnedUsd() []*USDValue { + if x != nil { + return x.TotalEarnedUsd + } + return nil +} + +func (x *Reward) GetEndingBalance() *Stake { + if x != nil { + return x.EndingBalance + } + return nil +} + +func (x *Reward) GetProtocol() string { + if x != nil { + return x.Protocol + } + return "" +} + +type isReward_PeriodIdentifier interface { + isReward_PeriodIdentifier() +} + +type Reward_Epoch struct { + // A unique identifier for the consensus-cycle of the blockchain. + Epoch int64 `protobuf:"varint,13,opt,name=epoch,proto3,oneof"` +} + +type Reward_Date struct { + // The date of the reward in format 'YYYY-MM-DD' in UTC. + // (-- api-linter: core::0142::time-field-type=disabled False positive. This isn't a timestamp, but a YYYY-MM-DD field --) + Date string `protobuf:"bytes,14,opt,name=date,proto3,oneof"` +} + +func (*Reward_Epoch) isReward_PeriodIdentifier() {} + +func (*Reward_Date) isReward_PeriodIdentifier() {} + +// Information regarding the USD value of a reward, with necessary context and metadata. +type USDValue struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The source of the USD price conversion. Could be internal to Coinbase, and external source, or any other source. + Source USDValue_Source `protobuf:"varint,1,opt,name=source,proto3,enum=coinbase.staking.rewards.v1.USDValue_Source" json:"source,omitempty"` + // The timestamp at which the USD value was sourced to convert the value into USD. + // This value is as close to the time the reward was earned as possible. + // Timestamps are in UTC, conforming to the RFC-3339 spec (e.g. 2024-11-13T19:38:36Z). + ConversionTime *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=conversion_time,json=conversionTime,proto3" json:"conversion_time,omitempty"` + // The USD value of the reward at the conversion time. + Amount *AssetAmount `protobuf:"bytes,3,opt,name=amount,proto3" json:"amount,omitempty"` + // The price of the native unit at the conversion time. + ConversionPrice string `protobuf:"bytes,4,opt,name=conversion_price,json=conversionPrice,proto3" json:"conversion_price,omitempty"` +} + +func (x *USDValue) Reset() { + *x = USDValue{} + if protoimpl.UnsafeEnabled { + mi := &file_coinbase_staking_rewards_v1_reward_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *USDValue) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*USDValue) ProtoMessage() {} + +func (x *USDValue) ProtoReflect() protoreflect.Message { + mi := &file_coinbase_staking_rewards_v1_reward_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use USDValue.ProtoReflect.Descriptor instead. +func (*USDValue) Descriptor() ([]byte, []int) { + return file_coinbase_staking_rewards_v1_reward_proto_rawDescGZIP(), []int{1} +} + +func (x *USDValue) GetSource() USDValue_Source { + if x != nil { + return x.Source + } + return USDValue_SOURCE_UNSPECIFIED +} + +func (x *USDValue) GetConversionTime() *timestamppb.Timestamp { + if x != nil { + return x.ConversionTime + } + return nil +} + +func (x *USDValue) GetAmount() *AssetAmount { + if x != nil { + return x.Amount + } + return nil +} + +func (x *USDValue) GetConversionPrice() string { + if x != nil { + return x.ConversionPrice + } + return "" +} + +// The request message for ListRewards. +type ListRewardsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The protocol that the rewards were earned on. + // The response will only include rewards for the protocol specified here. + Parent string `protobuf:"bytes,1,opt,name=parent,proto3" json:"parent,omitempty"` + // The maximum number of items to return. Maximum size of this value is 500. + // If user supplies a value > 500, the API will truncate to 500. + PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` + // A page token as part of the response of a previous call. + // Provide this to retrieve the next page. + // + // When paginating, all other parameters must match the previous + // request to list resources correctly. + PageToken string `protobuf:"bytes,3,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"` + // [AIP-160](https://google.aip.dev/160) format compliant filter. Supported protocols are 'ethereum', 'solana', and 'cosmos'. + // Supplying other protocols will return an error. + // * **Ethereum**: + // - Fields: + // - `address` - A ethereum validator public key. + // - `date` - A date in format 'YYYY-MM-DD'. Supports multiple comparisons (ex: '2024-01-15). + // - `period_end_time` - A timestamp in RFC-3339 format. Supports multiple comparisons (ex: '2024-01-01T00:00:00Z' and '2024-01-15T00:00:00Z'). + // - Example(s): + // - `"address='0xac53512c39d0081ca4437c285305eb423f474e6153693c12fbba4a3df78bcaa3422b31d800c5bea71c1b017168a60474' AND date >= '2024-01-01' AND date < '2024-01-15'"` + // - `"address='0xac53512c39d0081ca4437c285305eb423f474e6153693c12fbba4a3df78bcaa3422b31d800c5bea71c1b017168a60474' AND period_end_time >= '2024-01-01T00:00:00Z' AND period_end_time < '2024-01-15T00:00:00Z'"` + // - `"address='0xac53512c39d0081ca4437c285305eb423f474e6153693c12fbba4a3df78bcaa3422b31d800c5bea71c1b017168a60474' AND date = '2024-01-01'"` + // + // * **Solana**: + // - Fields: + // - `address` - A solana validator or delegator address. + // - `epoch` - A solana epoch. Supports epoch comparisons (ex: `epoch >= 1000 AND epoch <= 2000`). + // - `period_end_time` - A timestamp in RFC-3339 format. Supports multiple comparisons (ex: '2024-01-01T00:00:00Z' and '2024-01-15T00:00:00Z'). + // - Example(s): + // - `"address='beefKGBWeSpHzYBHZXwp5So7wdQGX6mu4ZHCsH3uTar' AND epoch >= 540 AND epoch < 550"` + // - `"address='beefKGBWeSpHzYBHZXwp5So7wdQGX6mu4ZHCsH3uTar' AND period_end_time >= '2024-01-01T00:00:00Z' AND period_end_time < '2024-01-15T00:00:00Z'"` + // - `"address='beefKGBWeSpHzYBHZXwp5So7wdQGX6mu4ZHCsH3uTar' AND epoch = 550"` + // + // * **Cosmos**: + // - Fields: + // - `address` - A cosmos validator or delegator address (ex: `cosmosvaloper1c4k24jzduc365kywrsvf5ujz4ya6mwympnc4en` and `cosmos1c4k24jzduc365kywrsvf5ujz4ya6mwymy8vq4q`) + // - `date` - A date in format 'YYYY-MM-DD'. Supports multiple comparisons (ex: '2024-01-15). + // - `period_end_time` - A timestamp in RFC-3339 format. Supports multiple comparisons (ex: '2024-01-01T00:00:00Z' and '2024-01-15T00:00:00Z'). + // - Example(s): + // - `"address='cosmos1mfduj0qax6ut8rd6cfc4j0ds06z0mwlhrljhqh' AND date = '2024-11-16'"` + // - `"address='cosmos1mfduj0qax6ut8rd6cfc4j0ds06z0mwlhrljhqh' AND period_end_time >= '2024-01-01T00:00:00Z' AND period_end_time < '2024-01-15T00:00:00Z'"` + // - `"address='cosmos1mfduj0qax6ut8rd6cfc4j0ds06z0mwlhrljhqh' AND date = '2024-01-01'"` + Filter string `protobuf:"bytes,4,opt,name=filter,proto3" json:"filter,omitempty"` +} + +func (x *ListRewardsRequest) Reset() { + *x = ListRewardsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_coinbase_staking_rewards_v1_reward_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListRewardsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListRewardsRequest) ProtoMessage() {} + +func (x *ListRewardsRequest) ProtoReflect() protoreflect.Message { + mi := &file_coinbase_staking_rewards_v1_reward_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListRewardsRequest.ProtoReflect.Descriptor instead. +func (*ListRewardsRequest) Descriptor() ([]byte, []int) { + return file_coinbase_staking_rewards_v1_reward_proto_rawDescGZIP(), []int{2} +} + +func (x *ListRewardsRequest) GetParent() string { + if x != nil { + return x.Parent + } + return "" +} + +func (x *ListRewardsRequest) GetPageSize() int32 { + if x != nil { + return x.PageSize + } + return 0 +} + +func (x *ListRewardsRequest) GetPageToken() string { + if x != nil { + return x.PageToken + } + return "" +} + +func (x *ListRewardsRequest) GetFilter() string { + if x != nil { + return x.Filter + } + return "" +} + +// The response message for ListRewards. +type ListRewardsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The rewards returned in this response. + Rewards []*Reward `protobuf:"bytes,1,rep,name=rewards,proto3" json:"rewards,omitempty"` + // The page token the user must use in the next request if the next page is desired. + NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"` +} + +func (x *ListRewardsResponse) Reset() { + *x = ListRewardsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_coinbase_staking_rewards_v1_reward_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListRewardsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListRewardsResponse) ProtoMessage() {} + +func (x *ListRewardsResponse) ProtoReflect() protoreflect.Message { + mi := &file_coinbase_staking_rewards_v1_reward_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListRewardsResponse.ProtoReflect.Descriptor instead. +func (*ListRewardsResponse) Descriptor() ([]byte, []int) { + return file_coinbase_staking_rewards_v1_reward_proto_rawDescGZIP(), []int{3} +} + +func (x *ListRewardsResponse) GetRewards() []*Reward { + if x != nil { + return x.Rewards + } + return nil +} + +func (x *ListRewardsResponse) GetNextPageToken() string { + if x != nil { + return x.NextPageToken + } + return "" +} + +var File_coinbase_staking_rewards_v1_reward_proto protoreflect.FileDescriptor + +var file_coinbase_staking_rewards_v1_reward_proto_rawDesc = []byte{ + 0x0a, 0x28, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x73, 0x74, 0x61, 0x6b, 0x69, + 0x6e, 0x67, 0x2f, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x65, + 0x77, 0x61, 0x72, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1b, 0x63, 0x6f, 0x69, 0x6e, + 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x72, 0x65, 0x77, + 0x61, 0x72, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x1a, 0x28, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, + 0x65, 0x2f, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2f, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, + 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x1a, 0x27, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x73, 0x74, 0x61, 0x6b, + 0x69, 0x6e, 0x67, 0x2f, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x73, + 0x74, 0x61, 0x6b, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x62, 0x65, 0x68, + 0x61, 0x76, 0x69, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, + 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x83, 0x06, 0x0a, 0x06, 0x52, 0x65, 0x77, 0x61, + 0x72, 0x64, 0x12, 0x1d, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x12, 0x1b, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x03, + 0x42, 0x03, 0xe0, 0x41, 0x03, 0x48, 0x00, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x19, + 0x0a, 0x04, 0x64, 0x61, 0x74, 0x65, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, + 0x03, 0x48, 0x00, 0x52, 0x04, 0x64, 0x61, 0x74, 0x65, 0x12, 0x5c, 0x0a, 0x10, 0x61, 0x67, 0x67, + 0x72, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x0e, 0x32, 0x2c, 0x2e, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, + 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x2e, 0x76, + 0x31, 0x2e, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x55, 0x6e, 0x69, + 0x74, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0f, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x55, 0x6e, 0x69, 0x74, 0x12, 0x4b, 0x0a, 0x11, 0x70, 0x65, 0x72, 0x69, 0x6f, + 0x64, 0x5f, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x03, + 0xe0, 0x41, 0x03, 0x52, 0x0f, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x53, 0x74, 0x61, 0x72, 0x74, + 0x54, 0x69, 0x6d, 0x65, 0x12, 0x47, 0x0a, 0x0f, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x5f, 0x65, + 0x6e, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0d, + 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x45, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x66, 0x0a, + 0x18, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x65, 0x61, 0x72, 0x6e, 0x65, 0x64, 0x5f, 0x6e, 0x61, + 0x74, 0x69, 0x76, 0x65, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x28, 0x2e, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, + 0x6e, 0x67, 0x2e, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x73, + 0x73, 0x65, 0x74, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x15, + 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x45, 0x61, 0x72, 0x6e, 0x65, 0x64, 0x4e, 0x61, 0x74, 0x69, 0x76, + 0x65, 0x55, 0x6e, 0x69, 0x74, 0x12, 0x54, 0x0a, 0x10, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x65, + 0x61, 0x72, 0x6e, 0x65, 0x64, 0x5f, 0x75, 0x73, 0x64, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x25, 0x2e, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, + 0x6e, 0x67, 0x2e, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x53, + 0x44, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0e, 0x74, 0x6f, 0x74, + 0x61, 0x6c, 0x45, 0x61, 0x72, 0x6e, 0x65, 0x64, 0x55, 0x73, 0x64, 0x12, 0x4e, 0x0a, 0x0e, 0x65, + 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x09, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, + 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x2e, 0x76, + 0x31, 0x2e, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0d, 0x65, 0x6e, + 0x64, 0x69, 0x6e, 0x67, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x1f, 0x0a, 0x08, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, + 0x41, 0x03, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x3a, 0x5c, 0xea, 0x41, + 0x59, 0x0a, 0x1f, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x61, 0x6b, + 0x69, 0x6e, 0x67, 0x2e, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x2f, 0x52, 0x65, 0x77, 0x61, + 0x72, 0x64, 0x12, 0x25, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x73, 0x2f, 0x7b, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x7d, 0x2f, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, + 0x2f, 0x7b, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x7d, 0x2a, 0x07, 0x72, 0x65, 0x77, 0x61, 0x72, + 0x64, 0x73, 0x32, 0x06, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x42, 0x13, 0x0a, 0x11, 0x70, 0x65, + 0x72, 0x69, 0x6f, 0x64, 0x5f, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x4a, + 0x04, 0x08, 0x03, 0x10, 0x04, 0x52, 0x06, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x22, 0xcf, 0x02, + 0x0a, 0x08, 0x55, 0x53, 0x44, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x49, 0x0a, 0x06, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2c, 0x2e, 0x63, 0x6f, 0x69, + 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x72, 0x65, + 0x77, 0x61, 0x72, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x53, 0x44, 0x56, 0x61, 0x6c, 0x75, + 0x65, 0x2e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x06, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x48, 0x0a, 0x0f, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, + 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, + 0x0e, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x12, + 0x45, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x28, 0x2e, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, + 0x6e, 0x67, 0x2e, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x73, + 0x73, 0x65, 0x74, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x06, + 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x2e, 0x0a, 0x10, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, + 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, + 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0f, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, + 0x6e, 0x50, 0x72, 0x69, 0x63, 0x65, 0x22, 0x37, 0x0a, 0x06, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x12, 0x16, 0x0a, 0x12, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, + 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x15, 0x0a, 0x11, 0x43, 0x4f, 0x49, 0x4e, + 0x42, 0x41, 0x53, 0x45, 0x5f, 0x45, 0x58, 0x43, 0x48, 0x41, 0x4e, 0x47, 0x45, 0x10, 0x01, 0x22, + 0xba, 0x01, 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x41, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x29, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x23, 0x0a, 0x21, + 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, + 0x2e, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x2f, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, + 0x6c, 0x52, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x12, 0x20, 0x0a, 0x09, 0x70, 0x61, 0x67, + 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x42, 0x03, 0xe0, 0x41, + 0x01, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x22, 0x0a, 0x0a, 0x70, + 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, + 0x03, 0xe0, 0x41, 0x01, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, + 0x1b, 0x0a, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, + 0x03, 0xe0, 0x41, 0x01, 0x52, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x22, 0x86, 0x01, 0x0a, + 0x13, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x42, 0x0a, 0x07, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, + 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, + 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, + 0x07, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x12, 0x2b, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, + 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, + 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x2a, 0x47, 0x0a, 0x0f, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x55, 0x6e, 0x69, 0x74, 0x12, 0x20, 0x0a, 0x1c, 0x41, 0x47, 0x47, 0x52, + 0x45, 0x47, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x49, 0x54, 0x5f, 0x55, 0x4e, 0x53, + 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x45, 0x50, + 0x4f, 0x43, 0x48, 0x10, 0x01, 0x12, 0x07, 0x0a, 0x03, 0x44, 0x41, 0x59, 0x10, 0x02, 0x42, 0x52, + 0x5a, 0x50, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x69, + 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2d, 0x63, 0x6c, + 0x69, 0x65, 0x6e, 0x74, 0x2d, 0x6c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x2d, 0x67, 0x6f, 0x2f, + 0x67, 0x65, 0x6e, 0x2f, 0x67, 0x6f, 0x2f, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2f, + 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2f, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x2f, + 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_coinbase_staking_rewards_v1_reward_proto_rawDescOnce sync.Once + file_coinbase_staking_rewards_v1_reward_proto_rawDescData = file_coinbase_staking_rewards_v1_reward_proto_rawDesc +) + +func file_coinbase_staking_rewards_v1_reward_proto_rawDescGZIP() []byte { + file_coinbase_staking_rewards_v1_reward_proto_rawDescOnce.Do(func() { + file_coinbase_staking_rewards_v1_reward_proto_rawDescData = protoimpl.X.CompressGZIP(file_coinbase_staking_rewards_v1_reward_proto_rawDescData) + }) + return file_coinbase_staking_rewards_v1_reward_proto_rawDescData +} + +var file_coinbase_staking_rewards_v1_reward_proto_enumTypes = make([]protoimpl.EnumInfo, 2) +var file_coinbase_staking_rewards_v1_reward_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_coinbase_staking_rewards_v1_reward_proto_goTypes = []interface{}{ + (AggregationUnit)(0), // 0: coinbase.staking.rewards.v1.AggregationUnit + (USDValue_Source)(0), // 1: coinbase.staking.rewards.v1.USDValue.Source + (*Reward)(nil), // 2: coinbase.staking.rewards.v1.Reward + (*USDValue)(nil), // 3: coinbase.staking.rewards.v1.USDValue + (*ListRewardsRequest)(nil), // 4: coinbase.staking.rewards.v1.ListRewardsRequest + (*ListRewardsResponse)(nil), // 5: coinbase.staking.rewards.v1.ListRewardsResponse + (*timestamppb.Timestamp)(nil), // 6: google.protobuf.Timestamp + (*AssetAmount)(nil), // 7: coinbase.staking.rewards.v1.AssetAmount + (*Stake)(nil), // 8: coinbase.staking.rewards.v1.Stake +} +var file_coinbase_staking_rewards_v1_reward_proto_depIdxs = []int32{ + 0, // 0: coinbase.staking.rewards.v1.Reward.aggregation_unit:type_name -> coinbase.staking.rewards.v1.AggregationUnit + 6, // 1: coinbase.staking.rewards.v1.Reward.period_start_time:type_name -> google.protobuf.Timestamp + 6, // 2: coinbase.staking.rewards.v1.Reward.period_end_time:type_name -> google.protobuf.Timestamp + 7, // 3: coinbase.staking.rewards.v1.Reward.total_earned_native_unit:type_name -> coinbase.staking.rewards.v1.AssetAmount + 3, // 4: coinbase.staking.rewards.v1.Reward.total_earned_usd:type_name -> coinbase.staking.rewards.v1.USDValue + 8, // 5: coinbase.staking.rewards.v1.Reward.ending_balance:type_name -> coinbase.staking.rewards.v1.Stake + 1, // 6: coinbase.staking.rewards.v1.USDValue.source:type_name -> coinbase.staking.rewards.v1.USDValue.Source + 6, // 7: coinbase.staking.rewards.v1.USDValue.conversion_time:type_name -> google.protobuf.Timestamp + 7, // 8: coinbase.staking.rewards.v1.USDValue.amount:type_name -> coinbase.staking.rewards.v1.AssetAmount + 2, // 9: coinbase.staking.rewards.v1.ListRewardsResponse.rewards:type_name -> coinbase.staking.rewards.v1.Reward + 10, // [10:10] is the sub-list for method output_type + 10, // [10:10] is the sub-list for method input_type + 10, // [10:10] is the sub-list for extension type_name + 10, // [10:10] is the sub-list for extension extendee + 0, // [0:10] is the sub-list for field type_name +} + +func init() { file_coinbase_staking_rewards_v1_reward_proto_init() } +func file_coinbase_staking_rewards_v1_reward_proto_init() { + if File_coinbase_staking_rewards_v1_reward_proto != nil { + return + } + file_coinbase_staking_rewards_v1_common_proto_init() + file_coinbase_staking_rewards_v1_stake_proto_init() + if !protoimpl.UnsafeEnabled { + file_coinbase_staking_rewards_v1_reward_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Reward); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_coinbase_staking_rewards_v1_reward_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*USDValue); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_coinbase_staking_rewards_v1_reward_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListRewardsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_coinbase_staking_rewards_v1_reward_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListRewardsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_coinbase_staking_rewards_v1_reward_proto_msgTypes[0].OneofWrappers = []interface{}{ + (*Reward_Epoch)(nil), + (*Reward_Date)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_coinbase_staking_rewards_v1_reward_proto_rawDesc, + NumEnums: 2, + NumMessages: 4, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_coinbase_staking_rewards_v1_reward_proto_goTypes, + DependencyIndexes: file_coinbase_staking_rewards_v1_reward_proto_depIdxs, + EnumInfos: file_coinbase_staking_rewards_v1_reward_proto_enumTypes, + MessageInfos: file_coinbase_staking_rewards_v1_reward_proto_msgTypes, + }.Build() + File_coinbase_staking_rewards_v1_reward_proto = out.File + file_coinbase_staking_rewards_v1_reward_proto_rawDesc = nil + file_coinbase_staking_rewards_v1_reward_proto_goTypes = nil + file_coinbase_staking_rewards_v1_reward_proto_depIdxs = nil +} diff --git a/gen/go/coinbase/staking/rewards/v1/reward_aip.go b/gen/go/coinbase/staking/rewards/v1/reward_aip.go new file mode 100644 index 0000000..dbb7053 --- /dev/null +++ b/gen/go/coinbase/staking/rewards/v1/reward_aip.go @@ -0,0 +1,78 @@ +// Code generated by protoc-gen-go-aip. DO NOT EDIT. +// +// versions: +// protoc-gen-go-aip development +// protoc (unknown) +// source: coinbase/staking/rewards/v1/reward.proto + +package v1 + +import ( + fmt "fmt" + resourcename "go.einride.tech/aip/resourcename" + strings "strings" +) + +type RewardResourceName struct { + Protocol string + Reward string +} + +func (n ProtocolResourceName) RewardResourceName( + reward string, +) RewardResourceName { + return RewardResourceName{ + Protocol: n.Protocol, + Reward: reward, + } +} + +func (n RewardResourceName) Validate() error { + if n.Protocol == "" { + return fmt.Errorf("protocol: empty") + } + if strings.IndexByte(n.Protocol, '/') != -1 { + return fmt.Errorf("protocol: contains illegal character '/'") + } + if n.Reward == "" { + return fmt.Errorf("reward: empty") + } + if strings.IndexByte(n.Reward, '/') != -1 { + return fmt.Errorf("reward: contains illegal character '/'") + } + return nil +} + +func (n RewardResourceName) ContainsWildcard() bool { + return false || n.Protocol == "-" || n.Reward == "-" +} + +func (n RewardResourceName) String() string { + return resourcename.Sprint( + "protocols/{protocol}/rewards/{reward}", + n.Protocol, + n.Reward, + ) +} + +func (n RewardResourceName) MarshalString() (string, error) { + if err := n.Validate(); err != nil { + return "", err + } + return n.String(), nil +} + +func (n *RewardResourceName) UnmarshalString(name string) error { + return resourcename.Sscan( + name, + "protocols/{protocol}/rewards/{reward}", + &n.Protocol, + &n.Reward, + ) +} + +func (n RewardResourceName) ProtocolResourceName() ProtocolResourceName { + return ProtocolResourceName{ + Protocol: n.Protocol, + } +} diff --git a/gen/go/coinbase/staking/rewards/v1/reward_service.pb.go b/gen/go/coinbase/staking/rewards/v1/reward_service.pb.go new file mode 100644 index 0000000..69de992 --- /dev/null +++ b/gen/go/coinbase/staking/rewards/v1/reward_service.pb.go @@ -0,0 +1,244 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.30.0 +// protoc (unknown) +// source: coinbase/staking/rewards/v1/reward_service.proto + +package v1 + +import ( + _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" + _ "google.golang.org/genproto/googleapis/api/annotations" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +var File_coinbase_staking_rewards_v1_reward_service_proto protoreflect.FileDescriptor + +var file_coinbase_staking_rewards_v1_reward_service_proto_rawDesc = []byte{ + 0x0a, 0x30, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x73, 0x74, 0x61, 0x6b, 0x69, + 0x6e, 0x67, 0x2f, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x65, + 0x77, 0x61, 0x72, 0x64, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x12, 0x1b, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x61, + 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x1a, + 0x28, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, + 0x67, 0x2f, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x65, 0x77, + 0x61, 0x72, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x27, 0x63, 0x6f, 0x69, 0x6e, 0x62, + 0x61, 0x73, 0x65, 0x2f, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2f, 0x72, 0x65, 0x77, 0x61, + 0x72, 0x64, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, + 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x1a, 0x17, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6c, 0x69, + 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, + 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x32, 0x84, 0x0e, 0x0a, 0x0d, 0x52, 0x65, + 0x77, 0x61, 0x72, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0xdd, 0x09, 0x0a, 0x0b, + 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x12, 0x2f, 0x2e, 0x63, 0x6f, + 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x72, + 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, + 0x77, 0x61, 0x72, 0x64, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x30, 0x2e, 0x63, + 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, + 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, + 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xea, + 0x08, 0x92, 0x41, 0xb5, 0x08, 0x0a, 0x06, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x12, 0x17, 0x4c, + 0x69, 0x73, 0x74, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x20, 0x72, + 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x1a, 0x80, 0x01, 0x4c, 0x69, 0x73, 0x74, 0x73, 0x20, 0x6f, + 0x6e, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x20, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x20, 0x6f, + 0x66, 0x20, 0x61, 0x6e, 0x20, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x20, 0x66, 0x6f, 0x72, + 0x20, 0x61, 0x20, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x20, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x63, 0x6f, 0x6c, 0x2c, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x61, 0x6c, 0x20, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x20, 0x66, 0x6f, 0x72, 0x20, + 0x74, 0x69, 0x6d, 0x65, 0x20, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x2c, 0x20, 0x61, 0x67, 0x67, 0x72, + 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x2c, 0x20, + 0x61, 0x6e, 0x64, 0x20, 0x6d, 0x6f, 0x72, 0x65, 0x2e, 0x4a, 0xf5, 0x05, 0x0a, 0x03, 0x32, 0x30, + 0x30, 0x12, 0xed, 0x05, 0x0a, 0x02, 0x4f, 0x4b, 0x12, 0xe6, 0x05, 0x32, 0xe3, 0x05, 0x7b, 0x22, + 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x22, 0x3a, 0x5b, 0x7b, 0x22, 0x61, 0x64, 0x64, 0x72, + 0x65, 0x73, 0x73, 0x22, 0x3a, 0x22, 0x62, 0x65, 0x65, 0x66, 0x4b, 0x47, 0x42, 0x57, 0x65, 0x53, + 0x70, 0x48, 0x7a, 0x59, 0x42, 0x48, 0x5a, 0x58, 0x77, 0x70, 0x35, 0x53, 0x6f, 0x37, 0x77, 0x64, + 0x51, 0x47, 0x58, 0x36, 0x6d, 0x75, 0x34, 0x5a, 0x48, 0x43, 0x73, 0x48, 0x33, 0x75, 0x54, 0x61, + 0x72, 0x22, 0x2c, 0x22, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x22, 0x3a, 0x22, 0x35, 0x33, 0x33, 0x22, + 0x2c, 0x22, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x55, 0x6e, 0x69, + 0x74, 0x22, 0x3a, 0x22, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x22, 0x2c, 0x22, 0x70, 0x65, 0x72, 0x69, + 0x6f, 0x64, 0x53, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x22, 0x3a, 0x6e, 0x75, 0x6c, + 0x6c, 0x2c, 0x22, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x45, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, + 0x22, 0x3a, 0x22, 0x32, 0x30, 0x32, 0x33, 0x2d, 0x31, 0x31, 0x2d, 0x31, 0x36, 0x54, 0x30, 0x30, + 0x3a, 0x31, 0x33, 0x3a, 0x34, 0x34, 0x5a, 0x22, 0x2c, 0x22, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x45, + 0x61, 0x72, 0x6e, 0x65, 0x64, 0x4e, 0x61, 0x74, 0x69, 0x76, 0x65, 0x55, 0x6e, 0x69, 0x74, 0x22, + 0x3a, 0x7b, 0x22, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x3a, 0x22, 0x32, 0x32, 0x34, 0x2e, + 0x37, 0x30, 0x39, 0x38, 0x31, 0x34, 0x35, 0x22, 0x2c, 0x22, 0x65, 0x78, 0x70, 0x22, 0x3a, 0x22, + 0x39, 0x22, 0x2c, 0x22, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x72, 0x22, 0x3a, 0x22, 0x53, 0x4f, 0x4c, + 0x22, 0x2c, 0x22, 0x72, 0x61, 0x77, 0x4e, 0x75, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x22, 0x3a, 0x22, + 0x32, 0x32, 0x34, 0x37, 0x30, 0x39, 0x38, 0x31, 0x34, 0x35, 0x30, 0x39, 0x22, 0x7d, 0x2c, 0x22, + 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x45, 0x61, 0x72, 0x6e, 0x65, 0x64, 0x55, 0x73, 0x64, 0x22, 0x3a, + 0x6e, 0x75, 0x6c, 0x6c, 0x2c, 0x22, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x42, 0x61, 0x6c, 0x61, + 0x6e, 0x63, 0x65, 0x22, 0x3a, 0x6e, 0x75, 0x6c, 0x6c, 0x2c, 0x22, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x63, 0x6f, 0x6c, 0x22, 0x3a, 0x22, 0x73, 0x6f, 0x6c, 0x61, 0x6e, 0x61, 0x22, 0x7d, 0x2c, 0x7b, + 0x22, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x3a, 0x22, 0x62, 0x65, 0x65, 0x66, 0x4b, + 0x47, 0x42, 0x57, 0x65, 0x53, 0x70, 0x48, 0x7a, 0x59, 0x42, 0x48, 0x5a, 0x58, 0x77, 0x70, 0x35, + 0x53, 0x6f, 0x37, 0x77, 0x64, 0x51, 0x47, 0x58, 0x36, 0x6d, 0x75, 0x34, 0x5a, 0x48, 0x43, 0x73, + 0x48, 0x33, 0x75, 0x54, 0x61, 0x72, 0x22, 0x2c, 0x22, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x22, 0x3a, + 0x22, 0x35, 0x33, 0x32, 0x22, 0x2c, 0x22, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x55, 0x6e, 0x69, 0x74, 0x22, 0x3a, 0x22, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x22, 0x2c, + 0x22, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x53, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, + 0x22, 0x3a, 0x6e, 0x75, 0x6c, 0x6c, 0x2c, 0x22, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x45, 0x6e, + 0x64, 0x54, 0x69, 0x6d, 0x65, 0x22, 0x3a, 0x22, 0x32, 0x30, 0x32, 0x33, 0x2d, 0x31, 0x31, 0x2d, + 0x31, 0x33, 0x54, 0x31, 0x39, 0x3a, 0x33, 0x38, 0x3a, 0x33, 0x36, 0x5a, 0x22, 0x2c, 0x22, 0x74, + 0x6f, 0x74, 0x61, 0x6c, 0x45, 0x61, 0x72, 0x6e, 0x65, 0x64, 0x4e, 0x61, 0x74, 0x69, 0x76, 0x65, + 0x55, 0x6e, 0x69, 0x74, 0x22, 0x3a, 0x7b, 0x22, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x3a, + 0x22, 0x32, 0x32, 0x35, 0x2e, 0x30, 0x37, 0x39, 0x34, 0x32, 0x34, 0x31, 0x22, 0x2c, 0x22, 0x65, + 0x78, 0x70, 0x22, 0x3a, 0x22, 0x39, 0x22, 0x2c, 0x22, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x72, 0x22, + 0x3a, 0x22, 0x53, 0x4f, 0x4c, 0x22, 0x2c, 0x22, 0x72, 0x61, 0x77, 0x4e, 0x75, 0x6d, 0x65, 0x72, + 0x69, 0x63, 0x22, 0x3a, 0x22, 0x32, 0x32, 0x35, 0x30, 0x37, 0x39, 0x34, 0x32, 0x34, 0x30, 0x39, + 0x34, 0x22, 0x7d, 0x2c, 0x22, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x45, 0x61, 0x72, 0x6e, 0x65, 0x64, + 0x55, 0x73, 0x64, 0x22, 0x3a, 0x6e, 0x75, 0x6c, 0x6c, 0x2c, 0x22, 0x65, 0x6e, 0x64, 0x69, 0x6e, + 0x67, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x22, 0x3a, 0x6e, 0x75, 0x6c, 0x6c, 0x2c, 0x22, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x22, 0x3a, 0x22, 0x73, 0x6f, 0x6c, 0x61, 0x6e, + 0x61, 0x22, 0x7d, 0x5d, 0x2c, 0x22, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, + 0x6b, 0x65, 0x6e, 0x22, 0x3a, 0x22, 0x56, 0x41, 0x71, 0x6c, 0x2d, 0x77, 0x74, 0x64, 0x69, 0x4a, + 0x57, 0x6b, 0x57, 0x49, 0x49, 0x39, 0x62, 0x4a, 0x42, 0x44, 0x6e, 0x45, 0x39, 0x6f, 0x45, 0x63, + 0x2d, 0x38, 0x49, 0x6c, 0x67, 0x55, 0x30, 0x44, 0x74, 0x4b, 0x62, 0x78, 0x53, 0x44, 0x74, 0x42, + 0x67, 0x3d, 0x3a, 0x31, 0x3a, 0x31, 0x37, 0x30, 0x30, 0x32, 0x34, 0x31, 0x32, 0x37, 0x37, 0x22, + 0x7d, 0x4a, 0x96, 0x01, 0x0a, 0x03, 0x34, 0x30, 0x30, 0x12, 0x8e, 0x01, 0x0a, 0x2c, 0x54, 0x68, + 0x65, 0x20, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x20, 0x61, 0x74, 0x74, 0x65, 0x6d, 0x70, + 0x74, 0x65, 0x64, 0x20, 0x68, 0x61, 0x73, 0x20, 0x69, 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x20, + 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x12, 0x5e, 0x32, 0x5c, 0x7b, 0x22, + 0x63, 0x6f, 0x64, 0x65, 0x22, 0x3a, 0x33, 0x2c, 0x22, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x22, 0x3a, 0x22, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x20, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x66, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x2e, 0x20, 0x3c, 0x52, 0x65, + 0x6d, 0x65, 0x64, 0x69, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x61, 0x73, 0x73, 0x69, 0x73, 0x74, + 0x61, 0x6e, 0x63, 0x65, 0x20, 0x68, 0x65, 0x72, 0x65, 0x3e, 0x2e, 0x22, 0x2c, 0x22, 0x64, 0x65, + 0x74, 0x61, 0x69, 0x6c, 0x73, 0x22, 0x3a, 0x5b, 0x5d, 0x7d, 0xda, 0x41, 0x06, 0x70, 0x61, 0x72, + 0x65, 0x6e, 0x74, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x22, 0x12, 0x20, 0x2f, 0x76, 0x31, 0x2f, 0x7b, + 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x3d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x73, + 0x2f, 0x2a, 0x7d, 0x2f, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x12, 0xf3, 0x03, 0x0a, 0x0a, + 0x4c, 0x69, 0x73, 0x74, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x73, 0x12, 0x2e, 0x2e, 0x63, 0x6f, 0x69, + 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x72, 0x65, + 0x77, 0x61, 0x72, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x74, 0x61, + 0x6b, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2f, 0x2e, 0x63, 0x6f, 0x69, + 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x72, 0x65, + 0x77, 0x61, 0x72, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x74, 0x61, + 0x6b, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x83, 0x03, 0x92, 0x41, + 0xcf, 0x02, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x12, 0x20, 0x4c, 0x69, 0x73, 0x74, 0x20, + 0x61, 0x6e, 0x64, 0x20, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x20, 0x73, 0x74, 0x61, 0x6b, 0x69, + 0x6e, 0x67, 0x20, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x1a, 0x56, 0x4c, 0x69, 0x73, + 0x74, 0x73, 0x20, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x20, 0x62, 0x61, 0x6c, 0x61, 0x6e, + 0x63, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x61, 0x20, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, + 0x2c, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, + 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x74, 0x69, 0x6d, 0x65, + 0x20, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x61, 0x64, 0x64, 0x72, 0x65, + 0x73, 0x73, 0x2e, 0x4a, 0x33, 0x0a, 0x03, 0x32, 0x30, 0x30, 0x12, 0x2c, 0x0a, 0x02, 0x4f, 0x4b, + 0x12, 0x26, 0x0a, 0x24, 0x1a, 0x22, 0x23, 0x2f, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x2f, 0x76, 0x31, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x4a, 0x96, 0x01, 0x0a, 0x03, 0x34, 0x30, 0x30, + 0x12, 0x8e, 0x01, 0x0a, 0x2c, 0x54, 0x68, 0x65, 0x20, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x20, 0x61, 0x74, 0x74, 0x65, 0x6d, 0x70, 0x74, 0x65, 0x64, 0x20, 0x68, 0x61, 0x73, 0x20, 0x69, + 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x20, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, + 0x73, 0x12, 0x5e, 0x32, 0x5c, 0x7b, 0x22, 0x63, 0x6f, 0x64, 0x65, 0x22, 0x3a, 0x33, 0x2c, 0x22, + 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x3a, 0x22, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, + 0x20, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x66, 0x61, 0x69, 0x6c, + 0x65, 0x64, 0x2e, 0x20, 0x3c, 0x52, 0x65, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x20, 0x61, 0x73, 0x73, 0x69, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x20, 0x68, 0x65, 0x72, 0x65, + 0x3e, 0x2e, 0x22, 0x2c, 0x22, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x22, 0x3a, 0x5b, 0x5d, + 0x7d, 0xda, 0x41, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x21, + 0x12, 0x1f, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x3d, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x73, 0x74, 0x61, 0x6b, 0x65, + 0x73, 0x1a, 0x1d, 0xca, 0x41, 0x1a, 0x61, 0x70, 0x69, 0x2e, 0x64, 0x65, 0x76, 0x65, 0x6c, 0x6f, + 0x70, 0x65, 0x72, 0x2e, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x63, 0x6f, 0x6d, + 0x42, 0xa7, 0x05, 0x92, 0x41, 0xd1, 0x04, 0x12, 0x5d, 0x0a, 0x0f, 0x52, 0x65, 0x77, 0x61, 0x72, + 0x64, 0x73, 0x20, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x46, 0x53, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, + 0x73, 0x20, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x20, 0x74, 0x6f, 0x20, 0x6f, 0x6e, 0x63, 0x68, + 0x61, 0x69, 0x6e, 0x2c, 0x20, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2d, 0x72, 0x65, 0x6c, + 0x61, 0x74, 0x65, 0x64, 0x20, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x20, 0x64, 0x61, 0x74, + 0x61, 0x2e, 0x32, 0x02, 0x76, 0x31, 0x1a, 0x1a, 0x61, 0x70, 0x69, 0x2e, 0x64, 0x65, 0x76, 0x65, + 0x6c, 0x6f, 0x70, 0x65, 0x72, 0x2e, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x63, + 0x6f, 0x6d, 0x22, 0x08, 0x2f, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x2a, 0x01, 0x02, 0x32, + 0x10, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6a, 0x73, 0x6f, + 0x6e, 0x3a, 0x10, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6a, + 0x73, 0x6f, 0x6e, 0x52, 0x4c, 0x0a, 0x03, 0x34, 0x30, 0x31, 0x12, 0x45, 0x0a, 0x31, 0x52, 0x65, + 0x74, 0x75, 0x72, 0x6e, 0x65, 0x64, 0x20, 0x69, 0x66, 0x20, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, + 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x69, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x69, 0x73, 0x20, 0x69, 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x12, + 0x10, 0x32, 0x0e, 0x22, 0x55, 0x6e, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, + 0x22, 0x52, 0x76, 0x0a, 0x03, 0x35, 0x30, 0x30, 0x12, 0x6f, 0x0a, 0x2f, 0x52, 0x65, 0x74, 0x75, + 0x72, 0x6e, 0x65, 0x64, 0x20, 0x77, 0x68, 0x65, 0x6e, 0x20, 0x61, 0x6e, 0x20, 0x69, 0x6e, 0x74, + 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x20, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x65, 0x72, 0x72, + 0x6f, 0x72, 0x20, 0x68, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x73, 0x2e, 0x12, 0x3c, 0x32, 0x3a, 0x7b, + 0x22, 0x63, 0x6f, 0x64, 0x65, 0x22, 0x3a, 0x33, 0x2c, 0x22, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x22, 0x3a, 0x22, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x20, 0x73, 0x65, 0x72, + 0x76, 0x65, 0x72, 0x20, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x2e, 0x22, 0x2c, 0x22, 0x64, 0x65, 0x74, + 0x61, 0x69, 0x6c, 0x73, 0x22, 0x3a, 0x5b, 0x5d, 0x7d, 0x6a, 0x6c, 0x0a, 0x06, 0x52, 0x65, 0x77, + 0x61, 0x72, 0x64, 0x12, 0x62, 0x41, 0x20, 0x68, 0x69, 0x67, 0x68, 0x2d, 0x6c, 0x65, 0x76, 0x65, + 0x6c, 0x20, 0x76, 0x69, 0x65, 0x77, 0x20, 0x6f, 0x66, 0x20, 0x61, 0x6e, 0x20, 0x61, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 0x27, 0x73, 0x20, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x20, 0x61, + 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x64, 0x20, 0x6f, 0x76, 0x65, 0x72, 0x20, 0x73, + 0x6f, 0x6d, 0x65, 0x20, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x69, + 0x6d, 0x65, 0x20, 0x28, 0x65, 0x78, 0x3a, 0x20, 0x6f, 0x76, 0x65, 0x72, 0x20, 0x61, 0x6e, 0x20, + 0x45, 0x70, 0x6f, 0x63, 0x68, 0x29, 0x2e, 0x6a, 0x6f, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x6b, 0x65, + 0x12, 0x66, 0x41, 0x20, 0x73, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x20, 0x6f, 0x66, 0x20, + 0x61, 0x6e, 0x20, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x27, 0x73, 0x20, 0x73, 0x74, 0x61, + 0x6b, 0x69, 0x6e, 0x67, 0x2d, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x65, 0x64, 0x20, 0x62, 0x61, 0x6c, + 0x61, 0x6e, 0x63, 0x65, 0x20, 0x61, 0x74, 0x20, 0x61, 0x20, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, + 0x75, 0x6c, 0x61, 0x72, 0x20, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x69, + 0x6d, 0x65, 0x2e, 0x20, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x20, 0x63, 0x6f, 0x6d, 0x69, + 0x6e, 0x67, 0x20, 0x73, 0x6f, 0x6f, 0x6e, 0x2e, 0x5a, 0x50, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x73, 0x74, + 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2d, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2d, 0x6c, 0x69, 0x62, + 0x72, 0x61, 0x72, 0x79, 0x2d, 0x67, 0x6f, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x67, 0x6f, 0x2f, 0x63, + 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2f, + 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, +} + +var file_coinbase_staking_rewards_v1_reward_service_proto_goTypes = []interface{}{ + (*ListRewardsRequest)(nil), // 0: coinbase.staking.rewards.v1.ListRewardsRequest + (*ListStakesRequest)(nil), // 1: coinbase.staking.rewards.v1.ListStakesRequest + (*ListRewardsResponse)(nil), // 2: coinbase.staking.rewards.v1.ListRewardsResponse + (*ListStakesResponse)(nil), // 3: coinbase.staking.rewards.v1.ListStakesResponse +} +var file_coinbase_staking_rewards_v1_reward_service_proto_depIdxs = []int32{ + 0, // 0: coinbase.staking.rewards.v1.RewardService.ListRewards:input_type -> coinbase.staking.rewards.v1.ListRewardsRequest + 1, // 1: coinbase.staking.rewards.v1.RewardService.ListStakes:input_type -> coinbase.staking.rewards.v1.ListStakesRequest + 2, // 2: coinbase.staking.rewards.v1.RewardService.ListRewards:output_type -> coinbase.staking.rewards.v1.ListRewardsResponse + 3, // 3: coinbase.staking.rewards.v1.RewardService.ListStakes:output_type -> coinbase.staking.rewards.v1.ListStakesResponse + 2, // [2:4] is the sub-list for method output_type + 0, // [0:2] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_coinbase_staking_rewards_v1_reward_service_proto_init() } +func file_coinbase_staking_rewards_v1_reward_service_proto_init() { + if File_coinbase_staking_rewards_v1_reward_service_proto != nil { + return + } + file_coinbase_staking_rewards_v1_reward_proto_init() + file_coinbase_staking_rewards_v1_stake_proto_init() + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_coinbase_staking_rewards_v1_reward_service_proto_rawDesc, + NumEnums: 0, + NumMessages: 0, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_coinbase_staking_rewards_v1_reward_service_proto_goTypes, + DependencyIndexes: file_coinbase_staking_rewards_v1_reward_service_proto_depIdxs, + }.Build() + File_coinbase_staking_rewards_v1_reward_service_proto = out.File + file_coinbase_staking_rewards_v1_reward_service_proto_rawDesc = nil + file_coinbase_staking_rewards_v1_reward_service_proto_goTypes = nil + file_coinbase_staking_rewards_v1_reward_service_proto_depIdxs = nil +} diff --git a/gen/go/coinbase/staking/rewards/v1/reward_service.pb.gw.go b/gen/go/coinbase/staking/rewards/v1/reward_service.pb.gw.go new file mode 100644 index 0000000..8922b61 --- /dev/null +++ b/gen/go/coinbase/staking/rewards/v1/reward_service.pb.gw.go @@ -0,0 +1,328 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: coinbase/staking/rewards/v1/reward_service.proto + +/* +Package v1 is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package v1 + +import ( + "context" + "io" + "net/http" + + "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" + "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" + "google.golang.org/protobuf/proto" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = metadata.Join + +var ( + filter_RewardService_ListRewards_0 = &utilities.DoubleArray{Encoding: map[string]int{"parent": 0}, Base: []int{1, 2, 0, 0}, Check: []int{0, 1, 2, 2}} +) + +func request_RewardService_ListRewards_0(ctx context.Context, marshaler runtime.Marshaler, client RewardServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ListRewardsRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["parent"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "parent") + } + + protoReq.Parent, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "parent", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_RewardService_ListRewards_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.ListRewards(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_RewardService_ListRewards_0(ctx context.Context, marshaler runtime.Marshaler, server RewardServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ListRewardsRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["parent"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "parent") + } + + protoReq.Parent, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "parent", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_RewardService_ListRewards_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.ListRewards(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_RewardService_ListStakes_0 = &utilities.DoubleArray{Encoding: map[string]int{"parent": 0}, Base: []int{1, 2, 0, 0}, Check: []int{0, 1, 2, 2}} +) + +func request_RewardService_ListStakes_0(ctx context.Context, marshaler runtime.Marshaler, client RewardServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ListStakesRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["parent"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "parent") + } + + protoReq.Parent, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "parent", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_RewardService_ListStakes_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.ListStakes(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_RewardService_ListStakes_0(ctx context.Context, marshaler runtime.Marshaler, server RewardServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ListStakesRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["parent"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "parent") + } + + protoReq.Parent, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "parent", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_RewardService_ListStakes_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.ListStakes(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterRewardServiceHandlerServer registers the http handlers for service RewardService to "mux". +// UnaryRPC :call RewardServiceServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterRewardServiceHandlerFromEndpoint instead. +func RegisterRewardServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server RewardServiceServer) error { + + mux.Handle("GET", pattern_RewardService_ListRewards_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/coinbase.staking.rewards.v1.RewardService/ListRewards", runtime.WithHTTPPathPattern("/v1/{parent=protocols/*}/rewards")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_RewardService_ListRewards_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_RewardService_ListRewards_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_RewardService_ListStakes_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/coinbase.staking.rewards.v1.RewardService/ListStakes", runtime.WithHTTPPathPattern("/v1/{parent=protocols/*}/stakes")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_RewardService_ListStakes_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_RewardService_ListStakes_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterRewardServiceHandlerFromEndpoint is same as RegisterRewardServiceHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterRewardServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.DialContext(ctx, endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterRewardServiceHandler(ctx, mux, conn) +} + +// RegisterRewardServiceHandler registers the http handlers for service RewardService to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterRewardServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterRewardServiceHandlerClient(ctx, mux, NewRewardServiceClient(conn)) +} + +// RegisterRewardServiceHandlerClient registers the http handlers for service RewardService +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "RewardServiceClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "RewardServiceClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "RewardServiceClient" to call the correct interceptors. +func RegisterRewardServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client RewardServiceClient) error { + + mux.Handle("GET", pattern_RewardService_ListRewards_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/coinbase.staking.rewards.v1.RewardService/ListRewards", runtime.WithHTTPPathPattern("/v1/{parent=protocols/*}/rewards")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_RewardService_ListRewards_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_RewardService_ListRewards_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_RewardService_ListStakes_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/coinbase.staking.rewards.v1.RewardService/ListStakes", runtime.WithHTTPPathPattern("/v1/{parent=protocols/*}/stakes")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_RewardService_ListStakes_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_RewardService_ListStakes_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_RewardService_ListRewards_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 2, 5, 2, 2, 3}, []string{"v1", "protocols", "parent", "rewards"}, "")) + + pattern_RewardService_ListStakes_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 2, 5, 2, 2, 3}, []string{"v1", "protocols", "parent", "stakes"}, "")) +) + +var ( + forward_RewardService_ListRewards_0 = runtime.ForwardResponseMessage + + forward_RewardService_ListStakes_0 = runtime.ForwardResponseMessage +) diff --git a/gen/go/coinbase/staking/rewards/v1/reward_service_grpc.pb.go b/gen/go/coinbase/staking/rewards/v1/reward_service_grpc.pb.go new file mode 100644 index 0000000..2204c99 --- /dev/null +++ b/gen/go/coinbase/staking/rewards/v1/reward_service_grpc.pb.go @@ -0,0 +1,150 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc (unknown) +// source: coinbase/staking/rewards/v1/reward_service.proto + +package v1 + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + RewardService_ListRewards_FullMethodName = "/coinbase.staking.rewards.v1.RewardService/ListRewards" + RewardService_ListStakes_FullMethodName = "/coinbase.staking.rewards.v1.RewardService/ListStakes" +) + +// RewardServiceClient is the client API for RewardService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type RewardServiceClient interface { + // List rewards for a given protocol. + ListRewards(ctx context.Context, in *ListRewardsRequest, opts ...grpc.CallOption) (*ListRewardsResponse, error) + // List staking activities for a given protocol. + ListStakes(ctx context.Context, in *ListStakesRequest, opts ...grpc.CallOption) (*ListStakesResponse, error) +} + +type rewardServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewRewardServiceClient(cc grpc.ClientConnInterface) RewardServiceClient { + return &rewardServiceClient{cc} +} + +func (c *rewardServiceClient) ListRewards(ctx context.Context, in *ListRewardsRequest, opts ...grpc.CallOption) (*ListRewardsResponse, error) { + out := new(ListRewardsResponse) + err := c.cc.Invoke(ctx, RewardService_ListRewards_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *rewardServiceClient) ListStakes(ctx context.Context, in *ListStakesRequest, opts ...grpc.CallOption) (*ListStakesResponse, error) { + out := new(ListStakesResponse) + err := c.cc.Invoke(ctx, RewardService_ListStakes_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// RewardServiceServer is the server API for RewardService service. +// All implementations must embed UnimplementedRewardServiceServer +// for forward compatibility +type RewardServiceServer interface { + // List rewards for a given protocol. + ListRewards(context.Context, *ListRewardsRequest) (*ListRewardsResponse, error) + // List staking activities for a given protocol. + ListStakes(context.Context, *ListStakesRequest) (*ListStakesResponse, error) + mustEmbedUnimplementedRewardServiceServer() +} + +// UnimplementedRewardServiceServer must be embedded to have forward compatible implementations. +type UnimplementedRewardServiceServer struct { +} + +func (UnimplementedRewardServiceServer) ListRewards(context.Context, *ListRewardsRequest) (*ListRewardsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListRewards not implemented") +} +func (UnimplementedRewardServiceServer) ListStakes(context.Context, *ListStakesRequest) (*ListStakesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListStakes not implemented") +} +func (UnimplementedRewardServiceServer) mustEmbedUnimplementedRewardServiceServer() {} + +// UnsafeRewardServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to RewardServiceServer will +// result in compilation errors. +type UnsafeRewardServiceServer interface { + mustEmbedUnimplementedRewardServiceServer() +} + +func RegisterRewardServiceServer(s grpc.ServiceRegistrar, srv RewardServiceServer) { + s.RegisterService(&RewardService_ServiceDesc, srv) +} + +func _RewardService_ListRewards_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListRewardsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RewardServiceServer).ListRewards(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: RewardService_ListRewards_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RewardServiceServer).ListRewards(ctx, req.(*ListRewardsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _RewardService_ListStakes_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListStakesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RewardServiceServer).ListStakes(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: RewardService_ListStakes_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RewardServiceServer).ListStakes(ctx, req.(*ListStakesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// RewardService_ServiceDesc is the grpc.ServiceDesc for RewardService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var RewardService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "coinbase.staking.rewards.v1.RewardService", + HandlerType: (*RewardServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ListRewards", + Handler: _RewardService_ListRewards_Handler, + }, + { + MethodName: "ListStakes", + Handler: _RewardService_ListStakes_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "coinbase/staking/rewards/v1/reward_service.proto", +} diff --git a/gen/go/coinbase/staking/rewards/v1/stake.pb.go b/gen/go/coinbase/staking/rewards/v1/stake.pb.go new file mode 100644 index 0000000..901bba3 --- /dev/null +++ b/gen/go/coinbase/staking/rewards/v1/stake.pb.go @@ -0,0 +1,865 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.30.0 +// protoc (unknown) +// source: coinbase/staking/rewards/v1/stake.proto + +package v1 + +import ( + _ "google.golang.org/genproto/googleapis/api/annotations" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + _ "google.golang.org/protobuf/types/descriptorpb" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// The participant type of a staking-related address. +type ParticipantType int32 + +const ( + // The participant type is unknown. + ParticipantType_PARTICIPANT_TYPE_UNSPECIFIED ParticipantType = 0 + // Used when the onchain participant type is a delegator + // (i.e. someone who delegates the responsibilities of validating blocks to another address in return for a share of the rewards). + ParticipantType_DELEGATOR ParticipantType = 1 + // Used when the onchain participant type is a validator + // (i.e. an address that is directly responsible for performing validation of blocks). + ParticipantType_VALIDATOR ParticipantType = 2 +) + +// Enum value maps for ParticipantType. +var ( + ParticipantType_name = map[int32]string{ + 0: "PARTICIPANT_TYPE_UNSPECIFIED", + 1: "DELEGATOR", + 2: "VALIDATOR", + } + ParticipantType_value = map[string]int32{ + "PARTICIPANT_TYPE_UNSPECIFIED": 0, + "DELEGATOR": 1, + "VALIDATOR": 2, + } +) + +func (x ParticipantType) Enum() *ParticipantType { + p := new(ParticipantType) + *p = x + return p +} + +func (x ParticipantType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (ParticipantType) Descriptor() protoreflect.EnumDescriptor { + return file_coinbase_staking_rewards_v1_stake_proto_enumTypes[0].Descriptor() +} + +func (ParticipantType) Type() protoreflect.EnumType { + return &file_coinbase_staking_rewards_v1_stake_proto_enumTypes[0] +} + +func (x ParticipantType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use ParticipantType.Descriptor instead. +func (ParticipantType) EnumDescriptor() ([]byte, []int) { + return file_coinbase_staking_rewards_v1_stake_proto_rawDescGZIP(), []int{0} +} + +// Representing the different methods of calculating yield. +type RewardRate_CalculationMethods int32 + +const ( + // Calculation method is unknown or unspecified. + RewardRate_CALCULATION_METHODS_UNSPECIFIED RewardRate_CalculationMethods = 0 + // A single Ethereum validator acting in isolation is currently not able to compound earned rewards because + // Ethereum only allows validators to stake 32 ETH precisely. + // This percentage yield is assuming that the rewards never compound, mimicking the behavior of a solo staker. + RewardRate_SOLO_STAKER RewardRate_CalculationMethods = 1 + // A pool of Ethereum validators of sufficient size is able to compound rewards almost immediately. + // This percentage yield is assuming rewards compound immediately, mimicking the behavior of a sufficiently large pool. + RewardRate_POOLED_STAKER RewardRate_CalculationMethods = 2 + // A Solana delegator's staking rewards are staked (and therefore auto-compound) when rewards are paid out between epochs. + // This percentage yield is assuming the rewards are auto-compounded on that schedule, mimicking a Solana delegator. + RewardRate_EPOCH_AUTO_COMPOUNDING RewardRate_CalculationMethods = 3 + // A Solana validator's rewards accumulate in a separate account from the validator's active stake. + // This percentage yield is assuming the rewards are not auto-compounded at any point, mimicking a Solana validator who never staked their rewards. + RewardRate_NO_AUTO_COMPOUNDING RewardRate_CalculationMethods = 4 +) + +// Enum value maps for RewardRate_CalculationMethods. +var ( + RewardRate_CalculationMethods_name = map[int32]string{ + 0: "CALCULATION_METHODS_UNSPECIFIED", + 1: "SOLO_STAKER", + 2: "POOLED_STAKER", + 3: "EPOCH_AUTO_COMPOUNDING", + 4: "NO_AUTO_COMPOUNDING", + } + RewardRate_CalculationMethods_value = map[string]int32{ + "CALCULATION_METHODS_UNSPECIFIED": 0, + "SOLO_STAKER": 1, + "POOLED_STAKER": 2, + "EPOCH_AUTO_COMPOUNDING": 3, + "NO_AUTO_COMPOUNDING": 4, + } +) + +func (x RewardRate_CalculationMethods) Enum() *RewardRate_CalculationMethods { + p := new(RewardRate_CalculationMethods) + *p = x + return p +} + +func (x RewardRate_CalculationMethods) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (RewardRate_CalculationMethods) Descriptor() protoreflect.EnumDescriptor { + return file_coinbase_staking_rewards_v1_stake_proto_enumTypes[1].Descriptor() +} + +func (RewardRate_CalculationMethods) Type() protoreflect.EnumType { + return &file_coinbase_staking_rewards_v1_stake_proto_enumTypes[1] +} + +func (x RewardRate_CalculationMethods) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use RewardRate_CalculationMethods.Descriptor instead. +func (RewardRate_CalculationMethods) EnumDescriptor() ([]byte, []int) { + return file_coinbase_staking_rewards_v1_stake_proto_rawDescGZIP(), []int{1, 0} +} + +// The representation of a staking activity at a particular point in time. +// (-- api-linter: core::0123::resource-name-field=disabled +// +// aip.dev/not-precedent: Not including a 'name' field till our data sources support a unique identifier --) +type Stake struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The address of the staking balance. + Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` + // The time at which this balance was evaluated. + // Timestamps are in UTC, conforming to the RFC-3339 spec (e.g. 2023-11-13T19:38:36Z). + EvaluationTime *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=evaluation_time,json=evaluationTime,proto3" json:"evaluation_time,omitempty"` + // The total amount of stake that is actively earning rewards to this address. + // Includes any delegated stake and self-stake. + // For delegators, this would be only the amount delegated to a validator in most cases. + // Only includes stake that is *actively contributing to rewards and can't be reduced + // without affecting the rewards dynamics*. + // + // Pending inactive stake is included. + // Pending active stake is not included. + BondedStake *AssetAmount `protobuf:"bytes,4,opt,name=bonded_stake,json=bondedStake,proto3" json:"bonded_stake,omitempty"` + // The amount of stake that this address receives from other addresses. + // For most delegators, this will be 0. + TotalDelegationReceived *AssetAmount `protobuf:"bytes,5,opt,name=total_delegation_received,json=totalDelegationReceived,proto3" json:"total_delegation_received,omitempty"` + // The list of individual delegations this address has received from other addresses + DelegationsReceived *Stake_Delegation `protobuf:"bytes,6,opt,name=delegations_received,json=delegationsReceived,proto3,oneof" json:"delegations_received,omitempty"` + // The amount that this address stakes to another address. + DelegationsGiven *Stake_Delegation `protobuf:"bytes,7,opt,name=delegations_given,json=delegationsGiven,proto3,oneof" json:"delegations_given,omitempty"` + // An estimated yield of this address. + RewardRateCalculations []*RewardRate `protobuf:"bytes,9,rep,name=reward_rate_calculations,json=rewardRateCalculations,proto3" json:"reward_rate_calculations,omitempty"` + // The participant type at the time of evaluation (i.e. validator, delegator). + ParticipantType ParticipantType `protobuf:"varint,10,opt,name=participant_type,json=participantType,proto3,enum=coinbase.staking.rewards.v1.ParticipantType" json:"participant_type,omitempty"` + // The protocol on which this staking balance exists. + Protocol string `protobuf:"bytes,12,opt,name=protocol,proto3" json:"protocol,omitempty"` + // The amount of stake that is not actively earning rewards to this address. + // This amount includes any native token balance that is under the domain and control of the address in question, + // but is not actively staked. + // + // Pending active stake would be included here. + UnbondedBalance *AssetAmount `protobuf:"bytes,13,opt,name=unbonded_balance,json=unbondedBalance,proto3" json:"unbonded_balance,omitempty"` +} + +func (x *Stake) Reset() { + *x = Stake{} + if protoimpl.UnsafeEnabled { + mi := &file_coinbase_staking_rewards_v1_stake_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Stake) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Stake) ProtoMessage() {} + +func (x *Stake) ProtoReflect() protoreflect.Message { + mi := &file_coinbase_staking_rewards_v1_stake_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Stake.ProtoReflect.Descriptor instead. +func (*Stake) Descriptor() ([]byte, []int) { + return file_coinbase_staking_rewards_v1_stake_proto_rawDescGZIP(), []int{0} +} + +func (x *Stake) GetAddress() string { + if x != nil { + return x.Address + } + return "" +} + +func (x *Stake) GetEvaluationTime() *timestamppb.Timestamp { + if x != nil { + return x.EvaluationTime + } + return nil +} + +func (x *Stake) GetBondedStake() *AssetAmount { + if x != nil { + return x.BondedStake + } + return nil +} + +func (x *Stake) GetTotalDelegationReceived() *AssetAmount { + if x != nil { + return x.TotalDelegationReceived + } + return nil +} + +func (x *Stake) GetDelegationsReceived() *Stake_Delegation { + if x != nil { + return x.DelegationsReceived + } + return nil +} + +func (x *Stake) GetDelegationsGiven() *Stake_Delegation { + if x != nil { + return x.DelegationsGiven + } + return nil +} + +func (x *Stake) GetRewardRateCalculations() []*RewardRate { + if x != nil { + return x.RewardRateCalculations + } + return nil +} + +func (x *Stake) GetParticipantType() ParticipantType { + if x != nil { + return x.ParticipantType + } + return ParticipantType_PARTICIPANT_TYPE_UNSPECIFIED +} + +func (x *Stake) GetProtocol() string { + if x != nil { + return x.Protocol + } + return "" +} + +func (x *Stake) GetUnbondedBalance() *AssetAmount { + if x != nil { + return x.UnbondedBalance + } + return nil +} + +// Reward yield calculation at a given point in time. +type RewardRate struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The percentage rate of rewards calculation. Will include two digits after the decimal (ex: 3.05). + Percentage string `protobuf:"bytes,1,opt,name=percentage,proto3" json:"percentage,omitempty"` + // The time at which this yield calculation was calculated. + // Timestamps are in UTC, conforming to the RFC-3339 spec (e.g. 2023-11-13T19:38:36Z). + CalculatedTime *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=calculated_time,json=calculatedTime,proto3" json:"calculated_time,omitempty"` + // The method used to calculate this yield. This could include information about which + // rewards we're including in the calculation, how we're estimating the compounding period, etc. + CalculationMethod RewardRate_CalculationMethods `protobuf:"varint,3,opt,name=calculation_method,json=calculationMethod,proto3,enum=coinbase.staking.rewards.v1.RewardRate_CalculationMethods" json:"calculation_method,omitempty"` +} + +func (x *RewardRate) Reset() { + *x = RewardRate{} + if protoimpl.UnsafeEnabled { + mi := &file_coinbase_staking_rewards_v1_stake_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RewardRate) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RewardRate) ProtoMessage() {} + +func (x *RewardRate) ProtoReflect() protoreflect.Message { + mi := &file_coinbase_staking_rewards_v1_stake_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RewardRate.ProtoReflect.Descriptor instead. +func (*RewardRate) Descriptor() ([]byte, []int) { + return file_coinbase_staking_rewards_v1_stake_proto_rawDescGZIP(), []int{1} +} + +func (x *RewardRate) GetPercentage() string { + if x != nil { + return x.Percentage + } + return "" +} + +func (x *RewardRate) GetCalculatedTime() *timestamppb.Timestamp { + if x != nil { + return x.CalculatedTime + } + return nil +} + +func (x *RewardRate) GetCalculationMethod() RewardRate_CalculationMethods { + if x != nil { + return x.CalculationMethod + } + return RewardRate_CALCULATION_METHODS_UNSPECIFIED +} + +// The request message for ListStakes. +type ListStakesRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The protocol that the staking balance exists on. + // The response will only include staking balances for the protocol specified here. + Parent string `protobuf:"bytes,1,opt,name=parent,proto3" json:"parent,omitempty"` + // The maximum number of items to return. + PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` + // A page token as part of the response of a previous call. + // Provide this to retrieve the next page. + // + // When paginating, all other parameters must match the previous + // request to list resources. + PageToken string `protobuf:"bytes,3,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"` + // [AIP-160](https://google.aip.dev/160) format compliant filter. Supported protocols are 'ethereum', 'solana'. + // Supplying other protocols will return an error. + // * **Ethereum**: + // - Fields: + // - `address` - A ethereum validator public key. + // - `evaluation_time` - A timestamp in RFC-3339 format. Supports multiple comparisons (ex: '2024-01-01T00:00:00Z' and '2024-01-15T00:00:00Z'). + // - Example(s): + // - `"address='0xac53512c39d0081ca4437c285305eb423f474e6153693c12fbba4a3df78bcaa3422b31d800c5bea71c1b017168a60474'"` + // - `"address='0xac53512c39d0081ca4437c285305eb423f474e6153693c12fbba4a3df78bcaa3422b31d800c5bea71c1b017168a60474' AND evaluation_time >= '2024-01-01T00:00:00Z' AND evaluation_time < '2024-01-15T00:00:00Z'"` + // + // * **Solana**: + // - Fields: + // - `address` - A solana staking address. + // - `evaluation_time` - A timestamp in RFC-3339 format. Supports multiple comparisons (ex: '2024-01-01T00:00:00Z' and '2024-01-15T00:00:00Z'). + // - Example(s): + // - `"address='beefKGBWeSpHzYBHZXwp5So7wdQGX6mu4ZHCsH3uTar'"` + // - `"address='beefKGBWeSpHzYBHZXwp5So7wdQGX6mu4ZHCsH3uTar' AND evaluation_time >= '2024-01-01T00:00:00Z' AND evaluation_time < '2024-01-15T00:00:00Z'"` + Filter string `protobuf:"bytes,4,opt,name=filter,proto3" json:"filter,omitempty"` +} + +func (x *ListStakesRequest) Reset() { + *x = ListStakesRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_coinbase_staking_rewards_v1_stake_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListStakesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListStakesRequest) ProtoMessage() {} + +func (x *ListStakesRequest) ProtoReflect() protoreflect.Message { + mi := &file_coinbase_staking_rewards_v1_stake_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListStakesRequest.ProtoReflect.Descriptor instead. +func (*ListStakesRequest) Descriptor() ([]byte, []int) { + return file_coinbase_staking_rewards_v1_stake_proto_rawDescGZIP(), []int{2} +} + +func (x *ListStakesRequest) GetParent() string { + if x != nil { + return x.Parent + } + return "" +} + +func (x *ListStakesRequest) GetPageSize() int32 { + if x != nil { + return x.PageSize + } + return 0 +} + +func (x *ListStakesRequest) GetPageToken() string { + if x != nil { + return x.PageToken + } + return "" +} + +func (x *ListStakesRequest) GetFilter() string { + if x != nil { + return x.Filter + } + return "" +} + +// The response message for ListStakes. +type ListStakesResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The staking balances returned in this response. + Stakes []*Stake `protobuf:"bytes,1,rep,name=stakes,proto3" json:"stakes,omitempty"` + // The page token the user must use in the next request if the next page is desired. + NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"` +} + +func (x *ListStakesResponse) Reset() { + *x = ListStakesResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_coinbase_staking_rewards_v1_stake_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListStakesResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListStakesResponse) ProtoMessage() {} + +func (x *ListStakesResponse) ProtoReflect() protoreflect.Message { + mi := &file_coinbase_staking_rewards_v1_stake_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListStakesResponse.ProtoReflect.Descriptor instead. +func (*ListStakesResponse) Descriptor() ([]byte, []int) { + return file_coinbase_staking_rewards_v1_stake_proto_rawDescGZIP(), []int{3} +} + +func (x *ListStakesResponse) GetStakes() []*Stake { + if x != nil { + return x.Stakes + } + return nil +} + +func (x *ListStakesResponse) GetNextPageToken() string { + if x != nil { + return x.NextPageToken + } + return "" +} + +// A single delegation from one address to another. +type Stake_Delegation struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Address associated to the delegation + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + // Amount of delegation received or given + Amount *AssetAmount `protobuf:"bytes,2,opt,name=amount,proto3" json:"amount,omitempty"` + // Commission rate for delegation + CommissionRate string `protobuf:"bytes,3,opt,name=commission_rate,json=commissionRate,proto3" json:"commission_rate,omitempty"` +} + +func (x *Stake_Delegation) Reset() { + *x = Stake_Delegation{} + if protoimpl.UnsafeEnabled { + mi := &file_coinbase_staking_rewards_v1_stake_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Stake_Delegation) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Stake_Delegation) ProtoMessage() {} + +func (x *Stake_Delegation) ProtoReflect() protoreflect.Message { + mi := &file_coinbase_staking_rewards_v1_stake_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Stake_Delegation.ProtoReflect.Descriptor instead. +func (*Stake_Delegation) Descriptor() ([]byte, []int) { + return file_coinbase_staking_rewards_v1_stake_proto_rawDescGZIP(), []int{0, 0} +} + +func (x *Stake_Delegation) GetAddress() string { + if x != nil { + return x.Address + } + return "" +} + +func (x *Stake_Delegation) GetAmount() *AssetAmount { + if x != nil { + return x.Amount + } + return nil +} + +func (x *Stake_Delegation) GetCommissionRate() string { + if x != nil { + return x.CommissionRate + } + return "" +} + +var File_coinbase_staking_rewards_v1_stake_proto protoreflect.FileDescriptor + +var file_coinbase_staking_rewards_v1_stake_proto_rawDesc = []byte{ + 0x0a, 0x27, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x73, 0x74, 0x61, 0x6b, 0x69, + 0x6e, 0x67, 0x2f, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x74, + 0x61, 0x6b, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1b, 0x63, 0x6f, 0x69, 0x6e, 0x62, + 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x72, 0x65, 0x77, 0x61, + 0x72, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x1a, 0x28, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, + 0x2f, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2f, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, + 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x66, 0x69, 0x65, + 0x6c, 0x64, 0x5f, 0x62, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x1a, 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x20, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x65, + 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, + 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, + 0x8b, 0x09, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x12, 0x1d, 0x0a, 0x07, 0x61, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, + 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x48, 0x0a, 0x0f, 0x65, 0x76, 0x61, 0x6c, + 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x03, 0xe0, + 0x41, 0x03, 0x52, 0x0e, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x69, + 0x6d, 0x65, 0x12, 0x50, 0x0a, 0x0c, 0x62, 0x6f, 0x6e, 0x64, 0x65, 0x64, 0x5f, 0x73, 0x74, 0x61, + 0x6b, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x63, 0x6f, 0x69, 0x6e, 0x62, + 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x72, 0x65, 0x77, 0x61, + 0x72, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x73, 0x73, 0x65, 0x74, 0x41, 0x6d, 0x6f, 0x75, + 0x6e, 0x74, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0b, 0x62, 0x6f, 0x6e, 0x64, 0x65, 0x64, 0x53, + 0x74, 0x61, 0x6b, 0x65, 0x12, 0x69, 0x0a, 0x19, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x64, 0x65, + 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, + 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, + 0x73, 0x65, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x72, 0x65, 0x77, 0x61, 0x72, + 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x73, 0x73, 0x65, 0x74, 0x41, 0x6d, 0x6f, 0x75, 0x6e, + 0x74, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x17, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x44, 0x65, 0x6c, + 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x12, + 0x6a, 0x0a, 0x14, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x5f, 0x72, + 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, + 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, + 0x2e, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x6b, + 0x65, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x03, 0xe0, 0x41, + 0x03, 0x48, 0x00, 0x52, 0x13, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x88, 0x01, 0x01, 0x12, 0x64, 0x0a, 0x11, 0x64, + 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x5f, 0x67, 0x69, 0x76, 0x65, 0x6e, + 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, + 0x65, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, + 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x67, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x48, 0x01, 0x52, 0x10, 0x64, 0x65, + 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x47, 0x69, 0x76, 0x65, 0x6e, 0x88, 0x01, + 0x01, 0x12, 0x66, 0x0a, 0x18, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x72, 0x61, 0x74, 0x65, + 0x5f, 0x63, 0x61, 0x6c, 0x63, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x09, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, + 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x2e, 0x76, + 0x31, 0x2e, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x61, 0x74, 0x65, 0x42, 0x03, 0xe0, 0x41, + 0x03, 0x52, 0x16, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x61, 0x74, 0x65, 0x43, 0x61, 0x6c, + 0x63, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x5c, 0x0a, 0x10, 0x70, 0x61, 0x72, + 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x0a, 0x20, + 0x01, 0x28, 0x0e, 0x32, 0x2c, 0x2e, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, + 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x2e, 0x76, + 0x31, 0x2e, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x54, 0x79, 0x70, + 0x65, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0f, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, + 0x61, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1f, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x63, 0x6f, 0x6c, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x08, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x12, 0x58, 0x0a, 0x10, 0x75, 0x6e, 0x62, 0x6f, + 0x6e, 0x64, 0x65, 0x64, 0x5f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x0d, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, + 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x2e, 0x76, 0x31, + 0x2e, 0x41, 0x73, 0x73, 0x65, 0x74, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x42, 0x03, 0xe0, 0x41, + 0x03, 0x52, 0x0f, 0x75, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x65, 0x64, 0x42, 0x61, 0x6c, 0x61, 0x6e, + 0x63, 0x65, 0x1a, 0x91, 0x01, 0x0a, 0x0a, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x40, 0x0a, 0x06, 0x61, + 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x63, 0x6f, + 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x72, + 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x73, 0x73, 0x65, 0x74, 0x41, + 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x27, 0x0a, + 0x0f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x61, 0x74, 0x65, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x73, 0x73, 0x69, + 0x6f, 0x6e, 0x52, 0x61, 0x74, 0x65, 0x3a, 0x57, 0xea, 0x41, 0x54, 0x0a, 0x1e, 0x63, 0x6f, 0x69, + 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x72, 0x65, + 0x77, 0x61, 0x72, 0x64, 0x73, 0x2f, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x12, 0x23, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x73, 0x2f, 0x7b, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, + 0x7d, 0x2f, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x73, 0x2f, 0x7b, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x7d, + 0x2a, 0x06, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x73, 0x32, 0x05, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x42, + 0x17, 0x0a, 0x15, 0x5f, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x5f, + 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x42, 0x14, 0x0a, 0x12, 0x5f, 0x64, 0x65, 0x6c, + 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x5f, 0x67, 0x69, 0x76, 0x65, 0x6e, 0x4a, 0x04, + 0x08, 0x01, 0x10, 0x02, 0x4a, 0x04, 0x08, 0x08, 0x10, 0x09, 0x4a, 0x04, 0x08, 0x0b, 0x10, 0x0c, + 0x52, 0x02, 0x69, 0x64, 0x52, 0x06, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x52, 0x0f, 0x70, 0x65, + 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x22, 0x80, 0x03, + 0x0a, 0x0a, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x61, 0x74, 0x65, 0x12, 0x23, 0x0a, 0x0a, + 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0a, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x61, 0x67, + 0x65, 0x12, 0x48, 0x0a, 0x0f, 0x63, 0x61, 0x6c, 0x63, 0x75, 0x6c, 0x61, 0x74, 0x65, 0x64, 0x5f, + 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, + 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0e, 0x63, 0x61, 0x6c, + 0x63, 0x75, 0x6c, 0x61, 0x74, 0x65, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x6e, 0x0a, 0x12, 0x63, + 0x61, 0x6c, 0x63, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x65, 0x74, 0x68, 0x6f, + 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x3a, 0x2e, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, + 0x73, 0x65, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x72, 0x65, 0x77, 0x61, 0x72, + 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x61, 0x74, 0x65, + 0x2e, 0x43, 0x61, 0x6c, 0x63, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x74, 0x68, + 0x6f, 0x64, 0x73, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x11, 0x63, 0x61, 0x6c, 0x63, 0x75, 0x6c, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x22, 0x92, 0x01, 0x0a, 0x12, + 0x43, 0x61, 0x6c, 0x63, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x74, 0x68, 0x6f, + 0x64, 0x73, 0x12, 0x23, 0x0a, 0x1f, 0x43, 0x41, 0x4c, 0x43, 0x55, 0x4c, 0x41, 0x54, 0x49, 0x4f, + 0x4e, 0x5f, 0x4d, 0x45, 0x54, 0x48, 0x4f, 0x44, 0x53, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, + 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0f, 0x0a, 0x0b, 0x53, 0x4f, 0x4c, 0x4f, 0x5f, + 0x53, 0x54, 0x41, 0x4b, 0x45, 0x52, 0x10, 0x01, 0x12, 0x11, 0x0a, 0x0d, 0x50, 0x4f, 0x4f, 0x4c, + 0x45, 0x44, 0x5f, 0x53, 0x54, 0x41, 0x4b, 0x45, 0x52, 0x10, 0x02, 0x12, 0x1a, 0x0a, 0x16, 0x45, + 0x50, 0x4f, 0x43, 0x48, 0x5f, 0x41, 0x55, 0x54, 0x4f, 0x5f, 0x43, 0x4f, 0x4d, 0x50, 0x4f, 0x55, + 0x4e, 0x44, 0x49, 0x4e, 0x47, 0x10, 0x03, 0x12, 0x17, 0x0a, 0x13, 0x4e, 0x4f, 0x5f, 0x41, 0x55, + 0x54, 0x4f, 0x5f, 0x43, 0x4f, 0x4d, 0x50, 0x4f, 0x55, 0x4e, 0x44, 0x49, 0x4e, 0x47, 0x10, 0x04, + 0x22, 0xb9, 0x01, 0x0a, 0x11, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x73, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x41, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x29, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x23, 0x0a, 0x21, + 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, + 0x2e, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x2f, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, + 0x6c, 0x52, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x12, 0x20, 0x0a, 0x09, 0x70, 0x61, 0x67, + 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x42, 0x03, 0xe0, 0x41, + 0x01, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x22, 0x0a, 0x0a, 0x70, + 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, + 0x03, 0xe0, 0x41, 0x01, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, + 0x1b, 0x0a, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, + 0x03, 0xe0, 0x41, 0x01, 0x52, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x22, 0x82, 0x01, 0x0a, + 0x12, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x3f, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x73, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, + 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x2e, 0x76, + 0x31, 0x2e, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x06, 0x73, 0x74, + 0x61, 0x6b, 0x65, 0x73, 0x12, 0x2b, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, + 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, + 0x41, 0x03, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, + 0x6e, 0x2a, 0x51, 0x0a, 0x0f, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, + 0x54, 0x79, 0x70, 0x65, 0x12, 0x20, 0x0a, 0x1c, 0x50, 0x41, 0x52, 0x54, 0x49, 0x43, 0x49, 0x50, + 0x41, 0x4e, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, + 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x44, 0x45, 0x4c, 0x45, 0x47, 0x41, + 0x54, 0x4f, 0x52, 0x10, 0x01, 0x12, 0x0d, 0x0a, 0x09, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x41, 0x54, + 0x4f, 0x52, 0x10, 0x02, 0x42, 0x52, 0x5a, 0x50, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, + 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x73, 0x74, 0x61, 0x6b, + 0x69, 0x6e, 0x67, 0x2d, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2d, 0x6c, 0x69, 0x62, 0x72, 0x61, + 0x72, 0x79, 0x2d, 0x67, 0x6f, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x67, 0x6f, 0x2f, 0x63, 0x6f, 0x69, + 0x6e, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2f, 0x72, 0x65, + 0x77, 0x61, 0x72, 0x64, 0x73, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_coinbase_staking_rewards_v1_stake_proto_rawDescOnce sync.Once + file_coinbase_staking_rewards_v1_stake_proto_rawDescData = file_coinbase_staking_rewards_v1_stake_proto_rawDesc +) + +func file_coinbase_staking_rewards_v1_stake_proto_rawDescGZIP() []byte { + file_coinbase_staking_rewards_v1_stake_proto_rawDescOnce.Do(func() { + file_coinbase_staking_rewards_v1_stake_proto_rawDescData = protoimpl.X.CompressGZIP(file_coinbase_staking_rewards_v1_stake_proto_rawDescData) + }) + return file_coinbase_staking_rewards_v1_stake_proto_rawDescData +} + +var file_coinbase_staking_rewards_v1_stake_proto_enumTypes = make([]protoimpl.EnumInfo, 2) +var file_coinbase_staking_rewards_v1_stake_proto_msgTypes = make([]protoimpl.MessageInfo, 5) +var file_coinbase_staking_rewards_v1_stake_proto_goTypes = []interface{}{ + (ParticipantType)(0), // 0: coinbase.staking.rewards.v1.ParticipantType + (RewardRate_CalculationMethods)(0), // 1: coinbase.staking.rewards.v1.RewardRate.CalculationMethods + (*Stake)(nil), // 2: coinbase.staking.rewards.v1.Stake + (*RewardRate)(nil), // 3: coinbase.staking.rewards.v1.RewardRate + (*ListStakesRequest)(nil), // 4: coinbase.staking.rewards.v1.ListStakesRequest + (*ListStakesResponse)(nil), // 5: coinbase.staking.rewards.v1.ListStakesResponse + (*Stake_Delegation)(nil), // 6: coinbase.staking.rewards.v1.Stake.Delegation + (*timestamppb.Timestamp)(nil), // 7: google.protobuf.Timestamp + (*AssetAmount)(nil), // 8: coinbase.staking.rewards.v1.AssetAmount +} +var file_coinbase_staking_rewards_v1_stake_proto_depIdxs = []int32{ + 7, // 0: coinbase.staking.rewards.v1.Stake.evaluation_time:type_name -> google.protobuf.Timestamp + 8, // 1: coinbase.staking.rewards.v1.Stake.bonded_stake:type_name -> coinbase.staking.rewards.v1.AssetAmount + 8, // 2: coinbase.staking.rewards.v1.Stake.total_delegation_received:type_name -> coinbase.staking.rewards.v1.AssetAmount + 6, // 3: coinbase.staking.rewards.v1.Stake.delegations_received:type_name -> coinbase.staking.rewards.v1.Stake.Delegation + 6, // 4: coinbase.staking.rewards.v1.Stake.delegations_given:type_name -> coinbase.staking.rewards.v1.Stake.Delegation + 3, // 5: coinbase.staking.rewards.v1.Stake.reward_rate_calculations:type_name -> coinbase.staking.rewards.v1.RewardRate + 0, // 6: coinbase.staking.rewards.v1.Stake.participant_type:type_name -> coinbase.staking.rewards.v1.ParticipantType + 8, // 7: coinbase.staking.rewards.v1.Stake.unbonded_balance:type_name -> coinbase.staking.rewards.v1.AssetAmount + 7, // 8: coinbase.staking.rewards.v1.RewardRate.calculated_time:type_name -> google.protobuf.Timestamp + 1, // 9: coinbase.staking.rewards.v1.RewardRate.calculation_method:type_name -> coinbase.staking.rewards.v1.RewardRate.CalculationMethods + 2, // 10: coinbase.staking.rewards.v1.ListStakesResponse.stakes:type_name -> coinbase.staking.rewards.v1.Stake + 8, // 11: coinbase.staking.rewards.v1.Stake.Delegation.amount:type_name -> coinbase.staking.rewards.v1.AssetAmount + 12, // [12:12] is the sub-list for method output_type + 12, // [12:12] is the sub-list for method input_type + 12, // [12:12] is the sub-list for extension type_name + 12, // [12:12] is the sub-list for extension extendee + 0, // [0:12] is the sub-list for field type_name +} + +func init() { file_coinbase_staking_rewards_v1_stake_proto_init() } +func file_coinbase_staking_rewards_v1_stake_proto_init() { + if File_coinbase_staking_rewards_v1_stake_proto != nil { + return + } + file_coinbase_staking_rewards_v1_common_proto_init() + if !protoimpl.UnsafeEnabled { + file_coinbase_staking_rewards_v1_stake_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Stake); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_coinbase_staking_rewards_v1_stake_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RewardRate); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_coinbase_staking_rewards_v1_stake_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListStakesRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_coinbase_staking_rewards_v1_stake_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListStakesResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_coinbase_staking_rewards_v1_stake_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Stake_Delegation); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_coinbase_staking_rewards_v1_stake_proto_msgTypes[0].OneofWrappers = []interface{}{} + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_coinbase_staking_rewards_v1_stake_proto_rawDesc, + NumEnums: 2, + NumMessages: 5, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_coinbase_staking_rewards_v1_stake_proto_goTypes, + DependencyIndexes: file_coinbase_staking_rewards_v1_stake_proto_depIdxs, + EnumInfos: file_coinbase_staking_rewards_v1_stake_proto_enumTypes, + MessageInfos: file_coinbase_staking_rewards_v1_stake_proto_msgTypes, + }.Build() + File_coinbase_staking_rewards_v1_stake_proto = out.File + file_coinbase_staking_rewards_v1_stake_proto_rawDesc = nil + file_coinbase_staking_rewards_v1_stake_proto_goTypes = nil + file_coinbase_staking_rewards_v1_stake_proto_depIdxs = nil +} diff --git a/gen/go/coinbase/staking/rewards/v1/stake_aip.go b/gen/go/coinbase/staking/rewards/v1/stake_aip.go new file mode 100644 index 0000000..7b7df58 --- /dev/null +++ b/gen/go/coinbase/staking/rewards/v1/stake_aip.go @@ -0,0 +1,78 @@ +// Code generated by protoc-gen-go-aip. DO NOT EDIT. +// +// versions: +// protoc-gen-go-aip development +// protoc (unknown) +// source: coinbase/staking/rewards/v1/stake.proto + +package v1 + +import ( + fmt "fmt" + resourcename "go.einride.tech/aip/resourcename" + strings "strings" +) + +type StakeResourceName struct { + Protocol string + Stake string +} + +func (n ProtocolResourceName) StakeResourceName( + stake string, +) StakeResourceName { + return StakeResourceName{ + Protocol: n.Protocol, + Stake: stake, + } +} + +func (n StakeResourceName) Validate() error { + if n.Protocol == "" { + return fmt.Errorf("protocol: empty") + } + if strings.IndexByte(n.Protocol, '/') != -1 { + return fmt.Errorf("protocol: contains illegal character '/'") + } + if n.Stake == "" { + return fmt.Errorf("stake: empty") + } + if strings.IndexByte(n.Stake, '/') != -1 { + return fmt.Errorf("stake: contains illegal character '/'") + } + return nil +} + +func (n StakeResourceName) ContainsWildcard() bool { + return false || n.Protocol == "-" || n.Stake == "-" +} + +func (n StakeResourceName) String() string { + return resourcename.Sprint( + "protocols/{protocol}/stakes/{stake}", + n.Protocol, + n.Stake, + ) +} + +func (n StakeResourceName) MarshalString() (string, error) { + if err := n.Validate(); err != nil { + return "", err + } + return n.String(), nil +} + +func (n *StakeResourceName) UnmarshalString(name string) error { + return resourcename.Sscan( + name, + "protocols/{protocol}/stakes/{stake}", + &n.Protocol, + &n.Stake, + ) +} + +func (n StakeResourceName) ProtocolResourceName() ProtocolResourceName { + return ProtocolResourceName{ + Protocol: n.Protocol, + } +} diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..03482e3 --- /dev/null +++ b/go.mod @@ -0,0 +1,41 @@ +module github.com/coinbase/staking-client-library-go + +go 1.20 + +require ( + github.com/ethereum/go-ethereum v1.12.0 + github.com/googleapis/gax-go/v2 v2.11.0 + github.com/grpc-ecosystem/grpc-gateway/v2 v2.15.2 + github.com/stretchr/testify v1.8.1 + go.einride.tech/aip v0.60.0 + google.golang.org/api v0.126.0 + google.golang.org/genproto/googleapis/api v0.0.0-20230530153820-e85fd2cbaebc + google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc + google.golang.org/grpc v1.55.0 + google.golang.org/protobuf v1.30.0 + gopkg.in/square/go-jose.v2 v2.6.0 +) + +require ( + cloud.google.com/go/compute v1.19.3 // indirect + cloud.google.com/go/compute/metadata v0.2.3 // indirect + github.com/btcsuite/btcd/btcec/v2 v2.2.0 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 // indirect + github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect + github.com/golang/protobuf v1.5.3 // indirect + github.com/google/go-cmp v0.5.9 // indirect + github.com/google/s2a-go v0.1.4 // indirect + github.com/googleapis/enterprise-certificate-proxy v0.2.3 // indirect + github.com/holiman/uint256 v1.2.2-0.20230321075855-87b91420868c // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect + go.opencensus.io v0.24.0 // indirect + golang.org/x/crypto v0.9.0 // indirect + golang.org/x/net v0.10.0 // indirect + golang.org/x/oauth2 v0.8.0 // indirect + golang.org/x/sys v0.8.0 // indirect + golang.org/x/text v0.9.0 // indirect + google.golang.org/appengine v1.6.7 // indirect + google.golang.org/genproto v0.0.0-20230530153820-e85fd2cbaebc // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect +) diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..b6d2769 --- /dev/null +++ b/go.sum @@ -0,0 +1,250 @@ +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go/compute v1.19.3 h1:DcTwsFgGev/wV5+q8o2fzgcHOaac+DKGC91ZlvpsQds= +cloud.google.com/go/compute v1.19.3/go.mod h1:qxvISKp/gYnXkSAD1ppcSOveRAmzxicEv/JlizULFrI= +cloud.google.com/go/compute/metadata v0.2.3 h1:mg4jlk7mCAj6xXp9UJ4fjI9VUI5rubuGBW5aJ7UnBMY= +cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/DataDog/zstd v1.5.2 h1:vUG4lAyuPCXO0TLbXvPv7EB7cNK1QV/luu55UHLrrn8= +github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6 h1:fLjPD/aNc3UIOA6tDi6QXUemppXK3P9BI7mr2hd6gx8= +github.com/VictoriaMetrics/fastcache v1.6.0 h1:C/3Oi3EiBCqufydp1neRZkqcwmEiuRT9c3fqvvgKm5o= +github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= +github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= +github.com/btcsuite/btcd/btcec/v2 v2.2.0 h1:fzn1qaOt32TuLjFlkzYSsBC35Q3KUjT1SwPxiMSCF5k= +github.com/btcsuite/btcd/btcec/v2 v2.2.0/go.mod h1:U7MHm051Al6XmscBQ0BoNydpOTsFAn707034b5nY8zU= +github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 h1:q0rUy8C/TYNBQS1+CGKw68tLOFYSNEs0TFnxxnS9+4U= +github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= +github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= +github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cockroachdb/errors v1.9.1 h1:yFVvsI0VxmRShfawbt/laCIDy/mtTqqnvoNgiy5bEV8= +github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b h1:r6VH0faHjZeQy818SGhaone5OnYfxFR/+AzdY3sf5aE= +github.com/cockroachdb/pebble v0.0.0-20230209160836-829675f94811 h1:ytcWPaNPhNoGMWEhDvS3zToKcDpRsLuRolQJBVGdozk= +github.com/cockroachdb/redact v1.1.3 h1:AKZds10rFSIj7qADf0g46UixK8NNLwWTNdCIGS5wfSQ= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/decred/dcrd/crypto/blake256 v1.0.0 h1:/8DMNYp9SGi5f0w7uCm6d6M4OU2rGFK09Y2A4Xv7EE0= +github.com/decred/dcrd/crypto/blake256 v1.0.0/go.mod h1:sQl2p6Y26YV+ZOcSTP6thNdn47hh8kt6rqSlvmrXFAc= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 h1:YLtO71vCjJRCBcrPMtQ9nqBsqpA1m5sE92cU+pd5Mcc= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1/go.mod h1:hyedUtir6IdtD/7lIxGeCxkaw7y45JueMRL4DIyJDKs= +github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= +github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= +github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= +github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/ethereum/go-ethereum v1.12.0 h1:bdnhLPtqETd4m3mS8BGMNvBTf36bO5bx/hxE2zljOa0= +github.com/ethereum/go-ethereum v1.12.0/go.mod h1:/oo2X/dZLJjf2mJ6YT9wcWxa4nNJDBKDBU6sFIpx1Gs= +github.com/getsentry/sentry-go v0.18.0 h1:MtBW5H9QgdcJabtZcuJG80BMOwaBpkRDZkxRkNC1sN0= +github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/go-ole/go-ole v1.2.1 h1:2lOsA72HgjxAuMlKpFiCbHTvu44PIVkZ5hqm3RSdI/E= +github.com/go-stack/stack v1.8.1 h1:ntEHSVwIt7PNXNpgPmVfMrNhLtgjlmnZha2kOpuRiDw= +github.com/gofrs/flock v0.8.1 h1:+gYjHKf32LDeiEEFhQaotPbLuUXjY5ZqxKgXy7n59aw= +github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/glog v1.1.0 h1:/d3pCKDPWNnvIWe0vVUpNP32qc8U3PDVxySP/y360qE= +github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= +github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= +github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= +github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb h1:PBC98N2aIaM3XXiurYmW7fx4GZkL8feAMVq7nEjURHk= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= +github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/s2a-go v0.1.4 h1:1kZ/sQM3srePvKs3tXAvQzo66XfcReoqFpIpIccE7Oc= +github.com/google/s2a-go v0.1.4/go.mod h1:Ej+mSEMGRnqRzjc7VtF+jdBwYG5fuJfiZ8ELkjEwM0A= +github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/googleapis/enterprise-certificate-proxy v0.2.3 h1:yk9/cqRKtT9wXZSsRH9aurXEpJX+U6FLtpYTdC3R06k= +github.com/googleapis/enterprise-certificate-proxy v0.2.3/go.mod h1:AwSRAtLfXpU5Nm3pW+v7rGDHp09LsPtGY9MduiEsR9k= +github.com/googleapis/gax-go/v2 v2.11.0 h1:9V9PWXEsWnPpQhu/PeQIkS4eGzMlTLGgt80cUUI8Ki4= +github.com/googleapis/gax-go/v2 v2.11.0/go.mod h1:DxmR61SGKkGLa2xigwuZIQpkCI2S5iydzRfb3peWZJI= +github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.15.2 h1:gDLXvp5S9izjldquuoAhDzccbskOL6tDC5jMSyx3zxE= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.15.2/go.mod h1:7pdNwVWBBHGiCxa9lAszqCJMbfTISJ7oMftp8+UGV08= +github.com/holiman/uint256 v1.2.2-0.20230321075855-87b91420868c h1:DZfsyhDK1hnSS5lH8l+JggqzEleHteTYfutAiVlSUM8= +github.com/holiman/uint256 v1.2.2-0.20230321075855-87b91420868c/go.mod h1:SC8Ryt4n+UBbPbIBKaG9zbbDlp4jOru9xFZmPzLUTxw= +github.com/klauspost/compress v1.15.15 h1:EF27CXIuDsYJ6mmvtBRlEuB2UVOqHG1tAXgZ7yIO+lw= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= +github.com/mattn/go-runewidth v0.0.9 h1:Lm995f3rfxdpd6TSmuVCHVb/QhupuXlYr8sCI/QdE+0= +github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= +github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/prometheus/client_golang v1.14.0 h1:nJdhIvne2eSX/XRAFV9PcvFFRbrjbcTUj0VP62TMhnw= +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.3.0 h1:UBgGFHqYdG/TPFD1B1ogZywDqEkwp3fBMvqdiQ7Xew4= +github.com/prometheus/common v0.39.0 h1:oOyhkDq05hPZKItWVBkJ6g6AtGxi+fy7F4JvUV8uhsI= +github.com/prometheus/procfs v0.9.0 h1:wzCHvIvM5SxWqYvwgVL7yJY8Lz3PKn49KQtpgMYJfhI= +github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= +github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= +github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible h1:Bn1aCHHRnjv4Bl16T8rcaFjYSrGrIZvpiGO6P3Q4GpU= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= +github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 h1:epCh84lMvA70Z7CTTCmYQn2CKbY8j86K7/FAIr141uY= +github.com/tklauser/go-sysconf v0.3.5 h1:uu3Xl4nkLzQfXNsWn15rPc/HQCJKObbt1dKJeWp3vU4= +github.com/tklauser/numcpus v0.2.2 h1:oyhllyrScuYI6g+h/zUvNXNp1wy7x8qQy3t/piefldA= +github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= +go.einride.tech/aip v0.60.0 h1:h6bgabZ5BCfAptbGex8jbh3VvPBRLa6xq+pQ1CAjHYw= +go.einride.tech/aip v0.60.0/go.mod h1:SdLbSbgSU60Xkb4TMkmsZEQPHeEWx0ikBoq5QnqZvdg= +go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= +go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= +go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20220314234659-1baeb1ce4c0b/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.9.0 h1:LF6fAI+IutBocDJ2OT0Q1g8plpYljMZ4+lty+dsqw3g= +golang.org/x/crypto v0.9.0/go.mod h1:yrmDGqONDYtNj3tH8X9dzUun2m2lzPa9ngI6/RUPGR0= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20230206171751-46f607a40771 h1:xP7rWLUr1e1n2xkK5YB4LI0hPEy3LJC6Wk+D4pGlOJg= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M= +golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.8.0 h1:6dkIjl3j3LtZ/O3sTgZTMsLKSftL/B8Zgq4huOIIUu8= +golang.org/x/oauth2 v0.8.0/go.mod h1:yr7u4HXZRm1R1kBWqr/xKNqewf0plRYoB7sla+BCIXE= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.2.0 h1:PUR+T4wwASmuSTYdKjYHI5TD22Wy5ogLU5qZCOLxBrI= +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU= +golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= +golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE= +golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/api v0.126.0 h1:q4GJq+cAdMAC7XP7njvQ4tvohGLiSlytuL4BQxbIZ+o= +google.golang.org/api v0.126.0/go.mod h1:mBwVAtz+87bEN6CbA1GtZPDOqY2R5ONPqJeIlvyo4Aw= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= +google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +google.golang.org/genproto v0.0.0-20230530153820-e85fd2cbaebc h1:8DyZCyvI8mE1IdLy/60bS+52xfymkE72wv1asokgtao= +google.golang.org/genproto v0.0.0-20230530153820-e85fd2cbaebc/go.mod h1:xZnkP7mREFX5MORlOPEzLMr+90PPZQ2QWzrVTWfAq64= +google.golang.org/genproto/googleapis/api v0.0.0-20230530153820-e85fd2cbaebc h1:kVKPf/IiYSBWEWtkIn6wZXwWGCnLKcC8oWfZvXjsGnM= +google.golang.org/genproto/googleapis/api v0.0.0-20230530153820-e85fd2cbaebc/go.mod h1:vHYtlOoi6TsQ3Uk2yxR7NI5z8uoV+3pZtR4jmHIkRig= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc h1:XSJ8Vk1SWuNr8S18z1NZSziL0CPIXLCCMDOEFtHBOFc= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc/go.mod h1:66JfowdXAEgad5O9NnYcsNPLCPZJD++2L9X0PCMODrA= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= +google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= +google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= +google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= +google.golang.org/grpc v1.55.0 h1:3Oj82/tFSCeUrRTg/5E/7d/W5A1tj6Ky1ABAuZuv5ag= +google.golang.org/grpc v1.55.0/go.mod h1:iYEXKGkEBhg1PjZQvoYEVPTDkHo1/bjTnfwTeGONTY8= +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng= +google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= +gopkg.in/square/go-jose.v2 v2.6.0 h1:NGk74WTnPKBNUhNzQX7PYcTLUjoq7mzKk2OKbvwk2iI= +gopkg.in/square/go-jose.v2 v2.6.0/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gotest.tools/v3 v3.4.0 h1:ZazjZUfuVeZGLAmlKKuyv3IKP5orXcwtOwDQH6YVr6o= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/internal/signer/ethereum.go b/internal/signer/ethereum.go new file mode 100644 index 0000000..3837d2d --- /dev/null +++ b/internal/signer/ethereum.go @@ -0,0 +1,50 @@ +package signer + +import ( + "encoding/hex" + + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/crypto" +) + +type EthereumWallet struct{} + +func (ew *EthereumWallet) SignTransaction(privateKey string, unsignedTx *UnsignedTx) (*SignedTx, error) { + privateKeyBytes, err := hex.DecodeString(privateKey) + if err != nil { + return nil, err + } + + privKey, err := crypto.ToECDSA(privateKeyBytes) + if err != nil { + return nil, err + } + + decodedUnsignedTxBytes, err := hex.DecodeString(string(unsignedTx.Data)) + if err != nil { + return nil, err + } + + tx := &types.Transaction{} + + err = tx.UnmarshalBinary(decodedUnsignedTxBytes) + if err != nil { + return nil, err + } + + signer := types.LatestSignerForChainID(tx.ChainId()) + + signedTx, err := types.SignTx(tx, signer, privKey) + if err != nil { + return nil, err + } + + signedTxBytes, err := signedTx.MarshalBinary() + if err != nil { + return nil, err + } + + return &SignedTx{ + Data: []byte(hex.EncodeToString(signedTxBytes)), + }, nil +} diff --git a/internal/signer/signer.go b/internal/signer/signer.go new file mode 100644 index 0000000..27d0e34 --- /dev/null +++ b/internal/signer/signer.go @@ -0,0 +1,31 @@ +package signer + +// Wallet defines a structure to hold the public and private keys. +type Wallet struct { + PublicKey string + PrivateKey string +} + +// UnsignedTx represents an unsigned transaction. +type UnsignedTx struct { + Data []byte +} + +// SignedTx represents a signed transaction. +type SignedTx struct { + Data []byte +} + +// Signer is an interface for signing unsigned transactions. +type Signer interface { + // SignTransaction signs an unsigned transaction with the given private key and protocol. + SignTransaction(privateKey string, unsignedTx *UnsignedTx) (*SignedTx, error) +} + +func New(protocol string) Signer { + if protocol == "ethereum_kiln" { + return &EthereumWallet{} + } + + return nil +} diff --git a/protos/buf.gen.orchestration.yaml b/protos/buf.gen.orchestration.yaml new file mode 100644 index 0000000..2ed818f --- /dev/null +++ b/protos/buf.gen.orchestration.yaml @@ -0,0 +1,39 @@ +version: v1 +plugins: + - name: go + out: ./gen/go + opt: + - paths=source_relative + # generate gRPC stubs in golang + - name: go-grpc + out: ./gen/go + opt: + - paths=source_relative + # generate reverse proxy from protocol definitions + - name: grpc-gateway + out: ./gen/go + opt: + - paths=source_relative + - name: go-aip + out: ./gen/go + opt: + - paths=source_relative + - name: openapiv2 + out: ./docs/openapi + opt: + - allow_merge=true + - merge_file_name=orchestration + - name: go_gapic + out: ./gen/client + opt: + - transport=grpc+rest + - go-gapic-package=github.com/coinbase/staking-client-library-go/gen/client/coinbase/staking/orchestration/v1;v1 + - module=github.com/coinbase/staking-client-library-go/gen/client + - Mcoinbase/staking/orchestration/v1/api.proto=github.com/coinbase/staking-client-library-go/gen/go/coinbase/staking/orchestration/v1;stakingpb + - Mcoinbase/staking/orchestration/v1/action.proto=github.com/coinbase/staking-client-library-go/gen/go/coinbase/staking/orchestration/v1;stakingpb + - Mcoinbase/staking/orchestration/v1/common.proto=github.com/coinbase/staking-client-library-go/gen/go/coinbase/staking/orchestration/v1;stakingpb + - Mcoinbase/staking/orchestration/v1/network.proto=github.com/coinbase/staking-client-library-go/gen/go/coinbase/staking/orchestration/v1;stakingpb + - Mcoinbase/staking/orchestration/v1/protocol.proto=github.com/coinbase/staking-client-library-go/gen/go/coinbase/staking/orchestration/v1;stakingpb + - Mcoinbase/staking/orchestration/v1/staking_target.proto=github.com/coinbase/staking-client-library-go/gen/go/coinbase/staking/orchestration/v1;stakingpb + - Mcoinbase/staking/orchestration/v1/workflow.proto=github.com/coinbase/staking-client-library-go/gen/go/coinbase/staking/orchestration/v1;stakingpb + - Mcoinbase/staking/orchestration/v1/staking_context.proto=github.com/coinbase/staking-client-library-go/gen/go/coinbase/staking/orchestration/v1;stakingpb diff --git a/protos/buf.gen.rewards.yaml b/protos/buf.gen.rewards.yaml new file mode 100644 index 0000000..7ca1f7c --- /dev/null +++ b/protos/buf.gen.rewards.yaml @@ -0,0 +1,41 @@ +version: v1 +plugins: + - name: go + out: ./gen/go + opt: + - paths=source_relative + # NOTE: This generates gRPC boilerplate in golang + - name: go-grpc + out: ./gen/go + opt: + - paths=source_relative + # NOTE: This generates a REST reverse proxy from protobuf definitions + - name: grpc-gateway + out: ./gen/go + opt: + - paths=source_relative + - name: go-aip + out: ./gen/go + opt: + - paths=source_relative + # NOTE: This generates the OpenAPI v2 spec (aka Swagger spec) based on protobuf definitions + - name: openapiv2 + out: ./docs/openapi + opt: + - allow_merge=true + - merge_file_name=rewards + - name: go_gapic + out: ./gen/client + opt: + # Details on these configuration options can be found at: https://github.com/googleapis/gapic-generator-go#invocation + - transport=rest + - release-level=alpha + # The go package of the generated library + - go-gapic-package=github.com/coinbase/staking-client-library-go/gen/client/coinbase/staking/rewards/v1;v1 + # Prefix to be stripped from the go-gapic-package used in the generated filenames. + - module=github.com/coinbase/staking-client-library-go/gen/client + - Mcoinbase/staking/rewards/v1/reward_service.proto=github.com/coinbase/staking-client-library-go/gen/go/coinbase/staking/rewards/v1;rewardpb + - Mcoinbase/staking/rewards/v1/protocol.proto=github.com/coinbase/staking-client-library-go/gen/go/coinbase/staking/rewards/v1;rewardpb + - Mcoinbase/staking/rewards/v1/reward.proto=github.com/coinbase/staking-client-library-go/gen/go/coinbase/staking/rewards/v1;rewardpb + - Mcoinbase/staking/rewards/v1/stake.proto=github.com/coinbase/staking-client-library-go/gen/go/coinbase/staking/rewards/v1;rewardpb + - Mcoinbase/staking/rewards/v1/common.proto=github.com/coinbase/staking-client-library-go/gen/go/coinbase/staking/rewards/v1;rewardpb diff --git a/protos/buf.lock b/protos/buf.lock new file mode 100644 index 0000000..4ffc27f --- /dev/null +++ b/protos/buf.lock @@ -0,0 +1,13 @@ +# Generated by buf. DO NOT EDIT. +version: v1 +deps: + - remote: buf.build + owner: googleapis + repository: googleapis + commit: 7a6bc1e3207144b38e9066861e1de0ff + digest: shake256:d646836485c34192401253703c4e7ce899c826fceec060bf4b2a62c4749bd9976dc960833e134a1f814725e1ffd60b1bb3cf0335a7e99ef0e8cec34b070ffb66 + - remote: buf.build + owner: grpc-ecosystem + repository: grpc-gateway + commit: 3f42134f4c564983838425bc43c7a65f + digest: shake256:3d11d4c0fe5e05fda0131afefbce233940e27f0c31c5d4e385686aea58ccd30f72053f61af432fa83f1fc11cda57f5f18ca3da26a29064f73c5a0d076bba8d92 diff --git a/protos/buf.yaml b/protos/buf.yaml new file mode 100644 index 0000000..33390cd --- /dev/null +++ b/protos/buf.yaml @@ -0,0 +1,13 @@ +version: v1 +breaking: + use: + - PACKAGE +lint: + use: + - DEFAULT + except: + - PACKAGE_VERSION_SUFFIX +deps: + # adding well known types by google + - buf.build/googleapis/googleapis + - buf.build/grpc-ecosystem/grpc-gateway diff --git a/protos/coinbase/staking/orchestration/v1/action.proto b/protos/coinbase/staking/orchestration/v1/action.proto new file mode 100644 index 0000000..7b4cf37 --- /dev/null +++ b/protos/coinbase/staking/orchestration/v1/action.proto @@ -0,0 +1,41 @@ +syntax = "proto3"; + +package coinbase.staking.orchestration.v1; + +option go_package = "github.com/coinbase/staking-client-library-go/gen/go/coinbase/staking/orchestration/v1"; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; + +// An Action resource represents an action you may take on a network (e.g. stake, unstake). +message Action { + option (google.api.resource) = { + type: "staking.coinbase.com/Action" + pattern: "protocols/{protocol}/networks/{network}/actions/{action}" + singular: "action" + plural: "actions" + }; + + // The resource name of the Action. + // Format: protocols/{protocolName}/networks/{networkName}/actions/{actionName} + // Ex: protocols/ethereum_kiln/networks/holesky/validators/stake + string name = 1; +} + +// The request message for ListActions. +message ListActionsRequest { + // The resource name of the parent that owns + // the collection of actions. + // Format: protocols/{protocol}/networks/{network} + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "staking.coinbase.com/Action" + }]; +} + +// The response message for ListActions. +message ListActionsResponse { + // The list of actions. + repeated Action actions = 1; +} diff --git a/protos/coinbase/staking/orchestration/v1/api.proto b/protos/coinbase/staking/orchestration/v1/api.proto new file mode 100644 index 0000000..44b8bc3 --- /dev/null +++ b/protos/coinbase/staking/orchestration/v1/api.proto @@ -0,0 +1,327 @@ +syntax = "proto3"; + +package coinbase.staking.orchestration.v1; + +option go_package = "github.com/coinbase/staking-client-library-go/gen/go/coinbase/staking/orchestration/v1"; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "protoc-gen-openapiv2/options/annotations.proto"; + +import "coinbase/staking/orchestration/v1/protocol.proto"; +import "coinbase/staking/orchestration/v1/network.proto"; +import "coinbase/staking/orchestration/v1/action.proto"; +import "coinbase/staking/orchestration/v1/staking_target.proto"; +import "coinbase/staking/orchestration/v1/workflow.proto"; +import "coinbase/staking/orchestration/v1/staking_context.proto"; + +option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { + host: "api.developer.coinbase.com"; + base_path: "/staking"; + schemes: HTTPS + consumes: "application/json"; + produces: "application/json"; + info: { + title: "Orchestration Service"; + description: "Service that can power non-custodial staking experiences for your users."; + version: "v1"; + }; + responses: { + key: "400"; + value: { + description: "The request attempted has invalid parameters"; + schema: { + json_schema: { + ref: "#/definitions/rpcStatus"; + }; + }; + }; + }; + responses: { + key: "401"; + value: { + description: "Returned if authentication information is invalid"; + schema: { + json_schema: { + ref: "#/definitions/rpcStatus"; + }; + }; + }; + }; + responses: { + key: "403"; + value: { + description: "Returned when a user does not have permission to the resource."; + schema: { + json_schema: { + ref: "#/definitions/rpcStatus"; + }; + }; + }; + }; + responses: { + key: "404"; + value: { + description: "Returned when a resource is not found."; + schema: { + json_schema: { + ref: "#/definitions/rpcStatus"; + }; + }; + }; + }; + responses: { + key: "429"; + value: { + description: "Returned when a resource limit has been reached."; + schema: { + json_schema: { + ref: "#/definitions/rpcStatus"; + }; + }; + }; + }; + responses: { + key: "500"; + value: { + description: "Returned when an internal server error happens."; + schema: { + json_schema: { + ref: "#/definitions/rpcStatus"; + }; + }; + }; + }; + tags: [ + { + name: "Protocol"; + description: "Protocols details"; + }, + { + name: "Network"; + description: "Networks details"; + }, + { + name: "Action"; + description: "Actions details"; + }, + { + name: "StakingTarget"; + description: "Staking targets details"; + }, + { + name: "StakingContext"; + description: "Staking context details"; + }, + { + name: "Workflow"; + description: "Workflow management details"; + } + ]; +}; + +// StakingService manages staking related resources such as protocols, networks, validators and workflows. +service StakingService { + option (google.api.default_host) = "api.developer.coinbase.com"; + + // List supported protocols. + rpc ListProtocols(ListProtocolsRequest) returns (ListProtocolsResponse) { + option (google.api.http) = { + get: "/v1/protocols" + }; + + option (google.api.method_signature) = ""; + + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + summary: "List supported protocols"; + description: "List supported protocols"; + operation_id: "listProtocols"; + tags: "Protocol"; + responses: { + key: "200" + value: { + description: "OK"; + } + } + }; + + }; + + // List supported staking networks for a given protocol. + rpc ListNetworks(ListNetworksRequest) returns (ListNetworksResponse) { + option (google.api.http) = { + get: "/v1/{parent=protocols/*}/networks" + }; + + option (google.api.method_signature) = "parent"; + + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + summary: "List supported networks"; + description: "List supported networks"; + operation_id: "listNetworks"; + tags: "Network"; + responses: { + key: "200" + value: { + description: "OK"; + } + } + }; + + }; + + // List supported staking targets for a given protocol and network. + rpc ListStakingTargets(ListStakingTargetsRequest) returns (ListStakingTargetsResponse) { + option (google.api.http) = { + get: "/v1/{parent=protocols/*/networks/*}/stakingTargets" + }; + + option (google.api.method_signature) = "parent"; + + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + summary: "List supported staking targets"; + description: "List supported staking targets"; + operation_id: "listStakingTargets"; + tags: "StakingTarget"; + responses: { + key: "200" + value: { + description: "OK"; + } + } + }; + + }; + + // List supported actions for a given protocol and network. + rpc ListActions(ListActionsRequest) returns (ListActionsResponse) { + option (google.api.http) = { + get: "/v1/{parent=protocols/*/networks/*}/actions" + }; + + option (google.api.method_signature) = "parent"; + + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + summary: "List supported actions"; + description: "List supported actions"; + operation_id: "listActions"; + tags: "Action"; + responses: { + key: "200" + value: { + description: "OK"; + } + } + }; + + }; + + // Create a workflow to perform an action. + rpc CreateWorkflow(CreateWorkflowRequest) returns (Workflow) { + option (google.api.method_signature) = "parent,workflow"; + + option (google.api.http) = { + post: "/v1/{parent=projects/*}/workflows" + body: "workflow" + }; + + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + summary: "Create workflow"; + operation_id: "createWorkflow"; + tags: "Workflow"; + responses: { + key: "200" + value: { + description: "OK"; + } + } + }; + + }; + + // Get the current state of an active workflow. + rpc GetWorkflow(GetWorkflowRequest) returns (Workflow) { + option (google.api.http) = { + get: "/v1/{name=projects/*/workflows/*}" + }; + + option (google.api.method_signature) = "name"; + + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + summary: "Get workflow"; + operation_id: "getWorkflow"; + tags: "Workflow"; + responses: { + key: "200" + value: { + description: "OK"; + } + } + }; + + }; + + // List all workflows in a project. + rpc ListWorkflows(ListWorkflowsRequest) returns (ListWorkflowsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*}/workflows" + }; + + option (google.api.method_signature) = "parent"; + + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + summary: "List supported workflows"; + operation_id: "listWorkflows"; + tags: "Workflow"; + responses: { + key: "200" + value: { + description: "OK"; + } + } + }; + + }; + + // Perform the next step in a workflow. + rpc PerformWorkflowStep(PerformWorkflowStepRequest) returns (Workflow) { + option (google.api.http) = { + post: "/v1/{name=projects/*/workflows/*}/step" + body: "*" + }; + + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + summary: "Perform the next step in a workflow"; + description: "Perform the next step in a workflow"; + operation_id: "updateWorkflow"; + tags: "Workflow"; + responses: { + key: "200" + value: { + description: "OK"; + } + } + }; + + }; + + // View Staking context information given a specific network address. + rpc ViewStakingContext(ViewStakingContextRequest) returns (ViewStakingContextResponse) { + option (google.api.http) = { + get: "/v1/viewStakingContext:view" + }; + + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + summary: "Returns point-in-time context of staking data for an address"; + description: "Returns point-in-time context of staking data for an address"; + operation_id: "ViewStakingContext"; + tags: "StakingContext"; + responses: { + key: "200" + value: { + description: "OK"; + } + } + }; + }; +} diff --git a/protos/coinbase/staking/orchestration/v1/common.proto b/protos/coinbase/staking/orchestration/v1/common.proto new file mode 100644 index 0000000..474dffa --- /dev/null +++ b/protos/coinbase/staking/orchestration/v1/common.proto @@ -0,0 +1,17 @@ +syntax = "proto3"; + +package coinbase.staking.orchestration.v1; + +option go_package = "github.com/coinbase/staking-client-library-go/gen/go/coinbase/staking/orchestration/v1"; + +import "protoc-gen-openapiv2/options/annotations.proto"; + +// The amount of a token you wish to perform an action +// with. +message Amount { + // The total value of the token. + string value = 1; + + // The name of the token. + string currency = 2 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {description: "The currency of the token"}]; +} diff --git a/protos/coinbase/staking/orchestration/v1/ethereum_kiln.proto b/protos/coinbase/staking/orchestration/v1/ethereum_kiln.proto new file mode 100644 index 0000000..bc9cbdd --- /dev/null +++ b/protos/coinbase/staking/orchestration/v1/ethereum_kiln.proto @@ -0,0 +1,113 @@ +syntax = "proto3"; + +package coinbase.staking.orchestration.v1; + +import "coinbase/staking/orchestration/v1/common.proto"; +import "protoc-gen-openapiv2/options/annotations.proto"; +import "google/api/field_behavior.proto"; + +option go_package = "github.com/coinbase/staking-client-library-go/gen/go/coinbase/staking/orchestration/v1"; + +// The parameters required for the stake action on Ethereum Kiln. +message EthereumKilnStakeParameters { + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = { + json_schema: {title: "EthereumKiln: Stake Parameters"} + }; + + // The address you wish to stake from. + string staker_address = 1 [(google.api.field_behavior) = REQUIRED]; + + // The address of the integrator contract. + string integrator_contract_address = 2 [(google.api.field_behavior) = REQUIRED]; + + // The amount of Ethereum to stake in wei. + Amount amount = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// The parameters required for the unstake action on Ethereum Kiln. +message EthereumKilnUnstakeParameters { + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = { + json_schema: {title: "EthereumKiln: Unstake Parameters"} + }; + + // The address you wish to unstake from. + string staker_address = 1 [(google.api.field_behavior) = REQUIRED]; + + // The address of the integrator contract. + string integrator_contract_address = 2 [(google.api.field_behavior) = REQUIRED]; + + // The amount of Ethereum to unstake in wei. + Amount amount = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// The parameters required for the claim stake action on Ethereum Kiln. +message EthereumKilnClaimStakeParameters { + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = { + json_schema: {title: "EthereumKiln: Claim Stake Parameters"} + }; + + // The address you wish to claim stake for. + string staker_address = 1 [(google.api.field_behavior) = REQUIRED]; + + // The address of the integrator contract + string integrator_contract_address = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// The parameters needed for staking on Ethereum via Kiln. +message EthereumKilnStakingParameters { + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = { + json_schema: {title: "EthereumKiln: Staking Parameters"} + }; + + reserved 3; // reserved for EthereumKilnClaimRewardsParameters filed. + + oneof parameters { + // The parameters for stake action on Ethereum Kiln. + EthereumKilnStakeParameters stake_parameters = 1; + // The parameters for unstake action on Ethereum Kiln. + EthereumKilnUnstakeParameters unstake_parameters = 2; + // The parameters for claim stake action on Ethereum Kiln. + EthereumKilnClaimStakeParameters claim_stake_parameters = 4; + } +} + +// The protocol specific parameters required for fetching a staking context. +message EthereumKilnStakingContextParameters { + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = { + json_schema: {title: "EthereumKiln: Staking Context Parameters"} + }; + + // Integrator contract address. + string integrator_contract_address = 1; +} + +// The protocol specific details for an Ethereum Kiln staking context. +message EthereumKilnStakingContextDetails { + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = { + json_schema: {title: "EthereumKiln: Staking context details"} + }; + + // The Ethereum balance of the address. + // This can be used to gate the stake action to make sure the requested stake amount + // is less than ethereum_balance. + Amount ethereum_balance = 1; + + // The number of integrator shares owned by the address. + Amount integrator_share_balance = 2; + + // The total Ethereum you can exchange for your integrator shares. + // This can be used to gate the unstake action to make sure the requested unstake amount + // is less than integrator_share_underlying_balance + Amount integrator_share_underlying_balance = 3; + + // The total amount of Ethereum you can redeem for all non-claimed vPool shares. + // This along with the condition total_shares_pending_exit == fulfillable_share_count + // can be used to gate the claim_stake action. + Amount total_exitable_eth = 4; + + // The number of vPool shares are eligible to receive now or at a later point in time. + Amount total_shares_pending_exit = 5; + + // The number of vPool shares you are able to claim now. + Amount fulfillable_share_count = 6; +} diff --git a/protos/coinbase/staking/orchestration/v1/network.proto b/protos/coinbase/staking/orchestration/v1/network.proto new file mode 100644 index 0000000..87f61a3 --- /dev/null +++ b/protos/coinbase/staking/orchestration/v1/network.proto @@ -0,0 +1,43 @@ +syntax = "proto3"; + +package coinbase.staking.orchestration.v1; + +option go_package = "github.com/coinbase/staking-client-library-go/gen/go/coinbase/staking/orchestration/v1"; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; + +// A Network resource represents a blockchain network e.g. mainnet, testnet, etc. +message Network { + option (google.api.resource) = { + type: "staking.coinbase.com/Network" + pattern: "protocols/{protocol}/networks/{network}" + singular: "network" + plural: "networks" + }; + + // The resource name of the Network. + // Format: protocols/{protocolName}/networks/{networkName} + // Ex: protocols/ethereum_kiln/networks/holesky + string name = 1; + + reserved 2; // reserved for IsMainnet, represented if the network is the mainnet network for the given protocol. +} + +// The request message for ListNetworks. +message ListNetworksRequest { + // The resource name of the parent that owns + // the collection of networks. + // Format: protocols/{protocol} + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "staking.coinbase.com/Network" + }]; +} + +// The response message for ListNetworks. +message ListNetworksResponse { + // The list of networks. + repeated Network networks = 1; +} diff --git a/protos/coinbase/staking/orchestration/v1/protocol.proto b/protos/coinbase/staking/orchestration/v1/protocol.proto new file mode 100644 index 0000000..06510f9 --- /dev/null +++ b/protos/coinbase/staking/orchestration/v1/protocol.proto @@ -0,0 +1,31 @@ +syntax = "proto3"; + +package coinbase.staking.orchestration.v1; + +option go_package = "github.com/coinbase/staking-client-library-go/gen/go/coinbase/staking/orchestration/v1"; + +import "google/api/resource.proto"; + +// A Protocol resource (e.g. ethereum_kiln, solana etc.). +message Protocol { + option (google.api.resource) = { + type: "staking.coinbase.com/Protocol" + pattern: "protocols/{protocol}" + singular: "protocol" + plural: "protocols" + }; + + // The resource name of the Protocol. + // Format: protocols/{protocolName} + // Ex: protocols/ethereum_kiln + string name = 1; +} + +// The request message for ListProtocols. +message ListProtocolsRequest { } + +// The response message for ListProtocols. +message ListProtocolsResponse { + // The list of protocols. + repeated Protocol protocols = 1; +} diff --git a/protos/coinbase/staking/orchestration/v1/solana.proto b/protos/coinbase/staking/orchestration/v1/solana.proto new file mode 100644 index 0000000..abc9b72 --- /dev/null +++ b/protos/coinbase/staking/orchestration/v1/solana.proto @@ -0,0 +1,168 @@ +syntax = "proto3"; + +package coinbase.staking.orchestration.v1; + +import "coinbase/staking/orchestration/v1/common.proto"; +import "google/api/field_behavior.proto"; +import "protoc-gen-openapiv2/options/annotations.proto"; + +option go_package = "github.com/coinbase/staking-client-library-go/gen/go/coinbase/staking/orchestration/v1"; + +// A prioritization fee that can be added to a Solana transaction. +message PriorityFee { + // The maximum number of compute units a transaction is allowed to consume. + int64 compute_unit_limit = 1; + + // The price to pay per compute unit. + int64 unit_price = 2; +} + +// The parameters required to perform a stake operation on Solana. +message SolanaStakeParameters { + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = { + json_schema: {title: "Solana: Stake Parameters"} + }; + + // The address where the funds are coming from to stake. + string wallet_address = 1; + + // The address of the validator. + string validator_address = 2; + + // The amount of Solana to stake in lamports. (1 lamport = 0.000000001 SOL) + Amount amount = 3; + + // The option to set a priority fee for the transaction. + PriorityFee priority_fee = 4; +} + +// The parameters required to perform a unstake operation on Solana. +message SolanaUnstakeParameters { + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = { + json_schema: {title: "Solana: Unstake Parameters"} + }; + + // The address which is the signing authority to unstake. + string wallet_address = 1; + + // The address of the stake account to unstake from. + string stake_account_address = 2; + + // The amount of Solana to unstake in lamports. (1 lamport = 0.000000001 SOL) + Amount amount = 3; + + // The option to set a priority fee for the transaction. + PriorityFee priority_fee = 4; +} + +// The parameters required to perform a claim stake operation on Solana. +message SolanaClaimStakeParameters { + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = { + json_schema: {title: "Solana: Claim Stake Parameters"} + }; + + // The address which is the signing authority to claim stake. + string wallet_address = 1; + + // The address of the stake account to claim stake from. + string stake_account_address = 2; + + // The option to set a priority fee for the transaction. + PriorityFee priority_fee = 3; +} + +// The protocol specific parameters required for fetching a staking context. +message SolanaStakingContextParameters { + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = { + json_schema: {title: "Solana: Staking Context Parameters"} + }; +} + +// The protocol specific details for a Solana staking context. +message SolanaStakingContextDetails { + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = { + json_schema: {title: "Solana: Staking Context Details"} + }; + + // The total balance of the main wallet address (system account). + // Used to check the balance for any future staking or transaction to send. + Amount balance = 1; + + // The current epoch that the Solana blockchain is in. + // Used as a frame of reference for future stake activations and deactivations. + int64 current_epoch = 2; + + // How much of the epoch has passed as a percentage. + // Used to inform how much time is left before a stake is activated or deactivated. + string epoch_completion_percentage = 3; + + // The list of staking accounts that are linked to the main wallet address (system account). + // Used to check for statuses and balances of all stake accounts related to the main wallet address that + // they're linked to. + repeated StakeAccount stake_accounts = 4; +} + +// The balance information for a stake account. +message StakeAccount { + // The address of the stake account. + // Used to hold the staked funds transferred over from the main wallet. + string address = 1; + + // The bonded balance in lamports on the stake account (rent is not included in bonded amount). + // Used to check the amount that is currently staked. + Amount bonded_stake = 2; + + // The rent amount for the stake account in lamports. + // Used to highlight the amount used as the rent to maintain the address on the Solana blockchain. + Amount rent_reserve = 3; + + // The total balance on the address in lamports. + // Used to check the total balance for the stake account. + Amount balance = 4; + + // Represents the different states a stake account balance can have. + // Used to check to see if stake is actively earning rewards or ready to be withdrawn. + enum BalanceState { + // The balance is not known. + BALANCE_STATE_UNSPECIFIED = 0; + + // The balance is not actively staking. + BALANCE_STATE_INACTIVE = 1; + + // The balance is in a warm up period and will activate in the next epoch. + BALANCE_STATE_ACTIVATING = 2; + + // The balance is actively staking and earning rewards. + BALANCE_STATE_ACTIVE = 3; + + // The balance is in a cool down period and will be deactivated in the next epoch. + BALANCE_STATE_DEACTIVATING = 4; + } + + // The balance state of the stake account. + // Used to show what state the currently staked funds are in. + BalanceState balance_state = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The validator (vote account) that the stake account is assigned to stake to. + // Used to show where the staked funds are staked to. + string validator = 6; +} + +// The parameters needed for staking on Solana. +message SolanaStakingParameters { + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = { + json_schema: {title: "Solana: Staking Parameters"} + }; + + reserved 1 to 6; + reserved "create_stake_parameters", "delegate_stake_parameters", "deactivate_stake_parameters", "withdraw_stake_parameters", "split_stake_parameters", "merge_stake_parameters"; + + oneof parameters { + // The parameters for stake action on Solana. + SolanaStakeParameters stake_parameters = 7; + // The parameters for unstake action on Solana. + SolanaUnstakeParameters unstake_parameters = 8; + // The parameters for claim stake action on Solana. + SolanaClaimStakeParameters claim_stake_parameters = 9; + } +} diff --git a/protos/coinbase/staking/orchestration/v1/staking_context.proto b/protos/coinbase/staking/orchestration/v1/staking_context.proto new file mode 100644 index 0000000..e1fcf10 --- /dev/null +++ b/protos/coinbase/staking/orchestration/v1/staking_context.proto @@ -0,0 +1,45 @@ +syntax = "proto3"; + +package coinbase.staking.orchestration.v1; + +option go_package = "github.com/coinbase/staking-client-library-go/gen/go/coinbase/staking/orchestration/v1"; + +import "google/api/field_behavior.proto"; +import "coinbase/staking/orchestration/v1/ethereum_kiln.proto"; +import "coinbase/staking/orchestration/v1/solana.proto"; + +// The request message for the ViewStakingContext request. +message ViewStakingContextRequest { + // The address to fetch staking context for. + string address = 1 [(google.api.field_behavior) = REQUIRED]; + + // The network to fetch staking context for. + string network = 2 [(google.api.field_behavior) = REQUIRED]; + + // The protocol specific parameters needed to fetch a staking context. + oneof staking_context_parameters { + + // EthereumKiln staking context parameters. + EthereumKilnStakingContextParameters ethereum_kiln_staking_context_parameters = 3 [(google.api.field_behavior) = REQUIRED]; + + // Solana staking context parameters. + SolanaStakingContextParameters solana_staking_context_parameters = 4 [(google.api.field_behavior) = REQUIRED]; + + } +} + +// The response message for the ViewStakingContext request. +message ViewStakingContextResponse { + // The address you are getting a staking context for. + string address = 1 [(google.api.field_behavior) = REQUIRED]; + + // The protocol specific details of the staking context. + oneof staking_context_details { + + // EthereumKiln staking context details. + EthereumKilnStakingContextDetails ethereum_kiln_staking_context_details = 2 [(google.api.field_behavior) = REQUIRED]; + + // Solana staking context details. + SolanaStakingContextDetails solana_staking_context_details = 3 [(google.api.field_behavior) = REQUIRED]; + } +} diff --git a/protos/coinbase/staking/orchestration/v1/staking_target.proto b/protos/coinbase/staking/orchestration/v1/staking_target.proto new file mode 100644 index 0000000..a85bd04 --- /dev/null +++ b/protos/coinbase/staking/orchestration/v1/staking_target.proto @@ -0,0 +1,97 @@ +syntax = "proto3"; + +package coinbase.staking.orchestration.v1; + +option go_package = "github.com/coinbase/staking-client-library-go/gen/go/coinbase/staking/orchestration/v1"; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; + +// A Validator resource represents an active validator for the given protocol network. +message Validator { + option (google.api.resource) = { + type: "staking.coinbase.com/Validator" + pattern: "protocols/{protocol}/networks/{network}/stakingTargets/{validator}" + singular: "validator" + plural: "validators" + }; + + // The resource name of the Validator. + // Format: protocols/{protocolName}/networks/{networkName}/stakingTargets/{validatorName} + // Ex: protocols/solana/networks/testnet/stakingTargets/GkqYQysEGmuL6V2AJoNnWZUz2ZBGWhzQXsJiXm2CLKAN + string name = 1; + + // The public address of the validator. + string address = 2; + + // The rate of commission for the validator + float commission_rate = 3; +} + +// A Contract resource, which represents an active contract +// for the given protocol network which you can submit an action +// to. +message Contract { + option (google.api.resource) = { + type: "staking.coinbase.com/Contract" + pattern: "protocols/{protocol}/networks/{network}/stakingTargets/{contract}" + singular: "contract" + plural: "contracts" + }; + + // The resource name of the Contract Address. + // Format: protocols/{protocolName}/networks/{networkName}/stakingTargets/{contractName} + // Ex: protocols/ethereum_kiln/networks/holesky/stakingTargets/0xA55416de5DE61A0AC1aa8970a280E04388B1dE4b + string name = 1; + + // The contract address you may submit actions to. + string address = 2; +} + +// A Staking Target represents a destination that you perform an action on related to staking. +message StakingTarget { + + oneof staking_targets { + // A validator to stake to. + Validator validator = 1; + + // A contract to send a staking action to. + Contract contract = 2; + } +} + +// The request message for ListStakingTargets. +message ListStakingTargetsRequest { + // The resource name of the parent that owns + // the collection of staking targets. + // Format: protocols/{protocol}/networks/{network} + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "staking.coinbase.com/StakingTarget" + }]; + + // The maximum number of staking targets to return. The service may + // return fewer than this value. + // + // If unspecified, 100 staking targets will be returned. + // The maximum value is 1000; values over 1000 will be floored to 1000. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // A page token as part of the response of a previous call. + // Provide this to retrieve the next page. + // + // When paginating, all other parameters must match the previous + // request to list resources. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// The response message for ListStakingTargets. +message ListStakingTargetsResponse { + // The list of staking targets. + repeated StakingTarget staking_targets = 1; + + // A token which can be provided as `page_token` to retrieve the next page. + // If this field is omitted, there are no additional pages. + string next_page_token = 2; +} diff --git a/protos/coinbase/staking/orchestration/v1/workflow.proto b/protos/coinbase/staking/orchestration/v1/workflow.proto new file mode 100644 index 0000000..41b1308 --- /dev/null +++ b/protos/coinbase/staking/orchestration/v1/workflow.proto @@ -0,0 +1,280 @@ +syntax = "proto3"; + +package coinbase.staking.orchestration.v1; + +import "coinbase/staking/orchestration/v1/ethereum_kiln.proto"; +import "coinbase/staking/orchestration/v1/solana.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; +import "protoc-gen-openapiv2/options/annotations.proto"; + +option go_package = "github.com/coinbase/staking-client-library-go/gen/go/coinbase/staking/orchestration/v1"; + +// The details of a transaction being constructed and broadcasted to the network. +message TxStepOutput { + // The unsigned transaction which was signed in order to be broadcasted. + string unsigned_tx = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The signed transaction which was asked to be broadcasted. + string signed_tx = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The hash of the broadcasted transaction. + string tx_hash = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // State defines an enumeration of states for a staking transaction. + enum State { + reserved 11 to 15; + reserved "STATE_CANCELING", "STATE_CANCELED", "STATE_CANCEL_FAILED", "STATE_FAILED_REFRESHABLE", "STATE_REFRESHING"; + + // Unspecified transaction state, this is for backwards compatibility. + STATE_UNSPECIFIED = 0; + // Tx has not yet been constructed in the backend. + STATE_NOT_CONSTRUCTED = 1; + // Tx construction is over in the backend. + STATE_CONSTRUCTED = 2; + // Tx is waiting to be signed. + STATE_PENDING_SIGNING = 3; + // Tx has been signed and returned to the backend. + STATE_SIGNED = 4; + // Tx is being broadcasted to the network. + STATE_BROADCASTING = 5; + // Tx is waiting for confirmation. + STATE_CONFIRMING = 6; + // Tx has been confirmed to be included in a block. + STATE_CONFIRMED = 7; + // Tx has been finalized. + STATE_FINALIZED = 8; + // Tx construction or broadcasting failed. + STATE_FAILED = 9; + // Tx has been successfully executed. + STATE_SUCCESS = 10; + // Tx is waiting to be externally broadcasted by the customer. + STATE_PENDING_EXT_BROADCAST = 16; + } + + // The state of the transaction step. + State state = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The error message if the transaction step failed. + string error_message = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// The output details of a step where we wait for some kind of on-chain activity to finish like reaching a certain checkpoint, epoch or block. +message WaitStepOutput { + // The beginning of wait period. + int64 start = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The current wait progress. + int64 current = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The target wait end point. + int64 target = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The unit of wait time. + enum WaitUnit { + // Unspecified wait time. + WAIT_UNIT_UNSPECIFIED = 0; + // Wait time measured in seconds. + WAIT_UNIT_SECONDS = 1; + // Wait time measured in blocks. + WAIT_UNIT_BLOCKS = 2; + // Wait time measured in epochs. + WAIT_UNIT_EPOCHS = 3; + // Wait time measured in checkpoints. + WAIT_UNIT_CHECKPOINTS = 4; + } + + // The wait unit (like checkpoint, block, epoch etc). + WaitUnit unit = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // WaitStepState defines an enumeration of states for a wait step. + enum State { + // Unspecified wait step state. + STATE_UNSPECIFIED = 0; + // Wait step has not started. + STATE_NOT_STARTED = 1; + // Wait step is in-progress. + STATE_IN_PROGRESS = 2; + // Wait step completed. + STATE_COMPLETED = 3; + } + + // The state of the wait step. + State state = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// The information for a step in the workflow. +message WorkflowStep { + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = { + json_schema: {title: "The information for a step in the workflow"} + }; + + // The human readable name of the step. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The output of the current step. It can be of tx or wait type. + oneof output { + // The tx step output (e.g. transaction metadata such as unsigned tx, signed tx etc). + TxStepOutput tx_step_output = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The waiting details for any kind like how many checkpoints away for unbonding etc. + WaitStepOutput wait_step_output = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + } +} + +// A Workflow resource. +message Workflow { + option (google.api.resource) = { + type: "staking.coinbase.com/Workflow" + pattern: "projects/{project}/workflows/{workflow}" + singular: "workflow" + plural: "workflows" + }; + + // The resource name of the workflow. + // Format: projects/{projectUUID}/workflows/{workflowUUID} + // Ex: projects/ 123e4567-e89b-12d3-a456-426614174000/workflows/123e4567-e89b-12d3-a456-426614174000 + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The resource name of the action being + // performed. + // Format: protocols/{protocol}/networks/{network}/actions/{action} + string action = 2 [(google.api.field_behavior) = REQUIRED]; + + reserved 3; + + // The parameters of the action to take. + oneof staking_parameters { + // Solana staking parameters. + SolanaStakingParameters solana_staking_parameters = 9 [(google.api.field_behavior) = REQUIRED]; + // EthereumKiln staking parameters. + EthereumKilnStakingParameters ethereum_kiln_staking_parameters = 10 [(google.api.field_behavior) = REQUIRED]; + } + + // The state of a workflow + enum State { + // Example flow: A workflow with skip_broadcast = true leading to a successful completion. + // IN_PROGRESS -> WAITING_FOR_EXT_BROADCAST -> IN_PROGRESS -> COMPLETED + // Example flow: A workflow with skip_broadcast = false leading to a successful completion. + // IN_PROGRESS -> WAITING_FOR_SIGNING -> IN_PROGRESS -> COMPLETED + // Example flow: A workflow with skip_broadcast = false leading to a failure. + // IN_PROGRESS -> WAITING_FOR_SIGNING -> IN_PROGRESS -> FAILED + + reserved 5 to 8; + reserved "STATE_CANCELING", "STATE_CANCELED", "STATE_CANCEL_FAILED", "STATE_FAILED_REFRESHABLE"; + + // Unspecified workflow state, this is for backwards compatibility. + STATE_UNSPECIFIED = 0; + // In Progress represents a workflow that is currently in progress. + STATE_IN_PROGRESS = 1; + // Waiting for signing represents the workflow is waiting on the consumer to sign and return the corresponding signed tx. + STATE_WAITING_FOR_SIGNING = 2; + // Completed represents the workflow has completed. + STATE_COMPLETED = 3; + // Failed represents the workflow has failed. + STATE_FAILED = 4; + // Waiting for external broadcast represents the workflow is waiting for the customer to broadcast a tx and return its corresponding tx hash. + STATE_WAITING_FOR_EXT_BROADCAST = 9; + } + + // The current state of the workflow. + State state = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The index of the current step. + int32 current_step_id = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The list of steps for this workflow. + repeated WorkflowStep steps = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The timestamp the workflow was created. + google.protobuf.Timestamp create_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The timestamp the workflow was last updated. + google.protobuf.Timestamp update_time = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Flag to skip tx broadcast to network on behalf of the user. Use this flag if you instead prefer to broadcast signed txs on your own. + bool skip_broadcast = 11 [(google.api.field_behavior) = OPTIONAL]; + + // The timestamp the workflow completed. + google.protobuf.Timestamp complete_time = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// The request message for CreateWorkflow. +message CreateWorkflowRequest { + // The resource name of the parent that owns + // the workflow. + // Format: projects/{project} + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = {child_type: "staking.coinbase.com/Workflow"} + ]; + + // The workflow to create. + Workflow workflow = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// The message for GetWorkflow. +message GetWorkflowRequest { + // The resource name of the workflow. + // Format: projects/{project}/workflows/{workflow} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = {type: "staking.coinbase.com/Workflow"} + ]; +} + +// The message for ListWorkflows. +message ListWorkflowsRequest { + // The resource name of the parent that owns + // the collection of networks. + // Format: projects/{project} + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = {child_type: "staking.coinbase.com/Workflow"} + ]; + + // [AIP-160](https://google.aip.dev/160) filter + // Supported fields: + // - string action: "stake", "unstake" + // - string protocol: "ethereum_kiln" + // - string network: "holesky", "mainnet" + string filter = 2 [(google.api.field_behavior) = OPTIONAL]; + + // The maximum number of workflows to return. The service may + // return fewer than this value. + // + // If unspecified, 100 workflows will be returned. + // The maximum value is 1000; values over 1000 will be floored to 1000. + int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; + + // A page token as part of the response of a previous call. + // Provide this to retrieve the next page. + // + // When paginating, all other parameters must match the previous + // request to list resources. + string page_token = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// The response message for ListWorkflows. +message ListWorkflowsResponse { + // The list of workflows. + repeated Workflow workflows = 1; + + // A token which can be provided as `page_token` to retrieve the next page. + // If this field is omitted, there are no additional pages. + string next_page_token = 2; +} + +// The request message for PerformWorkflowStep. +message PerformWorkflowStepRequest { + // The resource name of the workflow. + // Format: projects/{project}/workflows/{workflow} + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // The index of the step to be performed. + int32 step = 2 [(google.api.field_behavior) = REQUIRED]; + + // Transaction metadata. This is either the signed transaction or transaction hash depending on the workflow's broadcast method. + string data = 3 [(google.api.field_behavior) = REQUIRED]; +} diff --git a/protos/coinbase/staking/rewards/v1/common.proto b/protos/coinbase/staking/rewards/v1/common.proto new file mode 100644 index 0000000..aaf77d8 --- /dev/null +++ b/protos/coinbase/staking/rewards/v1/common.proto @@ -0,0 +1,26 @@ +syntax = "proto3"; + +package coinbase.staking.rewards.v1; + +import "google/api/field_behavior.proto"; + +option go_package = "github.com/coinbase/staking-client-library-go/gen/go/coinbase/staking/rewards/v1"; + +// Amount encapsulation for a given asset. +message AssetAmount { + // The amount of the asset in the most common denomination. + // Ex: ETH (converted from gwei) + // Ex: USD (converted from fractional pennies) + string amount = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The number of decimals needed to convert from the raw numeric value to the most + // common denomination. + string exp = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The ticker of this asset (ex: USD, ETH, SOL). + string ticker = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The raw, unadulterated numeric value. + // Ex: Wei (in Ethereum) and Lamports (in Solana). + string raw_numeric = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/protos/coinbase/staking/rewards/v1/protocol.proto b/protos/coinbase/staking/rewards/v1/protocol.proto new file mode 100644 index 0000000..df80145 --- /dev/null +++ b/protos/coinbase/staking/rewards/v1/protocol.proto @@ -0,0 +1,21 @@ +syntax = "proto3"; + +package coinbase.staking.rewards.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; + +option go_package = "github.com/coinbase/staking-client-library-go/gen/go/coinbase/staking/rewards/v1"; + +// A resource for a protocol. +message Protocol { + option (google.api.resource) = { + type: "coinbase.staking.rewards/Protocol" + pattern: "protocols/{protocol}" + singular: "protocol" + plural: "protocols" + }; + + // Name of the protocol (eg. ethereum, solana, cosmos, etc.). + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/protos/coinbase/staking/rewards/v1/reward.proto b/protos/coinbase/staking/rewards/v1/reward.proto new file mode 100644 index 0000000..aa1b2d6 --- /dev/null +++ b/protos/coinbase/staking/rewards/v1/reward.proto @@ -0,0 +1,164 @@ +syntax = "proto3"; + +package coinbase.staking.rewards.v1; + +import "coinbase/staking/rewards/v1/common.proto"; +import "coinbase/staking/rewards/v1/stake.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "github.com/coinbase/staking-client-library-go/gen/go/coinbase/staking/rewards/v1"; + +// Rewards earned within a particular period of time. +// (-- api-linter: core::0123::resource-name-field=disabled +// aip.dev/not-precedent: Not including a 'name' field till our data sources support a unique identifier --) +message Reward { + option (google.api.resource) = { + type: "coinbase.staking.rewards/Reward" + pattern: "protocols/{protocol}/rewards/{reward}" + singular: "reward" + plural: "rewards" + }; + + // The address that earned this reward. + string address = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + reserved 3; + reserved "period"; + + // The period identifier of this reward aggregation. ex: epoch number, date. + oneof period_identifier { + // A unique identifier for the consensus-cycle of the blockchain. + int64 epoch = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; + // The date of the reward in format 'YYYY-MM-DD' in UTC. + // (-- api-linter: core::0142::time-field-type=disabled False positive. This isn't a timestamp, but a YYYY-MM-DD field --) + string date = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // The unit of time that the reward events were rolled up by. + // Can be either "epoch" or "daily". + AggregationUnit aggregation_unit = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The starting time of this reward period. Returned when querying by epoch. + // Timestamps are in UTC, conforming to the RFC-3339 spec (e.g. 2024-11-13T19:38:36Z). + // Field currently unavailable. Coming soon. + google.protobuf.Timestamp period_start_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The ending time of this reward period. Returned when querying by epoch. + // Timestamps are in UTC, conforming to the RFC-3339 spec (e.g. 2024-11-13T19:38:36Z). + google.protobuf.Timestamp period_end_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The amount earned in this time period in the native unit of the protocol. + AssetAmount total_earned_native_unit = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The amount earned in this time period in USD. Calculated by getting each individual reward of this + // time period and summing the USD value of each individual component. USD value is calculate at + // the time each component was earned. + repeated USDValue total_earned_usd = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // A snapshot of the staking balance the end of this period. + // Field currently unavailable. Coming soon. + Stake ending_balance = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The protocol on which this reward was earned. + string protocol = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Information regarding the USD value of a reward, with necessary context and metadata. +message USDValue { + // The source of the USD price conversion. Could be internal to Coinbase, and external source, or any other source. + Source source = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The source of the USD price conversion. + enum Source { + // The USD value source is unknown or unspecified. + SOURCE_UNSPECIFIED = 0; + // The USD value source is the Coinbase exchange. + COINBASE_EXCHANGE = 1; + } + + // The timestamp at which the USD value was sourced to convert the value into USD. + // This value is as close to the time the reward was earned as possible. + // Timestamps are in UTC, conforming to the RFC-3339 spec (e.g. 2024-11-13T19:38:36Z). + google.protobuf.Timestamp conversion_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The USD value of the reward at the conversion time. + AssetAmount amount = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The price of the native unit at the conversion time. + string conversion_price = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// The request message for ListRewards. +message ListRewardsRequest { + // The protocol that the rewards were earned on. + // The response will only include rewards for the protocol specified here. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference).type = "coinbase.staking.rewards/Protocol" + ]; + + // The maximum number of items to return. Maximum size of this value is 500. + // If user supplies a value > 500, the API will truncate to 500. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // A page token as part of the response of a previous call. + // Provide this to retrieve the next page. + // + // When paginating, all other parameters must match the previous + // request to list resources correctly. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // [AIP-160](https://google.aip.dev/160) format compliant filter. Supported protocols are 'ethereum', 'solana', and 'cosmos'. + // Supplying other protocols will return an error. + // * **Ethereum**: + // - Fields: + // - `address` - A ethereum validator public key. + // - `date` - A date in format 'YYYY-MM-DD'. Supports multiple comparisons (ex: '2024-01-15). + // - `period_end_time` - A timestamp in RFC-3339 format. Supports multiple comparisons (ex: '2024-01-01T00:00:00Z' and '2024-01-15T00:00:00Z'). + // - Example(s): + // - `"address='0xac53512c39d0081ca4437c285305eb423f474e6153693c12fbba4a3df78bcaa3422b31d800c5bea71c1b017168a60474' AND date >= '2024-01-01' AND date < '2024-01-15'"` + // - `"address='0xac53512c39d0081ca4437c285305eb423f474e6153693c12fbba4a3df78bcaa3422b31d800c5bea71c1b017168a60474' AND period_end_time >= '2024-01-01T00:00:00Z' AND period_end_time < '2024-01-15T00:00:00Z'"` + // - `"address='0xac53512c39d0081ca4437c285305eb423f474e6153693c12fbba4a3df78bcaa3422b31d800c5bea71c1b017168a60474' AND date = '2024-01-01'"` + // + // * **Solana**: + // - Fields: + // - `address` - A solana validator or delegator address. + // - `epoch` - A solana epoch. Supports epoch comparisons (ex: `epoch >= 1000 AND epoch <= 2000`). + // - `period_end_time` - A timestamp in RFC-3339 format. Supports multiple comparisons (ex: '2024-01-01T00:00:00Z' and '2024-01-15T00:00:00Z'). + // - Example(s): + // - `"address='beefKGBWeSpHzYBHZXwp5So7wdQGX6mu4ZHCsH3uTar' AND epoch >= 540 AND epoch < 550"` + // - `"address='beefKGBWeSpHzYBHZXwp5So7wdQGX6mu4ZHCsH3uTar' AND period_end_time >= '2024-01-01T00:00:00Z' AND period_end_time < '2024-01-15T00:00:00Z'"` + // - `"address='beefKGBWeSpHzYBHZXwp5So7wdQGX6mu4ZHCsH3uTar' AND epoch = 550"` + // + // * **Cosmos**: + // - Fields: + // - `address` - A cosmos validator or delegator address (ex: `cosmosvaloper1c4k24jzduc365kywrsvf5ujz4ya6mwympnc4en` and `cosmos1c4k24jzduc365kywrsvf5ujz4ya6mwymy8vq4q`) + // - `date` - A date in format 'YYYY-MM-DD'. Supports multiple comparisons (ex: '2024-01-15). + // - `period_end_time` - A timestamp in RFC-3339 format. Supports multiple comparisons (ex: '2024-01-01T00:00:00Z' and '2024-01-15T00:00:00Z'). + // - Example(s): + // - `"address='cosmos1mfduj0qax6ut8rd6cfc4j0ds06z0mwlhrljhqh' AND date = '2024-11-16'"` + // - `"address='cosmos1mfduj0qax6ut8rd6cfc4j0ds06z0mwlhrljhqh' AND period_end_time >= '2024-01-01T00:00:00Z' AND period_end_time < '2024-01-15T00:00:00Z'"` + // - `"address='cosmos1mfduj0qax6ut8rd6cfc4j0ds06z0mwlhrljhqh' AND date = '2024-01-01'"` + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// The response message for ListRewards. +message ListRewardsResponse { + // The rewards returned in this response. + repeated Reward rewards = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The page token the user must use in the next request if the next page is desired. + string next_page_token = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// The unit of time that the reward events were aggregated by. +enum AggregationUnit { + // Aggregation unit is unknown or unspecified. + AGGREGATION_UNIT_UNSPECIFIED = 0; + // Indicates the rewards are aggregated by epoch. This means there will be a 'epoch' field displaying the epoch on this resource. + EPOCH = 1; + // Indicates the rewards are aggregated by day. This means there will be a 'date' field displaying the date on this resource. + DAY = 2; +} diff --git a/protos/coinbase/staking/rewards/v1/reward_service.proto b/protos/coinbase/staking/rewards/v1/reward_service.proto new file mode 100644 index 0000000..ad6e3fa --- /dev/null +++ b/protos/coinbase/staking/rewards/v1/reward_service.proto @@ -0,0 +1,110 @@ +syntax = "proto3"; + +package coinbase.staking.rewards.v1; + +import "coinbase/staking/rewards/v1/reward.proto"; +import "coinbase/staking/rewards/v1/stake.proto"; +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "protoc-gen-openapiv2/options/annotations.proto"; + +option go_package = "github.com/coinbase/staking-client-library-go/gen/go/coinbase/staking/rewards/v1"; +option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { + host: "api.developer.coinbase.com"; + base_path: "/rewards"; + schemes: HTTPS + consumes: "application/json"; + produces: "application/json"; + info: { + title: "Rewards Service"; + description: "Service that provides access to onchain, staking-related rewards data."; + version: "v1"; + }; + + responses: { + key: "401"; + value: { + description: "Returned if authentication information is invalid"; + schema: {example: '"Unauthorized"'}; + }; + }; + + responses: { + key: "500"; + value: { + description: "Returned when an internal server error happens."; + schema: {example: '{"code":3,"message":"Internal server error.","details":[]}'}; + }; + }; + tags: [ + { + name: "Reward"; + description: "A high-level view of an address's rewards aggregated over some period of time (ex: over an Epoch)."; + }, + { + name: "Stake"; + description: "A snapshot of an address's staking-related balance at a particular point in time. Feature coming soon."; + } + ]; +}; + +// RewardService exposes publicly available onchain staking-related rewards data across all supported protocols. +service RewardService { + option (google.api.default_host) = "api.developer.coinbase.com"; + + // List rewards for a given protocol. + rpc ListRewards(ListRewardsRequest) returns (ListRewardsResponse) { + option (google.api.http) = {get: "/v1/{parent=protocols/*}/rewards"}; + + option (google.api.method_signature) = "parent"; + + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + summary: "List and filter rewards"; + description: "Lists onchain rewards of an address for a specific protocol, with optional filters for time range, aggregation period, and more."; + tags: "Reward"; + responses: { + key: "200" + value: { + description: "OK" + schema: {example: '{"rewards":[{"address":"beefKGBWeSpHzYBHZXwp5So7wdQGX6mu4ZHCsH3uTar","epoch":"533","aggregationUnit":"epoch","periodStartTime":null,"periodEndTime":"2023-11-16T00:13:44Z","totalEarnedNativeUnit":{"amount":"224.7098145","exp":"9","ticker":"SOL","rawNumeric":"224709814509"},"totalEarnedUsd":null,"endingBalance":null,"protocol":"solana"},{"address":"beefKGBWeSpHzYBHZXwp5So7wdQGX6mu4ZHCsH3uTar","epoch":"532","aggregationUnit":"epoch","periodStartTime":null,"periodEndTime":"2023-11-13T19:38:36Z","totalEarnedNativeUnit":{"amount":"225.0794241","exp":"9","ticker":"SOL","rawNumeric":"225079424094"},"totalEarnedUsd":null,"endingBalance":null,"protocol":"solana"}],"nextPageToken":"VAql-wtdiJWkWII9bJBDnE9oEc-8IlgU0DtKbxSDtBg=:1:1700241277"}'}, + } + } + responses: { + key: "400"; + value: { + description: "The request attempted has invalid parameters"; + schema: {example: '{"code":3,"message":"Filter validation failed. .","details":[]}'}; + }; + }; + }; + } + + // List staking activities for a given protocol. + rpc ListStakes(ListStakesRequest) returns (ListStakesResponse) { + option (google.api.http) = {get: "/v1/{parent=protocols/*}/stakes"}; + + option (google.api.method_signature) = "parent"; + + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + summary: "List and filter staking balances"; + description: "Lists staking balance of a protocol, with optional filters for time range and address."; + tags: "Stake"; + responses: { + key: "200" + value: { + description: "OK" + schema: { + json_schema: {ref: "#/definitions/v1ListStakesResponse"} + } + } + } + responses: { + key: "400"; + value: { + description: "The request attempted has invalid parameters"; + schema: {example: '{"code":3,"message":"Filter validation failed. .","details":[]}'}; + }; + }; + }; + } +} diff --git a/protos/coinbase/staking/rewards/v1/stake.proto b/protos/coinbase/staking/rewards/v1/stake.proto new file mode 100644 index 0000000..2dc5fc9 --- /dev/null +++ b/protos/coinbase/staking/rewards/v1/stake.proto @@ -0,0 +1,190 @@ +syntax = "proto3"; + +package coinbase.staking.rewards.v1; + +import "coinbase/staking/rewards/v1/common.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/descriptor.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "github.com/coinbase/staking-client-library-go/gen/go/coinbase/staking/rewards/v1"; + +// The representation of a staking activity at a particular point in time. +// (-- api-linter: core::0123::resource-name-field=disabled +// aip.dev/not-precedent: Not including a 'name' field till our data sources support a unique identifier --) +message Stake { + option (google.api.resource) = { + type: "coinbase.staking.rewards/Stake" + pattern: "protocols/{protocol}/stakes/{stake}" + singular: "stake" + plural: "stakes" + }; + + // The unique identifier for this staking balance. This is intended to be added in the future when GetStakes is implemented + // but as of now, we only support ListStakes and therefore don't need a unique identifier. It's been marked as reserved to ensure + // that the spot is available when we do implement GetStakes. This ensures that a field such as "id" is assigned a value + // within the first 15 spots, which takes just one byte to encode instead of two. This is a slight performance optimization. + reserved "id"; + reserved 1; + + // The address of the staking balance. + string address = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The time at which this balance was evaluated. + // Timestamps are in UTC, conforming to the RFC-3339 spec (e.g. 2023-11-13T19:38:36Z). + google.protobuf.Timestamp evaluation_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The total amount of stake that is actively earning rewards to this address. + // Includes any delegated stake and self-stake. + // For delegators, this would be only the amount delegated to a validator in most cases. + // Only includes stake that is *actively contributing to rewards and can't be reduced + // without affecting the rewards dynamics*. + // + // Pending inactive stake is included. + // Pending active stake is not included. + AssetAmount bonded_stake = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The amount of stake that this address receives from other addresses. + // For most delegators, this will be 0. + AssetAmount total_delegation_received = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The list of individual delegations this address has received from other addresses + optional Delegation delegations_received = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The amount that this address stakes to another address. + optional Delegation delegations_given = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // A single delegation from one address to another. + message Delegation { + // Address associated to the delegation + string address = 1; + // Amount of delegation received or given + AssetAmount amount = 2; + // Commission rate for delegation + string commission_rate = 3; + } + + // If this staking-related address is active at evaluation_time. Can help inform the user if their staking-related address + // is active or not, such as in the case of DOT where an address can be staking but not in the active set. + // active(8) has been temporarily reserved because it's not something we want to implement for quite some time. + reserved "active"; + reserved 8; + + // An estimated yield of this address. + repeated RewardRate reward_rate_calculations = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The participant type at the time of evaluation (i.e. validator, delegator). + ParticipantType participant_type = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Any pending rewards to this address. We consider pending rewards those rewards which + // haven't been "earned" yet. + // pending_rewards(11) has been reserved until we reach consensus on the definition of pending rewards. + reserved "pending_rewards"; + reserved 11; + + // The protocol on which this staking balance exists. + string protocol = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The amount of stake that is not actively earning rewards to this address. + // This amount includes any native token balance that is under the domain and control of the address in question, + // but is not actively staked. + // + // Pending active stake would be included here. + AssetAmount unbonded_balance = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Reward yield calculation at a given point in time. +message RewardRate { + // The percentage rate of rewards calculation. Will include two digits after the decimal (ex: 3.05). + string percentage = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The time at which this yield calculation was calculated. + // Timestamps are in UTC, conforming to the RFC-3339 spec (e.g. 2023-11-13T19:38:36Z). + google.protobuf.Timestamp calculated_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The method used to calculate this yield. This could include information about which + // rewards we're including in the calculation, how we're estimating the compounding period, etc. + CalculationMethods calculation_method = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Representing the different methods of calculating yield. + enum CalculationMethods { + // Calculation method is unknown or unspecified. + CALCULATION_METHODS_UNSPECIFIED = 0; + // A single Ethereum validator acting in isolation is currently not able to compound earned rewards because + // Ethereum only allows validators to stake 32 ETH precisely. + // This percentage yield is assuming that the rewards never compound, mimicking the behavior of a solo staker. + SOLO_STAKER = 1; + // A pool of Ethereum validators of sufficient size is able to compound rewards almost immediately. + // This percentage yield is assuming rewards compound immediately, mimicking the behavior of a sufficiently large pool. + POOLED_STAKER = 2; + // A Solana delegator's staking rewards are staked (and therefore auto-compound) when rewards are paid out between epochs. + // This percentage yield is assuming the rewards are auto-compounded on that schedule, mimicking a Solana delegator. + EPOCH_AUTO_COMPOUNDING = 3; + // A Solana validator's rewards accumulate in a separate account from the validator's active stake. + // This percentage yield is assuming the rewards are not auto-compounded at any point, mimicking a Solana validator who never staked their rewards. + NO_AUTO_COMPOUNDING = 4; + } +} + +// The request message for ListStakes. +message ListStakesRequest { + // The protocol that the staking balance exists on. + // The response will only include staking balances for the protocol specified here. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference).type = "coinbase.staking.rewards/Protocol" + ]; + + // The maximum number of items to return. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // A page token as part of the response of a previous call. + // Provide this to retrieve the next page. + // + // When paginating, all other parameters must match the previous + // request to list resources. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // [AIP-160](https://google.aip.dev/160) format compliant filter. Supported protocols are 'ethereum', 'solana'. + // Supplying other protocols will return an error. + // * **Ethereum**: + // - Fields: + // - `address` - A ethereum validator public key. + // - `evaluation_time` - A timestamp in RFC-3339 format. Supports multiple comparisons (ex: '2024-01-01T00:00:00Z' and '2024-01-15T00:00:00Z'). + // - Example(s): + // - `"address='0xac53512c39d0081ca4437c285305eb423f474e6153693c12fbba4a3df78bcaa3422b31d800c5bea71c1b017168a60474'"` + // - `"address='0xac53512c39d0081ca4437c285305eb423f474e6153693c12fbba4a3df78bcaa3422b31d800c5bea71c1b017168a60474' AND evaluation_time >= '2024-01-01T00:00:00Z' AND evaluation_time < '2024-01-15T00:00:00Z'"` + // + // * **Solana**: + // - Fields: + // - `address` - A solana staking address. + // - `evaluation_time` - A timestamp in RFC-3339 format. Supports multiple comparisons (ex: '2024-01-01T00:00:00Z' and '2024-01-15T00:00:00Z'). + // - Example(s): + // - `"address='beefKGBWeSpHzYBHZXwp5So7wdQGX6mu4ZHCsH3uTar'"` + // - `"address='beefKGBWeSpHzYBHZXwp5So7wdQGX6mu4ZHCsH3uTar' AND evaluation_time >= '2024-01-01T00:00:00Z' AND evaluation_time < '2024-01-15T00:00:00Z'"` + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// The response message for ListStakes. +message ListStakesResponse { + // The staking balances returned in this response. + repeated Stake stakes = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The page token the user must use in the next request if the next page is desired. + string next_page_token = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// The participant type of a staking-related address. +enum ParticipantType { + // The participant type is unknown. + PARTICIPANT_TYPE_UNSPECIFIED = 0; + + // Used when the onchain participant type is a delegator + // (i.e. someone who delegates the responsibilities of validating blocks to another address in return for a share of the rewards). + DELEGATOR = 1; + + // Used when the onchain participant type is a validator + // (i.e. an address that is directly responsible for performing validation of blocks). + VALIDATOR = 2; +}