From 68eb4666471f3771a54dad9d4012082bdfec16e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Pawelec?= Date: Wed, 11 Oct 2023 08:54:41 +0200 Subject: [PATCH 1/5] add new optin for receipt output. document optins. --- Directory.Build.props | 2 +- .../Configuration/SlowQueryLoggingOptions.cs | 64 ++++++++++++++++++ .../Configuration/NodeWorkersOptions.cs | 66 ++++++++++++++++++- .../AspNetCore/RequestAbortedFeature.cs | 66 ++++++++++++++++++- .../AspNetCore/RequestTimeoutFeature.cs | 66 ++++++++++++++++++- .../ClientConnectionClosedException.cs | 66 ++++++++++++++++++- .../Exceptions/GenericBadRequestException.cs | 66 ++++++++++++++++++- .../Services/ISqlQueryObserver.cs | 64 ++++++++++++++++++ .../gateway-api-schema.yaml | 31 +++++++++ .../generated/Api/StatisticsApi.cs | 17 +++-- .../Model/StateEntityDetailsOptIns.cs | 25 ++++--- .../StateEntityFungiblesPageRequestOptIns.cs | 5 +- ...tityNonFungibleResourceVaultsPageOptIns.cs | 5 +- ...tateEntityNonFungiblesPageRequestOptIns.cs | 10 +-- .../Model/TransactionDetailsOptIns.cs | 57 +++++++++++----- .../Model/ValidatorUptimeCollectionItem.cs | 15 +++-- .../GatewayModelExtensions.cs | 4 +- .../Interceptors/MetricsInterceptor.cs | 66 ++++++++++++++++++- .../Metrics/SqlQueryMetricsHelper.cs | 66 ++++++++++++++++++- .../QueryableExtensions.cs | 66 ++++++++++++++++++- .../Services/DapperWrapper.cs | 66 ++++++++++++++++++- 21 files changed, 833 insertions(+), 60 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index 1c50faaa4..6203cc427 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -13,7 +13,7 @@ - 1.0.1 + 1.0.2 develop diff --git a/src/RadixDlt.NetworkGateway.Abstractions/Configuration/SlowQueryLoggingOptions.cs b/src/RadixDlt.NetworkGateway.Abstractions/Configuration/SlowQueryLoggingOptions.cs index d771c62de..1a1e649c2 100644 --- a/src/RadixDlt.NetworkGateway.Abstractions/Configuration/SlowQueryLoggingOptions.cs +++ b/src/RadixDlt.NetworkGateway.Abstractions/Configuration/SlowQueryLoggingOptions.cs @@ -1,3 +1,67 @@ +/* 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 FluentValidation; using System; diff --git a/src/RadixDlt.NetworkGateway.DataAggregator/Configuration/NodeWorkersOptions.cs b/src/RadixDlt.NetworkGateway.DataAggregator/Configuration/NodeWorkersOptions.cs index 76a5b11d9..a32af691f 100644 --- a/src/RadixDlt.NetworkGateway.DataAggregator/Configuration/NodeWorkersOptions.cs +++ b/src/RadixDlt.NetworkGateway.DataAggregator/Configuration/NodeWorkersOptions.cs @@ -1,4 +1,68 @@ -using FluentValidation; +/* 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 FluentValidation; using Microsoft.Extensions.Configuration; using RadixDlt.NetworkGateway.Abstractions.Configuration; diff --git a/src/RadixDlt.NetworkGateway.GatewayApi/AspNetCore/RequestAbortedFeature.cs b/src/RadixDlt.NetworkGateway.GatewayApi/AspNetCore/RequestAbortedFeature.cs index c530d7872..90e6a6bad 100644 --- a/src/RadixDlt.NetworkGateway.GatewayApi/AspNetCore/RequestAbortedFeature.cs +++ b/src/RadixDlt.NetworkGateway.GatewayApi/AspNetCore/RequestAbortedFeature.cs @@ -1,4 +1,68 @@ -using System.Threading; +/* 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.Threading; namespace RadixDlt.NetworkGateway.GatewayApi.AspNetCore; diff --git a/src/RadixDlt.NetworkGateway.GatewayApi/AspNetCore/RequestTimeoutFeature.cs b/src/RadixDlt.NetworkGateway.GatewayApi/AspNetCore/RequestTimeoutFeature.cs index 0f00eaf58..dde26bdb4 100644 --- a/src/RadixDlt.NetworkGateway.GatewayApi/AspNetCore/RequestTimeoutFeature.cs +++ b/src/RadixDlt.NetworkGateway.GatewayApi/AspNetCore/RequestTimeoutFeature.cs @@ -1,4 +1,68 @@ -using System; +/* 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; using System.Threading; namespace RadixDlt.NetworkGateway.GatewayApi.AspNetCore; diff --git a/src/RadixDlt.NetworkGateway.GatewayApi/Exceptions/ClientConnectionClosedException.cs b/src/RadixDlt.NetworkGateway.GatewayApi/Exceptions/ClientConnectionClosedException.cs index a5b8f1f70..19d09dd6a 100644 --- a/src/RadixDlt.NetworkGateway.GatewayApi/Exceptions/ClientConnectionClosedException.cs +++ b/src/RadixDlt.NetworkGateway.GatewayApi/Exceptions/ClientConnectionClosedException.cs @@ -1,4 +1,68 @@ -namespace RadixDlt.NetworkGateway.GatewayApi.Exceptions; +/* 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. + */ + +namespace RadixDlt.NetworkGateway.GatewayApi.Exceptions; public sealed class ClientConnectionClosedException : KnownGatewayErrorException { diff --git a/src/RadixDlt.NetworkGateway.GatewayApi/Exceptions/GenericBadRequestException.cs b/src/RadixDlt.NetworkGateway.GatewayApi/Exceptions/GenericBadRequestException.cs index f1681f531..0ae518269 100644 --- a/src/RadixDlt.NetworkGateway.GatewayApi/Exceptions/GenericBadRequestException.cs +++ b/src/RadixDlt.NetworkGateway.GatewayApi/Exceptions/GenericBadRequestException.cs @@ -1,4 +1,68 @@ -using System.Net; +/* 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.Net; namespace RadixDlt.NetworkGateway.GatewayApi.Exceptions; diff --git a/src/RadixDlt.NetworkGateway.GatewayApi/Services/ISqlQueryObserver.cs b/src/RadixDlt.NetworkGateway.GatewayApi/Services/ISqlQueryObserver.cs index 3149944f8..25932b4bb 100644 --- a/src/RadixDlt.NetworkGateway.GatewayApi/Services/ISqlQueryObserver.cs +++ b/src/RadixDlt.NetworkGateway.GatewayApi/Services/ISqlQueryObserver.cs @@ -1,3 +1,67 @@ +/* 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; namespace RadixDlt.NetworkGateway.GatewayApi.Services; diff --git a/src/RadixDlt.NetworkGateway.GatewayApi/gateway-api-schema.yaml b/src/RadixDlt.NetworkGateway.GatewayApi/gateway-api-schema.yaml index 75772f9df..31b998ce4 100644 --- a/src/RadixDlt.NetworkGateway.GatewayApi/gateway-api-schema.yaml +++ b/src/RadixDlt.NetworkGateway.GatewayApi/gateway-api-schema.yaml @@ -627,6 +627,13 @@ paths: post: operationId: ValidatorsUptime summary: Get Validators Uptime + description: | + Returns validators uptime data for time range limited by from_state_version and at_state_version. + `at_state_version` defines upper boundary (inclusive) for queried data. i.e `{ at_state_version = {epoch = 10} }`, will return uptime statistics from genesis till 10. + `from_state_version` defines lower boundary (inclusive) for queried data. i.e `{ from_state_version = {epoch = 10} }`, will return uptime statistics from epoch 10 till current max ledger tip. + it's possible to define both at once i.e `{ at_state_version = {epoch = 10}, from_state_version = {epoch = 25} }` will return uptime statistics for epochs from 10 till 25. + you can use one of `state_version`, `epoch`, `epoch` and `round`, or `timestamp` to define from/at state version parameter, but then ongoing epoch will be selected and used for querying data. + i.e for request with `{ from_state_version = { state_version = 100 000}, at_state_version = { state_version = 300 000} }` gateway api will check in which epoch transactions with state version 100 000 and 300 000 and then use that as inclusive boundary for request. tags: - Statistics requestBody: @@ -1388,14 +1395,17 @@ components: address: $ref: "#/components/schemas/Address" proposals_made: + description: number of proposals made. type: integer format: int64 nullable: true proposals_missed: + description: number of proposals missed. type: integer format: int64 nullable: true epochs_active_in: + description: number of epochs validator was active in. type: integer format: int64 @@ -1821,21 +1831,33 @@ components: type: object properties: raw_hex: + description: (false by default) If set to true, raw transaction hex is returned. type: boolean receipt_state_changes: + description: (false by default) if set to true, state changes inside receipt object are returned. type: boolean receipt_fee_summary: + description: (false by default) if set to true, fee summary inside receipt object is returned. type: boolean receipt_fee_source: + description: (false by default) if set to true, fee source inside receipt object is returned. type: boolean receipt_fee_destination: + description: (false by default) if set to true, fee destination inside receipt object is returned. type: boolean receipt_costing_parameters: + description: (false by default) if set to true, costing parameters inside receipt object is returned. type: boolean receipt_events: + description: (false by default) if set to true, events inside receipt object is returned. + type: boolean + receipt_output: + description: (true by default) If set to true, transaction receipt output is returned. type: boolean affected_global_entities: + description: (false by default) if set to true, all affected global entities by given transaction are returned. type: boolean + TransactionCommittedDetailsResponse: allOf: - $ref: "#/components/schemas/LedgerStateMixin" @@ -1960,14 +1982,19 @@ components: type: object properties: ancestor_identities: + description: (false by default) if set to true, ancestor addresses - parent_address, owner_address and global_address for entities are returned. type: boolean component_royalty_vault_balance: + description: (false by default) if set to true, royalty vault balance for component entities is returned. type: boolean package_royalty_vault_balance: + description: (false by default) if set to true, royalty vault balance for package entities is returned. type: boolean non_fungible_include_nfids: + description: (false by default) if set to true, first page of non fungible ids are returned for each non fungible resource, with cursor which can be later used at `/state/entity/page/non-fungible-vault/ids` endpoint. type: boolean explicit_metadata: + description: (empty by default) allows specifying explicitly metadata properties which should be returned in response, limited to max 20 items. type: array items: type: string @@ -2232,6 +2259,7 @@ components: type: object properties: explicit_metadata: + description: (empty by default) allows specifying explicitly metadata properties which should be returned in response, limited to max 20 items. type: array items: type: string @@ -2295,8 +2323,10 @@ components: type: object properties: non_fungible_include_nfids: + description: (false by default) if set to true, first page of non fungible ids are returned for each non fungible resource, with cursor which can be later used at `/state/entity/page/non-fungible-vault/ids` endpoint. type: boolean explicit_metadata: + description: (empty by default) allows specifying explicitly metadata properties which should be returned in response, limited to max 20 items. type: array items: type: string @@ -2333,6 +2363,7 @@ components: type: object properties: non_fungible_include_nfids: + description: (false by default) if set to true, first page of non fungible ids are returned for each non fungible resource, with cursor which can be later used at `/state/entity/page/non-fungible-vault/ids` endpoint. type: boolean StateEntityNonFungibleResourceVaultsPageResponse: diff --git a/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Api/StatisticsApi.cs b/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Api/StatisticsApi.cs index 7f943b169..fefe3f206 100644 --- a/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Api/StatisticsApi.cs +++ b/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Api/StatisticsApi.cs @@ -94,6 +94,9 @@ public interface IStatisticsApiSync : IApiAccessor /// /// Get Validators Uptime /// + /// + /// Returns validators uptime data for time range limited by from_state_version and at_state_version. `at_state_version` defines upper boundary (inclusive) for queried data. i.e `{ at_state_version = {epoch = 10} }`, will return uptime statistics from genesis till 10. `from_state_version` defines lower boundary (inclusive) for queried data. i.e `{ from_state_version = {epoch = 10} }`, will return uptime statistics from epoch 10 till current max ledger tip. it's possible to define both at once i.e `{ at_state_version = {epoch = 10}, from_state_version = {epoch = 25} }` will return uptime statistics for epochs from 10 till 25. you can use one of `state_version`, `epoch`, `epoch` and `round`, or `timestamp` to define from/at state version parameter, but then ongoing epoch will be selected and used for querying data. i.e for request with `{ from_state_version = { state_version = 100 000}, at_state_version = { state_version = 300 000} }` gateway api will check in which epoch transactions with state version 100 000 and 300 000 and then use that as inclusive boundary for request. + /// /// Thrown when fails to make API call /// /// ValidatorsUptimeResponse @@ -103,7 +106,7 @@ public interface IStatisticsApiSync : IApiAccessor /// Get Validators Uptime /// /// - /// + /// Returns validators uptime data for time range limited by from_state_version and at_state_version. `at_state_version` defines upper boundary (inclusive) for queried data. i.e `{ at_state_version = {epoch = 10} }`, will return uptime statistics from genesis till 10. `from_state_version` defines lower boundary (inclusive) for queried data. i.e `{ from_state_version = {epoch = 10} }`, will return uptime statistics from epoch 10 till current max ledger tip. it's possible to define both at once i.e `{ at_state_version = {epoch = 10}, from_state_version = {epoch = 25} }` will return uptime statistics for epochs from 10 till 25. you can use one of `state_version`, `epoch`, `epoch` and `round`, or `timestamp` to define from/at state version parameter, but then ongoing epoch will be selected and used for querying data. i.e for request with `{ from_state_version = { state_version = 100 000}, at_state_version = { state_version = 300 000} }` gateway api will check in which epoch transactions with state version 100 000 and 300 000 and then use that as inclusive boundary for request. /// /// Thrown when fails to make API call /// @@ -122,7 +125,7 @@ public interface IStatisticsApiAsync : IApiAccessor /// Get Validators Uptime /// /// - /// + /// Returns validators uptime data for time range limited by from_state_version and at_state_version. `at_state_version` defines upper boundary (inclusive) for queried data. i.e `{ at_state_version = {epoch = 10} }`, will return uptime statistics from genesis till 10. `from_state_version` defines lower boundary (inclusive) for queried data. i.e `{ from_state_version = {epoch = 10} }`, will return uptime statistics from epoch 10 till current max ledger tip. it's possible to define both at once i.e `{ at_state_version = {epoch = 10}, from_state_version = {epoch = 25} }` will return uptime statistics for epochs from 10 till 25. you can use one of `state_version`, `epoch`, `epoch` and `round`, or `timestamp` to define from/at state version parameter, but then ongoing epoch will be selected and used for querying data. i.e for request with `{ from_state_version = { state_version = 100 000}, at_state_version = { state_version = 300 000} }` gateway api will check in which epoch transactions with state version 100 000 and 300 000 and then use that as inclusive boundary for request. /// /// Thrown when fails to make API call /// @@ -134,7 +137,7 @@ public interface IStatisticsApiAsync : IApiAccessor /// Get Validators Uptime /// /// - /// + /// Returns validators uptime data for time range limited by from_state_version and at_state_version. `at_state_version` defines upper boundary (inclusive) for queried data. i.e `{ at_state_version = {epoch = 10} }`, will return uptime statistics from genesis till 10. `from_state_version` defines lower boundary (inclusive) for queried data. i.e `{ from_state_version = {epoch = 10} }`, will return uptime statistics from epoch 10 till current max ledger tip. it's possible to define both at once i.e `{ at_state_version = {epoch = 10}, from_state_version = {epoch = 25} }` will return uptime statistics for epochs from 10 till 25. you can use one of `state_version`, `epoch`, `epoch` and `round`, or `timestamp` to define from/at state version parameter, but then ongoing epoch will be selected and used for querying data. i.e for request with `{ from_state_version = { state_version = 100 000}, at_state_version = { state_version = 300 000} }` gateway api will check in which epoch transactions with state version 100 000 and 300 000 and then use that as inclusive boundary for request. /// /// Thrown when fails to make API call /// @@ -355,7 +358,7 @@ public RadixDlt.NetworkGateway.GatewayApiSdk.Client.ExceptionFactory ExceptionFa } /// - /// Get Validators Uptime + /// Get Validators Uptime Returns validators uptime data for time range limited by from_state_version and at_state_version. `at_state_version` defines upper boundary (inclusive) for queried data. i.e `{ at_state_version = {epoch = 10} }`, will return uptime statistics from genesis till 10. `from_state_version` defines lower boundary (inclusive) for queried data. i.e `{ from_state_version = {epoch = 10} }`, will return uptime statistics from epoch 10 till current max ledger tip. it's possible to define both at once i.e `{ at_state_version = {epoch = 10}, from_state_version = {epoch = 25} }` will return uptime statistics for epochs from 10 till 25. you can use one of `state_version`, `epoch`, `epoch` and `round`, or `timestamp` to define from/at state version parameter, but then ongoing epoch will be selected and used for querying data. i.e for request with `{ from_state_version = { state_version = 100 000}, at_state_version = { state_version = 300 000} }` gateway api will check in which epoch transactions with state version 100 000 and 300 000 and then use that as inclusive boundary for request. /// /// Thrown when fails to make API call /// @@ -367,7 +370,7 @@ public ValidatorsUptimeResponse ValidatorsUptime(ValidatorsUptimeRequest validat } /// - /// Get Validators Uptime + /// Get Validators Uptime Returns validators uptime data for time range limited by from_state_version and at_state_version. `at_state_version` defines upper boundary (inclusive) for queried data. i.e `{ at_state_version = {epoch = 10} }`, will return uptime statistics from genesis till 10. `from_state_version` defines lower boundary (inclusive) for queried data. i.e `{ from_state_version = {epoch = 10} }`, will return uptime statistics from epoch 10 till current max ledger tip. it's possible to define both at once i.e `{ at_state_version = {epoch = 10}, from_state_version = {epoch = 25} }` will return uptime statistics for epochs from 10 till 25. you can use one of `state_version`, `epoch`, `epoch` and `round`, or `timestamp` to define from/at state version parameter, but then ongoing epoch will be selected and used for querying data. i.e for request with `{ from_state_version = { state_version = 100 000}, at_state_version = { state_version = 300 000} }` gateway api will check in which epoch transactions with state version 100 000 and 300 000 and then use that as inclusive boundary for request. /// /// Thrown when fails to make API call /// @@ -411,7 +414,7 @@ public RadixDlt.NetworkGateway.GatewayApiSdk.Client.ApiResponse - /// Get Validators Uptime + /// Get Validators Uptime Returns validators uptime data for time range limited by from_state_version and at_state_version. `at_state_version` defines upper boundary (inclusive) for queried data. i.e `{ at_state_version = {epoch = 10} }`, will return uptime statistics from genesis till 10. `from_state_version` defines lower boundary (inclusive) for queried data. i.e `{ from_state_version = {epoch = 10} }`, will return uptime statistics from epoch 10 till current max ledger tip. it's possible to define both at once i.e `{ at_state_version = {epoch = 10}, from_state_version = {epoch = 25} }` will return uptime statistics for epochs from 10 till 25. you can use one of `state_version`, `epoch`, `epoch` and `round`, or `timestamp` to define from/at state version parameter, but then ongoing epoch will be selected and used for querying data. i.e for request with `{ from_state_version = { state_version = 100 000}, at_state_version = { state_version = 300 000} }` gateway api will check in which epoch transactions with state version 100 000 and 300 000 and then use that as inclusive boundary for request. /// /// Thrown when fails to make API call /// @@ -424,7 +427,7 @@ public RadixDlt.NetworkGateway.GatewayApiSdk.Client.ApiResponse - /// Get Validators Uptime + /// Get Validators Uptime Returns validators uptime data for time range limited by from_state_version and at_state_version. `at_state_version` defines upper boundary (inclusive) for queried data. i.e `{ at_state_version = {epoch = 10} }`, will return uptime statistics from genesis till 10. `from_state_version` defines lower boundary (inclusive) for queried data. i.e `{ from_state_version = {epoch = 10} }`, will return uptime statistics from epoch 10 till current max ledger tip. it's possible to define both at once i.e `{ at_state_version = {epoch = 10}, from_state_version = {epoch = 25} }` will return uptime statistics for epochs from 10 till 25. you can use one of `state_version`, `epoch`, `epoch` and `round`, or `timestamp` to define from/at state version parameter, but then ongoing epoch will be selected and used for querying data. i.e for request with `{ from_state_version = { state_version = 100 000}, at_state_version = { state_version = 300 000} }` gateway api will check in which epoch transactions with state version 100 000 and 300 000 and then use that as inclusive boundary for request. /// /// Thrown when fails to make API call /// diff --git a/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/StateEntityDetailsOptIns.cs b/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/StateEntityDetailsOptIns.cs index 8c6a676d7..debcbceca 100644 --- a/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/StateEntityDetailsOptIns.cs +++ b/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/StateEntityDetailsOptIns.cs @@ -98,11 +98,11 @@ public partial class StateEntityDetailsOptIns : IEquatable /// Initializes a new instance of the class. /// - /// ancestorIdentities. - /// componentRoyaltyVaultBalance. - /// packageRoyaltyVaultBalance. - /// nonFungibleIncludeNfids. - /// explicitMetadata. + /// (false by default) if set to true, ancestor addresses - parent_address, owner_address and global_address for entities are returned.. + /// (false by default) if set to true, royalty vault balance for component entities is returned.. + /// (false by default) if set to true, royalty vault balance for package entities is returned.. + /// (false by default) if set to true, first page of non fungible ids are returned for each non fungible resource, with cursor which can be later used at `/state/entity/page/non-fungible-vault/ids` endpoint.. + /// (empty by default) allows specifying explicitly metadata properties which should be returned in response, limited to max 20 items.. public StateEntityDetailsOptIns(bool ancestorIdentities = default(bool), bool componentRoyaltyVaultBalance = default(bool), bool packageRoyaltyVaultBalance = default(bool), bool nonFungibleIncludeNfids = default(bool), List explicitMetadata = default(List)) { this.AncestorIdentities = ancestorIdentities; @@ -113,32 +113,37 @@ public partial class StateEntityDetailsOptIns : IEquatable - /// Gets or Sets AncestorIdentities + /// (false by default) if set to true, ancestor addresses - parent_address, owner_address and global_address for entities are returned. /// + /// (false by default) if set to true, ancestor addresses - parent_address, owner_address and global_address for entities are returned. [DataMember(Name = "ancestor_identities", EmitDefaultValue = true)] public bool AncestorIdentities { get; set; } /// - /// Gets or Sets ComponentRoyaltyVaultBalance + /// (false by default) if set to true, royalty vault balance for component entities is returned. /// + /// (false by default) if set to true, royalty vault balance for component entities is returned. [DataMember(Name = "component_royalty_vault_balance", EmitDefaultValue = true)] public bool ComponentRoyaltyVaultBalance { get; set; } /// - /// Gets or Sets PackageRoyaltyVaultBalance + /// (false by default) if set to true, royalty vault balance for package entities is returned. /// + /// (false by default) if set to true, royalty vault balance for package entities is returned. [DataMember(Name = "package_royalty_vault_balance", EmitDefaultValue = true)] public bool PackageRoyaltyVaultBalance { get; set; } /// - /// Gets or Sets NonFungibleIncludeNfids + /// (false by default) if set to true, first page of non fungible ids are returned for each non fungible resource, with cursor which can be later used at `/state/entity/page/non-fungible-vault/ids` endpoint. /// + /// (false by default) if set to true, first page of non fungible ids are returned for each non fungible resource, with cursor which can be later used at `/state/entity/page/non-fungible-vault/ids` endpoint. [DataMember(Name = "non_fungible_include_nfids", EmitDefaultValue = true)] public bool NonFungibleIncludeNfids { get; set; } /// - /// Gets or Sets ExplicitMetadata + /// (empty by default) allows specifying explicitly metadata properties which should be returned in response, limited to max 20 items. /// + /// (empty by default) allows specifying explicitly metadata properties which should be returned in response, limited to max 20 items. [DataMember(Name = "explicit_metadata", EmitDefaultValue = true)] public List ExplicitMetadata { get; set; } diff --git a/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/StateEntityFungiblesPageRequestOptIns.cs b/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/StateEntityFungiblesPageRequestOptIns.cs index 7c12dde69..6183d49dc 100644 --- a/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/StateEntityFungiblesPageRequestOptIns.cs +++ b/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/StateEntityFungiblesPageRequestOptIns.cs @@ -98,15 +98,16 @@ public partial class StateEntityFungiblesPageRequestOptIns : IEquatable /// Initializes a new instance of the class. /// - /// explicitMetadata. + /// (empty by default) allows specifying explicitly metadata properties which should be returned in response, limited to max 20 items.. public StateEntityFungiblesPageRequestOptIns(List explicitMetadata = default(List)) { this.ExplicitMetadata = explicitMetadata; } /// - /// Gets or Sets ExplicitMetadata + /// (empty by default) allows specifying explicitly metadata properties which should be returned in response, limited to max 20 items. /// + /// (empty by default) allows specifying explicitly metadata properties which should be returned in response, limited to max 20 items. [DataMember(Name = "explicit_metadata", EmitDefaultValue = true)] public List ExplicitMetadata { get; set; } diff --git a/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/StateEntityNonFungibleResourceVaultsPageOptIns.cs b/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/StateEntityNonFungibleResourceVaultsPageOptIns.cs index 6c9acdacc..42c78085b 100644 --- a/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/StateEntityNonFungibleResourceVaultsPageOptIns.cs +++ b/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/StateEntityNonFungibleResourceVaultsPageOptIns.cs @@ -98,15 +98,16 @@ public partial class StateEntityNonFungibleResourceVaultsPageOptIns : IEquatable /// /// Initializes a new instance of the class. /// - /// nonFungibleIncludeNfids. + /// (false by default) if set to true, first page of non fungible ids are returned for each non fungible resource, with cursor which can be later used at `/state/entity/page/non-fungible-vault/ids` endpoint.. public StateEntityNonFungibleResourceVaultsPageOptIns(bool nonFungibleIncludeNfids = default(bool)) { this.NonFungibleIncludeNfids = nonFungibleIncludeNfids; } /// - /// Gets or Sets NonFungibleIncludeNfids + /// (false by default) if set to true, first page of non fungible ids are returned for each non fungible resource, with cursor which can be later used at `/state/entity/page/non-fungible-vault/ids` endpoint. /// + /// (false by default) if set to true, first page of non fungible ids are returned for each non fungible resource, with cursor which can be later used at `/state/entity/page/non-fungible-vault/ids` endpoint. [DataMember(Name = "non_fungible_include_nfids", EmitDefaultValue = true)] public bool NonFungibleIncludeNfids { get; set; } diff --git a/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/StateEntityNonFungiblesPageRequestOptIns.cs b/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/StateEntityNonFungiblesPageRequestOptIns.cs index cfdb8b1d1..c2b5d7ee8 100644 --- a/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/StateEntityNonFungiblesPageRequestOptIns.cs +++ b/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/StateEntityNonFungiblesPageRequestOptIns.cs @@ -98,8 +98,8 @@ public partial class StateEntityNonFungiblesPageRequestOptIns : IEquatable /// Initializes a new instance of the class. /// - /// nonFungibleIncludeNfids. - /// explicitMetadata. + /// (false by default) if set to true, first page of non fungible ids are returned for each non fungible resource, with cursor which can be later used at `/state/entity/page/non-fungible-vault/ids` endpoint.. + /// (empty by default) allows specifying explicitly metadata properties which should be returned in response, limited to max 20 items.. public StateEntityNonFungiblesPageRequestOptIns(bool nonFungibleIncludeNfids = default(bool), List explicitMetadata = default(List)) { this.NonFungibleIncludeNfids = nonFungibleIncludeNfids; @@ -107,14 +107,16 @@ public partial class StateEntityNonFungiblesPageRequestOptIns : IEquatable - /// Gets or Sets NonFungibleIncludeNfids + /// (false by default) if set to true, first page of non fungible ids are returned for each non fungible resource, with cursor which can be later used at `/state/entity/page/non-fungible-vault/ids` endpoint. /// + /// (false by default) if set to true, first page of non fungible ids are returned for each non fungible resource, with cursor which can be later used at `/state/entity/page/non-fungible-vault/ids` endpoint. [DataMember(Name = "non_fungible_include_nfids", EmitDefaultValue = true)] public bool NonFungibleIncludeNfids { get; set; } /// - /// Gets or Sets ExplicitMetadata + /// (empty by default) allows specifying explicitly metadata properties which should be returned in response, limited to max 20 items. /// + /// (empty by default) allows specifying explicitly metadata properties which should be returned in response, limited to max 20 items. [DataMember(Name = "explicit_metadata", EmitDefaultValue = true)] public List ExplicitMetadata { get; set; } diff --git a/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/TransactionDetailsOptIns.cs b/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/TransactionDetailsOptIns.cs index e4a9e721e..17dc563bf 100644 --- a/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/TransactionDetailsOptIns.cs +++ b/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/TransactionDetailsOptIns.cs @@ -98,15 +98,16 @@ public partial class TransactionDetailsOptIns : IEquatable /// Initializes a new instance of the class. /// - /// rawHex. - /// receiptStateChanges. - /// receiptFeeSummary. - /// receiptFeeSource. - /// receiptFeeDestination. - /// receiptCostingParameters. - /// receiptEvents. - /// affectedGlobalEntities. - public TransactionDetailsOptIns(bool rawHex = default(bool), bool receiptStateChanges = default(bool), bool receiptFeeSummary = default(bool), bool receiptFeeSource = default(bool), bool receiptFeeDestination = default(bool), bool receiptCostingParameters = default(bool), bool receiptEvents = default(bool), bool affectedGlobalEntities = default(bool)) + /// (false by default) If set to true, raw transaction hex is returned.. + /// (false by default) if set to true, state changes inside receipt object are returned.. + /// (false by default) if set to true, fee summary inside receipt object is returned.. + /// (false by default) if set to true, fee source inside receipt object is returned.. + /// (false by default) if set to true, fee destination inside receipt object is returned.. + /// (false by default) if set to true, costing parameters inside receipt object is returned.. + /// (false by default) if set to true, events inside receipt object is returned.. + /// (true by default) If set to true, transaction receipt output is returned.. + /// (false by default) if set to true, all affected global entities by given transaction are returned.. + public TransactionDetailsOptIns(bool rawHex = default(bool), bool receiptStateChanges = default(bool), bool receiptFeeSummary = default(bool), bool receiptFeeSource = default(bool), bool receiptFeeDestination = default(bool), bool receiptCostingParameters = default(bool), bool receiptEvents = default(bool), bool receiptOutput = default(bool), bool affectedGlobalEntities = default(bool)) { this.RawHex = rawHex; this.ReceiptStateChanges = receiptStateChanges; @@ -115,54 +116,70 @@ public partial class TransactionDetailsOptIns : IEquatable - /// Gets or Sets RawHex + /// (false by default) If set to true, raw transaction hex is returned. /// + /// (false by default) If set to true, raw transaction hex is returned. [DataMember(Name = "raw_hex", EmitDefaultValue = true)] public bool RawHex { get; set; } /// - /// Gets or Sets ReceiptStateChanges + /// (false by default) if set to true, state changes inside receipt object are returned. /// + /// (false by default) if set to true, state changes inside receipt object are returned. [DataMember(Name = "receipt_state_changes", EmitDefaultValue = true)] public bool ReceiptStateChanges { get; set; } /// - /// Gets or Sets ReceiptFeeSummary + /// (false by default) if set to true, fee summary inside receipt object is returned. /// + /// (false by default) if set to true, fee summary inside receipt object is returned. [DataMember(Name = "receipt_fee_summary", EmitDefaultValue = true)] public bool ReceiptFeeSummary { get; set; } /// - /// Gets or Sets ReceiptFeeSource + /// (false by default) if set to true, fee source inside receipt object is returned. /// + /// (false by default) if set to true, fee source inside receipt object is returned. [DataMember(Name = "receipt_fee_source", EmitDefaultValue = true)] public bool ReceiptFeeSource { get; set; } /// - /// Gets or Sets ReceiptFeeDestination + /// (false by default) if set to true, fee destination inside receipt object is returned. /// + /// (false by default) if set to true, fee destination inside receipt object is returned. [DataMember(Name = "receipt_fee_destination", EmitDefaultValue = true)] public bool ReceiptFeeDestination { get; set; } /// - /// Gets or Sets ReceiptCostingParameters + /// (false by default) if set to true, costing parameters inside receipt object is returned. /// + /// (false by default) if set to true, costing parameters inside receipt object is returned. [DataMember(Name = "receipt_costing_parameters", EmitDefaultValue = true)] public bool ReceiptCostingParameters { get; set; } /// - /// Gets or Sets ReceiptEvents + /// (false by default) if set to true, events inside receipt object is returned. /// + /// (false by default) if set to true, events inside receipt object is returned. [DataMember(Name = "receipt_events", EmitDefaultValue = true)] public bool ReceiptEvents { get; set; } /// - /// Gets or Sets AffectedGlobalEntities + /// (true by default) If set to true, transaction receipt output is returned. /// + /// (true by default) If set to true, transaction receipt output is returned. + [DataMember(Name = "receipt_output", EmitDefaultValue = true)] + public bool ReceiptOutput { get; set; } + + /// + /// (false by default) if set to true, all affected global entities by given transaction are returned. + /// + /// (false by default) if set to true, all affected global entities by given transaction are returned. [DataMember(Name = "affected_global_entities", EmitDefaultValue = true)] public bool AffectedGlobalEntities { get; set; } @@ -181,6 +198,7 @@ public override string ToString() sb.Append(" ReceiptFeeDestination: ").Append(ReceiptFeeDestination).Append("\n"); sb.Append(" ReceiptCostingParameters: ").Append(ReceiptCostingParameters).Append("\n"); sb.Append(" ReceiptEvents: ").Append(ReceiptEvents).Append("\n"); + sb.Append(" ReceiptOutput: ").Append(ReceiptOutput).Append("\n"); sb.Append(" AffectedGlobalEntities: ").Append(AffectedGlobalEntities).Append("\n"); sb.Append("}\n"); return sb.ToString(); @@ -245,6 +263,10 @@ public bool Equals(TransactionDetailsOptIns input) this.ReceiptEvents == input.ReceiptEvents || this.ReceiptEvents.Equals(input.ReceiptEvents) ) && + ( + this.ReceiptOutput == input.ReceiptOutput || + this.ReceiptOutput.Equals(input.ReceiptOutput) + ) && ( this.AffectedGlobalEntities == input.AffectedGlobalEntities || this.AffectedGlobalEntities.Equals(input.AffectedGlobalEntities) @@ -267,6 +289,7 @@ public override int GetHashCode() hashCode = (hashCode * 59) + this.ReceiptFeeDestination.GetHashCode(); hashCode = (hashCode * 59) + this.ReceiptCostingParameters.GetHashCode(); hashCode = (hashCode * 59) + this.ReceiptEvents.GetHashCode(); + hashCode = (hashCode * 59) + this.ReceiptOutput.GetHashCode(); hashCode = (hashCode * 59) + this.AffectedGlobalEntities.GetHashCode(); return hashCode; } diff --git a/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/ValidatorUptimeCollectionItem.cs b/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/ValidatorUptimeCollectionItem.cs index d0bdbd9a2..3bf76b6a1 100644 --- a/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/ValidatorUptimeCollectionItem.cs +++ b/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/ValidatorUptimeCollectionItem.cs @@ -104,9 +104,9 @@ protected ValidatorUptimeCollectionItem() { } /// Initializes a new instance of the class. /// /// Bech32m-encoded human readable version of the address. (required). - /// proposalsMade. - /// proposalsMissed. - /// epochsActiveIn (required). + /// number of proposals made.. + /// number of proposals missed.. + /// number of epochs validator was active in. (required). public ValidatorUptimeCollectionItem(string address = default(string), long? proposalsMade = default(long?), long? proposalsMissed = default(long?), long epochsActiveIn = default(long)) { // to ensure "address" is required (not null) @@ -128,20 +128,23 @@ protected ValidatorUptimeCollectionItem() { } public string Address { get; set; } /// - /// Gets or Sets ProposalsMade + /// number of proposals made. /// + /// number of proposals made. [DataMember(Name = "proposals_made", EmitDefaultValue = true)] public long? ProposalsMade { get; set; } /// - /// Gets or Sets ProposalsMissed + /// number of proposals missed. /// + /// number of proposals missed. [DataMember(Name = "proposals_missed", EmitDefaultValue = true)] public long? ProposalsMissed { get; set; } /// - /// Gets or Sets EpochsActiveIn + /// number of epochs validator was active in. /// + /// number of epochs validator was active in. [DataMember(Name = "epochs_active_in", IsRequired = true, EmitDefaultValue = true)] public long EpochsActiveIn { get; set; } diff --git a/src/RadixDlt.NetworkGateway.PostgresIntegration/GatewayModelExtensions.cs b/src/RadixDlt.NetworkGateway.PostgresIntegration/GatewayModelExtensions.cs index 9facc1073..6654e1e7f 100644 --- a/src/RadixDlt.NetworkGateway.PostgresIntegration/GatewayModelExtensions.cs +++ b/src/RadixDlt.NetworkGateway.PostgresIntegration/GatewayModelExtensions.cs @@ -129,14 +129,14 @@ public static GatewayModel.CommittedTransactionInfo ToGatewayModel( { ErrorMessage = lt.EngineReceipt.ErrorMessage, Status = ToGatewayModel(lt.EngineReceipt.Status), - Output = lt.EngineReceipt.Output != null ? new JRaw(lt.EngineReceipt.Output) : null, + Output = optIns.ReceiptOutput && lt.EngineReceipt.Output != null ? new JRaw(lt.EngineReceipt.Output) : null, FeeSummary = optIns.ReceiptFeeSummary ? new JRaw(lt.EngineReceipt.FeeSummary) : null, FeeDestination = optIns.ReceiptFeeDestination && lt.EngineReceipt.FeeDestination != null ? new JRaw(lt.EngineReceipt.FeeDestination) : null, FeeSource = optIns.ReceiptFeeSource && lt.EngineReceipt.FeeSource != null ? new JRaw(lt.EngineReceipt.FeeSource) : null, CostingParameters = optIns.ReceiptCostingParameters ? new JRaw(lt.EngineReceipt.CostingParameters) : null, NextEpoch = lt.EngineReceipt.NextEpoch != null ? new JRaw(lt.EngineReceipt.NextEpoch) : null, StateUpdates = optIns.ReceiptStateChanges ? new JRaw(lt.EngineReceipt.StateUpdates) : null, - Events = events?.Select(x => new GatewayModel.EventsItem(x.Name, new JRaw(x.Emitter), new JRaw(x.Data))).ToList(), + Events = optIns.ReceiptEvents ? events?.Select(x => new GatewayModel.EventsItem(x.Name, new JRaw(x.Emitter), new JRaw(x.Data))).ToList() : null, }; return new GatewayModel.CommittedTransactionInfo( diff --git a/src/RadixDlt.NetworkGateway.PostgresIntegration/Interceptors/MetricsInterceptor.cs b/src/RadixDlt.NetworkGateway.PostgresIntegration/Interceptors/MetricsInterceptor.cs index 3d043ddc0..06eec88ce 100644 --- a/src/RadixDlt.NetworkGateway.PostgresIntegration/Interceptors/MetricsInterceptor.cs +++ b/src/RadixDlt.NetworkGateway.PostgresIntegration/Interceptors/MetricsInterceptor.cs @@ -1,4 +1,68 @@ -using Microsoft.EntityFrameworkCore.Diagnostics; +/* 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 Microsoft.EntityFrameworkCore.Diagnostics; using Microsoft.EntityFrameworkCore.Storage.Internal; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; diff --git a/src/RadixDlt.NetworkGateway.PostgresIntegration/Metrics/SqlQueryMetricsHelper.cs b/src/RadixDlt.NetworkGateway.PostgresIntegration/Metrics/SqlQueryMetricsHelper.cs index f95f619c6..87d8c1930 100644 --- a/src/RadixDlt.NetworkGateway.PostgresIntegration/Metrics/SqlQueryMetricsHelper.cs +++ b/src/RadixDlt.NetworkGateway.PostgresIntegration/Metrics/SqlQueryMetricsHelper.cs @@ -1,4 +1,68 @@ -using RadixDlt.NetworkGateway.PostgresIntegration.Interceptors; +/* 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 RadixDlt.NetworkGateway.PostgresIntegration.Interceptors; using System; using System.Linq; diff --git a/src/RadixDlt.NetworkGateway.PostgresIntegration/QueryableExtensions.cs b/src/RadixDlt.NetworkGateway.PostgresIntegration/QueryableExtensions.cs index 79c8b1b2c..53ad37f6a 100644 --- a/src/RadixDlt.NetworkGateway.PostgresIntegration/QueryableExtensions.cs +++ b/src/RadixDlt.NetworkGateway.PostgresIntegration/QueryableExtensions.cs @@ -1,4 +1,68 @@ -using Microsoft.EntityFrameworkCore; +/* 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 Microsoft.EntityFrameworkCore; using RadixDlt.NetworkGateway.PostgresIntegration.Metrics; using System.Linq; using System.Runtime.CompilerServices; diff --git a/src/RadixDlt.NetworkGateway.PostgresIntegration/Services/DapperWrapper.cs b/src/RadixDlt.NetworkGateway.PostgresIntegration/Services/DapperWrapper.cs index a448fb894..1825f4c2e 100644 --- a/src/RadixDlt.NetworkGateway.PostgresIntegration/Services/DapperWrapper.cs +++ b/src/RadixDlt.NetworkGateway.PostgresIntegration/Services/DapperWrapper.cs @@ -1,4 +1,68 @@ -using Dapper; +/* 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 Dapper; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; using Newtonsoft.Json; From 928c9a9a709a1bca51d1d58597072c0fa0cb20cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Pawelec?= Date: Wed, 11 Oct 2023 08:57:06 +0200 Subject: [PATCH 2/5] validate optins for /state/entity/page/fungibles and non /state/entity/page/nonfungibles. --- .../Validators/StateEntityFungiblesPageRequestValidator.cs | 6 +++++- .../StateEntityNonFungiblesPageRequestValidator.cs | 7 ++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/RadixDlt.NetworkGateway.GatewayApi/Validators/StateEntityFungiblesPageRequestValidator.cs b/src/RadixDlt.NetworkGateway.GatewayApi/Validators/StateEntityFungiblesPageRequestValidator.cs index e10d4d174..13cf16e5b 100644 --- a/src/RadixDlt.NetworkGateway.GatewayApi/Validators/StateEntityFungiblesPageRequestValidator.cs +++ b/src/RadixDlt.NetworkGateway.GatewayApi/Validators/StateEntityFungiblesPageRequestValidator.cs @@ -74,7 +74,8 @@ internal class StateEntityFungiblesPageRequestValidator : AbstractValidator endpointOptionsSnapshot, LedgerStateSelectorValidator ledgerStateSelectorValidator, - PaginableRequestValidator paginableRequestValidator) + PaginableRequestValidator paginableRequestValidator, + StateEntityFungiblesPageRequestOptInsValidator entityFungiblesPageRequestOptInsValidator) { RuleFor(x => x.Address) .NotEmpty() @@ -95,5 +96,8 @@ public StateEntityFungiblesPageRequestValidator( RuleFor(x => x.LimitPerPage) .GreaterThan(0) .LessThanOrEqualTo(endpointOptionsSnapshot.Value.MaxPageSize); + + RuleFor(x => x.OptIns) + .SetValidator(entityFungiblesPageRequestOptInsValidator); } } diff --git a/src/RadixDlt.NetworkGateway.GatewayApi/Validators/StateEntityNonFungiblesPageRequestValidator.cs b/src/RadixDlt.NetworkGateway.GatewayApi/Validators/StateEntityNonFungiblesPageRequestValidator.cs index b7f31453c..5bdaa159c 100644 --- a/src/RadixDlt.NetworkGateway.GatewayApi/Validators/StateEntityNonFungiblesPageRequestValidator.cs +++ b/src/RadixDlt.NetworkGateway.GatewayApi/Validators/StateEntityNonFungiblesPageRequestValidator.cs @@ -74,7 +74,9 @@ internal class StateEntityNonFungiblesPageRequestValidator : AbstractValidator endpointOptionsSnapshot, LedgerStateSelectorValidator ledgerStateSelectorValidator, - PaginableRequestValidator paginableRequestValidator) + PaginableRequestValidator paginableRequestValidator, + StateEntityNonFungiblesPageRequestOptInsValidator nonFungiblesPageRequestOptInsValidator + ) { RuleFor(x => x.Address) .NotEmpty() @@ -89,6 +91,9 @@ public StateEntityNonFungiblesPageRequestValidator( RuleFor(x => x.Cursor) .Base64(); + RuleFor(x => x.OptIns) + .SetValidator(nonFungiblesPageRequestOptInsValidator); + RuleFor(x => x) .SetValidator(paginableRequestValidator); From b264de3ef30c5b7241992085075c514541db2c06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Pawelec?= Date: Wed, 11 Oct 2023 13:27:36 +0200 Subject: [PATCH 3/5] remove not implemented quantity from event filter. --- .../Model/LedgerTransactionEventFilter.cs | 2 -- .../Handlers/DefaultTransactionHandler.cs | 1 - src/RadixDlt.NetworkGateway.GatewayApi/gateway-api-schema.yaml | 2 -- 3 files changed, 5 deletions(-) diff --git a/src/RadixDlt.NetworkGateway.Abstractions/Model/LedgerTransactionEventFilter.cs b/src/RadixDlt.NetworkGateway.Abstractions/Model/LedgerTransactionEventFilter.cs index e2ebb617d..9f3836b45 100644 --- a/src/RadixDlt.NetworkGateway.Abstractions/Model/LedgerTransactionEventFilter.cs +++ b/src/RadixDlt.NetworkGateway.Abstractions/Model/LedgerTransactionEventFilter.cs @@ -79,6 +79,4 @@ public enum EventType public EntityAddress? EmitterEntityAddress { get; set; } public EntityAddress? ResourceAddress { get; set; } - - public TokenAmount? Qunatity { get; set; } } diff --git a/src/RadixDlt.NetworkGateway.GatewayApi/Handlers/DefaultTransactionHandler.cs b/src/RadixDlt.NetworkGateway.GatewayApi/Handlers/DefaultTransactionHandler.cs index 07810c5e2..018e3eca0 100644 --- a/src/RadixDlt.NetworkGateway.GatewayApi/Handlers/DefaultTransactionHandler.cs +++ b/src/RadixDlt.NetworkGateway.GatewayApi/Handlers/DefaultTransactionHandler.cs @@ -179,7 +179,6 @@ public DefaultTransactionHandler( Event = eventType, EmitterEntityAddress = ef.EmitterAddress != null ? (EntityAddress)ef.EmitterAddress : null, ResourceAddress = ef.ResourceAddress != null ? (EntityAddress)ef.ResourceAddress : null, - Qunatity = ef.Quantity != null ? TokenAmount.FromDecimalString(ef.Quantity) : null, }); }); diff --git a/src/RadixDlt.NetworkGateway.GatewayApi/gateway-api-schema.yaml b/src/RadixDlt.NetworkGateway.GatewayApi/gateway-api-schema.yaml index 31b998ce4..974acd450 100644 --- a/src/RadixDlt.NetworkGateway.GatewayApi/gateway-api-schema.yaml +++ b/src/RadixDlt.NetworkGateway.GatewayApi/gateway-api-schema.yaml @@ -1931,8 +1931,6 @@ components: $ref: "#/components/schemas/Address" resource_address: $ref: "#/components/schemas/Address" - quantity: - $ref: "#/components/schemas/BigDecimal" StreamTransactionsResponse: allOf: - $ref: "#/components/schemas/LedgerStateMixin" From 642d93d511f79790662714b838e083165b91ecce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Pawelec?= Date: Wed, 11 Oct 2023 13:52:28 +0200 Subject: [PATCH 4/5] apply pull request comments. Move detailed description to request. --- .../gateway-api-schema.yaml | 60 ++++++++++--------- .../generated/Api/StatisticsApi.cs | 16 ++--- .../generated/Model/AtLedgerStateMixin.cs | 2 +- .../Model/StateEntityDetailsOptIns.cs | 30 +++++----- .../StateEntityFungiblesPageRequestOptIns.cs | 6 +- ...tityNonFungibleResourceVaultsPageOptIns.cs | 6 +- ...tateEntityNonFungiblesPageRequestOptIns.cs | 12 ++-- .../Model/StreamTransactionsRequest.cs | 38 ++++++------ .../Model/StreamTransactionsRequestAllOf.cs | 20 +------ ...treamTransactionsRequestEventFilterItem.cs | 21 +------ .../Model/TransactionDetailsOptIns.cs | 54 ++++++++--------- .../Model/ValidatorsUptimeRequest.cs | 2 +- .../Model/ValidatorsUptimeRequestAllOf.cs | 20 +------ 13 files changed, 118 insertions(+), 169 deletions(-) diff --git a/src/RadixDlt.NetworkGateway.GatewayApi/gateway-api-schema.yaml b/src/RadixDlt.NetworkGateway.GatewayApi/gateway-api-schema.yaml index 974acd450..1cedc9957 100644 --- a/src/RadixDlt.NetworkGateway.GatewayApi/gateway-api-schema.yaml +++ b/src/RadixDlt.NetworkGateway.GatewayApi/gateway-api-schema.yaml @@ -628,12 +628,7 @@ paths: operationId: ValidatorsUptime summary: Get Validators Uptime description: | - Returns validators uptime data for time range limited by from_state_version and at_state_version. - `at_state_version` defines upper boundary (inclusive) for queried data. i.e `{ at_state_version = {epoch = 10} }`, will return uptime statistics from genesis till 10. - `from_state_version` defines lower boundary (inclusive) for queried data. i.e `{ from_state_version = {epoch = 10} }`, will return uptime statistics from epoch 10 till current max ledger tip. - it's possible to define both at once i.e `{ at_state_version = {epoch = 10}, from_state_version = {epoch = 25} }` will return uptime statistics for epochs from 10 till 25. - you can use one of `state_version`, `epoch`, `epoch` and `round`, or `timestamp` to define from/at state version parameter, but then ongoing epoch will be selected and used for querying data. - i.e for request with `{ from_state_version = { state_version = 100 000}, at_state_version = { state_version = 300 000} }` gateway api will check in which epoch transactions with state version 100 000 and 300 000 and then use that as inclusive boundary for request. + Returns validators uptime data for time range limited by `from_state_version` and `at_state_version`. tags: - Statistics requestBody: @@ -799,11 +794,19 @@ components: # AtLedgerStateMixin: + description: defines upper boundary (inclusive) for queried data. i.e `{ "at_state_version" = {"epoch" = 10} }`, will return data till 10 epoch. type: object properties: at_ledger_state: $ref: "#/components/schemas/LedgerStateSelector" + FromLedgerStateMixin: + description: defines lower boundary (inclusive) for queried data. i.e `{ "from_state_version" = {"epoch" = 10} }`, will return data from epoch 10 till current max ledger tip. + type: object + properties: + from_ledger_state: + $ref: "#/components/schemas/LedgerStateSelector" + LedgerStateSelector: description: | Optional. This allows for a request to be made against a historic state. @@ -1831,31 +1834,31 @@ components: type: object properties: raw_hex: - description: (false by default) If set to true, raw transaction hex is returned. + description: if set to `true`, raw transaction hex is returned. type: boolean receipt_state_changes: - description: (false by default) if set to true, state changes inside receipt object are returned. + description: if set to `true`, state changes inside receipt object are returned. type: boolean receipt_fee_summary: - description: (false by default) if set to true, fee summary inside receipt object is returned. + description: if set to `true`, fee summary inside receipt object is returned. type: boolean receipt_fee_source: - description: (false by default) if set to true, fee source inside receipt object is returned. + description: if set to `true`, fee source inside receipt object is returned. type: boolean receipt_fee_destination: - description: (false by default) if set to true, fee destination inside receipt object is returned. + description: if set to `true`, fee destination inside receipt object is returned. type: boolean receipt_costing_parameters: - description: (false by default) if set to true, costing parameters inside receipt object is returned. + description: if set to `true`, costing parameters inside receipt object is returned. type: boolean receipt_events: - description: (false by default) if set to true, events inside receipt object is returned. + description: if set to `true`, events inside receipt object is returned. type: boolean receipt_output: - description: (true by default) If set to true, transaction receipt output is returned. + description: (true by default) if set to `true`, transaction receipt output is returned. type: boolean affected_global_entities: - description: (false by default) if set to true, all affected global entities by given transaction are returned. + description: if set to `true`, all affected global entities by given transaction are returned. type: boolean TransactionCommittedDetailsResponse: @@ -1875,11 +1878,10 @@ components: StreamTransactionsRequest: allOf: - $ref: "#/components/schemas/AtLedgerStateMixin" + - $ref: "#/components/schemas/FromLedgerStateMixin" - $ref: "#/components/schemas/CursorLimitMixin" - type: object properties: - from_ledger_state: - $ref: "#/components/schemas/LedgerStateSelector" kind_filter: description: Limit returned transactions by their kind. Defaults to `user`. type: string @@ -1980,19 +1982,19 @@ components: type: object properties: ancestor_identities: - description: (false by default) if set to true, ancestor addresses - parent_address, owner_address and global_address for entities are returned. + description: if set to `true`, ancestor addresses - `parent_address`, `owner_address` and `global_address` for entities are returned. type: boolean component_royalty_vault_balance: - description: (false by default) if set to true, royalty vault balance for component entities is returned. + description: if set to `true`, `royalty_vault_balance` for component entities is returned. type: boolean package_royalty_vault_balance: - description: (false by default) if set to true, royalty vault balance for package entities is returned. + description: if set to `true`, `royalty_vault_balance` for package entities is returned. type: boolean non_fungible_include_nfids: - description: (false by default) if set to true, first page of non fungible ids are returned for each non fungible resource, with cursor which can be later used at `/state/entity/page/non-fungible-vault/ids` endpoint. + description: if set to `true`, first page of non fungible ids are returned for each non fungible resource, with `next_cursor` which can be later used at `/state/entity/page/non-fungible-vault/ids` endpoint. type: boolean explicit_metadata: - description: (empty by default) allows specifying explicitly metadata properties which should be returned in response, limited to max 20 items. + description: allows specifying explicitly metadata properties which should be returned in response. type: array items: type: string @@ -2257,7 +2259,7 @@ components: type: object properties: explicit_metadata: - description: (empty by default) allows specifying explicitly metadata properties which should be returned in response, limited to max 20 items. + description: allows specifying explicitly metadata properties which should be returned in response, limited to max 20 items. type: array items: type: string @@ -2321,10 +2323,10 @@ components: type: object properties: non_fungible_include_nfids: - description: (false by default) if set to true, first page of non fungible ids are returned for each non fungible resource, with cursor which can be later used at `/state/entity/page/non-fungible-vault/ids` endpoint. + description: if set to `true`, first page of non fungible ids are returned for each non fungible resource, with cursor which can be later used at `/state/entity/page/non-fungible-vault/ids` endpoint. type: boolean explicit_metadata: - description: (empty by default) allows specifying explicitly metadata properties which should be returned in response, limited to max 20 items. + description: allows specifying explicitly metadata properties which should be returned in response, limited to max 20 items. type: array items: type: string @@ -2361,7 +2363,7 @@ components: type: object properties: non_fungible_include_nfids: - description: (false by default) if set to true, first page of non fungible ids are returned for each non fungible resource, with cursor which can be later used at `/state/entity/page/non-fungible-vault/ids` endpoint. + description: if set to `true`, first page of non fungible ids are returned for each non fungible resource, with cursor which can be later used at `/state/entity/page/non-fungible-vault/ids` endpoint. type: boolean StateEntityNonFungibleResourceVaultsPageResponse: @@ -2627,12 +2629,14 @@ components: $ref: "#/components/schemas/ValidatorCollection" ValidatorsUptimeRequest: + description: | + For `at_ledger_state` and `from_ledger_state` you can use one of `state_version`, `epoch`, `epoch` and `round`, or `timestamp`, but then ongoing epoch will be selected and used for querying data. + i.e for request with `{ "from_state_version" = { "state_version" = 100 }, "at_state_version" = { "state_version" = 300} }` gateway api will check in which epoch transactions with state version 100 and 300 were and then use that as inclusive boundary for request. allOf: - $ref: "#/components/schemas/AtLedgerStateMixin" + - $ref: "#/components/schemas/FromLedgerStateMixin" - type: object properties: - from_ledger_state: - $ref: "#/components/schemas/LedgerStateSelector" validator_addresses: type: array items: diff --git a/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Api/StatisticsApi.cs b/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Api/StatisticsApi.cs index fefe3f206..b9a20daad 100644 --- a/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Api/StatisticsApi.cs +++ b/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Api/StatisticsApi.cs @@ -95,7 +95,7 @@ public interface IStatisticsApiSync : IApiAccessor /// Get Validators Uptime /// /// - /// Returns validators uptime data for time range limited by from_state_version and at_state_version. `at_state_version` defines upper boundary (inclusive) for queried data. i.e `{ at_state_version = {epoch = 10} }`, will return uptime statistics from genesis till 10. `from_state_version` defines lower boundary (inclusive) for queried data. i.e `{ from_state_version = {epoch = 10} }`, will return uptime statistics from epoch 10 till current max ledger tip. it's possible to define both at once i.e `{ at_state_version = {epoch = 10}, from_state_version = {epoch = 25} }` will return uptime statistics for epochs from 10 till 25. you can use one of `state_version`, `epoch`, `epoch` and `round`, or `timestamp` to define from/at state version parameter, but then ongoing epoch will be selected and used for querying data. i.e for request with `{ from_state_version = { state_version = 100 000}, at_state_version = { state_version = 300 000} }` gateway api will check in which epoch transactions with state version 100 000 and 300 000 and then use that as inclusive boundary for request. + /// Returns validators uptime data for time range limited by `from_state_version` and `at_state_version`. /// /// Thrown when fails to make API call /// @@ -106,7 +106,7 @@ public interface IStatisticsApiSync : IApiAccessor /// Get Validators Uptime /// /// - /// Returns validators uptime data for time range limited by from_state_version and at_state_version. `at_state_version` defines upper boundary (inclusive) for queried data. i.e `{ at_state_version = {epoch = 10} }`, will return uptime statistics from genesis till 10. `from_state_version` defines lower boundary (inclusive) for queried data. i.e `{ from_state_version = {epoch = 10} }`, will return uptime statistics from epoch 10 till current max ledger tip. it's possible to define both at once i.e `{ at_state_version = {epoch = 10}, from_state_version = {epoch = 25} }` will return uptime statistics for epochs from 10 till 25. you can use one of `state_version`, `epoch`, `epoch` and `round`, or `timestamp` to define from/at state version parameter, but then ongoing epoch will be selected and used for querying data. i.e for request with `{ from_state_version = { state_version = 100 000}, at_state_version = { state_version = 300 000} }` gateway api will check in which epoch transactions with state version 100 000 and 300 000 and then use that as inclusive boundary for request. + /// Returns validators uptime data for time range limited by `from_state_version` and `at_state_version`. /// /// Thrown when fails to make API call /// @@ -125,7 +125,7 @@ public interface IStatisticsApiAsync : IApiAccessor /// Get Validators Uptime /// /// - /// Returns validators uptime data for time range limited by from_state_version and at_state_version. `at_state_version` defines upper boundary (inclusive) for queried data. i.e `{ at_state_version = {epoch = 10} }`, will return uptime statistics from genesis till 10. `from_state_version` defines lower boundary (inclusive) for queried data. i.e `{ from_state_version = {epoch = 10} }`, will return uptime statistics from epoch 10 till current max ledger tip. it's possible to define both at once i.e `{ at_state_version = {epoch = 10}, from_state_version = {epoch = 25} }` will return uptime statistics for epochs from 10 till 25. you can use one of `state_version`, `epoch`, `epoch` and `round`, or `timestamp` to define from/at state version parameter, but then ongoing epoch will be selected and used for querying data. i.e for request with `{ from_state_version = { state_version = 100 000}, at_state_version = { state_version = 300 000} }` gateway api will check in which epoch transactions with state version 100 000 and 300 000 and then use that as inclusive boundary for request. + /// Returns validators uptime data for time range limited by `from_state_version` and `at_state_version`. /// /// Thrown when fails to make API call /// @@ -137,7 +137,7 @@ public interface IStatisticsApiAsync : IApiAccessor /// Get Validators Uptime /// /// - /// Returns validators uptime data for time range limited by from_state_version and at_state_version. `at_state_version` defines upper boundary (inclusive) for queried data. i.e `{ at_state_version = {epoch = 10} }`, will return uptime statistics from genesis till 10. `from_state_version` defines lower boundary (inclusive) for queried data. i.e `{ from_state_version = {epoch = 10} }`, will return uptime statistics from epoch 10 till current max ledger tip. it's possible to define both at once i.e `{ at_state_version = {epoch = 10}, from_state_version = {epoch = 25} }` will return uptime statistics for epochs from 10 till 25. you can use one of `state_version`, `epoch`, `epoch` and `round`, or `timestamp` to define from/at state version parameter, but then ongoing epoch will be selected and used for querying data. i.e for request with `{ from_state_version = { state_version = 100 000}, at_state_version = { state_version = 300 000} }` gateway api will check in which epoch transactions with state version 100 000 and 300 000 and then use that as inclusive boundary for request. + /// Returns validators uptime data for time range limited by `from_state_version` and `at_state_version`. /// /// Thrown when fails to make API call /// @@ -358,7 +358,7 @@ public RadixDlt.NetworkGateway.GatewayApiSdk.Client.ExceptionFactory ExceptionFa } /// - /// Get Validators Uptime Returns validators uptime data for time range limited by from_state_version and at_state_version. `at_state_version` defines upper boundary (inclusive) for queried data. i.e `{ at_state_version = {epoch = 10} }`, will return uptime statistics from genesis till 10. `from_state_version` defines lower boundary (inclusive) for queried data. i.e `{ from_state_version = {epoch = 10} }`, will return uptime statistics from epoch 10 till current max ledger tip. it's possible to define both at once i.e `{ at_state_version = {epoch = 10}, from_state_version = {epoch = 25} }` will return uptime statistics for epochs from 10 till 25. you can use one of `state_version`, `epoch`, `epoch` and `round`, or `timestamp` to define from/at state version parameter, but then ongoing epoch will be selected and used for querying data. i.e for request with `{ from_state_version = { state_version = 100 000}, at_state_version = { state_version = 300 000} }` gateway api will check in which epoch transactions with state version 100 000 and 300 000 and then use that as inclusive boundary for request. + /// Get Validators Uptime Returns validators uptime data for time range limited by `from_state_version` and `at_state_version`. /// /// Thrown when fails to make API call /// @@ -370,7 +370,7 @@ public ValidatorsUptimeResponse ValidatorsUptime(ValidatorsUptimeRequest validat } /// - /// Get Validators Uptime Returns validators uptime data for time range limited by from_state_version and at_state_version. `at_state_version` defines upper boundary (inclusive) for queried data. i.e `{ at_state_version = {epoch = 10} }`, will return uptime statistics from genesis till 10. `from_state_version` defines lower boundary (inclusive) for queried data. i.e `{ from_state_version = {epoch = 10} }`, will return uptime statistics from epoch 10 till current max ledger tip. it's possible to define both at once i.e `{ at_state_version = {epoch = 10}, from_state_version = {epoch = 25} }` will return uptime statistics for epochs from 10 till 25. you can use one of `state_version`, `epoch`, `epoch` and `round`, or `timestamp` to define from/at state version parameter, but then ongoing epoch will be selected and used for querying data. i.e for request with `{ from_state_version = { state_version = 100 000}, at_state_version = { state_version = 300 000} }` gateway api will check in which epoch transactions with state version 100 000 and 300 000 and then use that as inclusive boundary for request. + /// Get Validators Uptime Returns validators uptime data for time range limited by `from_state_version` and `at_state_version`. /// /// Thrown when fails to make API call /// @@ -414,7 +414,7 @@ public RadixDlt.NetworkGateway.GatewayApiSdk.Client.ApiResponse - /// Get Validators Uptime Returns validators uptime data for time range limited by from_state_version and at_state_version. `at_state_version` defines upper boundary (inclusive) for queried data. i.e `{ at_state_version = {epoch = 10} }`, will return uptime statistics from genesis till 10. `from_state_version` defines lower boundary (inclusive) for queried data. i.e `{ from_state_version = {epoch = 10} }`, will return uptime statistics from epoch 10 till current max ledger tip. it's possible to define both at once i.e `{ at_state_version = {epoch = 10}, from_state_version = {epoch = 25} }` will return uptime statistics for epochs from 10 till 25. you can use one of `state_version`, `epoch`, `epoch` and `round`, or `timestamp` to define from/at state version parameter, but then ongoing epoch will be selected and used for querying data. i.e for request with `{ from_state_version = { state_version = 100 000}, at_state_version = { state_version = 300 000} }` gateway api will check in which epoch transactions with state version 100 000 and 300 000 and then use that as inclusive boundary for request. + /// Get Validators Uptime Returns validators uptime data for time range limited by `from_state_version` and `at_state_version`. /// /// Thrown when fails to make API call /// @@ -427,7 +427,7 @@ public RadixDlt.NetworkGateway.GatewayApiSdk.Client.ApiResponse - /// Get Validators Uptime Returns validators uptime data for time range limited by from_state_version and at_state_version. `at_state_version` defines upper boundary (inclusive) for queried data. i.e `{ at_state_version = {epoch = 10} }`, will return uptime statistics from genesis till 10. `from_state_version` defines lower boundary (inclusive) for queried data. i.e `{ from_state_version = {epoch = 10} }`, will return uptime statistics from epoch 10 till current max ledger tip. it's possible to define both at once i.e `{ at_state_version = {epoch = 10}, from_state_version = {epoch = 25} }` will return uptime statistics for epochs from 10 till 25. you can use one of `state_version`, `epoch`, `epoch` and `round`, or `timestamp` to define from/at state version parameter, but then ongoing epoch will be selected and used for querying data. i.e for request with `{ from_state_version = { state_version = 100 000}, at_state_version = { state_version = 300 000} }` gateway api will check in which epoch transactions with state version 100 000 and 300 000 and then use that as inclusive boundary for request. + /// Get Validators Uptime Returns validators uptime data for time range limited by `from_state_version` and `at_state_version`. /// /// Thrown when fails to make API call /// diff --git a/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/AtLedgerStateMixin.cs b/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/AtLedgerStateMixin.cs index 9449cf19c..431d85561 100644 --- a/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/AtLedgerStateMixin.cs +++ b/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/AtLedgerStateMixin.cs @@ -90,7 +90,7 @@ namespace RadixDlt.NetworkGateway.GatewayApiSdk.Model { /// - /// AtLedgerStateMixin + /// defines upper boundary (inclusive) for queried data. i.e `{ \"at_state_version\" = {\"epoch\" = 10} }`, will return data till 10 epoch. /// [DataContract(Name = "AtLedgerStateMixin")] public partial class AtLedgerStateMixin : IEquatable diff --git a/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/StateEntityDetailsOptIns.cs b/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/StateEntityDetailsOptIns.cs index debcbceca..b30006821 100644 --- a/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/StateEntityDetailsOptIns.cs +++ b/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/StateEntityDetailsOptIns.cs @@ -98,11 +98,11 @@ public partial class StateEntityDetailsOptIns : IEquatable /// Initializes a new instance of the class. /// - /// (false by default) if set to true, ancestor addresses - parent_address, owner_address and global_address for entities are returned.. - /// (false by default) if set to true, royalty vault balance for component entities is returned.. - /// (false by default) if set to true, royalty vault balance for package entities is returned.. - /// (false by default) if set to true, first page of non fungible ids are returned for each non fungible resource, with cursor which can be later used at `/state/entity/page/non-fungible-vault/ids` endpoint.. - /// (empty by default) allows specifying explicitly metadata properties which should be returned in response, limited to max 20 items.. + /// if set to `true`, ancestor addresses - `parent_address`, `owner_address` and `global_address` for entities are returned.. + /// if set to `true`, `royalty_vault_balance` for component entities is returned.. + /// if set to `true`, `royalty_vault_balance` for package entities is returned.. + /// if set to `true`, first page of non fungible ids are returned for each non fungible resource, with `next_cursor` which can be later used at `/state/entity/page/non-fungible-vault/ids` endpoint.. + /// allows specifying explicitly metadata properties which should be returned in response.. public StateEntityDetailsOptIns(bool ancestorIdentities = default(bool), bool componentRoyaltyVaultBalance = default(bool), bool packageRoyaltyVaultBalance = default(bool), bool nonFungibleIncludeNfids = default(bool), List explicitMetadata = default(List)) { this.AncestorIdentities = ancestorIdentities; @@ -113,37 +113,37 @@ public partial class StateEntityDetailsOptIns : IEquatable - /// (false by default) if set to true, ancestor addresses - parent_address, owner_address and global_address for entities are returned. + /// if set to `true`, ancestor addresses - `parent_address`, `owner_address` and `global_address` for entities are returned. /// - /// (false by default) if set to true, ancestor addresses - parent_address, owner_address and global_address for entities are returned. + /// if set to `true`, ancestor addresses - `parent_address`, `owner_address` and `global_address` for entities are returned. [DataMember(Name = "ancestor_identities", EmitDefaultValue = true)] public bool AncestorIdentities { get; set; } /// - /// (false by default) if set to true, royalty vault balance for component entities is returned. + /// if set to `true`, `royalty_vault_balance` for component entities is returned. /// - /// (false by default) if set to true, royalty vault balance for component entities is returned. + /// if set to `true`, `royalty_vault_balance` for component entities is returned. [DataMember(Name = "component_royalty_vault_balance", EmitDefaultValue = true)] public bool ComponentRoyaltyVaultBalance { get; set; } /// - /// (false by default) if set to true, royalty vault balance for package entities is returned. + /// if set to `true`, `royalty_vault_balance` for package entities is returned. /// - /// (false by default) if set to true, royalty vault balance for package entities is returned. + /// if set to `true`, `royalty_vault_balance` for package entities is returned. [DataMember(Name = "package_royalty_vault_balance", EmitDefaultValue = true)] public bool PackageRoyaltyVaultBalance { get; set; } /// - /// (false by default) if set to true, first page of non fungible ids are returned for each non fungible resource, with cursor which can be later used at `/state/entity/page/non-fungible-vault/ids` endpoint. + /// if set to `true`, first page of non fungible ids are returned for each non fungible resource, with `next_cursor` which can be later used at `/state/entity/page/non-fungible-vault/ids` endpoint. /// - /// (false by default) if set to true, first page of non fungible ids are returned for each non fungible resource, with cursor which can be later used at `/state/entity/page/non-fungible-vault/ids` endpoint. + /// if set to `true`, first page of non fungible ids are returned for each non fungible resource, with `next_cursor` which can be later used at `/state/entity/page/non-fungible-vault/ids` endpoint. [DataMember(Name = "non_fungible_include_nfids", EmitDefaultValue = true)] public bool NonFungibleIncludeNfids { get; set; } /// - /// (empty by default) allows specifying explicitly metadata properties which should be returned in response, limited to max 20 items. + /// allows specifying explicitly metadata properties which should be returned in response. /// - /// (empty by default) allows specifying explicitly metadata properties which should be returned in response, limited to max 20 items. + /// allows specifying explicitly metadata properties which should be returned in response. [DataMember(Name = "explicit_metadata", EmitDefaultValue = true)] public List ExplicitMetadata { get; set; } diff --git a/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/StateEntityFungiblesPageRequestOptIns.cs b/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/StateEntityFungiblesPageRequestOptIns.cs index 6183d49dc..9adcbaaad 100644 --- a/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/StateEntityFungiblesPageRequestOptIns.cs +++ b/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/StateEntityFungiblesPageRequestOptIns.cs @@ -98,16 +98,16 @@ public partial class StateEntityFungiblesPageRequestOptIns : IEquatable /// Initializes a new instance of the class. /// - /// (empty by default) allows specifying explicitly metadata properties which should be returned in response, limited to max 20 items.. + /// allows specifying explicitly metadata properties which should be returned in response, limited to max 20 items.. public StateEntityFungiblesPageRequestOptIns(List explicitMetadata = default(List)) { this.ExplicitMetadata = explicitMetadata; } /// - /// (empty by default) allows specifying explicitly metadata properties which should be returned in response, limited to max 20 items. + /// allows specifying explicitly metadata properties which should be returned in response, limited to max 20 items. /// - /// (empty by default) allows specifying explicitly metadata properties which should be returned in response, limited to max 20 items. + /// allows specifying explicitly metadata properties which should be returned in response, limited to max 20 items. [DataMember(Name = "explicit_metadata", EmitDefaultValue = true)] public List ExplicitMetadata { get; set; } diff --git a/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/StateEntityNonFungibleResourceVaultsPageOptIns.cs b/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/StateEntityNonFungibleResourceVaultsPageOptIns.cs index 42c78085b..abbf9f927 100644 --- a/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/StateEntityNonFungibleResourceVaultsPageOptIns.cs +++ b/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/StateEntityNonFungibleResourceVaultsPageOptIns.cs @@ -98,16 +98,16 @@ public partial class StateEntityNonFungibleResourceVaultsPageOptIns : IEquatable /// /// Initializes a new instance of the class. /// - /// (false by default) if set to true, first page of non fungible ids are returned for each non fungible resource, with cursor which can be later used at `/state/entity/page/non-fungible-vault/ids` endpoint.. + /// if set to `true`, first page of non fungible ids are returned for each non fungible resource, with cursor which can be later used at `/state/entity/page/non-fungible-vault/ids` endpoint.. public StateEntityNonFungibleResourceVaultsPageOptIns(bool nonFungibleIncludeNfids = default(bool)) { this.NonFungibleIncludeNfids = nonFungibleIncludeNfids; } /// - /// (false by default) if set to true, first page of non fungible ids are returned for each non fungible resource, with cursor which can be later used at `/state/entity/page/non-fungible-vault/ids` endpoint. + /// if set to `true`, first page of non fungible ids are returned for each non fungible resource, with cursor which can be later used at `/state/entity/page/non-fungible-vault/ids` endpoint. /// - /// (false by default) if set to true, first page of non fungible ids are returned for each non fungible resource, with cursor which can be later used at `/state/entity/page/non-fungible-vault/ids` endpoint. + /// if set to `true`, first page of non fungible ids are returned for each non fungible resource, with cursor which can be later used at `/state/entity/page/non-fungible-vault/ids` endpoint. [DataMember(Name = "non_fungible_include_nfids", EmitDefaultValue = true)] public bool NonFungibleIncludeNfids { get; set; } diff --git a/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/StateEntityNonFungiblesPageRequestOptIns.cs b/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/StateEntityNonFungiblesPageRequestOptIns.cs index c2b5d7ee8..2c5535f34 100644 --- a/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/StateEntityNonFungiblesPageRequestOptIns.cs +++ b/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/StateEntityNonFungiblesPageRequestOptIns.cs @@ -98,8 +98,8 @@ public partial class StateEntityNonFungiblesPageRequestOptIns : IEquatable /// Initializes a new instance of the class. /// - /// (false by default) if set to true, first page of non fungible ids are returned for each non fungible resource, with cursor which can be later used at `/state/entity/page/non-fungible-vault/ids` endpoint.. - /// (empty by default) allows specifying explicitly metadata properties which should be returned in response, limited to max 20 items.. + /// if set to `true`, first page of non fungible ids are returned for each non fungible resource, with cursor which can be later used at `/state/entity/page/non-fungible-vault/ids` endpoint.. + /// allows specifying explicitly metadata properties which should be returned in response, limited to max 20 items.. public StateEntityNonFungiblesPageRequestOptIns(bool nonFungibleIncludeNfids = default(bool), List explicitMetadata = default(List)) { this.NonFungibleIncludeNfids = nonFungibleIncludeNfids; @@ -107,16 +107,16 @@ public partial class StateEntityNonFungiblesPageRequestOptIns : IEquatable - /// (false by default) if set to true, first page of non fungible ids are returned for each non fungible resource, with cursor which can be later used at `/state/entity/page/non-fungible-vault/ids` endpoint. + /// if set to `true`, first page of non fungible ids are returned for each non fungible resource, with cursor which can be later used at `/state/entity/page/non-fungible-vault/ids` endpoint. /// - /// (false by default) if set to true, first page of non fungible ids are returned for each non fungible resource, with cursor which can be later used at `/state/entity/page/non-fungible-vault/ids` endpoint. + /// if set to `true`, first page of non fungible ids are returned for each non fungible resource, with cursor which can be later used at `/state/entity/page/non-fungible-vault/ids` endpoint. [DataMember(Name = "non_fungible_include_nfids", EmitDefaultValue = true)] public bool NonFungibleIncludeNfids { get; set; } /// - /// (empty by default) allows specifying explicitly metadata properties which should be returned in response, limited to max 20 items. + /// allows specifying explicitly metadata properties which should be returned in response, limited to max 20 items. /// - /// (empty by default) allows specifying explicitly metadata properties which should be returned in response, limited to max 20 items. + /// allows specifying explicitly metadata properties which should be returned in response, limited to max 20 items. [DataMember(Name = "explicit_metadata", EmitDefaultValue = true)] public List ExplicitMetadata { get; set; } diff --git a/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/StreamTransactionsRequest.cs b/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/StreamTransactionsRequest.cs index 26c5c17bb..d728c759c 100644 --- a/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/StreamTransactionsRequest.cs +++ b/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/StreamTransactionsRequest.cs @@ -161,9 +161,9 @@ public enum OrderEnum /// Initializes a new instance of the class. /// /// atLedgerState. + /// fromLedgerState. /// This cursor allows forward pagination, by providing the cursor from the previous request.. /// The page size requested.. - /// fromLedgerState. /// Limit returned transactions by their kind. Defaults to `user`.. /// manifestAccountsWithdrawnFromFilter. /// manifestAccountsDepositedIntoFilter. @@ -172,12 +172,12 @@ public enum OrderEnum /// eventsFilter. /// Configures the order of returned result set. Defaults to `desc`.. /// optIns. - public StreamTransactionsRequest(LedgerStateSelector atLedgerState = default(LedgerStateSelector), string cursor = default(string), int? limitPerPage = default(int?), LedgerStateSelector fromLedgerState = default(LedgerStateSelector), KindFilterEnum? kindFilter = default(KindFilterEnum?), List manifestAccountsWithdrawnFromFilter = default(List), List manifestAccountsDepositedIntoFilter = default(List), List manifestResourcesFilter = default(List), List affectedGlobalEntitiesFilter = default(List), List eventsFilter = default(List), OrderEnum? order = default(OrderEnum?), TransactionDetailsOptIns optIns = default(TransactionDetailsOptIns)) + public StreamTransactionsRequest(LedgerStateSelector atLedgerState = default(LedgerStateSelector), LedgerStateSelector fromLedgerState = default(LedgerStateSelector), string cursor = default(string), int? limitPerPage = default(int?), KindFilterEnum? kindFilter = default(KindFilterEnum?), List manifestAccountsWithdrawnFromFilter = default(List), List manifestAccountsDepositedIntoFilter = default(List), List manifestResourcesFilter = default(List), List affectedGlobalEntitiesFilter = default(List), List eventsFilter = default(List), OrderEnum? order = default(OrderEnum?), TransactionDetailsOptIns optIns = default(TransactionDetailsOptIns)) { this.AtLedgerState = atLedgerState; + this.FromLedgerState = fromLedgerState; this.Cursor = cursor; this.LimitPerPage = limitPerPage; - this.FromLedgerState = fromLedgerState; this.KindFilter = kindFilter; this.ManifestAccountsWithdrawnFromFilter = manifestAccountsWithdrawnFromFilter; this.ManifestAccountsDepositedIntoFilter = manifestAccountsDepositedIntoFilter; @@ -194,6 +194,12 @@ public enum OrderEnum [DataMember(Name = "at_ledger_state", EmitDefaultValue = true)] public LedgerStateSelector AtLedgerState { get; set; } + /// + /// Gets or Sets FromLedgerState + /// + [DataMember(Name = "from_ledger_state", EmitDefaultValue = true)] + public LedgerStateSelector FromLedgerState { get; set; } + /// /// This cursor allows forward pagination, by providing the cursor from the previous request. /// @@ -208,12 +214,6 @@ public enum OrderEnum [DataMember(Name = "limit_per_page", EmitDefaultValue = true)] public int? LimitPerPage { get; set; } - /// - /// Gets or Sets FromLedgerState - /// - [DataMember(Name = "from_ledger_state", EmitDefaultValue = true)] - public LedgerStateSelector FromLedgerState { get; set; } - /// /// Gets or Sets ManifestAccountsWithdrawnFromFilter /// @@ -259,9 +259,9 @@ public override string ToString() StringBuilder sb = new StringBuilder(); sb.Append("class StreamTransactionsRequest {\n"); sb.Append(" AtLedgerState: ").Append(AtLedgerState).Append("\n"); + sb.Append(" FromLedgerState: ").Append(FromLedgerState).Append("\n"); sb.Append(" Cursor: ").Append(Cursor).Append("\n"); sb.Append(" LimitPerPage: ").Append(LimitPerPage).Append("\n"); - sb.Append(" FromLedgerState: ").Append(FromLedgerState).Append("\n"); sb.Append(" KindFilter: ").Append(KindFilter).Append("\n"); sb.Append(" ManifestAccountsWithdrawnFromFilter: ").Append(ManifestAccountsWithdrawnFromFilter).Append("\n"); sb.Append(" ManifestAccountsDepositedIntoFilter: ").Append(ManifestAccountsDepositedIntoFilter).Append("\n"); @@ -310,6 +310,11 @@ public bool Equals(StreamTransactionsRequest input) (this.AtLedgerState != null && this.AtLedgerState.Equals(input.AtLedgerState)) ) && + ( + this.FromLedgerState == input.FromLedgerState || + (this.FromLedgerState != null && + this.FromLedgerState.Equals(input.FromLedgerState)) + ) && ( this.Cursor == input.Cursor || (this.Cursor != null && @@ -320,11 +325,6 @@ public bool Equals(StreamTransactionsRequest input) (this.LimitPerPage != null && this.LimitPerPage.Equals(input.LimitPerPage)) ) && - ( - this.FromLedgerState == input.FromLedgerState || - (this.FromLedgerState != null && - this.FromLedgerState.Equals(input.FromLedgerState)) - ) && ( this.KindFilter == input.KindFilter || this.KindFilter.Equals(input.KindFilter) @@ -383,6 +383,10 @@ public override int GetHashCode() { hashCode = (hashCode * 59) + this.AtLedgerState.GetHashCode(); } + if (this.FromLedgerState != null) + { + hashCode = (hashCode * 59) + this.FromLedgerState.GetHashCode(); + } if (this.Cursor != null) { hashCode = (hashCode * 59) + this.Cursor.GetHashCode(); @@ -391,10 +395,6 @@ public override int GetHashCode() { hashCode = (hashCode * 59) + this.LimitPerPage.GetHashCode(); } - if (this.FromLedgerState != null) - { - hashCode = (hashCode * 59) + this.FromLedgerState.GetHashCode(); - } hashCode = (hashCode * 59) + this.KindFilter.GetHashCode(); if (this.ManifestAccountsWithdrawnFromFilter != null) { diff --git a/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/StreamTransactionsRequestAllOf.cs b/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/StreamTransactionsRequestAllOf.cs index 5e5b18fee..f96717fb1 100644 --- a/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/StreamTransactionsRequestAllOf.cs +++ b/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/StreamTransactionsRequestAllOf.cs @@ -160,7 +160,6 @@ public enum OrderEnum /// /// Initializes a new instance of the class. /// - /// fromLedgerState. /// Limit returned transactions by their kind. Defaults to `user`.. /// manifestAccountsWithdrawnFromFilter. /// manifestAccountsDepositedIntoFilter. @@ -169,9 +168,8 @@ public enum OrderEnum /// eventsFilter. /// Configures the order of returned result set. Defaults to `desc`.. /// optIns. - public StreamTransactionsRequestAllOf(LedgerStateSelector fromLedgerState = default(LedgerStateSelector), KindFilterEnum? kindFilter = default(KindFilterEnum?), List manifestAccountsWithdrawnFromFilter = default(List), List manifestAccountsDepositedIntoFilter = default(List), List manifestResourcesFilter = default(List), List affectedGlobalEntitiesFilter = default(List), List eventsFilter = default(List), OrderEnum? order = default(OrderEnum?), TransactionDetailsOptIns optIns = default(TransactionDetailsOptIns)) + public StreamTransactionsRequestAllOf(KindFilterEnum? kindFilter = default(KindFilterEnum?), List manifestAccountsWithdrawnFromFilter = default(List), List manifestAccountsDepositedIntoFilter = default(List), List manifestResourcesFilter = default(List), List affectedGlobalEntitiesFilter = default(List), List eventsFilter = default(List), OrderEnum? order = default(OrderEnum?), TransactionDetailsOptIns optIns = default(TransactionDetailsOptIns)) { - this.FromLedgerState = fromLedgerState; this.KindFilter = kindFilter; this.ManifestAccountsWithdrawnFromFilter = manifestAccountsWithdrawnFromFilter; this.ManifestAccountsDepositedIntoFilter = manifestAccountsDepositedIntoFilter; @@ -182,12 +180,6 @@ public enum OrderEnum this.OptIns = optIns; } - /// - /// Gets or Sets FromLedgerState - /// - [DataMember(Name = "from_ledger_state", EmitDefaultValue = true)] - public LedgerStateSelector FromLedgerState { get; set; } - /// /// Gets or Sets ManifestAccountsWithdrawnFromFilter /// @@ -232,7 +224,6 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class StreamTransactionsRequestAllOf {\n"); - sb.Append(" FromLedgerState: ").Append(FromLedgerState).Append("\n"); sb.Append(" KindFilter: ").Append(KindFilter).Append("\n"); sb.Append(" ManifestAccountsWithdrawnFromFilter: ").Append(ManifestAccountsWithdrawnFromFilter).Append("\n"); sb.Append(" ManifestAccountsDepositedIntoFilter: ").Append(ManifestAccountsDepositedIntoFilter).Append("\n"); @@ -276,11 +267,6 @@ public bool Equals(StreamTransactionsRequestAllOf input) return false; } return - ( - this.FromLedgerState == input.FromLedgerState || - (this.FromLedgerState != null && - this.FromLedgerState.Equals(input.FromLedgerState)) - ) && ( this.KindFilter == input.KindFilter || this.KindFilter.Equals(input.KindFilter) @@ -335,10 +321,6 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - if (this.FromLedgerState != null) - { - hashCode = (hashCode * 59) + this.FromLedgerState.GetHashCode(); - } hashCode = (hashCode * 59) + this.KindFilter.GetHashCode(); if (this.ManifestAccountsWithdrawnFromFilter != null) { diff --git a/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/StreamTransactionsRequestEventFilterItem.cs b/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/StreamTransactionsRequestEventFilterItem.cs index 2306c7d36..514b56448 100644 --- a/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/StreamTransactionsRequestEventFilterItem.cs +++ b/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/StreamTransactionsRequestEventFilterItem.cs @@ -132,13 +132,11 @@ protected StreamTransactionsRequestEventFilterItem() { } /// _event (required). /// Bech32m-encoded human readable version of the address.. /// Bech32m-encoded human readable version of the address.. - /// String-encoded decimal representing the amount of a related fungible resource.. - public StreamTransactionsRequestEventFilterItem(EventEnum _event = default(EventEnum), string emitterAddress = default(string), string resourceAddress = default(string), string quantity = default(string)) + public StreamTransactionsRequestEventFilterItem(EventEnum _event = default(EventEnum), string emitterAddress = default(string), string resourceAddress = default(string)) { this.Event = _event; this.EmitterAddress = emitterAddress; this.ResourceAddress = resourceAddress; - this.Quantity = quantity; } /// @@ -155,13 +153,6 @@ protected StreamTransactionsRequestEventFilterItem() { } [DataMember(Name = "resource_address", EmitDefaultValue = true)] public string ResourceAddress { get; set; } - /// - /// String-encoded decimal representing the amount of a related fungible resource. - /// - /// String-encoded decimal representing the amount of a related fungible resource. - [DataMember(Name = "quantity", EmitDefaultValue = true)] - public string Quantity { get; set; } - /// /// Returns the string presentation of the object /// @@ -173,7 +164,6 @@ public override string ToString() sb.Append(" Event: ").Append(Event).Append("\n"); sb.Append(" EmitterAddress: ").Append(EmitterAddress).Append("\n"); sb.Append(" ResourceAddress: ").Append(ResourceAddress).Append("\n"); - sb.Append(" Quantity: ").Append(Quantity).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -222,11 +212,6 @@ public bool Equals(StreamTransactionsRequestEventFilterItem input) this.ResourceAddress == input.ResourceAddress || (this.ResourceAddress != null && this.ResourceAddress.Equals(input.ResourceAddress)) - ) && - ( - this.Quantity == input.Quantity || - (this.Quantity != null && - this.Quantity.Equals(input.Quantity)) ); } @@ -248,10 +233,6 @@ public override int GetHashCode() { hashCode = (hashCode * 59) + this.ResourceAddress.GetHashCode(); } - if (this.Quantity != null) - { - hashCode = (hashCode * 59) + this.Quantity.GetHashCode(); - } return hashCode; } } diff --git a/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/TransactionDetailsOptIns.cs b/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/TransactionDetailsOptIns.cs index 17dc563bf..07c7e5c86 100644 --- a/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/TransactionDetailsOptIns.cs +++ b/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/TransactionDetailsOptIns.cs @@ -98,15 +98,15 @@ public partial class TransactionDetailsOptIns : IEquatable /// Initializes a new instance of the class. /// - /// (false by default) If set to true, raw transaction hex is returned.. - /// (false by default) if set to true, state changes inside receipt object are returned.. - /// (false by default) if set to true, fee summary inside receipt object is returned.. - /// (false by default) if set to true, fee source inside receipt object is returned.. - /// (false by default) if set to true, fee destination inside receipt object is returned.. - /// (false by default) if set to true, costing parameters inside receipt object is returned.. - /// (false by default) if set to true, events inside receipt object is returned.. - /// (true by default) If set to true, transaction receipt output is returned.. - /// (false by default) if set to true, all affected global entities by given transaction are returned.. + /// if set to `true`, raw transaction hex is returned.. + /// if set to `true`, state changes inside receipt object are returned.. + /// if set to `true`, fee summary inside receipt object is returned.. + /// if set to `true`, fee source inside receipt object is returned.. + /// if set to `true`, fee destination inside receipt object is returned.. + /// if set to `true`, costing parameters inside receipt object is returned.. + /// if set to `true`, events inside receipt object is returned.. + /// (true by default) if set to `true`, transaction receipt output is returned.. + /// if set to `true`, all affected global entities by given transaction are returned.. public TransactionDetailsOptIns(bool rawHex = default(bool), bool receiptStateChanges = default(bool), bool receiptFeeSummary = default(bool), bool receiptFeeSource = default(bool), bool receiptFeeDestination = default(bool), bool receiptCostingParameters = default(bool), bool receiptEvents = default(bool), bool receiptOutput = default(bool), bool affectedGlobalEntities = default(bool)) { this.RawHex = rawHex; @@ -121,65 +121,65 @@ public partial class TransactionDetailsOptIns : IEquatable - /// (false by default) If set to true, raw transaction hex is returned. + /// if set to `true`, raw transaction hex is returned. /// - /// (false by default) If set to true, raw transaction hex is returned. + /// if set to `true`, raw transaction hex is returned. [DataMember(Name = "raw_hex", EmitDefaultValue = true)] public bool RawHex { get; set; } /// - /// (false by default) if set to true, state changes inside receipt object are returned. + /// if set to `true`, state changes inside receipt object are returned. /// - /// (false by default) if set to true, state changes inside receipt object are returned. + /// if set to `true`, state changes inside receipt object are returned. [DataMember(Name = "receipt_state_changes", EmitDefaultValue = true)] public bool ReceiptStateChanges { get; set; } /// - /// (false by default) if set to true, fee summary inside receipt object is returned. + /// if set to `true`, fee summary inside receipt object is returned. /// - /// (false by default) if set to true, fee summary inside receipt object is returned. + /// if set to `true`, fee summary inside receipt object is returned. [DataMember(Name = "receipt_fee_summary", EmitDefaultValue = true)] public bool ReceiptFeeSummary { get; set; } /// - /// (false by default) if set to true, fee source inside receipt object is returned. + /// if set to `true`, fee source inside receipt object is returned. /// - /// (false by default) if set to true, fee source inside receipt object is returned. + /// if set to `true`, fee source inside receipt object is returned. [DataMember(Name = "receipt_fee_source", EmitDefaultValue = true)] public bool ReceiptFeeSource { get; set; } /// - /// (false by default) if set to true, fee destination inside receipt object is returned. + /// if set to `true`, fee destination inside receipt object is returned. /// - /// (false by default) if set to true, fee destination inside receipt object is returned. + /// if set to `true`, fee destination inside receipt object is returned. [DataMember(Name = "receipt_fee_destination", EmitDefaultValue = true)] public bool ReceiptFeeDestination { get; set; } /// - /// (false by default) if set to true, costing parameters inside receipt object is returned. + /// if set to `true`, costing parameters inside receipt object is returned. /// - /// (false by default) if set to true, costing parameters inside receipt object is returned. + /// if set to `true`, costing parameters inside receipt object is returned. [DataMember(Name = "receipt_costing_parameters", EmitDefaultValue = true)] public bool ReceiptCostingParameters { get; set; } /// - /// (false by default) if set to true, events inside receipt object is returned. + /// if set to `true`, events inside receipt object is returned. /// - /// (false by default) if set to true, events inside receipt object is returned. + /// if set to `true`, events inside receipt object is returned. [DataMember(Name = "receipt_events", EmitDefaultValue = true)] public bool ReceiptEvents { get; set; } /// - /// (true by default) If set to true, transaction receipt output is returned. + /// (true by default) if set to `true`, transaction receipt output is returned. /// - /// (true by default) If set to true, transaction receipt output is returned. + /// (true by default) if set to `true`, transaction receipt output is returned. [DataMember(Name = "receipt_output", EmitDefaultValue = true)] public bool ReceiptOutput { get; set; } /// - /// (false by default) if set to true, all affected global entities by given transaction are returned. + /// if set to `true`, all affected global entities by given transaction are returned. /// - /// (false by default) if set to true, all affected global entities by given transaction are returned. + /// if set to `true`, all affected global entities by given transaction are returned. [DataMember(Name = "affected_global_entities", EmitDefaultValue = true)] public bool AffectedGlobalEntities { get; set; } diff --git a/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/ValidatorsUptimeRequest.cs b/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/ValidatorsUptimeRequest.cs index c9abd410b..985c3420e 100644 --- a/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/ValidatorsUptimeRequest.cs +++ b/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/ValidatorsUptimeRequest.cs @@ -90,7 +90,7 @@ namespace RadixDlt.NetworkGateway.GatewayApiSdk.Model { /// - /// ValidatorsUptimeRequest + /// For `at_ledger_state` and `from_ledger_state` you can use one of `state_version`, `epoch`, `epoch` and `round`, or `timestamp`, but then ongoing epoch will be selected and used for querying data. i.e for request with `{ \"from_state_version\" = { \"state_version\" = 100 }, \"at_state_version\" = { \"state_version\" = 300} }` gateway api will check in which epoch transactions with state version 100 and 300 were and then use that as inclusive boundary for request. /// [DataContract(Name = "ValidatorsUptimeRequest")] public partial class ValidatorsUptimeRequest : IEquatable diff --git a/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/ValidatorsUptimeRequestAllOf.cs b/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/ValidatorsUptimeRequestAllOf.cs index f88884299..a78b9cf23 100644 --- a/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/ValidatorsUptimeRequestAllOf.cs +++ b/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/ValidatorsUptimeRequestAllOf.cs @@ -98,20 +98,12 @@ public partial class ValidatorsUptimeRequestAllOf : IEquatable /// Initializes a new instance of the class. /// - /// fromLedgerState. /// validatorAddresses. - public ValidatorsUptimeRequestAllOf(LedgerStateSelector fromLedgerState = default(LedgerStateSelector), List validatorAddresses = default(List)) + public ValidatorsUptimeRequestAllOf(List validatorAddresses = default(List)) { - this.FromLedgerState = fromLedgerState; this.ValidatorAddresses = validatorAddresses; } - /// - /// Gets or Sets FromLedgerState - /// - [DataMember(Name = "from_ledger_state", EmitDefaultValue = true)] - public LedgerStateSelector FromLedgerState { get; set; } - /// /// Gets or Sets ValidatorAddresses /// @@ -126,7 +118,6 @@ public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class ValidatorsUptimeRequestAllOf {\n"); - sb.Append(" FromLedgerState: ").Append(FromLedgerState).Append("\n"); sb.Append(" ValidatorAddresses: ").Append(ValidatorAddresses).Append("\n"); sb.Append("}\n"); return sb.ToString(); @@ -163,11 +154,6 @@ public bool Equals(ValidatorsUptimeRequestAllOf input) return false; } return - ( - this.FromLedgerState == input.FromLedgerState || - (this.FromLedgerState != null && - this.FromLedgerState.Equals(input.FromLedgerState)) - ) && ( this.ValidatorAddresses == input.ValidatorAddresses || this.ValidatorAddresses != null && @@ -185,10 +171,6 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - if (this.FromLedgerState != null) - { - hashCode = (hashCode * 59) + this.FromLedgerState.GetHashCode(); - } if (this.ValidatorAddresses != null) { hashCode = (hashCode * 59) + this.ValidatorAddresses.GetHashCode(); From d4a8b69545f77b0382334ea714c73efc47bd753d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Pawelec?= Date: Wed, 11 Oct 2023 14:01:37 +0200 Subject: [PATCH 5/5] add changelog entry. --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 467d943a1..bae94cc8d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ Release Date: _unreleased_ - Changed default configuration value of MaxPageSize for endpoints to 100. Validate if max page size is higher than DefaultPageSize. +- added new optIn `receipt_output` to `/stream/transactions`, and `/transaction/committed-details` endpoints. Temporarily set by default to true, to allow client's migration. ## 1.0.1 - Babylon Release Date: _unreleased_