|
30 | 30 | "application/json"
|
31 | 31 | ],
|
32 | 32 | "paths": {
|
| 33 | + "/v1/portfolioRewards": { |
| 34 | + "get": { |
| 35 | + "summary": "List a portfolio's rewards", |
| 36 | + "description": "Lists rewards of addresses that have been staked via the Staking API.", |
| 37 | + "operationId": "RewardService_ListPortfolioRewards", |
| 38 | + "responses": { |
| 39 | + "200": { |
| 40 | + "description": "OK", |
| 41 | + "schema": { |
| 42 | + "example": { |
| 43 | + "rewards": [ |
| 44 | + { |
| 45 | + "address": "beefKGBWeSpHzYBHZXwp5So7wdQGX6mu4ZHCsH3uTar", |
| 46 | + "epoch": "533", |
| 47 | + "aggregationUnit": "epoch", |
| 48 | + "periodStartTime": null, |
| 49 | + "periodEndTime": "2023-11-16T00:13:44Z", |
| 50 | + "totalEarnedNativeUnit": { |
| 51 | + "amount": "224.7098145", |
| 52 | + "exp": "9", |
| 53 | + "ticker": "SOL", |
| 54 | + "rawNumeric": "224709814509" |
| 55 | + }, |
| 56 | + "totalEarnedUsd": null, |
| 57 | + "endingBalance": null, |
| 58 | + "protocol": "solana" |
| 59 | + }, |
| 60 | + { |
| 61 | + "address": "beefKGBWeSpHzYBHZXwp5So7wdQGX6mu4ZHCsH3uTar", |
| 62 | + "epoch": "532", |
| 63 | + "aggregationUnit": "epoch", |
| 64 | + "periodStartTime": null, |
| 65 | + "periodEndTime": "2023-11-13T19:38:36Z", |
| 66 | + "totalEarnedNativeUnit": { |
| 67 | + "amount": "225.0794241", |
| 68 | + "exp": "9", |
| 69 | + "ticker": "SOL", |
| 70 | + "rawNumeric": "225079424094" |
| 71 | + }, |
| 72 | + "totalEarnedUsd": null, |
| 73 | + "endingBalance": null, |
| 74 | + "protocol": "solana" |
| 75 | + } |
| 76 | + ], |
| 77 | + "nextPageToken": "VAql-wtdiJWkWII9bJBDnE9oEc-8IlgU0DtKbxSDtBg=:1:1700241277" |
| 78 | + } |
| 79 | + } |
| 80 | + }, |
| 81 | + "400": { |
| 82 | + "description": "The request attempted has invalid parameters", |
| 83 | + "schema": { |
| 84 | + "example": { |
| 85 | + "code": 3, |
| 86 | + "message": "Filter validation failed. \u003cRemediation assistance here\u003e.", |
| 87 | + "details": [] |
| 88 | + } |
| 89 | + } |
| 90 | + }, |
| 91 | + "401": { |
| 92 | + "description": "Returned if authentication information is invalid", |
| 93 | + "schema": { |
| 94 | + "example": "Unauthorized" |
| 95 | + } |
| 96 | + }, |
| 97 | + "500": { |
| 98 | + "description": "Returned when an internal server error happens.", |
| 99 | + "schema": { |
| 100 | + "example": { |
| 101 | + "code": 3, |
| 102 | + "message": "Internal server error.", |
| 103 | + "details": [] |
| 104 | + } |
| 105 | + } |
| 106 | + }, |
| 107 | + "default": { |
| 108 | + "description": "An unexpected error response.", |
| 109 | + "schema": { |
| 110 | + "$ref": "#/definitions/rpcStatus" |
| 111 | + } |
| 112 | + } |
| 113 | + }, |
| 114 | + "parameters": [ |
| 115 | + { |
| 116 | + "name": "pageSize", |
| 117 | + "description": "The maximum number of items to return.", |
| 118 | + "in": "query", |
| 119 | + "required": false, |
| 120 | + "type": "integer", |
| 121 | + "format": "int32" |
| 122 | + }, |
| 123 | + { |
| 124 | + "name": "pageToken", |
| 125 | + "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.", |
| 126 | + "in": "query", |
| 127 | + "required": false, |
| 128 | + "type": "string" |
| 129 | + } |
| 130 | + ], |
| 131 | + "tags": [ |
| 132 | + "Reward" |
| 133 | + ] |
| 134 | + } |
| 135 | + }, |
33 | 136 | "/v1/portfolios": {
|
34 | 137 | "get": {
|
35 |
| - "summary": "List all portfolios available to you.", |
| 138 | + "summary": "List portfolios", |
| 139 | + "description": "List portfolios in a CDP organization. Portfolios represent a collection of addresses, grouped together for easier management.", |
36 | 140 | "operationId": "RewardService_ListPortfolios",
|
37 | 141 | "responses": {
|
38 | 142 | "200": {
|
|
98 | 202 | },
|
99 | 203 | "/v1/{name}": {
|
100 | 204 | "get": {
|
101 |
| - "summary": "Get a portfolio based on the name.", |
| 205 | + "summary": "Get portfolio by name", |
| 206 | + "description": "Get portfolios in a CDP organization. Portfolios represent a collection of addresses, grouped together for easier management.", |
102 | 207 | "operationId": "RewardService_GetPortfolio",
|
103 | 208 | "responses": {
|
104 | 209 | "200": {
|
|
157 | 262 | },
|
158 | 263 | "/v1/{parent}/rewards": {
|
159 | 264 | "get": {
|
160 |
| - "summary": "List rewards", |
| 265 | + "summary": "List staking rewards", |
161 | 266 | "description": "Lists onchain rewards of an address for a specific protocol, with optional filters for time range, aggregation period, and more.",
|
162 | 267 | "operationId": "RewardService_ListRewards",
|
163 | 268 | "responses": {
|
|
266 | 371 | "in": "query",
|
267 | 372 | "required": false,
|
268 | 373 | "type": "string"
|
| 374 | + }, |
| 375 | + { |
| 376 | + "name": "orderBy", |
| 377 | + "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 'period_end_time desc'.\nExample(s):\n* 'period_end_time desc', which returns Rewards starting with the most recent.\n* 'period_end_time asc', which returns Rewards starting with the oldest available.\n* 'period_end_time', which returns Rewards starting with the oldest available.", |
| 378 | + "in": "query", |
| 379 | + "required": false, |
| 380 | + "type": "string" |
269 | 381 | }
|
270 | 382 | ],
|
271 | 383 | "tags": [
|
|
275 | 387 | },
|
276 | 388 | "/v1/{parent}/stakes": {
|
277 | 389 | "get": {
|
278 |
| - "summary": "List and filter staking balances", |
| 390 | + "summary": "List staking balances", |
279 | 391 | "description": "Lists staking balance of a protocol, with optional filters for time range and address.",
|
280 | 392 | "operationId": "RewardService_ListStakes",
|
281 | 393 | "responses": {
|
|
448 | 560 | "type": "string",
|
449 | 561 | "title": "The onchain address",
|
450 | 562 | "readOnly": true
|
| 563 | + }, |
| 564 | + "protocol": { |
| 565 | + "$ref": "#/definitions/v1ProtocolName", |
| 566 | + "title": "The protocol of this particular address", |
| 567 | + "readOnly": true |
451 | 568 | }
|
452 | 569 | },
|
453 | 570 | "description": "Represents an address on any protocol."
|
|
489 | 606 | },
|
490 | 607 | "description": "Amount encapsulation for a given asset."
|
491 | 608 | },
|
| 609 | + "v1ListPortfolioRewardsResponse": { |
| 610 | + "type": "object", |
| 611 | + "properties": { |
| 612 | + "portfolioRewards": { |
| 613 | + "type": "array", |
| 614 | + "items": { |
| 615 | + "type": "object", |
| 616 | + "$ref": "#/definitions/v1Reward" |
| 617 | + }, |
| 618 | + "description": "The rewards returned in this response.", |
| 619 | + "readOnly": true |
| 620 | + }, |
| 621 | + "nextPageToken": { |
| 622 | + "type": "string", |
| 623 | + "description": "The page token the user must use in the next request if the next page is desired.", |
| 624 | + "readOnly": true |
| 625 | + } |
| 626 | + }, |
| 627 | + "description": "The response to a ListPortfolioRewardRequest.\nContains a list of rewards associated with the addresses in a portfolio." |
| 628 | + }, |
492 | 629 | "v1ListPortfoliosResponse": {
|
493 | 630 | "type": "object",
|
494 | 631 | "properties": {
|
|
579 | 716 | },
|
580 | 717 | "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."
|
581 | 718 | },
|
| 719 | + "v1ProtocolName": { |
| 720 | + "type": "string", |
| 721 | + "enum": [ |
| 722 | + "PROTOCOL_NAME_UNSPECIFIED", |
| 723 | + "SOLANA", |
| 724 | + "COSMOS", |
| 725 | + "ETHEREUM" |
| 726 | + ], |
| 727 | + "default": "PROTOCOL_NAME_UNSPECIFIED", |
| 728 | + "description": "The complete list of supported protocols.\n\n - PROTOCOL_NAME_UNSPECIFIED: The protocol isn't defined\n - SOLANA: The Solana protocol\n - COSMOS: The Cosmos protocol\n - ETHEREUM: The Ethereum protocol" |
| 729 | + }, |
582 | 730 | "v1Reward": {
|
583 | 731 | "type": "object",
|
584 | 732 | "properties": {
|
|
617 | 765 | },
|
618 | 766 | "totalEarnedNativeUnit": {
|
619 | 767 | "$ref": "#/definitions/v1AssetAmount",
|
620 |
| - "description": "The amount earned in this time period in the native unit of the protocol.", |
| 768 | + "description": "The amount earned in this time period in the native unit of the protocol.\nThis is the net amount earned, meaning the amount that was actually paid out to the address.\nIf the rewards had a commission or fee taken out before it landed on this address, that commission amount is not included here.", |
| 769 | + "readOnly": true |
| 770 | + }, |
| 771 | + "totalEarnedNativeUnitGross": { |
| 772 | + "$ref": "#/definitions/v1AssetAmount", |
| 773 | + "description": "This is the gross amount earned, meaning the total amount of rewards that is attributable to the staking activity of this address.\nThis amount includes any commission or fee taken out before it landed on this address.", |
621 | 774 | "readOnly": true
|
622 | 775 | },
|
623 | 776 | "totalEarnedUsd": {
|
|
626 | 779 | "type": "object",
|
627 | 780 | "$ref": "#/definitions/v1USDValue"
|
628 | 781 | },
|
629 |
| - "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.", |
| 782 | + "description": "The amount earned in this time period in USD.\nIf multiple different price sources are used, then multiple USD values will be returned.\nTotal USD value is calculated by getting each individual reward components in this time period and summing the USD value of each individual component.\nUSD value is calculates at the time each component was earned.", |
630 | 783 | "readOnly": true
|
631 | 784 | },
|
632 | 785 | "endingBalance": {
|
|
690 | 843 | },
|
691 | 844 | "totalDelegationReceived": {
|
692 | 845 | "$ref": "#/definitions/v1AssetAmount",
|
693 |
| - "description": "The amount of stake that this address receives from other addresses.\nFor most delegators, this will be 0.", |
| 846 | + "description": "The amount of stake that this address receives from other addresses.\nFor most delegators, this will be 0. For validators, this will be the total amount of stake delegated to them.", |
694 | 847 | "readOnly": true
|
695 | 848 | },
|
696 | 849 | "delegationsReceived": {
|
|
0 commit comments