Skip to content

Commit

Permalink
pull request cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
PawelPawelec-RDX committed Aug 13, 2024
1 parent 3eb739b commit 86fb9ba
Show file tree
Hide file tree
Showing 23 changed files with 715 additions and 369 deletions.
3 changes: 2 additions & 1 deletion apps/DataAggregator/packages.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,8 @@
"dependencies": {
"JsonSubTypes": "[2.0.1, )",
"Newtonsoft.Json": "[13.0.3, )",
"Polly": "[8.3.0, )"
"Polly": "[8.3.0, )",
"RadixDlt.NetworkGateway.Abstractions": "[1.7.0-develop, )"
}
},
"radixdlt.networkgateway.postgresintegration": {
Expand Down
3 changes: 2 additions & 1 deletion apps/DatabaseMigrations/packages.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,8 @@
"dependencies": {
"JsonSubTypes": "[2.0.1, )",
"Newtonsoft.Json": "[13.0.3, )",
"Polly": "[8.3.0, )"
"Polly": "[8.3.0, )",
"RadixDlt.NetworkGateway.Abstractions": "[1.7.0-develop, )"
}
},
"radixdlt.networkgateway.postgresintegration": {
Expand Down
3 changes: 2 additions & 1 deletion apps/GatewayApi/packages.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -718,7 +718,8 @@
"dependencies": {
"JsonSubTypes": "[2.0.1, )",
"Newtonsoft.Json": "[13.0.3, )",
"Polly": "[8.3.0, )"
"Polly": "[8.3.0, )",
"RadixDlt.NetworkGateway.Abstractions": "[1.7.0-develop, )"
}
},
"radixdlt.networkgateway.postgresintegration": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,12 @@ internal class DefaultExtensionsHandler(IExtensionsQuerier extensionsQuerier, IO
{
public async Task<GatewayModel.ResourceOwnersResponse> ResourceOwners(GatewayModel.ResourceOwnersRequest request, CancellationToken token)
{
var cursor = GatewayModel.ResourceOwnersCursor.FromCursorString(request.Cursor);

return await extensionsQuerier.ResourceOwners(
(EntityAddress)request.ResourceAddress,
GatewayModel.OffsetCursor.FromCursorString(request.Cursor)?.Offset ?? 0,
endpointConfiguration.Value.ResolvePageSize(request.LimitPerPage),
cursor,
token);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public interface IExtensionsQuerier
{
Task<GatewayModel.ResourceOwnersResponse> ResourceOwners(
EntityAddress resourceAddress,
int offset,
int limit,
GatewayModel.ResourceOwnersCursor? cursor,
CancellationToken token = default);
}
Original file line number Diff line number Diff line change
Expand Up @@ -1910,7 +1910,9 @@ paths:
operationId: ResourceOwnersPage
summary: Get Resource Owners Page
description: |
Returns list of all owners of given resource, ordered by Amount (fungibles)/ Number Of Items (non fungibles) descending.
Returns list of all owners of given resource, ordered by Amount (fungibles)/ Number of items (non fungibles) descending.
This endpoint operates only at current state version, it is not possible to browse historical data.
Because of that it is not possible to offer stable pagination as data constantly changes. Values might change which might result in gaps or some entries being returned twice.
tags:
- Extensions
requestBody:
Expand Down
3 changes: 2 additions & 1 deletion src/RadixDlt.NetworkGateway.GatewayApi/packages.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,8 @@
"dependencies": {
"JsonSubTypes": "[2.0.1, )",
"Newtonsoft.Json": "[13.0.3, )",
"Polly": "[8.3.0, )"
"Polly": "[8.3.0, )",
"RadixDlt.NetworkGateway.Abstractions": "[1.7.0-develop, )"
}
},
"FluentValidation": {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
/* Copyright 2021 Radix Publishing Ltd incorporated in Jersey (Channel Islands).
*
* Licensed under the Radix License, Version 1.0 (the "License"); you may not use this
* file except in compliance with the License. You may obtain a copy of the License at:
*
* radixfoundation.org/licenses/LICENSE-v1
*
* The Licensor hereby grants permission for the Canonical version of the Work to be
* published, distributed and used under or by reference to the Licensor’s trademark
* Radix ® and use of any unregistered trade names, logos or get-up.
*
* The Licensor provides the Work (and each Contributor provides its Contributions) on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied,
* including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT,
* MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE.
*
* Whilst the Work is capable of being deployed, used and adopted (instantiated) to create
* a distributed ledger it is your responsibility to test and validate the code, together
* with all logic and performance of that code under all foreseeable scenarios.
*
* The Licensor does not make or purport to make and hereby excludes liability for all
* and any representation, warranty or undertaking in any form whatsoever, whether express
* or implied, to any entity or person, including any representation, warranty or
* undertaking, as to the functionality security use, value or other characteristics of
* any distributed ledger nor in respect the functioning or value of any tokens which may
* be created stored or transferred using the Work. The Licensor does not warrant that the
* Work or any use of the Work complies with any law or regulation in any territory where
* it may be implemented or used or that it will be appropriate for any specific purpose.
*
* Neither the licensor nor any current or former employees, officers, directors, partners,
* trustees, representatives, agents, advisors, contractors, or volunteers of the Licensor
* shall be liable for any direct or indirect, special, incidental, consequential or other
* losses of any kind, in tort, contract or otherwise (including but not limited to loss
* of revenue, income or profits, or loss of use or data, or loss of reputation, or loss
* of any economic or other opportunity of whatsoever nature or howsoever arising), arising
* out of or in connection with (without limitation of any use, misuse, of any ledger system
* or use made or its functionality or any performance or operation of any code or protocol
* caused by bugs or programming or logic errors or otherwise);
*
* A. any offer, purchase, holding, use, sale, exchange or transmission of any
* cryptographic keys, tokens or assets created, exchanged, stored or arising from any
* interaction with the Work;
*
* B. any failure in a transmission or loss of any token or assets keys or other digital
* artefacts due to errors in transmission;
*
* C. bugs, hacks, logic errors or faults in the Work or any communication;
*
* D. system software or apparatus including but not limited to losses caused by errors
* in holding or transmitting tokens by any third-party;
*
* E. breaches or failure of security including hacker attacks, loss or disclosure of
* password, loss of private key, unauthorised use or misuse of such passwords or keys;
*
* F. any losses including loss of anticipated savings or other benefits resulting from
* use of the Work or any changes to the Work (however implemented).
*
* You are solely responsible for; testing, validating and evaluation of all operation
* logic, functionality, security and appropriateness of using the Work for any commercial
* or non-commercial purpose and for any reproduction or redistribution by You of the
* Work. You assume all risks associated with Your use of the Work and the exercise of
* permissions under this License.
*/

using System.Runtime.Serialization;

namespace RadixDlt.NetworkGateway.GatewayApiSdk.Model;

[DataContract]
public sealed record ResourceOwnersCursor(long? IdBoundary, string BalanceBoundary)
{
[DataMember(Name = "id", EmitDefaultValue = false)]
public long? IdBoundary { get; set; } = IdBoundary;

[DataMember(Name = "b", EmitDefaultValue = false)]
public string BalanceBoundary { get; set; } = BalanceBoundary;

public static ResourceOwnersCursor FromCursorString(string cursorString)
{
return Serializations.FromBase64JsonOrDefault<ResourceOwnersCursor>(cursorString);
}

public string ToCursorString()
{
return Serializations.AsBase64Json(this);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,8 @@
<PackageReference Include="Polly" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\RadixDlt.NetworkGateway.Abstractions\RadixDlt.NetworkGateway.Abstractions.csproj" />
</ItemGroup>

</Project>
Loading

0 comments on commit 86fb9ba

Please sign in to comment.