diff --git a/Tzkt.Api/Controllers/DelegatesController.cs b/Tzkt.Api/Controllers/DelegatesController.cs index ba8ae6ff..070ea72e 100644 --- a/Tzkt.Api/Controllers/DelegatesController.cs +++ b/Tzkt.Api/Controllers/DelegatesController.cs @@ -37,7 +37,8 @@ public DelegatesController(AccountRepository accounts) [Range(0, 10000)] int limit = 100) { #region validate - if (sort != null && !sort.Validate("id", "stakingBalance", "balance", "numDelegators", "activationLevel", "deactivationLevel")) + if (sort != null && !sort.Validate("id", "stakedBalance", "externalStakedBalance", "delegatedBalance", + "stakingBalance", "balance", "numDelegators", "stakersCount", "activationLevel", "deactivationLevel")) return new BadRequest($"{nameof(sort)}", "Sorting by the specified field is not allowed."); #endregion diff --git a/Tzkt.Api/Repositories/AccountRepository.Bakers.cs b/Tzkt.Api/Repositories/AccountRepository.Bakers.cs index 4f0f6dee..b1c5f027 100644 --- a/Tzkt.Api/Repositories/AccountRepository.Bakers.cs +++ b/Tzkt.Api/Repositories/AccountRepository.Bakers.cs @@ -131,9 +131,13 @@ public async Task GetDelegatesCount(BoolParameter active) { "activationLevel" => ("ActivationLevel", "ActivationLevel"), "deactivationLevel" => ("DeactivationLevel", "DeactivationLevel"), + "stakedBalance" => ("OwnStakedBalance", "OwnStakedBalance"), + "externalStakedBalance" => ("ExternalStakedBalance", "ExternalStakedBalance"), + "delegatedBalance" => ("DelegatedBalance", "DelegatedBalance"), "stakingBalance" => ("StakingBalance", "StakingBalance"), "balance" => ("Balance", "Balance"), "numDelegators" => ("DelegatorsCount", "DelegatorsCount"), + "stakersCount" => ("StakersCount", "StakersCount"), _ => ("Id", "Id") }); @@ -355,9 +359,13 @@ public async Task GetDelegates( { "activationLevel" => ("ActivationLevel", "ActivationLevel"), "deactivationLevel" => ("DeactivationLevel", "DeactivationLevel"), + "stakedBalance" => ("OwnStakedBalance", "OwnStakedBalance"), + "externalStakedBalance" => ("ExternalStakedBalance", "ExternalStakedBalance"), + "delegatedBalance" => ("DelegatedBalance", "DelegatedBalance"), "stakingBalance" => ("StakingBalance", "StakingBalance"), "balance" => ("Balance", "Balance"), "numDelegators" => ("DelegatorsCount", "DelegatorsCount"), + "stakersCount" => ("StakersCount", "StakersCount"), _ => ("Id", "Id") }); @@ -857,9 +865,13 @@ public async Task GetDelegates( { "activationLevel" => ("ActivationLevel", "ActivationLevel"), "deactivationLevel" => ("DeactivationLevel", "DeactivationLevel"), + "stakedBalance" => ("OwnStakedBalance", "OwnStakedBalance"), + "externalStakedBalance" => ("ExternalStakedBalance", "ExternalStakedBalance"), + "delegatedBalance" => ("DelegatedBalance", "DelegatedBalance"), "stakingBalance" => ("StakingBalance", "StakingBalance"), "balance" => ("Balance", "Balance"), "numDelegators" => ("DelegatorsCount", "DelegatorsCount"), + "stakersCount" => ("StakersCount", "StakersCount"), _ => ("Id", "Id") }); diff --git a/Tzkt.Api/Swagger/Description.md b/Tzkt.Api/Swagger/Description.md index b3e3ce36..9f11b0a6 100644 --- a/Tzkt.Api/Swagger/Description.md +++ b/Tzkt.Api/Swagger/Description.md @@ -41,7 +41,7 @@ It's available for the following Tezos networks with the following base URLs: - Ghostnet: `https://api.ghostnet.tzkt.io/` ([view docs](https://api.ghostnet.tzkt.io)) - Parisnet: `https://api.parisnet.tzkt.io/` ([view docs](https://api.parisnet.tzkt.io)) -### Sending requests +### Sending Requests To send a request to Free TzKT API you need literally nothing. Just take the base URL of the particular network (for example, Tezos mainnet: `https://api.tzkt.io`) and append the path of the particular endpoint @@ -84,7 +84,7 @@ If your key was compromised, just let us know and we will issue a new one. Also note that passing the API key via HTTP headers is more secure, because in HTTPS headers are encrypted, but query string is not, so the key can be unintentionally exposed to third parties. -### Sending requests +### Sending Requests Sending a request with the API key passed as a query string parameter: