From 7007ebf99289bb6145fa3eed4429ef8773aecb3e Mon Sep 17 00:00:00 2001 From: Rohit Durvasula <88731568+drohit-cb@users.noreply.github.com> Date: Thu, 9 May 2024 12:58:33 -0700 Subject: [PATCH] Stop publishing openapi swagger (#30) This PR help stop publish our swagger json files, and instead simply point to our API reference present in the docs portal in our README. ## Description Of Change ## Testing Procedure Manually verified the README.md --- .gitignore | 2 + README.md | 2 +- docs/openapi/orchestration.swagger.json | 1571 ----------------------- docs/openapi/rewards.swagger.json | 761 ----------- package.json | 2 +- 5 files changed, 4 insertions(+), 2334 deletions(-) delete mode 100644 docs/openapi/orchestration.swagger.json delete mode 100644 docs/openapi/rewards.swagger.json diff --git a/.gitignore b/.gitignore index a13a9e2..0844e37 100644 --- a/.gitignore +++ b/.gitignore @@ -40,3 +40,5 @@ node_modules/ # VSCode configuration .vscode + +docs/**/*.json diff --git a/README.md b/README.md index 56e9a97..20a3724 100644 --- a/README.md +++ b/README.md @@ -270,7 +270,7 @@ client.Ethereum.listRewards(filter).then((resp) => { ## 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.cdp.coinbase.com/staking/docs/welcome) for detailed definitions, API specifications, integration guides, and more! +There are numerous examples in the [`examples directory`](./examples) to help get you started. For even more, refer to our [documentation website](https://docs.cdp.coinbase.com/staking/docs/welcome) for detailed definitions, [API specification](https://docs.cdp.coinbase.com/staking/reference), integration guides, and more! ## Contributing diff --git a/docs/openapi/orchestration.swagger.json b/docs/openapi/orchestration.swagger.json deleted file mode 100644 index 3a0deb1..0000000 --- a/docs/openapi/orchestration.swagger.json +++ /dev/null @@ -1,1571 +0,0 @@ -{ - "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/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": "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": "workflow", - "description": "The workflow to create.", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1Workflow", - "required": [ - "workflow" - ] - } - } - ], - "tags": [ - "Workflow" - ] - } - }, - "/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: workflows/{workflow}", - "in": "path", - "required": true, - "type": "string", - "pattern": "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: workflows/{workflow}", - "in": "path", - "required": true, - "type": "string", - "pattern": "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" - ] - } - } - }, - "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." - }, - "v1BulkTxStepOutput": { - "type": "object", - "properties": { - "unsignedTxs": { - "type": "array", - "items": { - "type": "string" - }, - "description": "The unsigned transactions that must be signed and broadcasted.", - "readOnly": true - }, - "state": { - "$ref": "#/definitions/v1BulkTxStepOutputState", - "description": "The state of the bulk tx step.", - "readOnly": true - } - }, - "description": "The details of multiple transactions being constructed and broadcasted to the network." - }, - "v1BulkTxStepOutputState": { - "type": "string", - "enum": [ - "STATE_UNSPECIFIED", - "STATE_IN_PROGRESS", - "STATE_FAILED", - "STATE_COMPLETED" - ], - "default": "STATE_UNSPECIFIED", - "description": "State defines an enumeration of states for a staking transaction.\n\n - STATE_UNSPECIFIED: Unspecified transaction state.\n - STATE_IN_PROGRESS: Txs construction in progress.\n - STATE_FAILED: Tx construction failed.\n - STATE_COMPLETED: Tx construction completed." - }, - "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" - ] - }, - "v1EthereumNativeStakeParameters": { - "type": "object", - "properties": { - "withdrawalAddress": { - "type": "string", - "title": "Ethereum address used to withdrawal funds" - }, - "feeRecipient": { - "type": "string", - "title": "Ethereum address used to accumulate fees" - }, - "amount": { - "$ref": "#/definitions/v1Amount", - "title": "Amount of ETH to stake in increments of 32" - } - }, - "title": "Ethereum: Native Stake Parameters", - "required": [ - "withdrawalAddress", - "feeRecipient", - "amount" - ] - }, - "v1EthereumStakingParameters": { - "type": "object", - "properties": { - "nativeStakeParameters": { - "$ref": "#/definitions/v1EthereumNativeStakeParameters", - "title": "Native staking parameters" - } - }, - "title": "Ethereum: Staking Parameters" - }, - "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.)." - }, - "v1ProvisionInfraStepOutput": { - "type": "object", - "properties": { - "state": { - "$ref": "#/definitions/v1ProvisionInfraStepOutputState", - "description": "The state of the provision infra step.", - "readOnly": true - } - }, - "description": "The details for an infrastructure provision request." - }, - "v1ProvisionInfraStepOutputState": { - "type": "string", - "enum": [ - "STATE_UNSPECIFIED", - "STATE_IN_PROGRESS", - "STATE_COMPLETED", - "STATE_FAILED" - ], - "default": "STATE_UNSPECIFIED", - "description": "State defines an enumeration of states for provisioning infra.\n\n - STATE_UNSPECIFIED: Unspecified step state.\n - STATE_IN_PROGRESS: Provision step is in-progress.\n - STATE_COMPLETED: Provision step completed.\n - STATE_FAILED: Provision step failed." - }, - "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_EXT_BROADCAST", - "STATE_SIGNED", - "STATE_BROADCASTING", - "STATE_CONFIRMING", - "STATE_CONFIRMED", - "STATE_FINALIZED", - "STATE_FAILED", - "STATE_SUCCESS" - ], - "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_EXT_BROADCAST: Tx is waiting to be externally broadcasted by the customer.\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." - }, - "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: workflows/{workflowUUID}\nEx: 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." - }, - "ethereumStakingParameters": { - "$ref": "#/definitions/v1EthereumStakingParameters", - "description": "Ethereum 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 - }, - "completeTime": { - "type": "string", - "format": "date-time", - "description": "The timestamp the workflow completed.", - "readOnly": true - } - }, - "description": "A Workflow resource.", - "required": [ - "action", - "solanaStakingParameters", - "ethereumKilnStakingParameters", - "ethereumStakingParameters" - ] - }, - "v1WorkflowState": { - "type": "string", - "enum": [ - "STATE_UNSPECIFIED", - "STATE_IN_PROGRESS", - "STATE_WAITING_FOR_EXT_BROADCAST", - "STATE_COMPLETED", - "STATE_FAILED" - ], - "default": "STATE_UNSPECIFIED", - "description": "Example flows:\n A workflow leading to a successful completion.\n IN_PROGRESS -\u003e WAITING_FOR_EXT_BROADCAST -\u003e IN_PROGRESS -\u003e COMPLETED\n A workflow leading to a failure.\n IN_PROGRESS -\u003e WAITING_FOR_EXT_BROADCAST -\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_EXT_BROADCAST: Waiting for external broadcast represents the workflow is waiting for the customer to broadcast a tx and return its corresponding tx hash.\n - STATE_COMPLETED: Completed represents the workflow has completed.\n - STATE_FAILED: Failed represents the workflow has failed.", - "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 - }, - "provisionInfraStepOutput": { - "$ref": "#/definitions/v1ProvisionInfraStepOutput", - "description": "The details for provisioned infrastructure.", - "readOnly": true - }, - "bulkTxStepOutput": { - "$ref": "#/definitions/v1BulkTxStepOutput", - "description": "The bulk tx step output (e.g. transaction metadata such as unsigned tx, signed tx 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 deleted file mode 100644 index 59a869f..0000000 --- a/docs/openapi/rewards.swagger.json +++ /dev/null @@ -1,761 +0,0 @@ -{ - "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." - }, - { - "name": "RewardService" - } - ], - "host": "api.developer.coinbase.com", - "basePath": "/rewards", - "schemes": [ - "https" - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "paths": { - "/v1/portfolios": { - "get": { - "summary": "List all portfolios available to you.", - "operationId": "RewardService_ListPortfolios", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1ListPortfoliosResponse" - } - }, - "400": { - "description": "The request attempted has invalid parameters", - "schema": { - "example": { - "code": 3, - "message": "Couldn't find portfolio. \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": "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" - } - ], - "tags": [ - "Portfolio" - ] - } - }, - "/v1/{name}": { - "get": { - "summary": "Get a portfolio based on the name.", - "operationId": "RewardService_GetPortfolio", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/v1Portfolio" - } - }, - "400": { - "description": "The request attempted has invalid parameters", - "schema": { - "example": { - "code": 3, - "message": "Couldn't get portfolio. \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": "name", - "description": "The resource name of the stake to retrieve.\nFormat: portfolios/{portfolio}", - "in": "path", - "required": true, - "type": "string", - "pattern": "portfolios/[^/]+" - } - ], - "tags": [ - "Portfolio" - ] - } - }, - "/v1/{parent}/rewards": { - "get": { - "summary": "List 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" - }, - { - "name": "orderBy", - "description": "The order in which to sort the results.\n[AIP-132](https://google.aip.dev/132) compliant order_by field.\nThe default behavior, if not supplied, is 'evaluation_time desc'.\nExample(s):\n* 'evaluation_time desc', which returns Stakes starting with the most recent.\n* 'evaluation_time asc', which returns Stakes starting with the oldest available.\n* 'evaluation_time', which returns Stakes starting with the oldest available.", - "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." - }, - "RewardState": { - "type": "string", - "enum": [ - "STATE_UNSPECIFIED", - "PENDING_CLAIMABLE", - "MATERIALIZED" - ], - "default": "STATE_UNSPECIFIED", - "description": "The state that a reward can potentially be in.\nNot all rewards are immediately usable and accessible which is\nprotocol dependent.\n\n - STATE_UNSPECIFIED: The reward state is in an unspecified state.\n - PENDING_CLAIMABLE: Indicates a reward that is not liquid and not on a users wallet address.\nTypically the user would need to perform a transaction to claim their reward.\ne.g. For Ethereum Partial Staking, the user must unstake then claim their rewards, each\nbeing it's own transaction on-chain to ultimately receive their rewards.\n - MATERIALIZED: Indicates a reward that is liquid and has been paid out to the users wallet address which\nis usually done by an explicit blockchain transaction.\ne.g. Solana rewards are paid out per epoch directly to the stake account address." - }, - "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" - } - } - } - }, - "v1Address": { - "type": "object", - "properties": { - "address": { - "type": "string", - "title": "The onchain address", - "readOnly": true - } - }, - "description": "Represents an address on any protocol." - }, - "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", - "format": "int64", - "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." - }, - "v1ListPortfoliosResponse": { - "type": "object", - "properties": { - "portfolios": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/v1Portfolio" - }, - "description": "The portfolios 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 ListPortfolios." - }, - "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)." - }, - "v1Portfolio": { - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "A unique identifier for the portfolio.", - "readOnly": true - }, - "addresses": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/v1Address" - }, - "title": "The addresses that make up the portfolio", - "readOnly": true - } - }, - "description": "A portfolio represents an arbitrary collection of addresses. A portfolio doesn't necessarily\nimply that the underlying addresses are linked onchain in any manner.\nA portfolio is a convenient way for users to group addresses together for reporting purposes.\nFor now, project and portfolio are synonymous, 1-to-1." - }, - "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 - }, - "rewardState": { - "$ref": "#/definitions/RewardState", - "description": "The state that the reward is in when calculated.", - "readOnly": true - } - }, - "description": "Rewards earned via onchain staking-related activites.\nA reward may be a particular event or a rollup of multiple events (ex: rewards earned in a day)." - }, - "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 balance 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/package.json b/package.json index 23daf42..cec6f33 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "scripts": { "clean": "rimraf ./dist", "gen": "npm run clean-gen && ./scripts/generate-client.sh", - "clean-gen": "rm -rf src/gen/* && rm -rf docs/openapi/*", + "clean-gen": "rm -rf src/gen/*", "build": "npm run clean && tsc", "prepare": "npm run build", "lint": "eslint . --ext .ts --ignore-pattern '/dist/*/*' --ignore-pattern '/src/gen/*/*'",