diff --git a/Tzkt.Api/Repositories/OperationRepository.Originations.cs b/Tzkt.Api/Repositories/OperationRepository.Originations.cs index 0d6aa840..61e3144a 100644 --- a/Tzkt.Api/Repositories/OperationRepository.Originations.cs +++ b/Tzkt.Api/Repositories/OperationRepository.Originations.cs @@ -379,6 +379,9 @@ public async Task> GetOriginations( bool includeBigmaps = false) { #region opts + if (offset?.Cr == 0 && (sort == null || sort.Asc == "id" || sort.Asc == "level")) + offset.Cr = null; + if (ImplicitSortByLevel) { if ((level != null || timestamp != null) && offset?.Cr == null) @@ -579,6 +582,9 @@ public async Task GetOriginations( joins.Add(@"LEFT JOIN ""Accounts"" as c ON c.""Id"" = o.""ContractId"""); #region opts + if (offset?.Cr == 0 && (sort == null || sort.Asc == "id" || sort.Asc == "level")) + offset.Cr = null; + if (ImplicitSortByLevel) { if ((level != null || timestamp != null) && offset?.Cr == null) @@ -866,6 +872,9 @@ public async Task GetOriginations( joins.Add(@"LEFT JOIN ""Accounts"" as c ON c.""Id"" = o.""ContractId"""); #region opts + if (offset?.Cr == 0 && (sort == null || sort.Asc == "id" || sort.Asc == "level")) + offset.Cr = null; + if (ImplicitSortByLevel) { if ((level != null || timestamp != null) && offset?.Cr == null) diff --git a/Tzkt.Api/Repositories/OperationRepository.Transactions.cs b/Tzkt.Api/Repositories/OperationRepository.Transactions.cs index 1b0c3be6..237ace40 100644 --- a/Tzkt.Api/Repositories/OperationRepository.Transactions.cs +++ b/Tzkt.Api/Repositories/OperationRepository.Transactions.cs @@ -349,6 +349,9 @@ public async Task> GetTransactions( bool includeBigmaps = false) { #region opts + if (offset?.Cr == 0 && (sort == null || sort.Asc == "id" || sort.Asc == "level")) + offset.Cr = null; + if (ImplicitSortByLevel) { if ((level != null || timestamp != null) && offset?.Cr == null) @@ -554,6 +557,9 @@ public async Task GetTransactions( return Array.Empty(); #region opts + if (offset?.Cr == 0 && (sort == null || sort.Asc == "id" || sort.Asc == "level")) + offset.Cr = null; + if (ImplicitSortByLevel) { if ((level != null || timestamp != null) && offset?.Cr == null) @@ -848,6 +854,9 @@ public async Task GetTransactions( return Array.Empty(); #region opts + if (offset?.Cr == 0 && (sort == null || sort.Asc == "id" || sort.Asc == "level")) + offset.Cr = null; + if (ImplicitSortByLevel) { if ((level != null || timestamp != null) && offset?.Cr == null)