diff --git a/.editorconfig b/.editorconfig index 3916710a6..d60342dcb 100644 --- a/.editorconfig +++ b/.editorconfig @@ -295,6 +295,7 @@ dotnet_diagnostic.SA1649.severity = none # SA1649FileNameMustMatchTypeName - it # > Inherited from other projects dotnet_diagnostic.SA0001.severity = none # SA0001XmlCommentAnalysisDisabled dotnet_diagnostic.SA1101.severity = none # SA1101PrefixLocalCallsWithThis +dotnet_diagnostic.SA1118.severity = none # SA1118ParameterMustNotSpanMultipleLines - SQL queries dotnet_diagnostic.SA1124.severity = none # SA1124DoNotUseRegions dotnet_diagnostic.SA1129.severity = none # SA1129DoNotUseDefaultValueTypeConstructor - does not comply with the use of HashCode dotnet_diagnostic.SA1201.severity = none # SA1201ElementsMustAppearInTheCorrectOrder diff --git a/CHANGELOG.md b/CHANGELOG.md index 986a3615e..f855f81c1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,16 +15,21 @@ Release built: _not released yet_ - New `event_global_emitters_filter` filter added to `/stream/transactions` endpoint. It allows filtering transactions by the global ancestor of an event emitter. For events emitted by a global entity it is going to be that entity, for internal entities it is going to be a global ancestor. - Changed `variant_id` of `ProgrammaticScryptoSborValueEnum` from numeric (`type: integer`) to string-encoded numeric (`type: string`) to make it compatible with the rest of the ecosystem. - Optimized `/statistics/validators/uptime` endpoint processing time. -- Added support for two-way linked dApps in the `/state/entity/details` endpoint. - - Brand-new `two_way_linked_*` properties on the `details` property of Resources, Accounts, Packages and other global components. +- Added support for two-way linked dApps in the `/state/entity/details` endpoint, returned when the `dapp_two_way_links` opt-in is enabled. + - Brand-new `two_way_linked_*` properties on the `details` property of the Resources, Accounts, Packages and other global entities. - See https://docs.radixdlt.com/docs/metadata-for-verification#metadata-standards-for-verification-of-onledger-entities for detailed specification. +- Added support for the Native Resource Details in the `/state/entity/details` endpoint, returned when the `native_resource_details` opt-in is enabled. + - Brand-new `native_resource_details` property on the `details` property. + - Includes **unit** redemption value for the Validator LSU token and the unit tokens of various Pools. ### Database changes - Replaced relationship-related columns (`*_entity_id`) in the `entities` table with more generic collection implementation using `correlated_entity_*` columns. - Replaced per-epoch validator emissions (`validator_emission_statistics` table) with their cumulative statistics (`validator_cumulative_emission_history` table). - Added `non_fungible_data_mutable_fields` to `entities` table. Which contains list of all mutable non fungible data fields for non fungible resource entities. - New `ledger_transaction_markers` type with the `event_global_emitter` discriminator. It represents the global emitter for each event. -- Added new `unverified_standard_metadata_*` tables. They hold **some** of the metadata entries using db-friendly (normalized) model. See https://docs.radixdlt.com/docs/metadata-standards +- Added new `unverified_standard_metadata_*` tables. They hold **some** of the metadata entries using db-friendly (normalized) model. See https://docs.radixdlt.com/docs/metadata-standards +- Extended list of supported entity correlations in the `entities` table. +- Renamed values of the `entity_relationship` enum type. ## 1.6.3 Release built: 06.08.2024 diff --git a/src/RadixDlt.NetworkGateway.Abstractions/Model/EntityRelationship.cs b/src/RadixDlt.NetworkGateway.Abstractions/Model/EntityRelationship.cs index 1c429f148..18ab5bab1 100644 --- a/src/RadixDlt.NetworkGateway.Abstractions/Model/EntityRelationship.cs +++ b/src/RadixDlt.NetworkGateway.Abstractions/Model/EntityRelationship.cs @@ -66,16 +66,43 @@ namespace RadixDlt.NetworkGateway.Abstractions.Model; public enum EntityRelationship { - ComponentPackage, - ValidatorStakeVault, - ValidatorPendingXrdWithdrawVault, - ValidatorLockedOwnerStakeUnitVault, - ValidatorPendingOwnerStakeUnitUnlockVault, - VaultResource, - VaultRoyalty, - VaultResourcePool, - AccountLockerLocker, - AccountLockerAccount, - ResourcePoolUnit, - ResourcePoolResource, + // Components + + ComponentToInstantiatingPackage, + + // Vaults + + VaultToResource, + + RoyaltyVaultOfComponent, + + // Validators + + ValidatorToStakeVault, + ValidatorToPendingXrdWithdrawVault, + ValidatorToLockedOwnerStakeUnitVault, + ValidatorToPendingOwnerStakeUnitUnlockVault, + + StakeVaultOfValidator, + ClaimTokenOfValidator, + + // Account Lockers (used on related Vaults and KeyValueStores) + + AccountLockerOfLocker, + AccountLockerOfAccount, + + // Resource Pools (used on One-, Two- and Multi-Resource Pools) + + ResourcePoolToUnitResource, + ResourcePoolToResource, + ResourcePoolToResourceVault, + + UnitVaultOfResourcePool, + ResourceVaultOfResourcePool, + + // Access Controllers + + AccessControllerToRecoveryBadge, + + RecoveryBadgeOfAccessController, } diff --git a/src/RadixDlt.NetworkGateway.Abstractions/Numerics/TokenAmount.cs b/src/RadixDlt.NetworkGateway.Abstractions/Numerics/TokenAmount.cs index f1cd6a113..aa5c09685 100644 --- a/src/RadixDlt.NetworkGateway.Abstractions/Numerics/TokenAmount.cs +++ b/src/RadixDlt.NetworkGateway.Abstractions/Numerics/TokenAmount.cs @@ -156,7 +156,7 @@ public static TokenAmount FromDecimalString(string decimalString) public static TokenAmount operator *(TokenAmount a, TokenAmount b) => (a.IsNaN() || b.IsNaN()) ? NaN : new TokenAmount(a._subUnits * b._subUnits); - public static TokenAmount operator /(TokenAmount a, TokenAmount b) => (a.IsNaN() || b.IsNaN()) ? NaN : new TokenAmount(a._subUnits / b._subUnits); + public static TokenAmount operator /(TokenAmount a, TokenAmount b) => (a.IsNaN() || b.IsNaN()) ? NaN : Divide(a, b); // ReSharper disable SimplifyConditionalTernaryExpression - As it's clearer as written #pragma warning disable IDE0075 @@ -269,4 +269,42 @@ public int CompareTo(TokenAmount other) var isNaNComparison = _isNaN.CompareTo(other._isNaN); return isNaNComparison != 0 ? isNaNComparison : _subUnits.CompareTo(other._subUnits); } + + // Heavily inspired by https://www.codeproject.com/Articles/5366079/BigDecimal-in-Csharp + // Licensed under CPOL: https://en.wikipedia.org/wiki/Code_Project_Open_License + // Author: Paulo Francisco Zemek. August, 01, 2023. + private static TokenAmount Divide(TokenAmount dividend, TokenAmount divisor) + { + if (divisor == Zero) + { + // This rule might look odd, but when simplifying expressions, x/x (x divided by x) is 1. + // So, to keep the rule true, 0 divided by 0 is also 1. + if (dividend == Zero) + { + return OneFullUnit; + } + + throw new DivideByZeroException($"{nameof(divisor)} can only be zero if {nameof(dividend)} is zero."); + } + + var doublePrecisionDividendSubUnits = dividend._subUnits * _divisor; + var divisorSubUnits = divisor._subUnits; + + return FromSubUnits(doublePrecisionDividendSubUnits / divisorSubUnits); + } + + // Is there a faster approach that works with BigIntegers? + // It seems Log10 isn't faster at all. + private static int CountDigits(BigInteger value) + { + int count = 0; + + while (value > 0) + { + count++; + value /= 10; + } + + return count; + } } diff --git a/src/RadixDlt.NetworkGateway.Abstractions/StandardMetadata/ResolvedTwoWayLink.cs b/src/RadixDlt.NetworkGateway.Abstractions/StandardMetadata/ResolvedTwoWayLink.cs index d6fe0801f..4362eb8a6 100644 --- a/src/RadixDlt.NetworkGateway.Abstractions/StandardMetadata/ResolvedTwoWayLink.cs +++ b/src/RadixDlt.NetworkGateway.Abstractions/StandardMetadata/ResolvedTwoWayLink.cs @@ -66,17 +66,14 @@ namespace RadixDlt.NetworkGateway.Abstractions.StandardMetadata; -public abstract record ResolvedTwoWayLink(string? InvalidReason) -{ - public bool IsValid => InvalidReason == null; -} +public abstract record ResolvedTwoWayLink; -public sealed record DappClaimedEntityResolvedTwoWayLink(EntityAddress EntityAddress, string? InvalidReason) : ResolvedTwoWayLink(InvalidReason); +public sealed record DappClaimedEntityResolvedTwoWayLink(EntityAddress EntityAddress) : ResolvedTwoWayLink; -public sealed record DappClaimedWebsiteResolvedTwoWayLink(Uri Origin, string? InvalidReason) : ResolvedTwoWayLink(InvalidReason); +public sealed record DappClaimedWebsiteResolvedTwoWayLink(Uri Origin) : ResolvedTwoWayLink; -public sealed record DappDefinitionResolvedTwoWayLink(EntityAddress EntityAddress, string? InvalidReason) : ResolvedTwoWayLink(InvalidReason); +public sealed record DappDefinitionResolvedTwoWayLink(EntityAddress EntityAddress) : ResolvedTwoWayLink; -public sealed record DappDefinitionsResolvedTwoWayLink(EntityAddress EntityAddress, string? InvalidReason) : ResolvedTwoWayLink(InvalidReason); +public sealed record DappDefinitionsResolvedTwoWayLink(EntityAddress EntityAddress) : ResolvedTwoWayLink; -public sealed record DappAccountLockerResolvedTwoWayLink(EntityAddress LockerAddress, string? InvalidReason) : ResolvedTwoWayLink(InvalidReason); +public sealed record DappAccountLockerResolvedTwoWayLink(EntityAddress LockerAddress) : ResolvedTwoWayLink; diff --git a/src/RadixDlt.NetworkGateway.GatewayApi/gateway-api-schema.yaml b/src/RadixDlt.NetworkGateway.GatewayApi/gateway-api-schema.yaml index 6cc327420..02d4a9542 100644 --- a/src/RadixDlt.NetworkGateway.GatewayApi/gateway-api-schema.yaml +++ b/src/RadixDlt.NetworkGateway.GatewayApi/gateway-api-schema.yaml @@ -3968,6 +3968,7 @@ components: package_royalty_vault_balance: true non_fungible_include_nfids: true dapp_two_way_links: true + native_resource_details: true explicit_metadata: - name - description @@ -4004,6 +4005,10 @@ components: description: if set to `true`, on-ledger dApp two-way links (resolved & verified) are returned. See https://docs.radixdlt.com/docs/metadata-for-verification for more details. type: boolean default: false + native_resource_details: + description: if set to `true`, additional details for the Network native resources are returned. + type: boolean + default: false StateEntityDetailsResponse: allOf: - $ref: "#/components/schemas/LedgerStateMixin" @@ -4094,6 +4099,8 @@ components: $ref: "#/components/schemas/BigDecimal" two_way_linked_dapps: $ref: "#/components/schemas/TwoWayLinkedDappsCollection" + native_resource_details: + $ref: "#/components/schemas/NativeResourceDetails" StateEntityDetailsResponseNonFungibleResourceDetails: allOf: - $ref: "#/components/schemas/StateEntityDetailsResponseItemDetails" @@ -4122,6 +4129,8 @@ components: type: string two_way_linked_dapps: $ref: "#/components/schemas/TwoWayLinkedDappsCollection" + native_resource_details: + $ref: "#/components/schemas/NativeResourceDetails" StateEntityDetailsResponseFungibleVaultDetails: allOf: - $ref: "#/components/schemas/StateEntityDetailsResponseItemDetails" @@ -4216,6 +4225,8 @@ components: two_way_linked_dapp_details: description: Two-way linked (resolved & verified) dApp details. Applicable to dApp definition accounts only and limited to on-ledger information only. $ref: "#/components/schemas/TwoWayLinkedDappOnLedgerDetails" + native_resource_details: + $ref: "#/components/schemas/NativeResourceDetails" StateAccountResourcePreferencesPageRequest: allOf: @@ -4745,6 +4756,7 @@ components: - kind: "U32" value: "1" StateKeyValueStoreDataRequestKeyItem: + description: Provide either `key_hex` or `key_json`. If both are provided, `key_hex` is used and `key_json` is ignored. type: object properties: key_hex: @@ -5016,6 +5028,188 @@ components: items: type: string + # + # Native Resources + # + + NativeResourceUnitRedemptionValue: + type: array + items: + $ref: "#/components/schemas/NativeResourceRedemptionValueItem" + NativeResourceRedemptionValueItem: + type: object + required: + - resource_address + properties: + resource_address: + $ref: "#/components/schemas/Address" + amount: + $ref: "#/components/schemas/BigDecimal" + + NativeResourceKind: + type: string + enum: + - Xrd + - PackageOwnerBadge + - AccountOwnerBadge + - IdentityOwnerBadge + - ValidatorOwnerBadge + - Secp256k1SignatureResource + - Ed25519SignatureResource + - GlobalCallerResource + - PackageOfDirectCallerResource + - SystemExecutionResource + - ValidatorLiquidStakeUnit + - ValidatorClaimNft + - OneResourcePoolUnit + - TwoResourcePoolUnit + - MultiResourcePoolUnit + - AccessControllerRecoveryBadge + NativeResourceDetails: + type: object + discriminator: + propertyName: kind + mapping: + Xrd: "#/components/schemas/NativeResourceXrdValue" + PackageOwnerBadge: "#/components/schemas/NativeResourcePackageOwnerBadgeValue" + AccountOwnerBadge: "#/components/schemas/NativeResourceAccountOwnerBadgeValue" + IdentityOwnerBadge: "#/components/schemas/NativeResourceIdentityOwnerBadgeValue" + ValidatorOwnerBadge: "#/components/schemas/NativeResourceValidatorOwnerBadgeValue" + Secp256k1SignatureResource: "#/components/schemas/NativeResourceSecp256k1SignatureResourceValue" + Ed25519SignatureResource: "#/components/schemas/NativeResourceEd25519SignatureResourceValue" + GlobalCallerResource: "#/components/schemas/NativeResourceGlobalCallerResourceValue" + PackageOfDirectCallerResource: "#/components/schemas/NativeResourcePackageOfDirectCallerResourceValue" + SystemExecutionResource: "#/components/schemas/NativeResourceSystemExecutionResourceValue" + ValidatorLiquidStakeUnit: "#/components/schemas/NativeResourceValidatorLiquidStakeUnitValue" + ValidatorClaimNft: "#/components/schemas/NativeResourceValidatorClaimNftValue" + OneResourcePoolUnit: "#/components/schemas/NativeResourceOneResourcePoolUnitValue" + TwoResourcePoolUnit: "#/components/schemas/NativeResourceTwoResourcePoolUnitValue" + MultiResourcePoolUnit: "#/components/schemas/NativeResourceMultiResourcePoolUnitValue" + AccessControllerRecoveryBadge: "#/components/schemas/NativeResourceAccessControllerRecoveryBadgeValue" + required: + - kind + properties: + kind: + $ref: "#/components/schemas/NativeResourceKind" + NativeResourceXrdValue: + allOf: + - $ref: "#/components/schemas/NativeResourceDetails" + - type: object + NativeResourcePackageOwnerBadgeValue: + allOf: + - $ref: "#/components/schemas/NativeResourceDetails" + - type: object + NativeResourceAccountOwnerBadgeValue: + allOf: + - $ref: "#/components/schemas/NativeResourceDetails" + - type: object + NativeResourceIdentityOwnerBadgeValue: + allOf: + - $ref: "#/components/schemas/NativeResourceDetails" + - type: object + NativeResourceValidatorOwnerBadgeValue: + allOf: + - $ref: "#/components/schemas/NativeResourceDetails" + - type: object + NativeResourceSecp256k1SignatureResourceValue: + allOf: + - $ref: "#/components/schemas/NativeResourceDetails" + - type: object + NativeResourceEd25519SignatureResourceValue: + allOf: + - $ref: "#/components/schemas/NativeResourceDetails" + - type: object + NativeResourceGlobalCallerResourceValue: + allOf: + - $ref: "#/components/schemas/NativeResourceDetails" + - type: object + NativeResourcePackageOfDirectCallerResourceValue: + allOf: + - $ref: "#/components/schemas/NativeResourceDetails" + - type: object + NativeResourceSystemExecutionResourceValue: + allOf: + - $ref: "#/components/schemas/NativeResourceDetails" + - type: object + NativeResourceValidatorLiquidStakeUnitValue: + allOf: + - $ref: "#/components/schemas/NativeResourceDetails" + - type: object + required: + - validator_address + - redemption_resource_count + - unit_redemption_value + properties: + validator_address: + $ref: "#/components/schemas/Address" + redemption_resource_count: + type: integer + unit_redemption_value: + $ref: "#/components/schemas/NativeResourceUnitRedemptionValue" + NativeResourceValidatorClaimNftValue: + allOf: + - $ref: "#/components/schemas/NativeResourceDetails" + - type: object + required: + - validator_address + properties: + validator_address: + $ref: "#/components/schemas/Address" + NativeResourceOneResourcePoolUnitValue: + allOf: + - $ref: "#/components/schemas/NativeResourceDetails" + - type: object + required: + - pool_address + - redemption_resource_count + - unit_redemption_value + properties: + pool_address: + $ref: "#/components/schemas/Address" + redemption_resource_count: + type: integer + unit_redemption_value: + $ref: "#/components/schemas/NativeResourceUnitRedemptionValue" + NativeResourceTwoResourcePoolUnitValue: + allOf: + - $ref: "#/components/schemas/NativeResourceDetails" + - type: object + required: + - pool_address + - redemption_resource_count + - unit_redemption_value + properties: + pool_address: + $ref: "#/components/schemas/Address" + redemption_resource_count: + type: integer + unit_redemption_value: + $ref: "#/components/schemas/NativeResourceUnitRedemptionValue" + NativeResourceMultiResourcePoolUnitValue: + allOf: + - $ref: "#/components/schemas/NativeResourceDetails" + - type: object + required: + - pool_address + - redemption_resource_count + - unit_redemption_value + properties: + pool_address: + $ref: "#/components/schemas/Address" + redemption_resource_count: + type: integer + unit_redemption_value: + $ref: "#/components/schemas/NativeResourceUnitRedemptionValue" + NativeResourceAccessControllerRecoveryBadgeValue: + allOf: + - $ref: "#/components/schemas/NativeResourceDetails" + - type: object + required: + - access_controller_address + properties: + access_controller_address: + $ref: "#/components/schemas/Address" + # # Metadata Typed Value # diff --git a/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/NativeResourceAccessControllerRecoveryBadgeValue.cs b/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/NativeResourceAccessControllerRecoveryBadgeValue.cs new file mode 100644 index 000000000..afb3c499d --- /dev/null +++ b/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/NativeResourceAccessControllerRecoveryBadgeValue.cs @@ -0,0 +1,214 @@ +/* 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. + */ + +/* + * Radix Gateway API - Babylon + * + * This API is exposed by the Babylon Radix Gateway to enable clients to efficiently query current and historic state on the RadixDLT ledger, and intelligently handle transaction submission. It is designed for use by wallets and explorers, and for light queries from front-end dApps. For exchange/asset integrations, back-end dApp integrations, or simple use cases, you should consider using the Core API on a Node. A Gateway is only needed for reading historic snapshots of ledger states or a more robust set-up. The Gateway API is implemented by the [Network Gateway](https://github.com/radixdlt/babylon-gateway), which is configured to read from [full node(s)](https://github.com/radixdlt/babylon-node) to extract and index data from the network. This document is an API reference documentation, visit [User Guide](https://docs.radixdlt.com/) to learn more about how to run a Gateway of your own. ## Migration guide Please see [the latest release notes](https://github.com/radixdlt/babylon-gateway/releases). ## Integration and forward compatibility guarantees All responses may have additional fields added at any release, so clients are advised to use JSON parsers which ignore unknown fields on JSON objects. When the Radix protocol is updated, new functionality may be added, and so discriminated unions returned by the API may need to be updated to have new variants added, corresponding to the updated data. Clients may need to update in advance to be able to handle these new variants when a protocol update comes out. On the very rare occasions we need to make breaking changes to the API, these will be warned in advance with deprecation notices on previous versions. These deprecation notices will include a safe migration path. Deprecation notes or breaking changes will be flagged clearly in release notes for new versions of the Gateway. The Gateway DB schema is not subject to any compatibility guarantees, and may be changed at any release. DB changes will be flagged in the release notes so clients doing custom DB integrations can prepare. + * + * The version of the OpenAPI document: v1.7.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using JsonSubTypes; +using FileParameter = RadixDlt.NetworkGateway.GatewayApiSdk.Client.FileParameter; +using OpenAPIDateConverter = RadixDlt.NetworkGateway.GatewayApiSdk.Client.OpenAPIDateConverter; + +namespace RadixDlt.NetworkGateway.GatewayApiSdk.Model +{ + /// + /// NativeResourceAccessControllerRecoveryBadgeValue + /// + [DataContract(Name = "NativeResourceAccessControllerRecoveryBadgeValue")] + [JsonConverter(typeof(JsonSubtypes), "kind")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceAccessControllerRecoveryBadgeValue), "AccessControllerRecoveryBadge")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceAccountOwnerBadgeValue), "AccountOwnerBadge")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceEd25519SignatureResourceValue), "Ed25519SignatureResource")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceGlobalCallerResourceValue), "GlobalCallerResource")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceIdentityOwnerBadgeValue), "IdentityOwnerBadge")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceMultiResourcePoolUnitValue), "MultiResourcePoolUnit")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceOneResourcePoolUnitValue), "OneResourcePoolUnit")] + [JsonSubtypes.KnownSubType(typeof(NativeResourcePackageOfDirectCallerResourceValue), "PackageOfDirectCallerResource")] + [JsonSubtypes.KnownSubType(typeof(NativeResourcePackageOwnerBadgeValue), "PackageOwnerBadge")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceSecp256k1SignatureResourceValue), "Secp256k1SignatureResource")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceSystemExecutionResourceValue), "SystemExecutionResource")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceTwoResourcePoolUnitValue), "TwoResourcePoolUnit")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceValidatorClaimNftValue), "ValidatorClaimNft")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceValidatorLiquidStakeUnitValue), "ValidatorLiquidStakeUnit")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceValidatorOwnerBadgeValue), "ValidatorOwnerBadge")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceXrdValue), "Xrd")] + public partial class NativeResourceAccessControllerRecoveryBadgeValue : NativeResourceDetails, IEquatable + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected NativeResourceAccessControllerRecoveryBadgeValue() { } + /// + /// Initializes a new instance of the class. + /// + /// Bech32m-encoded human readable version of the address. (required). + /// kind (required) (default to NativeResourceKind.AccessControllerRecoveryBadge). + public NativeResourceAccessControllerRecoveryBadgeValue(string accessControllerAddress = default(string), NativeResourceKind kind = NativeResourceKind.AccessControllerRecoveryBadge) : base(kind) + { + // to ensure "accessControllerAddress" is required (not null) + if (accessControllerAddress == null) + { + throw new ArgumentNullException("accessControllerAddress is a required property for NativeResourceAccessControllerRecoveryBadgeValue and cannot be null"); + } + this.AccessControllerAddress = accessControllerAddress; + } + + /// + /// Bech32m-encoded human readable version of the address. + /// + /// Bech32m-encoded human readable version of the address. + [DataMember(Name = "access_controller_address", IsRequired = true, EmitDefaultValue = true)] + public string AccessControllerAddress { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class NativeResourceAccessControllerRecoveryBadgeValue {\n"); + sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); + sb.Append(" AccessControllerAddress: ").Append(AccessControllerAddress).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public override string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as NativeResourceAccessControllerRecoveryBadgeValue); + } + + /// + /// Returns true if NativeResourceAccessControllerRecoveryBadgeValue instances are equal + /// + /// Instance of NativeResourceAccessControllerRecoveryBadgeValue to be compared + /// Boolean + public bool Equals(NativeResourceAccessControllerRecoveryBadgeValue input) + { + if (input == null) + { + return false; + } + return base.Equals(input) && + ( + this.AccessControllerAddress == input.AccessControllerAddress || + (this.AccessControllerAddress != null && + this.AccessControllerAddress.Equals(input.AccessControllerAddress)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = base.GetHashCode(); + if (this.AccessControllerAddress != null) + { + hashCode = (hashCode * 59) + this.AccessControllerAddress.GetHashCode(); + } + return hashCode; + } + } + + } + +} diff --git a/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/NativeResourceAccessControllerRecoveryBadgeValueAllOf.cs b/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/NativeResourceAccessControllerRecoveryBadgeValueAllOf.cs new file mode 100644 index 000000000..fc100fde2 --- /dev/null +++ b/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/NativeResourceAccessControllerRecoveryBadgeValueAllOf.cs @@ -0,0 +1,194 @@ +/* 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. + */ + +/* + * Radix Gateway API - Babylon + * + * This API is exposed by the Babylon Radix Gateway to enable clients to efficiently query current and historic state on the RadixDLT ledger, and intelligently handle transaction submission. It is designed for use by wallets and explorers, and for light queries from front-end dApps. For exchange/asset integrations, back-end dApp integrations, or simple use cases, you should consider using the Core API on a Node. A Gateway is only needed for reading historic snapshots of ledger states or a more robust set-up. The Gateway API is implemented by the [Network Gateway](https://github.com/radixdlt/babylon-gateway), which is configured to read from [full node(s)](https://github.com/radixdlt/babylon-node) to extract and index data from the network. This document is an API reference documentation, visit [User Guide](https://docs.radixdlt.com/) to learn more about how to run a Gateway of your own. ## Migration guide Please see [the latest release notes](https://github.com/radixdlt/babylon-gateway/releases). ## Integration and forward compatibility guarantees All responses may have additional fields added at any release, so clients are advised to use JSON parsers which ignore unknown fields on JSON objects. When the Radix protocol is updated, new functionality may be added, and so discriminated unions returned by the API may need to be updated to have new variants added, corresponding to the updated data. Clients may need to update in advance to be able to handle these new variants when a protocol update comes out. On the very rare occasions we need to make breaking changes to the API, these will be warned in advance with deprecation notices on previous versions. These deprecation notices will include a safe migration path. Deprecation notes or breaking changes will be flagged clearly in release notes for new versions of the Gateway. The Gateway DB schema is not subject to any compatibility guarantees, and may be changed at any release. DB changes will be flagged in the release notes so clients doing custom DB integrations can prepare. + * + * The version of the OpenAPI document: v1.7.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using FileParameter = RadixDlt.NetworkGateway.GatewayApiSdk.Client.FileParameter; +using OpenAPIDateConverter = RadixDlt.NetworkGateway.GatewayApiSdk.Client.OpenAPIDateConverter; + +namespace RadixDlt.NetworkGateway.GatewayApiSdk.Model +{ + /// + /// NativeResourceAccessControllerRecoveryBadgeValueAllOf + /// + [DataContract(Name = "NativeResourceAccessControllerRecoveryBadgeValue_allOf")] + public partial class NativeResourceAccessControllerRecoveryBadgeValueAllOf : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected NativeResourceAccessControllerRecoveryBadgeValueAllOf() { } + /// + /// Initializes a new instance of the class. + /// + /// Bech32m-encoded human readable version of the address. (required). + public NativeResourceAccessControllerRecoveryBadgeValueAllOf(string accessControllerAddress = default(string)) + { + // to ensure "accessControllerAddress" is required (not null) + if (accessControllerAddress == null) + { + throw new ArgumentNullException("accessControllerAddress is a required property for NativeResourceAccessControllerRecoveryBadgeValueAllOf and cannot be null"); + } + this.AccessControllerAddress = accessControllerAddress; + } + + /// + /// Bech32m-encoded human readable version of the address. + /// + /// Bech32m-encoded human readable version of the address. + [DataMember(Name = "access_controller_address", IsRequired = true, EmitDefaultValue = true)] + public string AccessControllerAddress { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class NativeResourceAccessControllerRecoveryBadgeValueAllOf {\n"); + sb.Append(" AccessControllerAddress: ").Append(AccessControllerAddress).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as NativeResourceAccessControllerRecoveryBadgeValueAllOf); + } + + /// + /// Returns true if NativeResourceAccessControllerRecoveryBadgeValueAllOf instances are equal + /// + /// Instance of NativeResourceAccessControllerRecoveryBadgeValueAllOf to be compared + /// Boolean + public bool Equals(NativeResourceAccessControllerRecoveryBadgeValueAllOf input) + { + if (input == null) + { + return false; + } + return + ( + this.AccessControllerAddress == input.AccessControllerAddress || + (this.AccessControllerAddress != null && + this.AccessControllerAddress.Equals(input.AccessControllerAddress)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.AccessControllerAddress != null) + { + hashCode = (hashCode * 59) + this.AccessControllerAddress.GetHashCode(); + } + return hashCode; + } + } + + } + +} diff --git a/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/NativeResourceAccountOwnerBadgeValue.cs b/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/NativeResourceAccountOwnerBadgeValue.cs new file mode 100644 index 000000000..c505d606d --- /dev/null +++ b/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/NativeResourceAccountOwnerBadgeValue.cs @@ -0,0 +1,190 @@ +/* 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. + */ + +/* + * Radix Gateway API - Babylon + * + * This API is exposed by the Babylon Radix Gateway to enable clients to efficiently query current and historic state on the RadixDLT ledger, and intelligently handle transaction submission. It is designed for use by wallets and explorers, and for light queries from front-end dApps. For exchange/asset integrations, back-end dApp integrations, or simple use cases, you should consider using the Core API on a Node. A Gateway is only needed for reading historic snapshots of ledger states or a more robust set-up. The Gateway API is implemented by the [Network Gateway](https://github.com/radixdlt/babylon-gateway), which is configured to read from [full node(s)](https://github.com/radixdlt/babylon-node) to extract and index data from the network. This document is an API reference documentation, visit [User Guide](https://docs.radixdlt.com/) to learn more about how to run a Gateway of your own. ## Migration guide Please see [the latest release notes](https://github.com/radixdlt/babylon-gateway/releases). ## Integration and forward compatibility guarantees All responses may have additional fields added at any release, so clients are advised to use JSON parsers which ignore unknown fields on JSON objects. When the Radix protocol is updated, new functionality may be added, and so discriminated unions returned by the API may need to be updated to have new variants added, corresponding to the updated data. Clients may need to update in advance to be able to handle these new variants when a protocol update comes out. On the very rare occasions we need to make breaking changes to the API, these will be warned in advance with deprecation notices on previous versions. These deprecation notices will include a safe migration path. Deprecation notes or breaking changes will be flagged clearly in release notes for new versions of the Gateway. The Gateway DB schema is not subject to any compatibility guarantees, and may be changed at any release. DB changes will be flagged in the release notes so clients doing custom DB integrations can prepare. + * + * The version of the OpenAPI document: v1.7.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using JsonSubTypes; +using FileParameter = RadixDlt.NetworkGateway.GatewayApiSdk.Client.FileParameter; +using OpenAPIDateConverter = RadixDlt.NetworkGateway.GatewayApiSdk.Client.OpenAPIDateConverter; + +namespace RadixDlt.NetworkGateway.GatewayApiSdk.Model +{ + /// + /// NativeResourceAccountOwnerBadgeValue + /// + [DataContract(Name = "NativeResourceAccountOwnerBadgeValue")] + [JsonConverter(typeof(JsonSubtypes), "kind")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceAccessControllerRecoveryBadgeValue), "AccessControllerRecoveryBadge")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceAccountOwnerBadgeValue), "AccountOwnerBadge")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceEd25519SignatureResourceValue), "Ed25519SignatureResource")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceGlobalCallerResourceValue), "GlobalCallerResource")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceIdentityOwnerBadgeValue), "IdentityOwnerBadge")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceMultiResourcePoolUnitValue), "MultiResourcePoolUnit")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceOneResourcePoolUnitValue), "OneResourcePoolUnit")] + [JsonSubtypes.KnownSubType(typeof(NativeResourcePackageOfDirectCallerResourceValue), "PackageOfDirectCallerResource")] + [JsonSubtypes.KnownSubType(typeof(NativeResourcePackageOwnerBadgeValue), "PackageOwnerBadge")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceSecp256k1SignatureResourceValue), "Secp256k1SignatureResource")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceSystemExecutionResourceValue), "SystemExecutionResource")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceTwoResourcePoolUnitValue), "TwoResourcePoolUnit")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceValidatorClaimNftValue), "ValidatorClaimNft")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceValidatorLiquidStakeUnitValue), "ValidatorLiquidStakeUnit")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceValidatorOwnerBadgeValue), "ValidatorOwnerBadge")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceXrdValue), "Xrd")] + public partial class NativeResourceAccountOwnerBadgeValue : NativeResourceDetails, IEquatable + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected NativeResourceAccountOwnerBadgeValue() { } + /// + /// Initializes a new instance of the class. + /// + /// kind (required) (default to NativeResourceKind.AccountOwnerBadge). + public NativeResourceAccountOwnerBadgeValue(NativeResourceKind kind = NativeResourceKind.AccountOwnerBadge) : base(kind) + { + } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class NativeResourceAccountOwnerBadgeValue {\n"); + sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public override string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as NativeResourceAccountOwnerBadgeValue); + } + + /// + /// Returns true if NativeResourceAccountOwnerBadgeValue instances are equal + /// + /// Instance of NativeResourceAccountOwnerBadgeValue to be compared + /// Boolean + public bool Equals(NativeResourceAccountOwnerBadgeValue input) + { + if (input == null) + { + return false; + } + return base.Equals(input); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = base.GetHashCode(); + return hashCode; + } + } + + } + +} diff --git a/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/NativeResourceDetails.cs b/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/NativeResourceDetails.cs new file mode 100644 index 000000000..689d8e7a4 --- /dev/null +++ b/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/NativeResourceDetails.cs @@ -0,0 +1,218 @@ +/* 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. + */ + +/* + * Radix Gateway API - Babylon + * + * This API is exposed by the Babylon Radix Gateway to enable clients to efficiently query current and historic state on the RadixDLT ledger, and intelligently handle transaction submission. It is designed for use by wallets and explorers, and for light queries from front-end dApps. For exchange/asset integrations, back-end dApp integrations, or simple use cases, you should consider using the Core API on a Node. A Gateway is only needed for reading historic snapshots of ledger states or a more robust set-up. The Gateway API is implemented by the [Network Gateway](https://github.com/radixdlt/babylon-gateway), which is configured to read from [full node(s)](https://github.com/radixdlt/babylon-node) to extract and index data from the network. This document is an API reference documentation, visit [User Guide](https://docs.radixdlt.com/) to learn more about how to run a Gateway of your own. ## Migration guide Please see [the latest release notes](https://github.com/radixdlt/babylon-gateway/releases). ## Integration and forward compatibility guarantees All responses may have additional fields added at any release, so clients are advised to use JSON parsers which ignore unknown fields on JSON objects. When the Radix protocol is updated, new functionality may be added, and so discriminated unions returned by the API may need to be updated to have new variants added, corresponding to the updated data. Clients may need to update in advance to be able to handle these new variants when a protocol update comes out. On the very rare occasions we need to make breaking changes to the API, these will be warned in advance with deprecation notices on previous versions. These deprecation notices will include a safe migration path. Deprecation notes or breaking changes will be flagged clearly in release notes for new versions of the Gateway. The Gateway DB schema is not subject to any compatibility guarantees, and may be changed at any release. DB changes will be flagged in the release notes so clients doing custom DB integrations can prepare. + * + * The version of the OpenAPI document: v1.7.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using JsonSubTypes; +using FileParameter = RadixDlt.NetworkGateway.GatewayApiSdk.Client.FileParameter; +using OpenAPIDateConverter = RadixDlt.NetworkGateway.GatewayApiSdk.Client.OpenAPIDateConverter; + +namespace RadixDlt.NetworkGateway.GatewayApiSdk.Model +{ + /// + /// NativeResourceDetails + /// + [DataContract(Name = "NativeResourceDetails")] + [JsonConverter(typeof(JsonSubtypes), "kind")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceAccessControllerRecoveryBadgeValue), "AccessControllerRecoveryBadge")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceAccountOwnerBadgeValue), "AccountOwnerBadge")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceEd25519SignatureResourceValue), "Ed25519SignatureResource")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceGlobalCallerResourceValue), "GlobalCallerResource")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceIdentityOwnerBadgeValue), "IdentityOwnerBadge")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceMultiResourcePoolUnitValue), "MultiResourcePoolUnit")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceAccessControllerRecoveryBadgeValue), "NativeResourceAccessControllerRecoveryBadgeValue")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceAccountOwnerBadgeValue), "NativeResourceAccountOwnerBadgeValue")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceEd25519SignatureResourceValue), "NativeResourceEd25519SignatureResourceValue")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceGlobalCallerResourceValue), "NativeResourceGlobalCallerResourceValue")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceIdentityOwnerBadgeValue), "NativeResourceIdentityOwnerBadgeValue")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceMultiResourcePoolUnitValue), "NativeResourceMultiResourcePoolUnitValue")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceOneResourcePoolUnitValue), "NativeResourceOneResourcePoolUnitValue")] + [JsonSubtypes.KnownSubType(typeof(NativeResourcePackageOfDirectCallerResourceValue), "NativeResourcePackageOfDirectCallerResourceValue")] + [JsonSubtypes.KnownSubType(typeof(NativeResourcePackageOwnerBadgeValue), "NativeResourcePackageOwnerBadgeValue")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceSecp256k1SignatureResourceValue), "NativeResourceSecp256k1SignatureResourceValue")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceSystemExecutionResourceValue), "NativeResourceSystemExecutionResourceValue")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceTwoResourcePoolUnitValue), "NativeResourceTwoResourcePoolUnitValue")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceValidatorClaimNftValue), "NativeResourceValidatorClaimNftValue")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceValidatorLiquidStakeUnitValue), "NativeResourceValidatorLiquidStakeUnitValue")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceValidatorOwnerBadgeValue), "NativeResourceValidatorOwnerBadgeValue")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceXrdValue), "NativeResourceXrdValue")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceOneResourcePoolUnitValue), "OneResourcePoolUnit")] + [JsonSubtypes.KnownSubType(typeof(NativeResourcePackageOfDirectCallerResourceValue), "PackageOfDirectCallerResource")] + [JsonSubtypes.KnownSubType(typeof(NativeResourcePackageOwnerBadgeValue), "PackageOwnerBadge")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceSecp256k1SignatureResourceValue), "Secp256k1SignatureResource")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceSystemExecutionResourceValue), "SystemExecutionResource")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceTwoResourcePoolUnitValue), "TwoResourcePoolUnit")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceValidatorClaimNftValue), "ValidatorClaimNft")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceValidatorLiquidStakeUnitValue), "ValidatorLiquidStakeUnit")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceValidatorOwnerBadgeValue), "ValidatorOwnerBadge")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceXrdValue), "Xrd")] + public partial class NativeResourceDetails : IEquatable + { + + /// + /// Gets or Sets Kind + /// + [DataMember(Name = "kind", IsRequired = true, EmitDefaultValue = true)] + public NativeResourceKind Kind { get; set; } + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected NativeResourceDetails() { } + /// + /// Initializes a new instance of the class. + /// + /// kind (required). + public NativeResourceDetails(NativeResourceKind kind = default(NativeResourceKind)) + { + this.Kind = kind; + } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class NativeResourceDetails {\n"); + sb.Append(" Kind: ").Append(Kind).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as NativeResourceDetails); + } + + /// + /// Returns true if NativeResourceDetails instances are equal + /// + /// Instance of NativeResourceDetails to be compared + /// Boolean + public bool Equals(NativeResourceDetails input) + { + if (input == null) + { + return false; + } + return + ( + this.Kind == input.Kind || + this.Kind.Equals(input.Kind) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + hashCode = (hashCode * 59) + this.Kind.GetHashCode(); + return hashCode; + } + } + + } + +} diff --git a/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/NativeResourceEd25519SignatureResourceValue.cs b/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/NativeResourceEd25519SignatureResourceValue.cs new file mode 100644 index 000000000..4c3936201 --- /dev/null +++ b/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/NativeResourceEd25519SignatureResourceValue.cs @@ -0,0 +1,190 @@ +/* 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. + */ + +/* + * Radix Gateway API - Babylon + * + * This API is exposed by the Babylon Radix Gateway to enable clients to efficiently query current and historic state on the RadixDLT ledger, and intelligently handle transaction submission. It is designed for use by wallets and explorers, and for light queries from front-end dApps. For exchange/asset integrations, back-end dApp integrations, or simple use cases, you should consider using the Core API on a Node. A Gateway is only needed for reading historic snapshots of ledger states or a more robust set-up. The Gateway API is implemented by the [Network Gateway](https://github.com/radixdlt/babylon-gateway), which is configured to read from [full node(s)](https://github.com/radixdlt/babylon-node) to extract and index data from the network. This document is an API reference documentation, visit [User Guide](https://docs.radixdlt.com/) to learn more about how to run a Gateway of your own. ## Migration guide Please see [the latest release notes](https://github.com/radixdlt/babylon-gateway/releases). ## Integration and forward compatibility guarantees All responses may have additional fields added at any release, so clients are advised to use JSON parsers which ignore unknown fields on JSON objects. When the Radix protocol is updated, new functionality may be added, and so discriminated unions returned by the API may need to be updated to have new variants added, corresponding to the updated data. Clients may need to update in advance to be able to handle these new variants when a protocol update comes out. On the very rare occasions we need to make breaking changes to the API, these will be warned in advance with deprecation notices on previous versions. These deprecation notices will include a safe migration path. Deprecation notes or breaking changes will be flagged clearly in release notes for new versions of the Gateway. The Gateway DB schema is not subject to any compatibility guarantees, and may be changed at any release. DB changes will be flagged in the release notes so clients doing custom DB integrations can prepare. + * + * The version of the OpenAPI document: v1.7.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using JsonSubTypes; +using FileParameter = RadixDlt.NetworkGateway.GatewayApiSdk.Client.FileParameter; +using OpenAPIDateConverter = RadixDlt.NetworkGateway.GatewayApiSdk.Client.OpenAPIDateConverter; + +namespace RadixDlt.NetworkGateway.GatewayApiSdk.Model +{ + /// + /// NativeResourceEd25519SignatureResourceValue + /// + [DataContract(Name = "NativeResourceEd25519SignatureResourceValue")] + [JsonConverter(typeof(JsonSubtypes), "kind")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceAccessControllerRecoveryBadgeValue), "AccessControllerRecoveryBadge")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceAccountOwnerBadgeValue), "AccountOwnerBadge")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceEd25519SignatureResourceValue), "Ed25519SignatureResource")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceGlobalCallerResourceValue), "GlobalCallerResource")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceIdentityOwnerBadgeValue), "IdentityOwnerBadge")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceMultiResourcePoolUnitValue), "MultiResourcePoolUnit")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceOneResourcePoolUnitValue), "OneResourcePoolUnit")] + [JsonSubtypes.KnownSubType(typeof(NativeResourcePackageOfDirectCallerResourceValue), "PackageOfDirectCallerResource")] + [JsonSubtypes.KnownSubType(typeof(NativeResourcePackageOwnerBadgeValue), "PackageOwnerBadge")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceSecp256k1SignatureResourceValue), "Secp256k1SignatureResource")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceSystemExecutionResourceValue), "SystemExecutionResource")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceTwoResourcePoolUnitValue), "TwoResourcePoolUnit")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceValidatorClaimNftValue), "ValidatorClaimNft")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceValidatorLiquidStakeUnitValue), "ValidatorLiquidStakeUnit")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceValidatorOwnerBadgeValue), "ValidatorOwnerBadge")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceXrdValue), "Xrd")] + public partial class NativeResourceEd25519SignatureResourceValue : NativeResourceDetails, IEquatable + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected NativeResourceEd25519SignatureResourceValue() { } + /// + /// Initializes a new instance of the class. + /// + /// kind (required) (default to NativeResourceKind.Ed25519SignatureResource). + public NativeResourceEd25519SignatureResourceValue(NativeResourceKind kind = NativeResourceKind.Ed25519SignatureResource) : base(kind) + { + } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class NativeResourceEd25519SignatureResourceValue {\n"); + sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public override string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as NativeResourceEd25519SignatureResourceValue); + } + + /// + /// Returns true if NativeResourceEd25519SignatureResourceValue instances are equal + /// + /// Instance of NativeResourceEd25519SignatureResourceValue to be compared + /// Boolean + public bool Equals(NativeResourceEd25519SignatureResourceValue input) + { + if (input == null) + { + return false; + } + return base.Equals(input); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = base.GetHashCode(); + return hashCode; + } + } + + } + +} diff --git a/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/NativeResourceGlobalCallerResourceValue.cs b/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/NativeResourceGlobalCallerResourceValue.cs new file mode 100644 index 000000000..8a2c6c3f3 --- /dev/null +++ b/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/NativeResourceGlobalCallerResourceValue.cs @@ -0,0 +1,190 @@ +/* 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. + */ + +/* + * Radix Gateway API - Babylon + * + * This API is exposed by the Babylon Radix Gateway to enable clients to efficiently query current and historic state on the RadixDLT ledger, and intelligently handle transaction submission. It is designed for use by wallets and explorers, and for light queries from front-end dApps. For exchange/asset integrations, back-end dApp integrations, or simple use cases, you should consider using the Core API on a Node. A Gateway is only needed for reading historic snapshots of ledger states or a more robust set-up. The Gateway API is implemented by the [Network Gateway](https://github.com/radixdlt/babylon-gateway), which is configured to read from [full node(s)](https://github.com/radixdlt/babylon-node) to extract and index data from the network. This document is an API reference documentation, visit [User Guide](https://docs.radixdlt.com/) to learn more about how to run a Gateway of your own. ## Migration guide Please see [the latest release notes](https://github.com/radixdlt/babylon-gateway/releases). ## Integration and forward compatibility guarantees All responses may have additional fields added at any release, so clients are advised to use JSON parsers which ignore unknown fields on JSON objects. When the Radix protocol is updated, new functionality may be added, and so discriminated unions returned by the API may need to be updated to have new variants added, corresponding to the updated data. Clients may need to update in advance to be able to handle these new variants when a protocol update comes out. On the very rare occasions we need to make breaking changes to the API, these will be warned in advance with deprecation notices on previous versions. These deprecation notices will include a safe migration path. Deprecation notes or breaking changes will be flagged clearly in release notes for new versions of the Gateway. The Gateway DB schema is not subject to any compatibility guarantees, and may be changed at any release. DB changes will be flagged in the release notes so clients doing custom DB integrations can prepare. + * + * The version of the OpenAPI document: v1.7.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using JsonSubTypes; +using FileParameter = RadixDlt.NetworkGateway.GatewayApiSdk.Client.FileParameter; +using OpenAPIDateConverter = RadixDlt.NetworkGateway.GatewayApiSdk.Client.OpenAPIDateConverter; + +namespace RadixDlt.NetworkGateway.GatewayApiSdk.Model +{ + /// + /// NativeResourceGlobalCallerResourceValue + /// + [DataContract(Name = "NativeResourceGlobalCallerResourceValue")] + [JsonConverter(typeof(JsonSubtypes), "kind")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceAccessControllerRecoveryBadgeValue), "AccessControllerRecoveryBadge")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceAccountOwnerBadgeValue), "AccountOwnerBadge")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceEd25519SignatureResourceValue), "Ed25519SignatureResource")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceGlobalCallerResourceValue), "GlobalCallerResource")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceIdentityOwnerBadgeValue), "IdentityOwnerBadge")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceMultiResourcePoolUnitValue), "MultiResourcePoolUnit")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceOneResourcePoolUnitValue), "OneResourcePoolUnit")] + [JsonSubtypes.KnownSubType(typeof(NativeResourcePackageOfDirectCallerResourceValue), "PackageOfDirectCallerResource")] + [JsonSubtypes.KnownSubType(typeof(NativeResourcePackageOwnerBadgeValue), "PackageOwnerBadge")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceSecp256k1SignatureResourceValue), "Secp256k1SignatureResource")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceSystemExecutionResourceValue), "SystemExecutionResource")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceTwoResourcePoolUnitValue), "TwoResourcePoolUnit")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceValidatorClaimNftValue), "ValidatorClaimNft")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceValidatorLiquidStakeUnitValue), "ValidatorLiquidStakeUnit")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceValidatorOwnerBadgeValue), "ValidatorOwnerBadge")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceXrdValue), "Xrd")] + public partial class NativeResourceGlobalCallerResourceValue : NativeResourceDetails, IEquatable + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected NativeResourceGlobalCallerResourceValue() { } + /// + /// Initializes a new instance of the class. + /// + /// kind (required) (default to NativeResourceKind.GlobalCallerResource). + public NativeResourceGlobalCallerResourceValue(NativeResourceKind kind = NativeResourceKind.GlobalCallerResource) : base(kind) + { + } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class NativeResourceGlobalCallerResourceValue {\n"); + sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public override string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as NativeResourceGlobalCallerResourceValue); + } + + /// + /// Returns true if NativeResourceGlobalCallerResourceValue instances are equal + /// + /// Instance of NativeResourceGlobalCallerResourceValue to be compared + /// Boolean + public bool Equals(NativeResourceGlobalCallerResourceValue input) + { + if (input == null) + { + return false; + } + return base.Equals(input); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = base.GetHashCode(); + return hashCode; + } + } + + } + +} diff --git a/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/NativeResourceIdentityOwnerBadgeValue.cs b/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/NativeResourceIdentityOwnerBadgeValue.cs new file mode 100644 index 000000000..34ecc40fd --- /dev/null +++ b/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/NativeResourceIdentityOwnerBadgeValue.cs @@ -0,0 +1,190 @@ +/* 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. + */ + +/* + * Radix Gateway API - Babylon + * + * This API is exposed by the Babylon Radix Gateway to enable clients to efficiently query current and historic state on the RadixDLT ledger, and intelligently handle transaction submission. It is designed for use by wallets and explorers, and for light queries from front-end dApps. For exchange/asset integrations, back-end dApp integrations, or simple use cases, you should consider using the Core API on a Node. A Gateway is only needed for reading historic snapshots of ledger states or a more robust set-up. The Gateway API is implemented by the [Network Gateway](https://github.com/radixdlt/babylon-gateway), which is configured to read from [full node(s)](https://github.com/radixdlt/babylon-node) to extract and index data from the network. This document is an API reference documentation, visit [User Guide](https://docs.radixdlt.com/) to learn more about how to run a Gateway of your own. ## Migration guide Please see [the latest release notes](https://github.com/radixdlt/babylon-gateway/releases). ## Integration and forward compatibility guarantees All responses may have additional fields added at any release, so clients are advised to use JSON parsers which ignore unknown fields on JSON objects. When the Radix protocol is updated, new functionality may be added, and so discriminated unions returned by the API may need to be updated to have new variants added, corresponding to the updated data. Clients may need to update in advance to be able to handle these new variants when a protocol update comes out. On the very rare occasions we need to make breaking changes to the API, these will be warned in advance with deprecation notices on previous versions. These deprecation notices will include a safe migration path. Deprecation notes or breaking changes will be flagged clearly in release notes for new versions of the Gateway. The Gateway DB schema is not subject to any compatibility guarantees, and may be changed at any release. DB changes will be flagged in the release notes so clients doing custom DB integrations can prepare. + * + * The version of the OpenAPI document: v1.7.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using JsonSubTypes; +using FileParameter = RadixDlt.NetworkGateway.GatewayApiSdk.Client.FileParameter; +using OpenAPIDateConverter = RadixDlt.NetworkGateway.GatewayApiSdk.Client.OpenAPIDateConverter; + +namespace RadixDlt.NetworkGateway.GatewayApiSdk.Model +{ + /// + /// NativeResourceIdentityOwnerBadgeValue + /// + [DataContract(Name = "NativeResourceIdentityOwnerBadgeValue")] + [JsonConverter(typeof(JsonSubtypes), "kind")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceAccessControllerRecoveryBadgeValue), "AccessControllerRecoveryBadge")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceAccountOwnerBadgeValue), "AccountOwnerBadge")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceEd25519SignatureResourceValue), "Ed25519SignatureResource")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceGlobalCallerResourceValue), "GlobalCallerResource")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceIdentityOwnerBadgeValue), "IdentityOwnerBadge")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceMultiResourcePoolUnitValue), "MultiResourcePoolUnit")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceOneResourcePoolUnitValue), "OneResourcePoolUnit")] + [JsonSubtypes.KnownSubType(typeof(NativeResourcePackageOfDirectCallerResourceValue), "PackageOfDirectCallerResource")] + [JsonSubtypes.KnownSubType(typeof(NativeResourcePackageOwnerBadgeValue), "PackageOwnerBadge")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceSecp256k1SignatureResourceValue), "Secp256k1SignatureResource")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceSystemExecutionResourceValue), "SystemExecutionResource")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceTwoResourcePoolUnitValue), "TwoResourcePoolUnit")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceValidatorClaimNftValue), "ValidatorClaimNft")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceValidatorLiquidStakeUnitValue), "ValidatorLiquidStakeUnit")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceValidatorOwnerBadgeValue), "ValidatorOwnerBadge")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceXrdValue), "Xrd")] + public partial class NativeResourceIdentityOwnerBadgeValue : NativeResourceDetails, IEquatable + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected NativeResourceIdentityOwnerBadgeValue() { } + /// + /// Initializes a new instance of the class. + /// + /// kind (required) (default to NativeResourceKind.IdentityOwnerBadge). + public NativeResourceIdentityOwnerBadgeValue(NativeResourceKind kind = NativeResourceKind.IdentityOwnerBadge) : base(kind) + { + } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class NativeResourceIdentityOwnerBadgeValue {\n"); + sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public override string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as NativeResourceIdentityOwnerBadgeValue); + } + + /// + /// Returns true if NativeResourceIdentityOwnerBadgeValue instances are equal + /// + /// Instance of NativeResourceIdentityOwnerBadgeValue to be compared + /// Boolean + public bool Equals(NativeResourceIdentityOwnerBadgeValue input) + { + if (input == null) + { + return false; + } + return base.Equals(input); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = base.GetHashCode(); + return hashCode; + } + } + + } + +} diff --git a/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/NativeResourceKind.cs b/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/NativeResourceKind.cs new file mode 100644 index 000000000..f6fae4e17 --- /dev/null +++ b/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/NativeResourceKind.cs @@ -0,0 +1,196 @@ +/* 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. + */ + +/* + * Radix Gateway API - Babylon + * + * This API is exposed by the Babylon Radix Gateway to enable clients to efficiently query current and historic state on the RadixDLT ledger, and intelligently handle transaction submission. It is designed for use by wallets and explorers, and for light queries from front-end dApps. For exchange/asset integrations, back-end dApp integrations, or simple use cases, you should consider using the Core API on a Node. A Gateway is only needed for reading historic snapshots of ledger states or a more robust set-up. The Gateway API is implemented by the [Network Gateway](https://github.com/radixdlt/babylon-gateway), which is configured to read from [full node(s)](https://github.com/radixdlt/babylon-node) to extract and index data from the network. This document is an API reference documentation, visit [User Guide](https://docs.radixdlt.com/) to learn more about how to run a Gateway of your own. ## Migration guide Please see [the latest release notes](https://github.com/radixdlt/babylon-gateway/releases). ## Integration and forward compatibility guarantees All responses may have additional fields added at any release, so clients are advised to use JSON parsers which ignore unknown fields on JSON objects. When the Radix protocol is updated, new functionality may be added, and so discriminated unions returned by the API may need to be updated to have new variants added, corresponding to the updated data. Clients may need to update in advance to be able to handle these new variants when a protocol update comes out. On the very rare occasions we need to make breaking changes to the API, these will be warned in advance with deprecation notices on previous versions. These deprecation notices will include a safe migration path. Deprecation notes or breaking changes will be flagged clearly in release notes for new versions of the Gateway. The Gateway DB schema is not subject to any compatibility guarantees, and may be changed at any release. DB changes will be flagged in the release notes so clients doing custom DB integrations can prepare. + * + * The version of the OpenAPI document: v1.7.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using FileParameter = RadixDlt.NetworkGateway.GatewayApiSdk.Client.FileParameter; +using OpenAPIDateConverter = RadixDlt.NetworkGateway.GatewayApiSdk.Client.OpenAPIDateConverter; + +namespace RadixDlt.NetworkGateway.GatewayApiSdk.Model +{ + /// + /// Defines NativeResourceKind + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum NativeResourceKind + { + /// + /// Enum Xrd for value: Xrd + /// + [EnumMember(Value = "Xrd")] + Xrd = 1, + + /// + /// Enum PackageOwnerBadge for value: PackageOwnerBadge + /// + [EnumMember(Value = "PackageOwnerBadge")] + PackageOwnerBadge = 2, + + /// + /// Enum AccountOwnerBadge for value: AccountOwnerBadge + /// + [EnumMember(Value = "AccountOwnerBadge")] + AccountOwnerBadge = 3, + + /// + /// Enum IdentityOwnerBadge for value: IdentityOwnerBadge + /// + [EnumMember(Value = "IdentityOwnerBadge")] + IdentityOwnerBadge = 4, + + /// + /// Enum ValidatorOwnerBadge for value: ValidatorOwnerBadge + /// + [EnumMember(Value = "ValidatorOwnerBadge")] + ValidatorOwnerBadge = 5, + + /// + /// Enum Secp256k1SignatureResource for value: Secp256k1SignatureResource + /// + [EnumMember(Value = "Secp256k1SignatureResource")] + Secp256k1SignatureResource = 6, + + /// + /// Enum Ed25519SignatureResource for value: Ed25519SignatureResource + /// + [EnumMember(Value = "Ed25519SignatureResource")] + Ed25519SignatureResource = 7, + + /// + /// Enum GlobalCallerResource for value: GlobalCallerResource + /// + [EnumMember(Value = "GlobalCallerResource")] + GlobalCallerResource = 8, + + /// + /// Enum PackageOfDirectCallerResource for value: PackageOfDirectCallerResource + /// + [EnumMember(Value = "PackageOfDirectCallerResource")] + PackageOfDirectCallerResource = 9, + + /// + /// Enum SystemExecutionResource for value: SystemExecutionResource + /// + [EnumMember(Value = "SystemExecutionResource")] + SystemExecutionResource = 10, + + /// + /// Enum ValidatorLiquidStakeUnit for value: ValidatorLiquidStakeUnit + /// + [EnumMember(Value = "ValidatorLiquidStakeUnit")] + ValidatorLiquidStakeUnit = 11, + + /// + /// Enum ValidatorClaimNft for value: ValidatorClaimNft + /// + [EnumMember(Value = "ValidatorClaimNft")] + ValidatorClaimNft = 12, + + /// + /// Enum OneResourcePoolUnit for value: OneResourcePoolUnit + /// + [EnumMember(Value = "OneResourcePoolUnit")] + OneResourcePoolUnit = 13, + + /// + /// Enum TwoResourcePoolUnit for value: TwoResourcePoolUnit + /// + [EnumMember(Value = "TwoResourcePoolUnit")] + TwoResourcePoolUnit = 14, + + /// + /// Enum MultiResourcePoolUnit for value: MultiResourcePoolUnit + /// + [EnumMember(Value = "MultiResourcePoolUnit")] + MultiResourcePoolUnit = 15, + + /// + /// Enum AccessControllerRecoveryBadge for value: AccessControllerRecoveryBadge + /// + [EnumMember(Value = "AccessControllerRecoveryBadge")] + AccessControllerRecoveryBadge = 16 + + } + +} diff --git a/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/NativeResourceMultiResourcePoolUnitValue.cs b/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/NativeResourceMultiResourcePoolUnitValue.cs new file mode 100644 index 000000000..a087889d6 --- /dev/null +++ b/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/NativeResourceMultiResourcePoolUnitValue.cs @@ -0,0 +1,252 @@ +/* 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. + */ + +/* + * Radix Gateway API - Babylon + * + * This API is exposed by the Babylon Radix Gateway to enable clients to efficiently query current and historic state on the RadixDLT ledger, and intelligently handle transaction submission. It is designed for use by wallets and explorers, and for light queries from front-end dApps. For exchange/asset integrations, back-end dApp integrations, or simple use cases, you should consider using the Core API on a Node. A Gateway is only needed for reading historic snapshots of ledger states or a more robust set-up. The Gateway API is implemented by the [Network Gateway](https://github.com/radixdlt/babylon-gateway), which is configured to read from [full node(s)](https://github.com/radixdlt/babylon-node) to extract and index data from the network. This document is an API reference documentation, visit [User Guide](https://docs.radixdlt.com/) to learn more about how to run a Gateway of your own. ## Migration guide Please see [the latest release notes](https://github.com/radixdlt/babylon-gateway/releases). ## Integration and forward compatibility guarantees All responses may have additional fields added at any release, so clients are advised to use JSON parsers which ignore unknown fields on JSON objects. When the Radix protocol is updated, new functionality may be added, and so discriminated unions returned by the API may need to be updated to have new variants added, corresponding to the updated data. Clients may need to update in advance to be able to handle these new variants when a protocol update comes out. On the very rare occasions we need to make breaking changes to the API, these will be warned in advance with deprecation notices on previous versions. These deprecation notices will include a safe migration path. Deprecation notes or breaking changes will be flagged clearly in release notes for new versions of the Gateway. The Gateway DB schema is not subject to any compatibility guarantees, and may be changed at any release. DB changes will be flagged in the release notes so clients doing custom DB integrations can prepare. + * + * The version of the OpenAPI document: v1.7.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using JsonSubTypes; +using FileParameter = RadixDlt.NetworkGateway.GatewayApiSdk.Client.FileParameter; +using OpenAPIDateConverter = RadixDlt.NetworkGateway.GatewayApiSdk.Client.OpenAPIDateConverter; + +namespace RadixDlt.NetworkGateway.GatewayApiSdk.Model +{ + /// + /// NativeResourceMultiResourcePoolUnitValue + /// + [DataContract(Name = "NativeResourceMultiResourcePoolUnitValue")] + [JsonConverter(typeof(JsonSubtypes), "kind")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceAccessControllerRecoveryBadgeValue), "AccessControllerRecoveryBadge")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceAccountOwnerBadgeValue), "AccountOwnerBadge")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceEd25519SignatureResourceValue), "Ed25519SignatureResource")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceGlobalCallerResourceValue), "GlobalCallerResource")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceIdentityOwnerBadgeValue), "IdentityOwnerBadge")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceMultiResourcePoolUnitValue), "MultiResourcePoolUnit")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceOneResourcePoolUnitValue), "OneResourcePoolUnit")] + [JsonSubtypes.KnownSubType(typeof(NativeResourcePackageOfDirectCallerResourceValue), "PackageOfDirectCallerResource")] + [JsonSubtypes.KnownSubType(typeof(NativeResourcePackageOwnerBadgeValue), "PackageOwnerBadge")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceSecp256k1SignatureResourceValue), "Secp256k1SignatureResource")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceSystemExecutionResourceValue), "SystemExecutionResource")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceTwoResourcePoolUnitValue), "TwoResourcePoolUnit")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceValidatorClaimNftValue), "ValidatorClaimNft")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceValidatorLiquidStakeUnitValue), "ValidatorLiquidStakeUnit")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceValidatorOwnerBadgeValue), "ValidatorOwnerBadge")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceXrdValue), "Xrd")] + public partial class NativeResourceMultiResourcePoolUnitValue : NativeResourceDetails, IEquatable + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected NativeResourceMultiResourcePoolUnitValue() { } + /// + /// Initializes a new instance of the class. + /// + /// Bech32m-encoded human readable version of the address. (required). + /// redemptionResourceCount (required). + /// unitRedemptionValue (required). + /// kind (required) (default to NativeResourceKind.MultiResourcePoolUnit). + public NativeResourceMultiResourcePoolUnitValue(string poolAddress = default(string), int redemptionResourceCount = default(int), List unitRedemptionValue = default(List), NativeResourceKind kind = NativeResourceKind.MultiResourcePoolUnit) : base(kind) + { + // to ensure "poolAddress" is required (not null) + if (poolAddress == null) + { + throw new ArgumentNullException("poolAddress is a required property for NativeResourceMultiResourcePoolUnitValue and cannot be null"); + } + this.PoolAddress = poolAddress; + this.RedemptionResourceCount = redemptionResourceCount; + // to ensure "unitRedemptionValue" is required (not null) + if (unitRedemptionValue == null) + { + throw new ArgumentNullException("unitRedemptionValue is a required property for NativeResourceMultiResourcePoolUnitValue and cannot be null"); + } + this.UnitRedemptionValue = unitRedemptionValue; + } + + /// + /// Bech32m-encoded human readable version of the address. + /// + /// Bech32m-encoded human readable version of the address. + [DataMember(Name = "pool_address", IsRequired = true, EmitDefaultValue = true)] + public string PoolAddress { get; set; } + + /// + /// Gets or Sets RedemptionResourceCount + /// + [DataMember(Name = "redemption_resource_count", IsRequired = true, EmitDefaultValue = true)] + public int RedemptionResourceCount { get; set; } + + /// + /// Gets or Sets UnitRedemptionValue + /// + [DataMember(Name = "unit_redemption_value", IsRequired = true, EmitDefaultValue = true)] + public List UnitRedemptionValue { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class NativeResourceMultiResourcePoolUnitValue {\n"); + sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); + sb.Append(" PoolAddress: ").Append(PoolAddress).Append("\n"); + sb.Append(" RedemptionResourceCount: ").Append(RedemptionResourceCount).Append("\n"); + sb.Append(" UnitRedemptionValue: ").Append(UnitRedemptionValue).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public override string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as NativeResourceMultiResourcePoolUnitValue); + } + + /// + /// Returns true if NativeResourceMultiResourcePoolUnitValue instances are equal + /// + /// Instance of NativeResourceMultiResourcePoolUnitValue to be compared + /// Boolean + public bool Equals(NativeResourceMultiResourcePoolUnitValue input) + { + if (input == null) + { + return false; + } + return base.Equals(input) && + ( + this.PoolAddress == input.PoolAddress || + (this.PoolAddress != null && + this.PoolAddress.Equals(input.PoolAddress)) + ) && base.Equals(input) && + ( + this.RedemptionResourceCount == input.RedemptionResourceCount || + this.RedemptionResourceCount.Equals(input.RedemptionResourceCount) + ) && base.Equals(input) && + ( + this.UnitRedemptionValue == input.UnitRedemptionValue || + this.UnitRedemptionValue != null && + input.UnitRedemptionValue != null && + this.UnitRedemptionValue.SequenceEqual(input.UnitRedemptionValue) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = base.GetHashCode(); + if (this.PoolAddress != null) + { + hashCode = (hashCode * 59) + this.PoolAddress.GetHashCode(); + } + hashCode = (hashCode * 59) + this.RedemptionResourceCount.GetHashCode(); + if (this.UnitRedemptionValue != null) + { + hashCode = (hashCode * 59) + this.UnitRedemptionValue.GetHashCode(); + } + return hashCode; + } + } + + } + +} diff --git a/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/NativeResourceOneResourcePoolUnitValue.cs b/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/NativeResourceOneResourcePoolUnitValue.cs new file mode 100644 index 000000000..9ee4efba7 --- /dev/null +++ b/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/NativeResourceOneResourcePoolUnitValue.cs @@ -0,0 +1,252 @@ +/* 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. + */ + +/* + * Radix Gateway API - Babylon + * + * This API is exposed by the Babylon Radix Gateway to enable clients to efficiently query current and historic state on the RadixDLT ledger, and intelligently handle transaction submission. It is designed for use by wallets and explorers, and for light queries from front-end dApps. For exchange/asset integrations, back-end dApp integrations, or simple use cases, you should consider using the Core API on a Node. A Gateway is only needed for reading historic snapshots of ledger states or a more robust set-up. The Gateway API is implemented by the [Network Gateway](https://github.com/radixdlt/babylon-gateway), which is configured to read from [full node(s)](https://github.com/radixdlt/babylon-node) to extract and index data from the network. This document is an API reference documentation, visit [User Guide](https://docs.radixdlt.com/) to learn more about how to run a Gateway of your own. ## Migration guide Please see [the latest release notes](https://github.com/radixdlt/babylon-gateway/releases). ## Integration and forward compatibility guarantees All responses may have additional fields added at any release, so clients are advised to use JSON parsers which ignore unknown fields on JSON objects. When the Radix protocol is updated, new functionality may be added, and so discriminated unions returned by the API may need to be updated to have new variants added, corresponding to the updated data. Clients may need to update in advance to be able to handle these new variants when a protocol update comes out. On the very rare occasions we need to make breaking changes to the API, these will be warned in advance with deprecation notices on previous versions. These deprecation notices will include a safe migration path. Deprecation notes or breaking changes will be flagged clearly in release notes for new versions of the Gateway. The Gateway DB schema is not subject to any compatibility guarantees, and may be changed at any release. DB changes will be flagged in the release notes so clients doing custom DB integrations can prepare. + * + * The version of the OpenAPI document: v1.7.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using JsonSubTypes; +using FileParameter = RadixDlt.NetworkGateway.GatewayApiSdk.Client.FileParameter; +using OpenAPIDateConverter = RadixDlt.NetworkGateway.GatewayApiSdk.Client.OpenAPIDateConverter; + +namespace RadixDlt.NetworkGateway.GatewayApiSdk.Model +{ + /// + /// NativeResourceOneResourcePoolUnitValue + /// + [DataContract(Name = "NativeResourceOneResourcePoolUnitValue")] + [JsonConverter(typeof(JsonSubtypes), "kind")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceAccessControllerRecoveryBadgeValue), "AccessControllerRecoveryBadge")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceAccountOwnerBadgeValue), "AccountOwnerBadge")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceEd25519SignatureResourceValue), "Ed25519SignatureResource")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceGlobalCallerResourceValue), "GlobalCallerResource")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceIdentityOwnerBadgeValue), "IdentityOwnerBadge")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceMultiResourcePoolUnitValue), "MultiResourcePoolUnit")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceOneResourcePoolUnitValue), "OneResourcePoolUnit")] + [JsonSubtypes.KnownSubType(typeof(NativeResourcePackageOfDirectCallerResourceValue), "PackageOfDirectCallerResource")] + [JsonSubtypes.KnownSubType(typeof(NativeResourcePackageOwnerBadgeValue), "PackageOwnerBadge")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceSecp256k1SignatureResourceValue), "Secp256k1SignatureResource")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceSystemExecutionResourceValue), "SystemExecutionResource")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceTwoResourcePoolUnitValue), "TwoResourcePoolUnit")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceValidatorClaimNftValue), "ValidatorClaimNft")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceValidatorLiquidStakeUnitValue), "ValidatorLiquidStakeUnit")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceValidatorOwnerBadgeValue), "ValidatorOwnerBadge")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceXrdValue), "Xrd")] + public partial class NativeResourceOneResourcePoolUnitValue : NativeResourceDetails, IEquatable + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected NativeResourceOneResourcePoolUnitValue() { } + /// + /// Initializes a new instance of the class. + /// + /// Bech32m-encoded human readable version of the address. (required). + /// redemptionResourceCount (required). + /// unitRedemptionValue (required). + /// kind (required) (default to NativeResourceKind.OneResourcePoolUnit). + public NativeResourceOneResourcePoolUnitValue(string poolAddress = default(string), int redemptionResourceCount = default(int), List unitRedemptionValue = default(List), NativeResourceKind kind = NativeResourceKind.OneResourcePoolUnit) : base(kind) + { + // to ensure "poolAddress" is required (not null) + if (poolAddress == null) + { + throw new ArgumentNullException("poolAddress is a required property for NativeResourceOneResourcePoolUnitValue and cannot be null"); + } + this.PoolAddress = poolAddress; + this.RedemptionResourceCount = redemptionResourceCount; + // to ensure "unitRedemptionValue" is required (not null) + if (unitRedemptionValue == null) + { + throw new ArgumentNullException("unitRedemptionValue is a required property for NativeResourceOneResourcePoolUnitValue and cannot be null"); + } + this.UnitRedemptionValue = unitRedemptionValue; + } + + /// + /// Bech32m-encoded human readable version of the address. + /// + /// Bech32m-encoded human readable version of the address. + [DataMember(Name = "pool_address", IsRequired = true, EmitDefaultValue = true)] + public string PoolAddress { get; set; } + + /// + /// Gets or Sets RedemptionResourceCount + /// + [DataMember(Name = "redemption_resource_count", IsRequired = true, EmitDefaultValue = true)] + public int RedemptionResourceCount { get; set; } + + /// + /// Gets or Sets UnitRedemptionValue + /// + [DataMember(Name = "unit_redemption_value", IsRequired = true, EmitDefaultValue = true)] + public List UnitRedemptionValue { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class NativeResourceOneResourcePoolUnitValue {\n"); + sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); + sb.Append(" PoolAddress: ").Append(PoolAddress).Append("\n"); + sb.Append(" RedemptionResourceCount: ").Append(RedemptionResourceCount).Append("\n"); + sb.Append(" UnitRedemptionValue: ").Append(UnitRedemptionValue).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public override string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as NativeResourceOneResourcePoolUnitValue); + } + + /// + /// Returns true if NativeResourceOneResourcePoolUnitValue instances are equal + /// + /// Instance of NativeResourceOneResourcePoolUnitValue to be compared + /// Boolean + public bool Equals(NativeResourceOneResourcePoolUnitValue input) + { + if (input == null) + { + return false; + } + return base.Equals(input) && + ( + this.PoolAddress == input.PoolAddress || + (this.PoolAddress != null && + this.PoolAddress.Equals(input.PoolAddress)) + ) && base.Equals(input) && + ( + this.RedemptionResourceCount == input.RedemptionResourceCount || + this.RedemptionResourceCount.Equals(input.RedemptionResourceCount) + ) && base.Equals(input) && + ( + this.UnitRedemptionValue == input.UnitRedemptionValue || + this.UnitRedemptionValue != null && + input.UnitRedemptionValue != null && + this.UnitRedemptionValue.SequenceEqual(input.UnitRedemptionValue) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = base.GetHashCode(); + if (this.PoolAddress != null) + { + hashCode = (hashCode * 59) + this.PoolAddress.GetHashCode(); + } + hashCode = (hashCode * 59) + this.RedemptionResourceCount.GetHashCode(); + if (this.UnitRedemptionValue != null) + { + hashCode = (hashCode * 59) + this.UnitRedemptionValue.GetHashCode(); + } + return hashCode; + } + } + + } + +} diff --git a/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/NativeResourceOneResourcePoolUnitValueAllOf.cs b/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/NativeResourceOneResourcePoolUnitValueAllOf.cs new file mode 100644 index 000000000..29a52d740 --- /dev/null +++ b/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/NativeResourceOneResourcePoolUnitValueAllOf.cs @@ -0,0 +1,232 @@ +/* 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. + */ + +/* + * Radix Gateway API - Babylon + * + * This API is exposed by the Babylon Radix Gateway to enable clients to efficiently query current and historic state on the RadixDLT ledger, and intelligently handle transaction submission. It is designed for use by wallets and explorers, and for light queries from front-end dApps. For exchange/asset integrations, back-end dApp integrations, or simple use cases, you should consider using the Core API on a Node. A Gateway is only needed for reading historic snapshots of ledger states or a more robust set-up. The Gateway API is implemented by the [Network Gateway](https://github.com/radixdlt/babylon-gateway), which is configured to read from [full node(s)](https://github.com/radixdlt/babylon-node) to extract and index data from the network. This document is an API reference documentation, visit [User Guide](https://docs.radixdlt.com/) to learn more about how to run a Gateway of your own. ## Migration guide Please see [the latest release notes](https://github.com/radixdlt/babylon-gateway/releases). ## Integration and forward compatibility guarantees All responses may have additional fields added at any release, so clients are advised to use JSON parsers which ignore unknown fields on JSON objects. When the Radix protocol is updated, new functionality may be added, and so discriminated unions returned by the API may need to be updated to have new variants added, corresponding to the updated data. Clients may need to update in advance to be able to handle these new variants when a protocol update comes out. On the very rare occasions we need to make breaking changes to the API, these will be warned in advance with deprecation notices on previous versions. These deprecation notices will include a safe migration path. Deprecation notes or breaking changes will be flagged clearly in release notes for new versions of the Gateway. The Gateway DB schema is not subject to any compatibility guarantees, and may be changed at any release. DB changes will be flagged in the release notes so clients doing custom DB integrations can prepare. + * + * The version of the OpenAPI document: v1.7.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using FileParameter = RadixDlt.NetworkGateway.GatewayApiSdk.Client.FileParameter; +using OpenAPIDateConverter = RadixDlt.NetworkGateway.GatewayApiSdk.Client.OpenAPIDateConverter; + +namespace RadixDlt.NetworkGateway.GatewayApiSdk.Model +{ + /// + /// NativeResourceOneResourcePoolUnitValueAllOf + /// + [DataContract(Name = "NativeResourceOneResourcePoolUnitValue_allOf")] + public partial class NativeResourceOneResourcePoolUnitValueAllOf : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected NativeResourceOneResourcePoolUnitValueAllOf() { } + /// + /// Initializes a new instance of the class. + /// + /// Bech32m-encoded human readable version of the address. (required). + /// redemptionResourceCount (required). + /// unitRedemptionValue (required). + public NativeResourceOneResourcePoolUnitValueAllOf(string poolAddress = default(string), int redemptionResourceCount = default(int), List unitRedemptionValue = default(List)) + { + // to ensure "poolAddress" is required (not null) + if (poolAddress == null) + { + throw new ArgumentNullException("poolAddress is a required property for NativeResourceOneResourcePoolUnitValueAllOf and cannot be null"); + } + this.PoolAddress = poolAddress; + this.RedemptionResourceCount = redemptionResourceCount; + // to ensure "unitRedemptionValue" is required (not null) + if (unitRedemptionValue == null) + { + throw new ArgumentNullException("unitRedemptionValue is a required property for NativeResourceOneResourcePoolUnitValueAllOf and cannot be null"); + } + this.UnitRedemptionValue = unitRedemptionValue; + } + + /// + /// Bech32m-encoded human readable version of the address. + /// + /// Bech32m-encoded human readable version of the address. + [DataMember(Name = "pool_address", IsRequired = true, EmitDefaultValue = true)] + public string PoolAddress { get; set; } + + /// + /// Gets or Sets RedemptionResourceCount + /// + [DataMember(Name = "redemption_resource_count", IsRequired = true, EmitDefaultValue = true)] + public int RedemptionResourceCount { get; set; } + + /// + /// Gets or Sets UnitRedemptionValue + /// + [DataMember(Name = "unit_redemption_value", IsRequired = true, EmitDefaultValue = true)] + public List UnitRedemptionValue { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class NativeResourceOneResourcePoolUnitValueAllOf {\n"); + sb.Append(" PoolAddress: ").Append(PoolAddress).Append("\n"); + sb.Append(" RedemptionResourceCount: ").Append(RedemptionResourceCount).Append("\n"); + sb.Append(" UnitRedemptionValue: ").Append(UnitRedemptionValue).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as NativeResourceOneResourcePoolUnitValueAllOf); + } + + /// + /// Returns true if NativeResourceOneResourcePoolUnitValueAllOf instances are equal + /// + /// Instance of NativeResourceOneResourcePoolUnitValueAllOf to be compared + /// Boolean + public bool Equals(NativeResourceOneResourcePoolUnitValueAllOf input) + { + if (input == null) + { + return false; + } + return + ( + this.PoolAddress == input.PoolAddress || + (this.PoolAddress != null && + this.PoolAddress.Equals(input.PoolAddress)) + ) && + ( + this.RedemptionResourceCount == input.RedemptionResourceCount || + this.RedemptionResourceCount.Equals(input.RedemptionResourceCount) + ) && + ( + this.UnitRedemptionValue == input.UnitRedemptionValue || + this.UnitRedemptionValue != null && + input.UnitRedemptionValue != null && + this.UnitRedemptionValue.SequenceEqual(input.UnitRedemptionValue) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.PoolAddress != null) + { + hashCode = (hashCode * 59) + this.PoolAddress.GetHashCode(); + } + hashCode = (hashCode * 59) + this.RedemptionResourceCount.GetHashCode(); + if (this.UnitRedemptionValue != null) + { + hashCode = (hashCode * 59) + this.UnitRedemptionValue.GetHashCode(); + } + return hashCode; + } + } + + } + +} diff --git a/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/NativeResourcePackageOfDirectCallerResourceValue.cs b/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/NativeResourcePackageOfDirectCallerResourceValue.cs new file mode 100644 index 000000000..adecd29ca --- /dev/null +++ b/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/NativeResourcePackageOfDirectCallerResourceValue.cs @@ -0,0 +1,190 @@ +/* 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. + */ + +/* + * Radix Gateway API - Babylon + * + * This API is exposed by the Babylon Radix Gateway to enable clients to efficiently query current and historic state on the RadixDLT ledger, and intelligently handle transaction submission. It is designed for use by wallets and explorers, and for light queries from front-end dApps. For exchange/asset integrations, back-end dApp integrations, or simple use cases, you should consider using the Core API on a Node. A Gateway is only needed for reading historic snapshots of ledger states or a more robust set-up. The Gateway API is implemented by the [Network Gateway](https://github.com/radixdlt/babylon-gateway), which is configured to read from [full node(s)](https://github.com/radixdlt/babylon-node) to extract and index data from the network. This document is an API reference documentation, visit [User Guide](https://docs.radixdlt.com/) to learn more about how to run a Gateway of your own. ## Migration guide Please see [the latest release notes](https://github.com/radixdlt/babylon-gateway/releases). ## Integration and forward compatibility guarantees All responses may have additional fields added at any release, so clients are advised to use JSON parsers which ignore unknown fields on JSON objects. When the Radix protocol is updated, new functionality may be added, and so discriminated unions returned by the API may need to be updated to have new variants added, corresponding to the updated data. Clients may need to update in advance to be able to handle these new variants when a protocol update comes out. On the very rare occasions we need to make breaking changes to the API, these will be warned in advance with deprecation notices on previous versions. These deprecation notices will include a safe migration path. Deprecation notes or breaking changes will be flagged clearly in release notes for new versions of the Gateway. The Gateway DB schema is not subject to any compatibility guarantees, and may be changed at any release. DB changes will be flagged in the release notes so clients doing custom DB integrations can prepare. + * + * The version of the OpenAPI document: v1.7.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using JsonSubTypes; +using FileParameter = RadixDlt.NetworkGateway.GatewayApiSdk.Client.FileParameter; +using OpenAPIDateConverter = RadixDlt.NetworkGateway.GatewayApiSdk.Client.OpenAPIDateConverter; + +namespace RadixDlt.NetworkGateway.GatewayApiSdk.Model +{ + /// + /// NativeResourcePackageOfDirectCallerResourceValue + /// + [DataContract(Name = "NativeResourcePackageOfDirectCallerResourceValue")] + [JsonConverter(typeof(JsonSubtypes), "kind")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceAccessControllerRecoveryBadgeValue), "AccessControllerRecoveryBadge")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceAccountOwnerBadgeValue), "AccountOwnerBadge")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceEd25519SignatureResourceValue), "Ed25519SignatureResource")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceGlobalCallerResourceValue), "GlobalCallerResource")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceIdentityOwnerBadgeValue), "IdentityOwnerBadge")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceMultiResourcePoolUnitValue), "MultiResourcePoolUnit")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceOneResourcePoolUnitValue), "OneResourcePoolUnit")] + [JsonSubtypes.KnownSubType(typeof(NativeResourcePackageOfDirectCallerResourceValue), "PackageOfDirectCallerResource")] + [JsonSubtypes.KnownSubType(typeof(NativeResourcePackageOwnerBadgeValue), "PackageOwnerBadge")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceSecp256k1SignatureResourceValue), "Secp256k1SignatureResource")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceSystemExecutionResourceValue), "SystemExecutionResource")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceTwoResourcePoolUnitValue), "TwoResourcePoolUnit")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceValidatorClaimNftValue), "ValidatorClaimNft")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceValidatorLiquidStakeUnitValue), "ValidatorLiquidStakeUnit")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceValidatorOwnerBadgeValue), "ValidatorOwnerBadge")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceXrdValue), "Xrd")] + public partial class NativeResourcePackageOfDirectCallerResourceValue : NativeResourceDetails, IEquatable + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected NativeResourcePackageOfDirectCallerResourceValue() { } + /// + /// Initializes a new instance of the class. + /// + /// kind (required) (default to NativeResourceKind.PackageOfDirectCallerResource). + public NativeResourcePackageOfDirectCallerResourceValue(NativeResourceKind kind = NativeResourceKind.PackageOfDirectCallerResource) : base(kind) + { + } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class NativeResourcePackageOfDirectCallerResourceValue {\n"); + sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public override string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as NativeResourcePackageOfDirectCallerResourceValue); + } + + /// + /// Returns true if NativeResourcePackageOfDirectCallerResourceValue instances are equal + /// + /// Instance of NativeResourcePackageOfDirectCallerResourceValue to be compared + /// Boolean + public bool Equals(NativeResourcePackageOfDirectCallerResourceValue input) + { + if (input == null) + { + return false; + } + return base.Equals(input); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = base.GetHashCode(); + return hashCode; + } + } + + } + +} diff --git a/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/NativeResourcePackageOwnerBadgeValue.cs b/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/NativeResourcePackageOwnerBadgeValue.cs new file mode 100644 index 000000000..e3d0e9e87 --- /dev/null +++ b/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/NativeResourcePackageOwnerBadgeValue.cs @@ -0,0 +1,190 @@ +/* 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. + */ + +/* + * Radix Gateway API - Babylon + * + * This API is exposed by the Babylon Radix Gateway to enable clients to efficiently query current and historic state on the RadixDLT ledger, and intelligently handle transaction submission. It is designed for use by wallets and explorers, and for light queries from front-end dApps. For exchange/asset integrations, back-end dApp integrations, or simple use cases, you should consider using the Core API on a Node. A Gateway is only needed for reading historic snapshots of ledger states or a more robust set-up. The Gateway API is implemented by the [Network Gateway](https://github.com/radixdlt/babylon-gateway), which is configured to read from [full node(s)](https://github.com/radixdlt/babylon-node) to extract and index data from the network. This document is an API reference documentation, visit [User Guide](https://docs.radixdlt.com/) to learn more about how to run a Gateway of your own. ## Migration guide Please see [the latest release notes](https://github.com/radixdlt/babylon-gateway/releases). ## Integration and forward compatibility guarantees All responses may have additional fields added at any release, so clients are advised to use JSON parsers which ignore unknown fields on JSON objects. When the Radix protocol is updated, new functionality may be added, and so discriminated unions returned by the API may need to be updated to have new variants added, corresponding to the updated data. Clients may need to update in advance to be able to handle these new variants when a protocol update comes out. On the very rare occasions we need to make breaking changes to the API, these will be warned in advance with deprecation notices on previous versions. These deprecation notices will include a safe migration path. Deprecation notes or breaking changes will be flagged clearly in release notes for new versions of the Gateway. The Gateway DB schema is not subject to any compatibility guarantees, and may be changed at any release. DB changes will be flagged in the release notes so clients doing custom DB integrations can prepare. + * + * The version of the OpenAPI document: v1.7.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using JsonSubTypes; +using FileParameter = RadixDlt.NetworkGateway.GatewayApiSdk.Client.FileParameter; +using OpenAPIDateConverter = RadixDlt.NetworkGateway.GatewayApiSdk.Client.OpenAPIDateConverter; + +namespace RadixDlt.NetworkGateway.GatewayApiSdk.Model +{ + /// + /// NativeResourcePackageOwnerBadgeValue + /// + [DataContract(Name = "NativeResourcePackageOwnerBadgeValue")] + [JsonConverter(typeof(JsonSubtypes), "kind")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceAccessControllerRecoveryBadgeValue), "AccessControllerRecoveryBadge")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceAccountOwnerBadgeValue), "AccountOwnerBadge")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceEd25519SignatureResourceValue), "Ed25519SignatureResource")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceGlobalCallerResourceValue), "GlobalCallerResource")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceIdentityOwnerBadgeValue), "IdentityOwnerBadge")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceMultiResourcePoolUnitValue), "MultiResourcePoolUnit")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceOneResourcePoolUnitValue), "OneResourcePoolUnit")] + [JsonSubtypes.KnownSubType(typeof(NativeResourcePackageOfDirectCallerResourceValue), "PackageOfDirectCallerResource")] + [JsonSubtypes.KnownSubType(typeof(NativeResourcePackageOwnerBadgeValue), "PackageOwnerBadge")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceSecp256k1SignatureResourceValue), "Secp256k1SignatureResource")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceSystemExecutionResourceValue), "SystemExecutionResource")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceTwoResourcePoolUnitValue), "TwoResourcePoolUnit")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceValidatorClaimNftValue), "ValidatorClaimNft")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceValidatorLiquidStakeUnitValue), "ValidatorLiquidStakeUnit")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceValidatorOwnerBadgeValue), "ValidatorOwnerBadge")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceXrdValue), "Xrd")] + public partial class NativeResourcePackageOwnerBadgeValue : NativeResourceDetails, IEquatable + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected NativeResourcePackageOwnerBadgeValue() { } + /// + /// Initializes a new instance of the class. + /// + /// kind (required) (default to NativeResourceKind.PackageOwnerBadge). + public NativeResourcePackageOwnerBadgeValue(NativeResourceKind kind = NativeResourceKind.PackageOwnerBadge) : base(kind) + { + } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class NativeResourcePackageOwnerBadgeValue {\n"); + sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public override string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as NativeResourcePackageOwnerBadgeValue); + } + + /// + /// Returns true if NativeResourcePackageOwnerBadgeValue instances are equal + /// + /// Instance of NativeResourcePackageOwnerBadgeValue to be compared + /// Boolean + public bool Equals(NativeResourcePackageOwnerBadgeValue input) + { + if (input == null) + { + return false; + } + return base.Equals(input); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = base.GetHashCode(); + return hashCode; + } + } + + } + +} diff --git a/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/NativeResourceRedemptionValueItem.cs b/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/NativeResourceRedemptionValueItem.cs new file mode 100644 index 000000000..0399ccceb --- /dev/null +++ b/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/NativeResourceRedemptionValueItem.cs @@ -0,0 +1,213 @@ +/* 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. + */ + +/* + * Radix Gateway API - Babylon + * + * This API is exposed by the Babylon Radix Gateway to enable clients to efficiently query current and historic state on the RadixDLT ledger, and intelligently handle transaction submission. It is designed for use by wallets and explorers, and for light queries from front-end dApps. For exchange/asset integrations, back-end dApp integrations, or simple use cases, you should consider using the Core API on a Node. A Gateway is only needed for reading historic snapshots of ledger states or a more robust set-up. The Gateway API is implemented by the [Network Gateway](https://github.com/radixdlt/babylon-gateway), which is configured to read from [full node(s)](https://github.com/radixdlt/babylon-node) to extract and index data from the network. This document is an API reference documentation, visit [User Guide](https://docs.radixdlt.com/) to learn more about how to run a Gateway of your own. ## Migration guide Please see [the latest release notes](https://github.com/radixdlt/babylon-gateway/releases). ## Integration and forward compatibility guarantees All responses may have additional fields added at any release, so clients are advised to use JSON parsers which ignore unknown fields on JSON objects. When the Radix protocol is updated, new functionality may be added, and so discriminated unions returned by the API may need to be updated to have new variants added, corresponding to the updated data. Clients may need to update in advance to be able to handle these new variants when a protocol update comes out. On the very rare occasions we need to make breaking changes to the API, these will be warned in advance with deprecation notices on previous versions. These deprecation notices will include a safe migration path. Deprecation notes or breaking changes will be flagged clearly in release notes for new versions of the Gateway. The Gateway DB schema is not subject to any compatibility guarantees, and may be changed at any release. DB changes will be flagged in the release notes so clients doing custom DB integrations can prepare. + * + * The version of the OpenAPI document: v1.7.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using FileParameter = RadixDlt.NetworkGateway.GatewayApiSdk.Client.FileParameter; +using OpenAPIDateConverter = RadixDlt.NetworkGateway.GatewayApiSdk.Client.OpenAPIDateConverter; + +namespace RadixDlt.NetworkGateway.GatewayApiSdk.Model +{ + /// + /// NativeResourceRedemptionValueItem + /// + [DataContract(Name = "NativeResourceRedemptionValueItem")] + public partial class NativeResourceRedemptionValueItem : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected NativeResourceRedemptionValueItem() { } + /// + /// Initializes a new instance of the class. + /// + /// Bech32m-encoded human readable version of the address. (required). + /// String-encoded decimal representing the amount of a related fungible resource.. + public NativeResourceRedemptionValueItem(string resourceAddress = default(string), string amount = default(string)) + { + // to ensure "resourceAddress" is required (not null) + if (resourceAddress == null) + { + throw new ArgumentNullException("resourceAddress is a required property for NativeResourceRedemptionValueItem and cannot be null"); + } + this.ResourceAddress = resourceAddress; + this.Amount = amount; + } + + /// + /// Bech32m-encoded human readable version of the address. + /// + /// Bech32m-encoded human readable version of the address. + [DataMember(Name = "resource_address", IsRequired = true, 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 = "amount", EmitDefaultValue = true)] + public string Amount { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class NativeResourceRedemptionValueItem {\n"); + sb.Append(" ResourceAddress: ").Append(ResourceAddress).Append("\n"); + sb.Append(" Amount: ").Append(Amount).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as NativeResourceRedemptionValueItem); + } + + /// + /// Returns true if NativeResourceRedemptionValueItem instances are equal + /// + /// Instance of NativeResourceRedemptionValueItem to be compared + /// Boolean + public bool Equals(NativeResourceRedemptionValueItem input) + { + if (input == null) + { + return false; + } + return + ( + this.ResourceAddress == input.ResourceAddress || + (this.ResourceAddress != null && + this.ResourceAddress.Equals(input.ResourceAddress)) + ) && + ( + this.Amount == input.Amount || + (this.Amount != null && + this.Amount.Equals(input.Amount)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ResourceAddress != null) + { + hashCode = (hashCode * 59) + this.ResourceAddress.GetHashCode(); + } + if (this.Amount != null) + { + hashCode = (hashCode * 59) + this.Amount.GetHashCode(); + } + return hashCode; + } + } + + } + +} diff --git a/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/NativeResourceSecp256k1SignatureResourceValue.cs b/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/NativeResourceSecp256k1SignatureResourceValue.cs new file mode 100644 index 000000000..ff5978ded --- /dev/null +++ b/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/NativeResourceSecp256k1SignatureResourceValue.cs @@ -0,0 +1,190 @@ +/* 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. + */ + +/* + * Radix Gateway API - Babylon + * + * This API is exposed by the Babylon Radix Gateway to enable clients to efficiently query current and historic state on the RadixDLT ledger, and intelligently handle transaction submission. It is designed for use by wallets and explorers, and for light queries from front-end dApps. For exchange/asset integrations, back-end dApp integrations, or simple use cases, you should consider using the Core API on a Node. A Gateway is only needed for reading historic snapshots of ledger states or a more robust set-up. The Gateway API is implemented by the [Network Gateway](https://github.com/radixdlt/babylon-gateway), which is configured to read from [full node(s)](https://github.com/radixdlt/babylon-node) to extract and index data from the network. This document is an API reference documentation, visit [User Guide](https://docs.radixdlt.com/) to learn more about how to run a Gateway of your own. ## Migration guide Please see [the latest release notes](https://github.com/radixdlt/babylon-gateway/releases). ## Integration and forward compatibility guarantees All responses may have additional fields added at any release, so clients are advised to use JSON parsers which ignore unknown fields on JSON objects. When the Radix protocol is updated, new functionality may be added, and so discriminated unions returned by the API may need to be updated to have new variants added, corresponding to the updated data. Clients may need to update in advance to be able to handle these new variants when a protocol update comes out. On the very rare occasions we need to make breaking changes to the API, these will be warned in advance with deprecation notices on previous versions. These deprecation notices will include a safe migration path. Deprecation notes or breaking changes will be flagged clearly in release notes for new versions of the Gateway. The Gateway DB schema is not subject to any compatibility guarantees, and may be changed at any release. DB changes will be flagged in the release notes so clients doing custom DB integrations can prepare. + * + * The version of the OpenAPI document: v1.7.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using JsonSubTypes; +using FileParameter = RadixDlt.NetworkGateway.GatewayApiSdk.Client.FileParameter; +using OpenAPIDateConverter = RadixDlt.NetworkGateway.GatewayApiSdk.Client.OpenAPIDateConverter; + +namespace RadixDlt.NetworkGateway.GatewayApiSdk.Model +{ + /// + /// NativeResourceSecp256k1SignatureResourceValue + /// + [DataContract(Name = "NativeResourceSecp256k1SignatureResourceValue")] + [JsonConverter(typeof(JsonSubtypes), "kind")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceAccessControllerRecoveryBadgeValue), "AccessControllerRecoveryBadge")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceAccountOwnerBadgeValue), "AccountOwnerBadge")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceEd25519SignatureResourceValue), "Ed25519SignatureResource")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceGlobalCallerResourceValue), "GlobalCallerResource")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceIdentityOwnerBadgeValue), "IdentityOwnerBadge")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceMultiResourcePoolUnitValue), "MultiResourcePoolUnit")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceOneResourcePoolUnitValue), "OneResourcePoolUnit")] + [JsonSubtypes.KnownSubType(typeof(NativeResourcePackageOfDirectCallerResourceValue), "PackageOfDirectCallerResource")] + [JsonSubtypes.KnownSubType(typeof(NativeResourcePackageOwnerBadgeValue), "PackageOwnerBadge")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceSecp256k1SignatureResourceValue), "Secp256k1SignatureResource")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceSystemExecutionResourceValue), "SystemExecutionResource")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceTwoResourcePoolUnitValue), "TwoResourcePoolUnit")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceValidatorClaimNftValue), "ValidatorClaimNft")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceValidatorLiquidStakeUnitValue), "ValidatorLiquidStakeUnit")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceValidatorOwnerBadgeValue), "ValidatorOwnerBadge")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceXrdValue), "Xrd")] + public partial class NativeResourceSecp256k1SignatureResourceValue : NativeResourceDetails, IEquatable + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected NativeResourceSecp256k1SignatureResourceValue() { } + /// + /// Initializes a new instance of the class. + /// + /// kind (required) (default to NativeResourceKind.Secp256k1SignatureResource). + public NativeResourceSecp256k1SignatureResourceValue(NativeResourceKind kind = NativeResourceKind.Secp256k1SignatureResource) : base(kind) + { + } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class NativeResourceSecp256k1SignatureResourceValue {\n"); + sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public override string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as NativeResourceSecp256k1SignatureResourceValue); + } + + /// + /// Returns true if NativeResourceSecp256k1SignatureResourceValue instances are equal + /// + /// Instance of NativeResourceSecp256k1SignatureResourceValue to be compared + /// Boolean + public bool Equals(NativeResourceSecp256k1SignatureResourceValue input) + { + if (input == null) + { + return false; + } + return base.Equals(input); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = base.GetHashCode(); + return hashCode; + } + } + + } + +} diff --git a/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/NativeResourceSystemExecutionResourceValue.cs b/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/NativeResourceSystemExecutionResourceValue.cs new file mode 100644 index 000000000..c2a2185ff --- /dev/null +++ b/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/NativeResourceSystemExecutionResourceValue.cs @@ -0,0 +1,190 @@ +/* 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. + */ + +/* + * Radix Gateway API - Babylon + * + * This API is exposed by the Babylon Radix Gateway to enable clients to efficiently query current and historic state on the RadixDLT ledger, and intelligently handle transaction submission. It is designed for use by wallets and explorers, and for light queries from front-end dApps. For exchange/asset integrations, back-end dApp integrations, or simple use cases, you should consider using the Core API on a Node. A Gateway is only needed for reading historic snapshots of ledger states or a more robust set-up. The Gateway API is implemented by the [Network Gateway](https://github.com/radixdlt/babylon-gateway), which is configured to read from [full node(s)](https://github.com/radixdlt/babylon-node) to extract and index data from the network. This document is an API reference documentation, visit [User Guide](https://docs.radixdlt.com/) to learn more about how to run a Gateway of your own. ## Migration guide Please see [the latest release notes](https://github.com/radixdlt/babylon-gateway/releases). ## Integration and forward compatibility guarantees All responses may have additional fields added at any release, so clients are advised to use JSON parsers which ignore unknown fields on JSON objects. When the Radix protocol is updated, new functionality may be added, and so discriminated unions returned by the API may need to be updated to have new variants added, corresponding to the updated data. Clients may need to update in advance to be able to handle these new variants when a protocol update comes out. On the very rare occasions we need to make breaking changes to the API, these will be warned in advance with deprecation notices on previous versions. These deprecation notices will include a safe migration path. Deprecation notes or breaking changes will be flagged clearly in release notes for new versions of the Gateway. The Gateway DB schema is not subject to any compatibility guarantees, and may be changed at any release. DB changes will be flagged in the release notes so clients doing custom DB integrations can prepare. + * + * The version of the OpenAPI document: v1.7.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using JsonSubTypes; +using FileParameter = RadixDlt.NetworkGateway.GatewayApiSdk.Client.FileParameter; +using OpenAPIDateConverter = RadixDlt.NetworkGateway.GatewayApiSdk.Client.OpenAPIDateConverter; + +namespace RadixDlt.NetworkGateway.GatewayApiSdk.Model +{ + /// + /// NativeResourceSystemExecutionResourceValue + /// + [DataContract(Name = "NativeResourceSystemExecutionResourceValue")] + [JsonConverter(typeof(JsonSubtypes), "kind")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceAccessControllerRecoveryBadgeValue), "AccessControllerRecoveryBadge")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceAccountOwnerBadgeValue), "AccountOwnerBadge")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceEd25519SignatureResourceValue), "Ed25519SignatureResource")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceGlobalCallerResourceValue), "GlobalCallerResource")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceIdentityOwnerBadgeValue), "IdentityOwnerBadge")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceMultiResourcePoolUnitValue), "MultiResourcePoolUnit")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceOneResourcePoolUnitValue), "OneResourcePoolUnit")] + [JsonSubtypes.KnownSubType(typeof(NativeResourcePackageOfDirectCallerResourceValue), "PackageOfDirectCallerResource")] + [JsonSubtypes.KnownSubType(typeof(NativeResourcePackageOwnerBadgeValue), "PackageOwnerBadge")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceSecp256k1SignatureResourceValue), "Secp256k1SignatureResource")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceSystemExecutionResourceValue), "SystemExecutionResource")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceTwoResourcePoolUnitValue), "TwoResourcePoolUnit")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceValidatorClaimNftValue), "ValidatorClaimNft")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceValidatorLiquidStakeUnitValue), "ValidatorLiquidStakeUnit")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceValidatorOwnerBadgeValue), "ValidatorOwnerBadge")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceXrdValue), "Xrd")] + public partial class NativeResourceSystemExecutionResourceValue : NativeResourceDetails, IEquatable + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected NativeResourceSystemExecutionResourceValue() { } + /// + /// Initializes a new instance of the class. + /// + /// kind (required) (default to NativeResourceKind.SystemExecutionResource). + public NativeResourceSystemExecutionResourceValue(NativeResourceKind kind = NativeResourceKind.SystemExecutionResource) : base(kind) + { + } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class NativeResourceSystemExecutionResourceValue {\n"); + sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public override string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as NativeResourceSystemExecutionResourceValue); + } + + /// + /// Returns true if NativeResourceSystemExecutionResourceValue instances are equal + /// + /// Instance of NativeResourceSystemExecutionResourceValue to be compared + /// Boolean + public bool Equals(NativeResourceSystemExecutionResourceValue input) + { + if (input == null) + { + return false; + } + return base.Equals(input); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = base.GetHashCode(); + return hashCode; + } + } + + } + +} diff --git a/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/NativeResourceTwoResourcePoolUnitValue.cs b/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/NativeResourceTwoResourcePoolUnitValue.cs new file mode 100644 index 000000000..7e0575ca5 --- /dev/null +++ b/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/NativeResourceTwoResourcePoolUnitValue.cs @@ -0,0 +1,252 @@ +/* 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. + */ + +/* + * Radix Gateway API - Babylon + * + * This API is exposed by the Babylon Radix Gateway to enable clients to efficiently query current and historic state on the RadixDLT ledger, and intelligently handle transaction submission. It is designed for use by wallets and explorers, and for light queries from front-end dApps. For exchange/asset integrations, back-end dApp integrations, or simple use cases, you should consider using the Core API on a Node. A Gateway is only needed for reading historic snapshots of ledger states or a more robust set-up. The Gateway API is implemented by the [Network Gateway](https://github.com/radixdlt/babylon-gateway), which is configured to read from [full node(s)](https://github.com/radixdlt/babylon-node) to extract and index data from the network. This document is an API reference documentation, visit [User Guide](https://docs.radixdlt.com/) to learn more about how to run a Gateway of your own. ## Migration guide Please see [the latest release notes](https://github.com/radixdlt/babylon-gateway/releases). ## Integration and forward compatibility guarantees All responses may have additional fields added at any release, so clients are advised to use JSON parsers which ignore unknown fields on JSON objects. When the Radix protocol is updated, new functionality may be added, and so discriminated unions returned by the API may need to be updated to have new variants added, corresponding to the updated data. Clients may need to update in advance to be able to handle these new variants when a protocol update comes out. On the very rare occasions we need to make breaking changes to the API, these will be warned in advance with deprecation notices on previous versions. These deprecation notices will include a safe migration path. Deprecation notes or breaking changes will be flagged clearly in release notes for new versions of the Gateway. The Gateway DB schema is not subject to any compatibility guarantees, and may be changed at any release. DB changes will be flagged in the release notes so clients doing custom DB integrations can prepare. + * + * The version of the OpenAPI document: v1.7.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using JsonSubTypes; +using FileParameter = RadixDlt.NetworkGateway.GatewayApiSdk.Client.FileParameter; +using OpenAPIDateConverter = RadixDlt.NetworkGateway.GatewayApiSdk.Client.OpenAPIDateConverter; + +namespace RadixDlt.NetworkGateway.GatewayApiSdk.Model +{ + /// + /// NativeResourceTwoResourcePoolUnitValue + /// + [DataContract(Name = "NativeResourceTwoResourcePoolUnitValue")] + [JsonConverter(typeof(JsonSubtypes), "kind")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceAccessControllerRecoveryBadgeValue), "AccessControllerRecoveryBadge")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceAccountOwnerBadgeValue), "AccountOwnerBadge")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceEd25519SignatureResourceValue), "Ed25519SignatureResource")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceGlobalCallerResourceValue), "GlobalCallerResource")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceIdentityOwnerBadgeValue), "IdentityOwnerBadge")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceMultiResourcePoolUnitValue), "MultiResourcePoolUnit")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceOneResourcePoolUnitValue), "OneResourcePoolUnit")] + [JsonSubtypes.KnownSubType(typeof(NativeResourcePackageOfDirectCallerResourceValue), "PackageOfDirectCallerResource")] + [JsonSubtypes.KnownSubType(typeof(NativeResourcePackageOwnerBadgeValue), "PackageOwnerBadge")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceSecp256k1SignatureResourceValue), "Secp256k1SignatureResource")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceSystemExecutionResourceValue), "SystemExecutionResource")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceTwoResourcePoolUnitValue), "TwoResourcePoolUnit")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceValidatorClaimNftValue), "ValidatorClaimNft")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceValidatorLiquidStakeUnitValue), "ValidatorLiquidStakeUnit")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceValidatorOwnerBadgeValue), "ValidatorOwnerBadge")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceXrdValue), "Xrd")] + public partial class NativeResourceTwoResourcePoolUnitValue : NativeResourceDetails, IEquatable + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected NativeResourceTwoResourcePoolUnitValue() { } + /// + /// Initializes a new instance of the class. + /// + /// Bech32m-encoded human readable version of the address. (required). + /// redemptionResourceCount (required). + /// unitRedemptionValue (required). + /// kind (required) (default to NativeResourceKind.TwoResourcePoolUnit). + public NativeResourceTwoResourcePoolUnitValue(string poolAddress = default(string), int redemptionResourceCount = default(int), List unitRedemptionValue = default(List), NativeResourceKind kind = NativeResourceKind.TwoResourcePoolUnit) : base(kind) + { + // to ensure "poolAddress" is required (not null) + if (poolAddress == null) + { + throw new ArgumentNullException("poolAddress is a required property for NativeResourceTwoResourcePoolUnitValue and cannot be null"); + } + this.PoolAddress = poolAddress; + this.RedemptionResourceCount = redemptionResourceCount; + // to ensure "unitRedemptionValue" is required (not null) + if (unitRedemptionValue == null) + { + throw new ArgumentNullException("unitRedemptionValue is a required property for NativeResourceTwoResourcePoolUnitValue and cannot be null"); + } + this.UnitRedemptionValue = unitRedemptionValue; + } + + /// + /// Bech32m-encoded human readable version of the address. + /// + /// Bech32m-encoded human readable version of the address. + [DataMember(Name = "pool_address", IsRequired = true, EmitDefaultValue = true)] + public string PoolAddress { get; set; } + + /// + /// Gets or Sets RedemptionResourceCount + /// + [DataMember(Name = "redemption_resource_count", IsRequired = true, EmitDefaultValue = true)] + public int RedemptionResourceCount { get; set; } + + /// + /// Gets or Sets UnitRedemptionValue + /// + [DataMember(Name = "unit_redemption_value", IsRequired = true, EmitDefaultValue = true)] + public List UnitRedemptionValue { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class NativeResourceTwoResourcePoolUnitValue {\n"); + sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); + sb.Append(" PoolAddress: ").Append(PoolAddress).Append("\n"); + sb.Append(" RedemptionResourceCount: ").Append(RedemptionResourceCount).Append("\n"); + sb.Append(" UnitRedemptionValue: ").Append(UnitRedemptionValue).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public override string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as NativeResourceTwoResourcePoolUnitValue); + } + + /// + /// Returns true if NativeResourceTwoResourcePoolUnitValue instances are equal + /// + /// Instance of NativeResourceTwoResourcePoolUnitValue to be compared + /// Boolean + public bool Equals(NativeResourceTwoResourcePoolUnitValue input) + { + if (input == null) + { + return false; + } + return base.Equals(input) && + ( + this.PoolAddress == input.PoolAddress || + (this.PoolAddress != null && + this.PoolAddress.Equals(input.PoolAddress)) + ) && base.Equals(input) && + ( + this.RedemptionResourceCount == input.RedemptionResourceCount || + this.RedemptionResourceCount.Equals(input.RedemptionResourceCount) + ) && base.Equals(input) && + ( + this.UnitRedemptionValue == input.UnitRedemptionValue || + this.UnitRedemptionValue != null && + input.UnitRedemptionValue != null && + this.UnitRedemptionValue.SequenceEqual(input.UnitRedemptionValue) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = base.GetHashCode(); + if (this.PoolAddress != null) + { + hashCode = (hashCode * 59) + this.PoolAddress.GetHashCode(); + } + hashCode = (hashCode * 59) + this.RedemptionResourceCount.GetHashCode(); + if (this.UnitRedemptionValue != null) + { + hashCode = (hashCode * 59) + this.UnitRedemptionValue.GetHashCode(); + } + return hashCode; + } + } + + } + +} diff --git a/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/NativeResourceValidatorClaimNFTValue.cs b/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/NativeResourceValidatorClaimNFTValue.cs new file mode 100644 index 000000000..b7b3ec41d --- /dev/null +++ b/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/NativeResourceValidatorClaimNFTValue.cs @@ -0,0 +1,214 @@ +/* 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. + */ + +/* + * Radix Gateway API - Babylon + * + * This API is exposed by the Babylon Radix Gateway to enable clients to efficiently query current and historic state on the RadixDLT ledger, and intelligently handle transaction submission. It is designed for use by wallets and explorers, and for light queries from front-end dApps. For exchange/asset integrations, back-end dApp integrations, or simple use cases, you should consider using the Core API on a Node. A Gateway is only needed for reading historic snapshots of ledger states or a more robust set-up. The Gateway API is implemented by the [Network Gateway](https://github.com/radixdlt/babylon-gateway), which is configured to read from [full node(s)](https://github.com/radixdlt/babylon-node) to extract and index data from the network. This document is an API reference documentation, visit [User Guide](https://docs.radixdlt.com/) to learn more about how to run a Gateway of your own. ## Migration guide Please see [the latest release notes](https://github.com/radixdlt/babylon-gateway/releases). ## Integration and forward compatibility guarantees All responses may have additional fields added at any release, so clients are advised to use JSON parsers which ignore unknown fields on JSON objects. When the Radix protocol is updated, new functionality may be added, and so discriminated unions returned by the API may need to be updated to have new variants added, corresponding to the updated data. Clients may need to update in advance to be able to handle these new variants when a protocol update comes out. On the very rare occasions we need to make breaking changes to the API, these will be warned in advance with deprecation notices on previous versions. These deprecation notices will include a safe migration path. Deprecation notes or breaking changes will be flagged clearly in release notes for new versions of the Gateway. The Gateway DB schema is not subject to any compatibility guarantees, and may be changed at any release. DB changes will be flagged in the release notes so clients doing custom DB integrations can prepare. + * + * The version of the OpenAPI document: v1.7.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using JsonSubTypes; +using FileParameter = RadixDlt.NetworkGateway.GatewayApiSdk.Client.FileParameter; +using OpenAPIDateConverter = RadixDlt.NetworkGateway.GatewayApiSdk.Client.OpenAPIDateConverter; + +namespace RadixDlt.NetworkGateway.GatewayApiSdk.Model +{ + /// + /// NativeResourceValidatorClaimNftValue + /// + [DataContract(Name = "NativeResourceValidatorClaimNftValue")] + [JsonConverter(typeof(JsonSubtypes), "kind")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceAccessControllerRecoveryBadgeValue), "AccessControllerRecoveryBadge")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceAccountOwnerBadgeValue), "AccountOwnerBadge")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceEd25519SignatureResourceValue), "Ed25519SignatureResource")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceGlobalCallerResourceValue), "GlobalCallerResource")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceIdentityOwnerBadgeValue), "IdentityOwnerBadge")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceMultiResourcePoolUnitValue), "MultiResourcePoolUnit")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceOneResourcePoolUnitValue), "OneResourcePoolUnit")] + [JsonSubtypes.KnownSubType(typeof(NativeResourcePackageOfDirectCallerResourceValue), "PackageOfDirectCallerResource")] + [JsonSubtypes.KnownSubType(typeof(NativeResourcePackageOwnerBadgeValue), "PackageOwnerBadge")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceSecp256k1SignatureResourceValue), "Secp256k1SignatureResource")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceSystemExecutionResourceValue), "SystemExecutionResource")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceTwoResourcePoolUnitValue), "TwoResourcePoolUnit")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceValidatorClaimNftValue), "ValidatorClaimNft")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceValidatorLiquidStakeUnitValue), "ValidatorLiquidStakeUnit")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceValidatorOwnerBadgeValue), "ValidatorOwnerBadge")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceXrdValue), "Xrd")] + public partial class NativeResourceValidatorClaimNftValue : NativeResourceDetails, IEquatable + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected NativeResourceValidatorClaimNftValue() { } + /// + /// Initializes a new instance of the class. + /// + /// Bech32m-encoded human readable version of the address. (required). + /// kind (required) (default to NativeResourceKind.ValidatorClaimNft). + public NativeResourceValidatorClaimNftValue(string validatorAddress = default(string), NativeResourceKind kind = NativeResourceKind.ValidatorClaimNft) : base(kind) + { + // to ensure "validatorAddress" is required (not null) + if (validatorAddress == null) + { + throw new ArgumentNullException("validatorAddress is a required property for NativeResourceValidatorClaimNftValue and cannot be null"); + } + this.ValidatorAddress = validatorAddress; + } + + /// + /// Bech32m-encoded human readable version of the address. + /// + /// Bech32m-encoded human readable version of the address. + [DataMember(Name = "validator_address", IsRequired = true, EmitDefaultValue = true)] + public string ValidatorAddress { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class NativeResourceValidatorClaimNftValue {\n"); + sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); + sb.Append(" ValidatorAddress: ").Append(ValidatorAddress).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public override string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as NativeResourceValidatorClaimNftValue); + } + + /// + /// Returns true if NativeResourceValidatorClaimNftValue instances are equal + /// + /// Instance of NativeResourceValidatorClaimNftValue to be compared + /// Boolean + public bool Equals(NativeResourceValidatorClaimNftValue input) + { + if (input == null) + { + return false; + } + return base.Equals(input) && + ( + this.ValidatorAddress == input.ValidatorAddress || + (this.ValidatorAddress != null && + this.ValidatorAddress.Equals(input.ValidatorAddress)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = base.GetHashCode(); + if (this.ValidatorAddress != null) + { + hashCode = (hashCode * 59) + this.ValidatorAddress.GetHashCode(); + } + return hashCode; + } + } + + } + +} diff --git a/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/NativeResourceValidatorClaimNFTValueAllOf.cs b/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/NativeResourceValidatorClaimNFTValueAllOf.cs new file mode 100644 index 000000000..312eddb9d --- /dev/null +++ b/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/NativeResourceValidatorClaimNFTValueAllOf.cs @@ -0,0 +1,194 @@ +/* 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. + */ + +/* + * Radix Gateway API - Babylon + * + * This API is exposed by the Babylon Radix Gateway to enable clients to efficiently query current and historic state on the RadixDLT ledger, and intelligently handle transaction submission. It is designed for use by wallets and explorers, and for light queries from front-end dApps. For exchange/asset integrations, back-end dApp integrations, or simple use cases, you should consider using the Core API on a Node. A Gateway is only needed for reading historic snapshots of ledger states or a more robust set-up. The Gateway API is implemented by the [Network Gateway](https://github.com/radixdlt/babylon-gateway), which is configured to read from [full node(s)](https://github.com/radixdlt/babylon-node) to extract and index data from the network. This document is an API reference documentation, visit [User Guide](https://docs.radixdlt.com/) to learn more about how to run a Gateway of your own. ## Migration guide Please see [the latest release notes](https://github.com/radixdlt/babylon-gateway/releases). ## Integration and forward compatibility guarantees All responses may have additional fields added at any release, so clients are advised to use JSON parsers which ignore unknown fields on JSON objects. When the Radix protocol is updated, new functionality may be added, and so discriminated unions returned by the API may need to be updated to have new variants added, corresponding to the updated data. Clients may need to update in advance to be able to handle these new variants when a protocol update comes out. On the very rare occasions we need to make breaking changes to the API, these will be warned in advance with deprecation notices on previous versions. These deprecation notices will include a safe migration path. Deprecation notes or breaking changes will be flagged clearly in release notes for new versions of the Gateway. The Gateway DB schema is not subject to any compatibility guarantees, and may be changed at any release. DB changes will be flagged in the release notes so clients doing custom DB integrations can prepare. + * + * The version of the OpenAPI document: v1.7.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using FileParameter = RadixDlt.NetworkGateway.GatewayApiSdk.Client.FileParameter; +using OpenAPIDateConverter = RadixDlt.NetworkGateway.GatewayApiSdk.Client.OpenAPIDateConverter; + +namespace RadixDlt.NetworkGateway.GatewayApiSdk.Model +{ + /// + /// NativeResourceValidatorClaimNftValueAllOf + /// + [DataContract(Name = "NativeResourceValidatorClaimNftValue_allOf")] + public partial class NativeResourceValidatorClaimNftValueAllOf : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected NativeResourceValidatorClaimNftValueAllOf() { } + /// + /// Initializes a new instance of the class. + /// + /// Bech32m-encoded human readable version of the address. (required). + public NativeResourceValidatorClaimNftValueAllOf(string validatorAddress = default(string)) + { + // to ensure "validatorAddress" is required (not null) + if (validatorAddress == null) + { + throw new ArgumentNullException("validatorAddress is a required property for NativeResourceValidatorClaimNftValueAllOf and cannot be null"); + } + this.ValidatorAddress = validatorAddress; + } + + /// + /// Bech32m-encoded human readable version of the address. + /// + /// Bech32m-encoded human readable version of the address. + [DataMember(Name = "validator_address", IsRequired = true, EmitDefaultValue = true)] + public string ValidatorAddress { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class NativeResourceValidatorClaimNftValueAllOf {\n"); + sb.Append(" ValidatorAddress: ").Append(ValidatorAddress).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as NativeResourceValidatorClaimNftValueAllOf); + } + + /// + /// Returns true if NativeResourceValidatorClaimNftValueAllOf instances are equal + /// + /// Instance of NativeResourceValidatorClaimNftValueAllOf to be compared + /// Boolean + public bool Equals(NativeResourceValidatorClaimNftValueAllOf input) + { + if (input == null) + { + return false; + } + return + ( + this.ValidatorAddress == input.ValidatorAddress || + (this.ValidatorAddress != null && + this.ValidatorAddress.Equals(input.ValidatorAddress)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ValidatorAddress != null) + { + hashCode = (hashCode * 59) + this.ValidatorAddress.GetHashCode(); + } + return hashCode; + } + } + + } + +} diff --git a/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/NativeResourceValidatorLiquidStakeUnitValue.cs b/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/NativeResourceValidatorLiquidStakeUnitValue.cs new file mode 100644 index 000000000..bfdc56ea8 --- /dev/null +++ b/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/NativeResourceValidatorLiquidStakeUnitValue.cs @@ -0,0 +1,252 @@ +/* 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. + */ + +/* + * Radix Gateway API - Babylon + * + * This API is exposed by the Babylon Radix Gateway to enable clients to efficiently query current and historic state on the RadixDLT ledger, and intelligently handle transaction submission. It is designed for use by wallets and explorers, and for light queries from front-end dApps. For exchange/asset integrations, back-end dApp integrations, or simple use cases, you should consider using the Core API on a Node. A Gateway is only needed for reading historic snapshots of ledger states or a more robust set-up. The Gateway API is implemented by the [Network Gateway](https://github.com/radixdlt/babylon-gateway), which is configured to read from [full node(s)](https://github.com/radixdlt/babylon-node) to extract and index data from the network. This document is an API reference documentation, visit [User Guide](https://docs.radixdlt.com/) to learn more about how to run a Gateway of your own. ## Migration guide Please see [the latest release notes](https://github.com/radixdlt/babylon-gateway/releases). ## Integration and forward compatibility guarantees All responses may have additional fields added at any release, so clients are advised to use JSON parsers which ignore unknown fields on JSON objects. When the Radix protocol is updated, new functionality may be added, and so discriminated unions returned by the API may need to be updated to have new variants added, corresponding to the updated data. Clients may need to update in advance to be able to handle these new variants when a protocol update comes out. On the very rare occasions we need to make breaking changes to the API, these will be warned in advance with deprecation notices on previous versions. These deprecation notices will include a safe migration path. Deprecation notes or breaking changes will be flagged clearly in release notes for new versions of the Gateway. The Gateway DB schema is not subject to any compatibility guarantees, and may be changed at any release. DB changes will be flagged in the release notes so clients doing custom DB integrations can prepare. + * + * The version of the OpenAPI document: v1.7.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using JsonSubTypes; +using FileParameter = RadixDlt.NetworkGateway.GatewayApiSdk.Client.FileParameter; +using OpenAPIDateConverter = RadixDlt.NetworkGateway.GatewayApiSdk.Client.OpenAPIDateConverter; + +namespace RadixDlt.NetworkGateway.GatewayApiSdk.Model +{ + /// + /// NativeResourceValidatorLiquidStakeUnitValue + /// + [DataContract(Name = "NativeResourceValidatorLiquidStakeUnitValue")] + [JsonConverter(typeof(JsonSubtypes), "kind")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceAccessControllerRecoveryBadgeValue), "AccessControllerRecoveryBadge")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceAccountOwnerBadgeValue), "AccountOwnerBadge")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceEd25519SignatureResourceValue), "Ed25519SignatureResource")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceGlobalCallerResourceValue), "GlobalCallerResource")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceIdentityOwnerBadgeValue), "IdentityOwnerBadge")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceMultiResourcePoolUnitValue), "MultiResourcePoolUnit")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceOneResourcePoolUnitValue), "OneResourcePoolUnit")] + [JsonSubtypes.KnownSubType(typeof(NativeResourcePackageOfDirectCallerResourceValue), "PackageOfDirectCallerResource")] + [JsonSubtypes.KnownSubType(typeof(NativeResourcePackageOwnerBadgeValue), "PackageOwnerBadge")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceSecp256k1SignatureResourceValue), "Secp256k1SignatureResource")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceSystemExecutionResourceValue), "SystemExecutionResource")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceTwoResourcePoolUnitValue), "TwoResourcePoolUnit")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceValidatorClaimNftValue), "ValidatorClaimNft")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceValidatorLiquidStakeUnitValue), "ValidatorLiquidStakeUnit")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceValidatorOwnerBadgeValue), "ValidatorOwnerBadge")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceXrdValue), "Xrd")] + public partial class NativeResourceValidatorLiquidStakeUnitValue : NativeResourceDetails, IEquatable + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected NativeResourceValidatorLiquidStakeUnitValue() { } + /// + /// Initializes a new instance of the class. + /// + /// Bech32m-encoded human readable version of the address. (required). + /// redemptionResourceCount (required). + /// unitRedemptionValue (required). + /// kind (required) (default to NativeResourceKind.ValidatorLiquidStakeUnit). + public NativeResourceValidatorLiquidStakeUnitValue(string validatorAddress = default(string), int redemptionResourceCount = default(int), List unitRedemptionValue = default(List), NativeResourceKind kind = NativeResourceKind.ValidatorLiquidStakeUnit) : base(kind) + { + // to ensure "validatorAddress" is required (not null) + if (validatorAddress == null) + { + throw new ArgumentNullException("validatorAddress is a required property for NativeResourceValidatorLiquidStakeUnitValue and cannot be null"); + } + this.ValidatorAddress = validatorAddress; + this.RedemptionResourceCount = redemptionResourceCount; + // to ensure "unitRedemptionValue" is required (not null) + if (unitRedemptionValue == null) + { + throw new ArgumentNullException("unitRedemptionValue is a required property for NativeResourceValidatorLiquidStakeUnitValue and cannot be null"); + } + this.UnitRedemptionValue = unitRedemptionValue; + } + + /// + /// Bech32m-encoded human readable version of the address. + /// + /// Bech32m-encoded human readable version of the address. + [DataMember(Name = "validator_address", IsRequired = true, EmitDefaultValue = true)] + public string ValidatorAddress { get; set; } + + /// + /// Gets or Sets RedemptionResourceCount + /// + [DataMember(Name = "redemption_resource_count", IsRequired = true, EmitDefaultValue = true)] + public int RedemptionResourceCount { get; set; } + + /// + /// Gets or Sets UnitRedemptionValue + /// + [DataMember(Name = "unit_redemption_value", IsRequired = true, EmitDefaultValue = true)] + public List UnitRedemptionValue { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class NativeResourceValidatorLiquidStakeUnitValue {\n"); + sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); + sb.Append(" ValidatorAddress: ").Append(ValidatorAddress).Append("\n"); + sb.Append(" RedemptionResourceCount: ").Append(RedemptionResourceCount).Append("\n"); + sb.Append(" UnitRedemptionValue: ").Append(UnitRedemptionValue).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public override string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as NativeResourceValidatorLiquidStakeUnitValue); + } + + /// + /// Returns true if NativeResourceValidatorLiquidStakeUnitValue instances are equal + /// + /// Instance of NativeResourceValidatorLiquidStakeUnitValue to be compared + /// Boolean + public bool Equals(NativeResourceValidatorLiquidStakeUnitValue input) + { + if (input == null) + { + return false; + } + return base.Equals(input) && + ( + this.ValidatorAddress == input.ValidatorAddress || + (this.ValidatorAddress != null && + this.ValidatorAddress.Equals(input.ValidatorAddress)) + ) && base.Equals(input) && + ( + this.RedemptionResourceCount == input.RedemptionResourceCount || + this.RedemptionResourceCount.Equals(input.RedemptionResourceCount) + ) && base.Equals(input) && + ( + this.UnitRedemptionValue == input.UnitRedemptionValue || + this.UnitRedemptionValue != null && + input.UnitRedemptionValue != null && + this.UnitRedemptionValue.SequenceEqual(input.UnitRedemptionValue) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = base.GetHashCode(); + if (this.ValidatorAddress != null) + { + hashCode = (hashCode * 59) + this.ValidatorAddress.GetHashCode(); + } + hashCode = (hashCode * 59) + this.RedemptionResourceCount.GetHashCode(); + if (this.UnitRedemptionValue != null) + { + hashCode = (hashCode * 59) + this.UnitRedemptionValue.GetHashCode(); + } + return hashCode; + } + } + + } + +} diff --git a/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/NativeResourceValidatorLiquidStakeUnitValueAllOf.cs b/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/NativeResourceValidatorLiquidStakeUnitValueAllOf.cs new file mode 100644 index 000000000..6d97decfe --- /dev/null +++ b/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/NativeResourceValidatorLiquidStakeUnitValueAllOf.cs @@ -0,0 +1,232 @@ +/* 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. + */ + +/* + * Radix Gateway API - Babylon + * + * This API is exposed by the Babylon Radix Gateway to enable clients to efficiently query current and historic state on the RadixDLT ledger, and intelligently handle transaction submission. It is designed for use by wallets and explorers, and for light queries from front-end dApps. For exchange/asset integrations, back-end dApp integrations, or simple use cases, you should consider using the Core API on a Node. A Gateway is only needed for reading historic snapshots of ledger states or a more robust set-up. The Gateway API is implemented by the [Network Gateway](https://github.com/radixdlt/babylon-gateway), which is configured to read from [full node(s)](https://github.com/radixdlt/babylon-node) to extract and index data from the network. This document is an API reference documentation, visit [User Guide](https://docs.radixdlt.com/) to learn more about how to run a Gateway of your own. ## Migration guide Please see [the latest release notes](https://github.com/radixdlt/babylon-gateway/releases). ## Integration and forward compatibility guarantees All responses may have additional fields added at any release, so clients are advised to use JSON parsers which ignore unknown fields on JSON objects. When the Radix protocol is updated, new functionality may be added, and so discriminated unions returned by the API may need to be updated to have new variants added, corresponding to the updated data. Clients may need to update in advance to be able to handle these new variants when a protocol update comes out. On the very rare occasions we need to make breaking changes to the API, these will be warned in advance with deprecation notices on previous versions. These deprecation notices will include a safe migration path. Deprecation notes or breaking changes will be flagged clearly in release notes for new versions of the Gateway. The Gateway DB schema is not subject to any compatibility guarantees, and may be changed at any release. DB changes will be flagged in the release notes so clients doing custom DB integrations can prepare. + * + * The version of the OpenAPI document: v1.7.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using FileParameter = RadixDlt.NetworkGateway.GatewayApiSdk.Client.FileParameter; +using OpenAPIDateConverter = RadixDlt.NetworkGateway.GatewayApiSdk.Client.OpenAPIDateConverter; + +namespace RadixDlt.NetworkGateway.GatewayApiSdk.Model +{ + /// + /// NativeResourceValidatorLiquidStakeUnitValueAllOf + /// + [DataContract(Name = "NativeResourceValidatorLiquidStakeUnitValue_allOf")] + public partial class NativeResourceValidatorLiquidStakeUnitValueAllOf : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected NativeResourceValidatorLiquidStakeUnitValueAllOf() { } + /// + /// Initializes a new instance of the class. + /// + /// Bech32m-encoded human readable version of the address. (required). + /// redemptionResourceCount (required). + /// unitRedemptionValue (required). + public NativeResourceValidatorLiquidStakeUnitValueAllOf(string validatorAddress = default(string), int redemptionResourceCount = default(int), List unitRedemptionValue = default(List)) + { + // to ensure "validatorAddress" is required (not null) + if (validatorAddress == null) + { + throw new ArgumentNullException("validatorAddress is a required property for NativeResourceValidatorLiquidStakeUnitValueAllOf and cannot be null"); + } + this.ValidatorAddress = validatorAddress; + this.RedemptionResourceCount = redemptionResourceCount; + // to ensure "unitRedemptionValue" is required (not null) + if (unitRedemptionValue == null) + { + throw new ArgumentNullException("unitRedemptionValue is a required property for NativeResourceValidatorLiquidStakeUnitValueAllOf and cannot be null"); + } + this.UnitRedemptionValue = unitRedemptionValue; + } + + /// + /// Bech32m-encoded human readable version of the address. + /// + /// Bech32m-encoded human readable version of the address. + [DataMember(Name = "validator_address", IsRequired = true, EmitDefaultValue = true)] + public string ValidatorAddress { get; set; } + + /// + /// Gets or Sets RedemptionResourceCount + /// + [DataMember(Name = "redemption_resource_count", IsRequired = true, EmitDefaultValue = true)] + public int RedemptionResourceCount { get; set; } + + /// + /// Gets or Sets UnitRedemptionValue + /// + [DataMember(Name = "unit_redemption_value", IsRequired = true, EmitDefaultValue = true)] + public List UnitRedemptionValue { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class NativeResourceValidatorLiquidStakeUnitValueAllOf {\n"); + sb.Append(" ValidatorAddress: ").Append(ValidatorAddress).Append("\n"); + sb.Append(" RedemptionResourceCount: ").Append(RedemptionResourceCount).Append("\n"); + sb.Append(" UnitRedemptionValue: ").Append(UnitRedemptionValue).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as NativeResourceValidatorLiquidStakeUnitValueAllOf); + } + + /// + /// Returns true if NativeResourceValidatorLiquidStakeUnitValueAllOf instances are equal + /// + /// Instance of NativeResourceValidatorLiquidStakeUnitValueAllOf to be compared + /// Boolean + public bool Equals(NativeResourceValidatorLiquidStakeUnitValueAllOf input) + { + if (input == null) + { + return false; + } + return + ( + this.ValidatorAddress == input.ValidatorAddress || + (this.ValidatorAddress != null && + this.ValidatorAddress.Equals(input.ValidatorAddress)) + ) && + ( + this.RedemptionResourceCount == input.RedemptionResourceCount || + this.RedemptionResourceCount.Equals(input.RedemptionResourceCount) + ) && + ( + this.UnitRedemptionValue == input.UnitRedemptionValue || + this.UnitRedemptionValue != null && + input.UnitRedemptionValue != null && + this.UnitRedemptionValue.SequenceEqual(input.UnitRedemptionValue) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ValidatorAddress != null) + { + hashCode = (hashCode * 59) + this.ValidatorAddress.GetHashCode(); + } + hashCode = (hashCode * 59) + this.RedemptionResourceCount.GetHashCode(); + if (this.UnitRedemptionValue != null) + { + hashCode = (hashCode * 59) + this.UnitRedemptionValue.GetHashCode(); + } + return hashCode; + } + } + + } + +} diff --git a/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/NativeResourceValidatorOwnerBadgeValue.cs b/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/NativeResourceValidatorOwnerBadgeValue.cs new file mode 100644 index 000000000..cb345b5e4 --- /dev/null +++ b/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/NativeResourceValidatorOwnerBadgeValue.cs @@ -0,0 +1,190 @@ +/* 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. + */ + +/* + * Radix Gateway API - Babylon + * + * This API is exposed by the Babylon Radix Gateway to enable clients to efficiently query current and historic state on the RadixDLT ledger, and intelligently handle transaction submission. It is designed for use by wallets and explorers, and for light queries from front-end dApps. For exchange/asset integrations, back-end dApp integrations, or simple use cases, you should consider using the Core API on a Node. A Gateway is only needed for reading historic snapshots of ledger states or a more robust set-up. The Gateway API is implemented by the [Network Gateway](https://github.com/radixdlt/babylon-gateway), which is configured to read from [full node(s)](https://github.com/radixdlt/babylon-node) to extract and index data from the network. This document is an API reference documentation, visit [User Guide](https://docs.radixdlt.com/) to learn more about how to run a Gateway of your own. ## Migration guide Please see [the latest release notes](https://github.com/radixdlt/babylon-gateway/releases). ## Integration and forward compatibility guarantees All responses may have additional fields added at any release, so clients are advised to use JSON parsers which ignore unknown fields on JSON objects. When the Radix protocol is updated, new functionality may be added, and so discriminated unions returned by the API may need to be updated to have new variants added, corresponding to the updated data. Clients may need to update in advance to be able to handle these new variants when a protocol update comes out. On the very rare occasions we need to make breaking changes to the API, these will be warned in advance with deprecation notices on previous versions. These deprecation notices will include a safe migration path. Deprecation notes or breaking changes will be flagged clearly in release notes for new versions of the Gateway. The Gateway DB schema is not subject to any compatibility guarantees, and may be changed at any release. DB changes will be flagged in the release notes so clients doing custom DB integrations can prepare. + * + * The version of the OpenAPI document: v1.7.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using JsonSubTypes; +using FileParameter = RadixDlt.NetworkGateway.GatewayApiSdk.Client.FileParameter; +using OpenAPIDateConverter = RadixDlt.NetworkGateway.GatewayApiSdk.Client.OpenAPIDateConverter; + +namespace RadixDlt.NetworkGateway.GatewayApiSdk.Model +{ + /// + /// NativeResourceValidatorOwnerBadgeValue + /// + [DataContract(Name = "NativeResourceValidatorOwnerBadgeValue")] + [JsonConverter(typeof(JsonSubtypes), "kind")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceAccessControllerRecoveryBadgeValue), "AccessControllerRecoveryBadge")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceAccountOwnerBadgeValue), "AccountOwnerBadge")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceEd25519SignatureResourceValue), "Ed25519SignatureResource")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceGlobalCallerResourceValue), "GlobalCallerResource")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceIdentityOwnerBadgeValue), "IdentityOwnerBadge")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceMultiResourcePoolUnitValue), "MultiResourcePoolUnit")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceOneResourcePoolUnitValue), "OneResourcePoolUnit")] + [JsonSubtypes.KnownSubType(typeof(NativeResourcePackageOfDirectCallerResourceValue), "PackageOfDirectCallerResource")] + [JsonSubtypes.KnownSubType(typeof(NativeResourcePackageOwnerBadgeValue), "PackageOwnerBadge")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceSecp256k1SignatureResourceValue), "Secp256k1SignatureResource")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceSystemExecutionResourceValue), "SystemExecutionResource")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceTwoResourcePoolUnitValue), "TwoResourcePoolUnit")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceValidatorClaimNftValue), "ValidatorClaimNft")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceValidatorLiquidStakeUnitValue), "ValidatorLiquidStakeUnit")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceValidatorOwnerBadgeValue), "ValidatorOwnerBadge")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceXrdValue), "Xrd")] + public partial class NativeResourceValidatorOwnerBadgeValue : NativeResourceDetails, IEquatable + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected NativeResourceValidatorOwnerBadgeValue() { } + /// + /// Initializes a new instance of the class. + /// + /// kind (required) (default to NativeResourceKind.ValidatorOwnerBadge). + public NativeResourceValidatorOwnerBadgeValue(NativeResourceKind kind = NativeResourceKind.ValidatorOwnerBadge) : base(kind) + { + } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class NativeResourceValidatorOwnerBadgeValue {\n"); + sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public override string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as NativeResourceValidatorOwnerBadgeValue); + } + + /// + /// Returns true if NativeResourceValidatorOwnerBadgeValue instances are equal + /// + /// Instance of NativeResourceValidatorOwnerBadgeValue to be compared + /// Boolean + public bool Equals(NativeResourceValidatorOwnerBadgeValue input) + { + if (input == null) + { + return false; + } + return base.Equals(input); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = base.GetHashCode(); + return hashCode; + } + } + + } + +} diff --git a/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/NativeResourceXrdValue.cs b/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/NativeResourceXrdValue.cs new file mode 100644 index 000000000..9dd458352 --- /dev/null +++ b/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/NativeResourceXrdValue.cs @@ -0,0 +1,190 @@ +/* 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. + */ + +/* + * Radix Gateway API - Babylon + * + * This API is exposed by the Babylon Radix Gateway to enable clients to efficiently query current and historic state on the RadixDLT ledger, and intelligently handle transaction submission. It is designed for use by wallets and explorers, and for light queries from front-end dApps. For exchange/asset integrations, back-end dApp integrations, or simple use cases, you should consider using the Core API on a Node. A Gateway is only needed for reading historic snapshots of ledger states or a more robust set-up. The Gateway API is implemented by the [Network Gateway](https://github.com/radixdlt/babylon-gateway), which is configured to read from [full node(s)](https://github.com/radixdlt/babylon-node) to extract and index data from the network. This document is an API reference documentation, visit [User Guide](https://docs.radixdlt.com/) to learn more about how to run a Gateway of your own. ## Migration guide Please see [the latest release notes](https://github.com/radixdlt/babylon-gateway/releases). ## Integration and forward compatibility guarantees All responses may have additional fields added at any release, so clients are advised to use JSON parsers which ignore unknown fields on JSON objects. When the Radix protocol is updated, new functionality may be added, and so discriminated unions returned by the API may need to be updated to have new variants added, corresponding to the updated data. Clients may need to update in advance to be able to handle these new variants when a protocol update comes out. On the very rare occasions we need to make breaking changes to the API, these will be warned in advance with deprecation notices on previous versions. These deprecation notices will include a safe migration path. Deprecation notes or breaking changes will be flagged clearly in release notes for new versions of the Gateway. The Gateway DB schema is not subject to any compatibility guarantees, and may be changed at any release. DB changes will be flagged in the release notes so clients doing custom DB integrations can prepare. + * + * The version of the OpenAPI document: v1.7.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using JsonSubTypes; +using FileParameter = RadixDlt.NetworkGateway.GatewayApiSdk.Client.FileParameter; +using OpenAPIDateConverter = RadixDlt.NetworkGateway.GatewayApiSdk.Client.OpenAPIDateConverter; + +namespace RadixDlt.NetworkGateway.GatewayApiSdk.Model +{ + /// + /// NativeResourceXrdValue + /// + [DataContract(Name = "NativeResourceXrdValue")] + [JsonConverter(typeof(JsonSubtypes), "kind")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceAccessControllerRecoveryBadgeValue), "AccessControllerRecoveryBadge")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceAccountOwnerBadgeValue), "AccountOwnerBadge")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceEd25519SignatureResourceValue), "Ed25519SignatureResource")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceGlobalCallerResourceValue), "GlobalCallerResource")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceIdentityOwnerBadgeValue), "IdentityOwnerBadge")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceMultiResourcePoolUnitValue), "MultiResourcePoolUnit")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceOneResourcePoolUnitValue), "OneResourcePoolUnit")] + [JsonSubtypes.KnownSubType(typeof(NativeResourcePackageOfDirectCallerResourceValue), "PackageOfDirectCallerResource")] + [JsonSubtypes.KnownSubType(typeof(NativeResourcePackageOwnerBadgeValue), "PackageOwnerBadge")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceSecp256k1SignatureResourceValue), "Secp256k1SignatureResource")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceSystemExecutionResourceValue), "SystemExecutionResource")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceTwoResourcePoolUnitValue), "TwoResourcePoolUnit")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceValidatorClaimNftValue), "ValidatorClaimNft")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceValidatorLiquidStakeUnitValue), "ValidatorLiquidStakeUnit")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceValidatorOwnerBadgeValue), "ValidatorOwnerBadge")] + [JsonSubtypes.KnownSubType(typeof(NativeResourceXrdValue), "Xrd")] + public partial class NativeResourceXrdValue : NativeResourceDetails, IEquatable + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected NativeResourceXrdValue() { } + /// + /// Initializes a new instance of the class. + /// + /// kind (required) (default to NativeResourceKind.Xrd). + public NativeResourceXrdValue(NativeResourceKind kind = NativeResourceKind.Xrd) : base(kind) + { + } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class NativeResourceXrdValue {\n"); + sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public override string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as NativeResourceXrdValue); + } + + /// + /// Returns true if NativeResourceXrdValue instances are equal + /// + /// Instance of NativeResourceXrdValue to be compared + /// Boolean + public bool Equals(NativeResourceXrdValue input) + { + if (input == null) + { + return false; + } + return base.Equals(input); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = base.GetHashCode(); + return hashCode; + } + } + + } + +} diff --git a/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/StateEntityDetailsOptIns.cs b/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/StateEntityDetailsOptIns.cs index d257b0115..90ecbfc3a 100644 --- a/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/StateEntityDetailsOptIns.cs +++ b/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/StateEntityDetailsOptIns.cs @@ -105,7 +105,8 @@ public partial class StateEntityDetailsOptIns : IEquatableif 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. (default to false). /// allows specifying explicitly metadata properties which should be returned in response.. /// if set to `true`, on-ledger dApp two-way links (resolved & verified) are returned. See https://docs.radixdlt.com/docs/metadata-for-verification for more details. (default to false). - public StateEntityDetailsOptIns(bool ancestorIdentities = false, bool componentRoyaltyConfig = false, bool componentRoyaltyVaultBalance = false, bool packageRoyaltyVaultBalance = false, bool nonFungibleIncludeNfids = false, List explicitMetadata = default(List), bool dappTwoWayLinks = false) + /// if set to `true`, additional details for the Network native resources are returned. (default to false). + public StateEntityDetailsOptIns(bool ancestorIdentities = false, bool componentRoyaltyConfig = false, bool componentRoyaltyVaultBalance = false, bool packageRoyaltyVaultBalance = false, bool nonFungibleIncludeNfids = false, List explicitMetadata = default(List), bool dappTwoWayLinks = false, bool nativeResourceDetails = false) { this.AncestorIdentities = ancestorIdentities; this.ComponentRoyaltyConfig = componentRoyaltyConfig; @@ -114,6 +115,7 @@ public partial class StateEntityDetailsOptIns : IEquatable @@ -165,6 +167,13 @@ public partial class StateEntityDetailsOptIns : IEquatable + /// if set to `true`, additional details for the Network native resources are returned. + /// + /// if set to `true`, additional details for the Network native resources are returned. + [DataMember(Name = "native_resource_details", EmitDefaultValue = true)] + public bool NativeResourceDetails { get; set; } + /// /// Returns the string presentation of the object /// @@ -180,6 +189,7 @@ public override string ToString() sb.Append(" NonFungibleIncludeNfids: ").Append(NonFungibleIncludeNfids).Append("\n"); sb.Append(" ExplicitMetadata: ").Append(ExplicitMetadata).Append("\n"); sb.Append(" DappTwoWayLinks: ").Append(DappTwoWayLinks).Append("\n"); + sb.Append(" NativeResourceDetails: ").Append(NativeResourceDetails).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -244,6 +254,10 @@ public bool Equals(StateEntityDetailsOptIns input) ( this.DappTwoWayLinks == input.DappTwoWayLinks || this.DappTwoWayLinks.Equals(input.DappTwoWayLinks) + ) && + ( + this.NativeResourceDetails == input.NativeResourceDetails || + this.NativeResourceDetails.Equals(input.NativeResourceDetails) ); } @@ -266,6 +280,7 @@ public override int GetHashCode() hashCode = (hashCode * 59) + this.ExplicitMetadata.GetHashCode(); } hashCode = (hashCode * 59) + this.DappTwoWayLinks.GetHashCode(); + hashCode = (hashCode * 59) + this.NativeResourceDetails.GetHashCode(); return hashCode; } } diff --git a/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/StateEntityDetailsResponseComponentDetails.cs b/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/StateEntityDetailsResponseComponentDetails.cs index b19964ae6..f419610aa 100644 --- a/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/StateEntityDetailsResponseComponentDetails.cs +++ b/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/StateEntityDetailsResponseComponentDetails.cs @@ -120,8 +120,9 @@ protected StateEntityDetailsResponseComponentDetails() { } /// royaltyConfig. /// Bech32m-encoded human readable version of the address.. /// twoWayLinkedDappDetails. + /// nativeResourceDetails. /// type (required) (default to StateEntityDetailsResponseItemDetailsType.Component). - public StateEntityDetailsResponseComponentDetails(string packageAddress = default(string), string blueprintName = default(string), string blueprintVersion = default(string), Object state = default(Object), ComponentEntityRoleAssignments roleAssignments = default(ComponentEntityRoleAssignments), string royaltyVaultBalance = default(string), ComponentRoyaltyConfig royaltyConfig = default(ComponentRoyaltyConfig), string twoWayLinkedDappAddress = default(string), TwoWayLinkedDappOnLedgerDetails twoWayLinkedDappDetails = default(TwoWayLinkedDappOnLedgerDetails), StateEntityDetailsResponseItemDetailsType type = StateEntityDetailsResponseItemDetailsType.Component) : base(type) + public StateEntityDetailsResponseComponentDetails(string packageAddress = default(string), string blueprintName = default(string), string blueprintVersion = default(string), Object state = default(Object), ComponentEntityRoleAssignments roleAssignments = default(ComponentEntityRoleAssignments), string royaltyVaultBalance = default(string), ComponentRoyaltyConfig royaltyConfig = default(ComponentRoyaltyConfig), string twoWayLinkedDappAddress = default(string), TwoWayLinkedDappOnLedgerDetails twoWayLinkedDappDetails = default(TwoWayLinkedDappOnLedgerDetails), NativeResourceDetails nativeResourceDetails = default(NativeResourceDetails), StateEntityDetailsResponseItemDetailsType type = StateEntityDetailsResponseItemDetailsType.Component) : base(type) { // to ensure "blueprintName" is required (not null) if (blueprintName == null) @@ -142,6 +143,7 @@ protected StateEntityDetailsResponseComponentDetails() { } this.RoyaltyConfig = royaltyConfig; this.TwoWayLinkedDappAddress = twoWayLinkedDappAddress; this.TwoWayLinkedDappDetails = twoWayLinkedDappDetails; + this.NativeResourceDetails = nativeResourceDetails; } /// @@ -202,6 +204,12 @@ protected StateEntityDetailsResponseComponentDetails() { } [DataMember(Name = "two_way_linked_dapp_details", EmitDefaultValue = true)] public TwoWayLinkedDappOnLedgerDetails TwoWayLinkedDappDetails { get; set; } + /// + /// Gets or Sets NativeResourceDetails + /// + [DataMember(Name = "native_resource_details", EmitDefaultValue = true)] + public NativeResourceDetails NativeResourceDetails { get; set; } + /// /// Returns the string presentation of the object /// @@ -220,6 +228,7 @@ public override string ToString() sb.Append(" RoyaltyConfig: ").Append(RoyaltyConfig).Append("\n"); sb.Append(" TwoWayLinkedDappAddress: ").Append(TwoWayLinkedDappAddress).Append("\n"); sb.Append(" TwoWayLinkedDappDetails: ").Append(TwoWayLinkedDappDetails).Append("\n"); + sb.Append(" NativeResourceDetails: ").Append(NativeResourceDetails).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -299,6 +308,11 @@ public bool Equals(StateEntityDetailsResponseComponentDetails input) this.TwoWayLinkedDappDetails == input.TwoWayLinkedDappDetails || (this.TwoWayLinkedDappDetails != null && this.TwoWayLinkedDappDetails.Equals(input.TwoWayLinkedDappDetails)) + ) && base.Equals(input) && + ( + this.NativeResourceDetails == input.NativeResourceDetails || + (this.NativeResourceDetails != null && + this.NativeResourceDetails.Equals(input.NativeResourceDetails)) ); } @@ -347,6 +361,10 @@ public override int GetHashCode() { hashCode = (hashCode * 59) + this.TwoWayLinkedDappDetails.GetHashCode(); } + if (this.NativeResourceDetails != null) + { + hashCode = (hashCode * 59) + this.NativeResourceDetails.GetHashCode(); + } return hashCode; } } diff --git a/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/StateEntityDetailsResponseComponentDetailsAllOf.cs b/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/StateEntityDetailsResponseComponentDetailsAllOf.cs index eccc6b127..d12f19d5d 100644 --- a/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/StateEntityDetailsResponseComponentDetailsAllOf.cs +++ b/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/StateEntityDetailsResponseComponentDetailsAllOf.cs @@ -112,7 +112,8 @@ protected StateEntityDetailsResponseComponentDetailsAllOf() { } /// royaltyConfig. /// Bech32m-encoded human readable version of the address.. /// twoWayLinkedDappDetails. - public StateEntityDetailsResponseComponentDetailsAllOf(string packageAddress = default(string), string blueprintName = default(string), string blueprintVersion = default(string), Object state = default(Object), ComponentEntityRoleAssignments roleAssignments = default(ComponentEntityRoleAssignments), string royaltyVaultBalance = default(string), ComponentRoyaltyConfig royaltyConfig = default(ComponentRoyaltyConfig), string twoWayLinkedDappAddress = default(string), TwoWayLinkedDappOnLedgerDetails twoWayLinkedDappDetails = default(TwoWayLinkedDappOnLedgerDetails)) + /// nativeResourceDetails. + public StateEntityDetailsResponseComponentDetailsAllOf(string packageAddress = default(string), string blueprintName = default(string), string blueprintVersion = default(string), Object state = default(Object), ComponentEntityRoleAssignments roleAssignments = default(ComponentEntityRoleAssignments), string royaltyVaultBalance = default(string), ComponentRoyaltyConfig royaltyConfig = default(ComponentRoyaltyConfig), string twoWayLinkedDappAddress = default(string), TwoWayLinkedDappOnLedgerDetails twoWayLinkedDappDetails = default(TwoWayLinkedDappOnLedgerDetails), NativeResourceDetails nativeResourceDetails = default(NativeResourceDetails)) { // to ensure "blueprintName" is required (not null) if (blueprintName == null) @@ -133,6 +134,7 @@ protected StateEntityDetailsResponseComponentDetailsAllOf() { } this.RoyaltyConfig = royaltyConfig; this.TwoWayLinkedDappAddress = twoWayLinkedDappAddress; this.TwoWayLinkedDappDetails = twoWayLinkedDappDetails; + this.NativeResourceDetails = nativeResourceDetails; } /// @@ -193,6 +195,12 @@ protected StateEntityDetailsResponseComponentDetailsAllOf() { } [DataMember(Name = "two_way_linked_dapp_details", EmitDefaultValue = true)] public TwoWayLinkedDappOnLedgerDetails TwoWayLinkedDappDetails { get; set; } + /// + /// Gets or Sets NativeResourceDetails + /// + [DataMember(Name = "native_resource_details", EmitDefaultValue = true)] + public NativeResourceDetails NativeResourceDetails { get; set; } + /// /// Returns the string presentation of the object /// @@ -210,6 +218,7 @@ public override string ToString() sb.Append(" RoyaltyConfig: ").Append(RoyaltyConfig).Append("\n"); sb.Append(" TwoWayLinkedDappAddress: ").Append(TwoWayLinkedDappAddress).Append("\n"); sb.Append(" TwoWayLinkedDappDetails: ").Append(TwoWayLinkedDappDetails).Append("\n"); + sb.Append(" NativeResourceDetails: ").Append(NativeResourceDetails).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -289,6 +298,11 @@ public bool Equals(StateEntityDetailsResponseComponentDetailsAllOf input) this.TwoWayLinkedDappDetails == input.TwoWayLinkedDappDetails || (this.TwoWayLinkedDappDetails != null && this.TwoWayLinkedDappDetails.Equals(input.TwoWayLinkedDappDetails)) + ) && + ( + this.NativeResourceDetails == input.NativeResourceDetails || + (this.NativeResourceDetails != null && + this.NativeResourceDetails.Equals(input.NativeResourceDetails)) ); } @@ -337,6 +351,10 @@ public override int GetHashCode() { hashCode = (hashCode * 59) + this.TwoWayLinkedDappDetails.GetHashCode(); } + if (this.NativeResourceDetails != null) + { + hashCode = (hashCode * 59) + this.NativeResourceDetails.GetHashCode(); + } return hashCode; } } diff --git a/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/StateEntityDetailsResponseFungibleResourceDetails.cs b/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/StateEntityDetailsResponseFungibleResourceDetails.cs index 5d3b9ae90..512f643b4 100644 --- a/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/StateEntityDetailsResponseFungibleResourceDetails.cs +++ b/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/StateEntityDetailsResponseFungibleResourceDetails.cs @@ -117,8 +117,9 @@ protected StateEntityDetailsResponseFungibleResourceDetails() { } /// String-encoded decimal representing the amount of a related fungible resource. (required). /// String-encoded decimal representing the amount of a related fungible resource. (required). /// twoWayLinkedDapps. + /// nativeResourceDetails. /// type (required) (default to StateEntityDetailsResponseItemDetailsType.FungibleResource). - public StateEntityDetailsResponseFungibleResourceDetails(ComponentEntityRoleAssignments roleAssignments = default(ComponentEntityRoleAssignments), int divisibility = default(int), string totalSupply = default(string), string totalMinted = default(string), string totalBurned = default(string), TwoWayLinkedDappsCollection twoWayLinkedDapps = default(TwoWayLinkedDappsCollection), StateEntityDetailsResponseItemDetailsType type = StateEntityDetailsResponseItemDetailsType.FungibleResource) : base(type) + public StateEntityDetailsResponseFungibleResourceDetails(ComponentEntityRoleAssignments roleAssignments = default(ComponentEntityRoleAssignments), int divisibility = default(int), string totalSupply = default(string), string totalMinted = default(string), string totalBurned = default(string), TwoWayLinkedDappsCollection twoWayLinkedDapps = default(TwoWayLinkedDappsCollection), NativeResourceDetails nativeResourceDetails = default(NativeResourceDetails), StateEntityDetailsResponseItemDetailsType type = StateEntityDetailsResponseItemDetailsType.FungibleResource) : base(type) { // to ensure "roleAssignments" is required (not null) if (roleAssignments == null) @@ -146,6 +147,7 @@ protected StateEntityDetailsResponseFungibleResourceDetails() { } } this.TotalBurned = totalBurned; this.TwoWayLinkedDapps = twoWayLinkedDapps; + this.NativeResourceDetails = nativeResourceDetails; } /// @@ -187,6 +189,12 @@ protected StateEntityDetailsResponseFungibleResourceDetails() { } [DataMember(Name = "two_way_linked_dapps", EmitDefaultValue = true)] public TwoWayLinkedDappsCollection TwoWayLinkedDapps { get; set; } + /// + /// Gets or Sets NativeResourceDetails + /// + [DataMember(Name = "native_resource_details", EmitDefaultValue = true)] + public NativeResourceDetails NativeResourceDetails { get; set; } + /// /// Returns the string presentation of the object /// @@ -202,6 +210,7 @@ public override string ToString() sb.Append(" TotalMinted: ").Append(TotalMinted).Append("\n"); sb.Append(" TotalBurned: ").Append(TotalBurned).Append("\n"); sb.Append(" TwoWayLinkedDapps: ").Append(TwoWayLinkedDapps).Append("\n"); + sb.Append(" NativeResourceDetails: ").Append(NativeResourceDetails).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -265,6 +274,11 @@ public bool Equals(StateEntityDetailsResponseFungibleResourceDetails input) this.TwoWayLinkedDapps == input.TwoWayLinkedDapps || (this.TwoWayLinkedDapps != null && this.TwoWayLinkedDapps.Equals(input.TwoWayLinkedDapps)) + ) && base.Equals(input) && + ( + this.NativeResourceDetails == input.NativeResourceDetails || + (this.NativeResourceDetails != null && + this.NativeResourceDetails.Equals(input.NativeResourceDetails)) ); } @@ -298,6 +312,10 @@ public override int GetHashCode() { hashCode = (hashCode * 59) + this.TwoWayLinkedDapps.GetHashCode(); } + if (this.NativeResourceDetails != null) + { + hashCode = (hashCode * 59) + this.NativeResourceDetails.GetHashCode(); + } return hashCode; } } diff --git a/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/StateEntityDetailsResponseFungibleResourceDetailsAllOf.cs b/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/StateEntityDetailsResponseFungibleResourceDetailsAllOf.cs index e54c25da1..12985e4f0 100644 --- a/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/StateEntityDetailsResponseFungibleResourceDetailsAllOf.cs +++ b/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/StateEntityDetailsResponseFungibleResourceDetailsAllOf.cs @@ -109,7 +109,8 @@ protected StateEntityDetailsResponseFungibleResourceDetailsAllOf() { } /// String-encoded decimal representing the amount of a related fungible resource. (required). /// String-encoded decimal representing the amount of a related fungible resource. (required). /// twoWayLinkedDapps. - public StateEntityDetailsResponseFungibleResourceDetailsAllOf(ComponentEntityRoleAssignments roleAssignments = default(ComponentEntityRoleAssignments), int divisibility = default(int), string totalSupply = default(string), string totalMinted = default(string), string totalBurned = default(string), TwoWayLinkedDappsCollection twoWayLinkedDapps = default(TwoWayLinkedDappsCollection)) + /// nativeResourceDetails. + public StateEntityDetailsResponseFungibleResourceDetailsAllOf(ComponentEntityRoleAssignments roleAssignments = default(ComponentEntityRoleAssignments), int divisibility = default(int), string totalSupply = default(string), string totalMinted = default(string), string totalBurned = default(string), TwoWayLinkedDappsCollection twoWayLinkedDapps = default(TwoWayLinkedDappsCollection), NativeResourceDetails nativeResourceDetails = default(NativeResourceDetails)) { // to ensure "roleAssignments" is required (not null) if (roleAssignments == null) @@ -137,6 +138,7 @@ protected StateEntityDetailsResponseFungibleResourceDetailsAllOf() { } } this.TotalBurned = totalBurned; this.TwoWayLinkedDapps = twoWayLinkedDapps; + this.NativeResourceDetails = nativeResourceDetails; } /// @@ -178,6 +180,12 @@ protected StateEntityDetailsResponseFungibleResourceDetailsAllOf() { } [DataMember(Name = "two_way_linked_dapps", EmitDefaultValue = true)] public TwoWayLinkedDappsCollection TwoWayLinkedDapps { get; set; } + /// + /// Gets or Sets NativeResourceDetails + /// + [DataMember(Name = "native_resource_details", EmitDefaultValue = true)] + public NativeResourceDetails NativeResourceDetails { get; set; } + /// /// Returns the string presentation of the object /// @@ -192,6 +200,7 @@ public override string ToString() sb.Append(" TotalMinted: ").Append(TotalMinted).Append("\n"); sb.Append(" TotalBurned: ").Append(TotalBurned).Append("\n"); sb.Append(" TwoWayLinkedDapps: ").Append(TwoWayLinkedDapps).Append("\n"); + sb.Append(" NativeResourceDetails: ").Append(NativeResourceDetails).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -255,6 +264,11 @@ public bool Equals(StateEntityDetailsResponseFungibleResourceDetailsAllOf input) this.TwoWayLinkedDapps == input.TwoWayLinkedDapps || (this.TwoWayLinkedDapps != null && this.TwoWayLinkedDapps.Equals(input.TwoWayLinkedDapps)) + ) && + ( + this.NativeResourceDetails == input.NativeResourceDetails || + (this.NativeResourceDetails != null && + this.NativeResourceDetails.Equals(input.NativeResourceDetails)) ); } @@ -288,6 +302,10 @@ public override int GetHashCode() { hashCode = (hashCode * 59) + this.TwoWayLinkedDapps.GetHashCode(); } + if (this.NativeResourceDetails != null) + { + hashCode = (hashCode * 59) + this.NativeResourceDetails.GetHashCode(); + } return hashCode; } } diff --git a/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/StateEntityDetailsResponseNonFungibleResourceDetails.cs b/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/StateEntityDetailsResponseNonFungibleResourceDetails.cs index 44e2264d2..8598b092d 100644 --- a/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/StateEntityDetailsResponseNonFungibleResourceDetails.cs +++ b/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/StateEntityDetailsResponseNonFungibleResourceDetails.cs @@ -124,8 +124,9 @@ protected StateEntityDetailsResponseNonFungibleResourceDetails() { } /// String-encoded decimal representing the amount of a related fungible resource. (required). /// nonFungibleDataMutableFields (required). /// twoWayLinkedDapps. + /// nativeResourceDetails. /// type (required) (default to StateEntityDetailsResponseItemDetailsType.NonFungibleResource). - public StateEntityDetailsResponseNonFungibleResourceDetails(ComponentEntityRoleAssignments roleAssignments = default(ComponentEntityRoleAssignments), NonFungibleIdType nonFungibleIdType = default(NonFungibleIdType), string totalSupply = default(string), string totalMinted = default(string), string totalBurned = default(string), List nonFungibleDataMutableFields = default(List), TwoWayLinkedDappsCollection twoWayLinkedDapps = default(TwoWayLinkedDappsCollection), StateEntityDetailsResponseItemDetailsType type = StateEntityDetailsResponseItemDetailsType.NonFungibleResource) : base(type) + public StateEntityDetailsResponseNonFungibleResourceDetails(ComponentEntityRoleAssignments roleAssignments = default(ComponentEntityRoleAssignments), NonFungibleIdType nonFungibleIdType = default(NonFungibleIdType), string totalSupply = default(string), string totalMinted = default(string), string totalBurned = default(string), List nonFungibleDataMutableFields = default(List), TwoWayLinkedDappsCollection twoWayLinkedDapps = default(TwoWayLinkedDappsCollection), NativeResourceDetails nativeResourceDetails = default(NativeResourceDetails), StateEntityDetailsResponseItemDetailsType type = StateEntityDetailsResponseItemDetailsType.NonFungibleResource) : base(type) { // to ensure "roleAssignments" is required (not null) if (roleAssignments == null) @@ -159,6 +160,7 @@ protected StateEntityDetailsResponseNonFungibleResourceDetails() { } } this.NonFungibleDataMutableFields = nonFungibleDataMutableFields; this.TwoWayLinkedDapps = twoWayLinkedDapps; + this.NativeResourceDetails = nativeResourceDetails; } /// @@ -200,6 +202,12 @@ protected StateEntityDetailsResponseNonFungibleResourceDetails() { } [DataMember(Name = "two_way_linked_dapps", EmitDefaultValue = true)] public TwoWayLinkedDappsCollection TwoWayLinkedDapps { get; set; } + /// + /// Gets or Sets NativeResourceDetails + /// + [DataMember(Name = "native_resource_details", EmitDefaultValue = true)] + public NativeResourceDetails NativeResourceDetails { get; set; } + /// /// Returns the string presentation of the object /// @@ -216,6 +224,7 @@ public override string ToString() sb.Append(" TotalBurned: ").Append(TotalBurned).Append("\n"); sb.Append(" NonFungibleDataMutableFields: ").Append(NonFungibleDataMutableFields).Append("\n"); sb.Append(" TwoWayLinkedDapps: ").Append(TwoWayLinkedDapps).Append("\n"); + sb.Append(" NativeResourceDetails: ").Append(NativeResourceDetails).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -285,6 +294,11 @@ public bool Equals(StateEntityDetailsResponseNonFungibleResourceDetails input) this.TwoWayLinkedDapps == input.TwoWayLinkedDapps || (this.TwoWayLinkedDapps != null && this.TwoWayLinkedDapps.Equals(input.TwoWayLinkedDapps)) + ) && base.Equals(input) && + ( + this.NativeResourceDetails == input.NativeResourceDetails || + (this.NativeResourceDetails != null && + this.NativeResourceDetails.Equals(input.NativeResourceDetails)) ); } @@ -322,6 +336,10 @@ public override int GetHashCode() { hashCode = (hashCode * 59) + this.TwoWayLinkedDapps.GetHashCode(); } + if (this.NativeResourceDetails != null) + { + hashCode = (hashCode * 59) + this.NativeResourceDetails.GetHashCode(); + } return hashCode; } } diff --git a/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/StateEntityDetailsResponseNonFungibleResourceDetailsAllOf.cs b/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/StateEntityDetailsResponseNonFungibleResourceDetailsAllOf.cs index 28d66ba23..041834950 100644 --- a/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/StateEntityDetailsResponseNonFungibleResourceDetailsAllOf.cs +++ b/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/StateEntityDetailsResponseNonFungibleResourceDetailsAllOf.cs @@ -116,7 +116,8 @@ protected StateEntityDetailsResponseNonFungibleResourceDetailsAllOf() { } /// String-encoded decimal representing the amount of a related fungible resource. (required). /// nonFungibleDataMutableFields (required). /// twoWayLinkedDapps. - public StateEntityDetailsResponseNonFungibleResourceDetailsAllOf(ComponentEntityRoleAssignments roleAssignments = default(ComponentEntityRoleAssignments), NonFungibleIdType nonFungibleIdType = default(NonFungibleIdType), string totalSupply = default(string), string totalMinted = default(string), string totalBurned = default(string), List nonFungibleDataMutableFields = default(List), TwoWayLinkedDappsCollection twoWayLinkedDapps = default(TwoWayLinkedDappsCollection)) + /// nativeResourceDetails. + public StateEntityDetailsResponseNonFungibleResourceDetailsAllOf(ComponentEntityRoleAssignments roleAssignments = default(ComponentEntityRoleAssignments), NonFungibleIdType nonFungibleIdType = default(NonFungibleIdType), string totalSupply = default(string), string totalMinted = default(string), string totalBurned = default(string), List nonFungibleDataMutableFields = default(List), TwoWayLinkedDappsCollection twoWayLinkedDapps = default(TwoWayLinkedDappsCollection), NativeResourceDetails nativeResourceDetails = default(NativeResourceDetails)) { // to ensure "roleAssignments" is required (not null) if (roleAssignments == null) @@ -150,6 +151,7 @@ protected StateEntityDetailsResponseNonFungibleResourceDetailsAllOf() { } } this.NonFungibleDataMutableFields = nonFungibleDataMutableFields; this.TwoWayLinkedDapps = twoWayLinkedDapps; + this.NativeResourceDetails = nativeResourceDetails; } /// @@ -191,6 +193,12 @@ protected StateEntityDetailsResponseNonFungibleResourceDetailsAllOf() { } [DataMember(Name = "two_way_linked_dapps", EmitDefaultValue = true)] public TwoWayLinkedDappsCollection TwoWayLinkedDapps { get; set; } + /// + /// Gets or Sets NativeResourceDetails + /// + [DataMember(Name = "native_resource_details", EmitDefaultValue = true)] + public NativeResourceDetails NativeResourceDetails { get; set; } + /// /// Returns the string presentation of the object /// @@ -206,6 +214,7 @@ public override string ToString() sb.Append(" TotalBurned: ").Append(TotalBurned).Append("\n"); sb.Append(" NonFungibleDataMutableFields: ").Append(NonFungibleDataMutableFields).Append("\n"); sb.Append(" TwoWayLinkedDapps: ").Append(TwoWayLinkedDapps).Append("\n"); + sb.Append(" NativeResourceDetails: ").Append(NativeResourceDetails).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -275,6 +284,11 @@ public bool Equals(StateEntityDetailsResponseNonFungibleResourceDetailsAllOf inp this.TwoWayLinkedDapps == input.TwoWayLinkedDapps || (this.TwoWayLinkedDapps != null && this.TwoWayLinkedDapps.Equals(input.TwoWayLinkedDapps)) + ) && + ( + this.NativeResourceDetails == input.NativeResourceDetails || + (this.NativeResourceDetails != null && + this.NativeResourceDetails.Equals(input.NativeResourceDetails)) ); } @@ -312,6 +326,10 @@ public override int GetHashCode() { hashCode = (hashCode * 59) + this.TwoWayLinkedDapps.GetHashCode(); } + if (this.NativeResourceDetails != null) + { + hashCode = (hashCode * 59) + this.NativeResourceDetails.GetHashCode(); + } return hashCode; } } diff --git a/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/StateKeyValueStoreDataRequestKeyItem.cs b/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/StateKeyValueStoreDataRequestKeyItem.cs index 6394521e0..ddaef8d13 100644 --- a/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/StateKeyValueStoreDataRequestKeyItem.cs +++ b/src/RadixDlt.NetworkGateway.GatewayApiSdk/generated/Model/StateKeyValueStoreDataRequestKeyItem.cs @@ -90,7 +90,7 @@ namespace RadixDlt.NetworkGateway.GatewayApiSdk.Model { /// - /// StateKeyValueStoreDataRequestKeyItem + /// Provide either `key_hex` or `key_json`. If both are provided, `key_hex` is used and `key_json` is ignored. /// [DataContract(Name = "StateKeyValueStoreDataRequestKeyItem")] public partial class StateKeyValueStoreDataRequestKeyItem : IEquatable diff --git a/src/RadixDlt.NetworkGateway.PostgresIntegration/LedgerExtension/RelationshipProcessor.cs b/src/RadixDlt.NetworkGateway.PostgresIntegration/LedgerExtension/RelationshipProcessor.cs index b250c83b0..0d817f355 100644 --- a/src/RadixDlt.NetworkGateway.PostgresIntegration/LedgerExtension/RelationshipProcessor.cs +++ b/src/RadixDlt.NetworkGateway.PostgresIntegration/LedgerExtension/RelationshipProcessor.cs @@ -87,7 +87,7 @@ public void ScanUpsert(CoreModel.Substate substateData, ReferencedEntity referen .Get((EntityAddress)rv.EntityAddress) .PostResolveConfigure((InternalFungibleVaultEntity e) => { - e.AddCorrelation(EntityRelationship.VaultRoyalty, referencedEntity.DatabaseId); + e.AddCorrelation(EntityRelationship.RoyaltyVaultOfComponent, referencedEntity.DatabaseId); }); } @@ -95,14 +95,14 @@ public void ScanUpsert(CoreModel.Substate substateData, ReferencedEntity referen { referencedEntity.PostResolveConfigure((ComponentEntity e) => { - e.AddCorrelation(EntityRelationship.ComponentPackage, _referencedEntities.Get((EntityAddress)objectDetails.BlueprintInfo.PackageAddress).DatabaseId); + e.AddCorrelation(EntityRelationship.ComponentToInstantiatingPackage, _referencedEntities.Get((EntityAddress)objectDetails.BlueprintInfo.PackageAddress).DatabaseId); }); if (objectDetails.BlueprintInfo.BlueprintName is CoreModel.NativeBlueprintNames.FungibleVault or CoreModel.NativeBlueprintNames.NonFungibleVault) { referencedEntity.PostResolveConfigure((VaultEntity e) => { - e.AddCorrelation(EntityRelationship.VaultResource, _referencedEntities.Get((EntityAddress)objectDetails.BlueprintInfo.OuterObject).DatabaseId); + e.AddCorrelation(EntityRelationship.VaultToResource, _referencedEntities.Get((EntityAddress)objectDetails.BlueprintInfo.OuterObject).DatabaseId); }); } } @@ -111,10 +111,35 @@ public void ScanUpsert(CoreModel.Substate substateData, ReferencedEntity referen { referencedEntity.PostResolveConfigure((GlobalValidatorEntity e) => { - e.AddCorrelation(EntityRelationship.ValidatorStakeVault, _referencedEntities.Get((EntityAddress)validator.Value.StakeXrdVault.EntityAddress).DatabaseId); - e.AddCorrelation(EntityRelationship.ValidatorPendingXrdWithdrawVault, _referencedEntities.Get((EntityAddress)validator.Value.PendingXrdWithdrawVault.EntityAddress).DatabaseId); - e.AddCorrelation(EntityRelationship.ValidatorLockedOwnerStakeUnitVault, _referencedEntities.Get((EntityAddress)validator.Value.LockedOwnerStakeUnitVault.EntityAddress).DatabaseId); - e.AddCorrelation(EntityRelationship.ValidatorPendingOwnerStakeUnitUnlockVault, _referencedEntities.Get((EntityAddress)validator.Value.PendingOwnerStakeUnitUnlockVault.EntityAddress).DatabaseId); + e.AddCorrelation(EntityRelationship.ValidatorToStakeVault, _referencedEntities.Get((EntityAddress)validator.Value.StakeXrdVault.EntityAddress).DatabaseId); + e.AddCorrelation(EntityRelationship.ValidatorToPendingXrdWithdrawVault, _referencedEntities.Get((EntityAddress)validator.Value.PendingXrdWithdrawVault.EntityAddress).DatabaseId); + e.AddCorrelation(EntityRelationship.ValidatorToLockedOwnerStakeUnitVault, _referencedEntities.Get((EntityAddress)validator.Value.LockedOwnerStakeUnitVault.EntityAddress).DatabaseId); + e.AddCorrelation(EntityRelationship.ValidatorToPendingOwnerStakeUnitUnlockVault, _referencedEntities.Get((EntityAddress)validator.Value.PendingOwnerStakeUnitUnlockVault.EntityAddress).DatabaseId); + + _referencedEntities.Get((EntityAddress)validator.Value.ClaimTokenResourceAddress).PostResolveConfigureLow((ResourceEntity cte) => + { + cte.AddCorrelation(EntityRelationship.ClaimTokenOfValidator, e.Id); + }); + + _referencedEntities.Get((EntityAddress)validator.Value.StakeUnitResourceAddress).PostResolveConfigureLow((ResourceEntity ue) => + { + ue.AddCorrelation(EntityRelationship.StakeVaultOfValidator, e.Id); + }); + }); + } + + if (substateData is CoreModel.AccessControllerFieldStateSubstate accessController) + { + var recoveryBadge = (EntityAddress)accessController.Value.RecoveryBadgeResourceAddress; + + referencedEntity.PostResolveConfigure((GlobalAccessControllerEntity ac) => + { + ac.AddCorrelation(EntityRelationship.AccessControllerToRecoveryBadge, _referencedEntities.Get(recoveryBadge).DatabaseId); + + _referencedEntities.Get(recoveryBadge).PostResolveConfigureLow((GlobalNonFungibleResourceEntity nf) => + { + nf.AddCorrelation(EntityRelationship.RecoveryBadgeOfAccessController, ac.Id); + }); }); } @@ -122,17 +147,25 @@ public void ScanUpsert(CoreModel.Substate substateData, ReferencedEntity referen { referencedEntity.PostResolveConfigureLow((GlobalOneResourcePoolEntity e) => { - e.AddCorrelation(EntityRelationship.ResourcePoolUnit, _referencedEntities.Get((EntityAddress)oneResourcePool.Value.PoolUnitResourceAddress).DatabaseId); + var poolUnitResourceEntity = _referencedEntities.Get((EntityAddress)oneResourcePool.Value.PoolUnitResourceAddress); + + e.AddCorrelation(EntityRelationship.ResourcePoolToUnitResource, poolUnitResourceEntity.DatabaseId); + + _referencedEntities.GetByDatabaseId(poolUnitResourceEntity.DatabaseId).PostResolveConfigureLow((ResourceEntity ue) => + { + ue.AddCorrelation(EntityRelationship.UnitVaultOfResourcePool, e.Id); + }); var vault = oneResourcePool.Value.Vault; _referencedEntities.Get((EntityAddress)vault.EntityAddress).PostResolveConfigureLow((VaultEntity ve) => { - ve.AddCorrelation(EntityRelationship.VaultResourcePool, referencedEntity.DatabaseId); + e.AddCorrelation(EntityRelationship.ResourcePoolToResourceVault, ve.Id); + ve.AddCorrelation(EntityRelationship.ResourceVaultOfResourcePool, referencedEntity.DatabaseId); // as OneResourcePool substates do not expose Resource we need to rely on Vault's correlation to the Resource, // hence the use of .PostResolveConfigureLow() to ensure this correlation is already set - e.AddCorrelation(EntityRelationship.ResourcePoolResource, ve.GetResourceEntityId()); + e.AddCorrelation(EntityRelationship.ResourcePoolToResource, ve.GetResourceEntityId()); }); }); } @@ -141,33 +174,49 @@ public void ScanUpsert(CoreModel.Substate substateData, ReferencedEntity referen { referencedEntity.PostResolveConfigure((GlobalTwoResourcePoolEntity e) => { - e.AddCorrelation(EntityRelationship.ResourcePoolUnit, _referencedEntities.Get((EntityAddress)twoResourcePool.Value.PoolUnitResourceAddress).DatabaseId); + var poolUnitResourceEntity = _referencedEntities.Get((EntityAddress)twoResourcePool.Value.PoolUnitResourceAddress); + + e.AddCorrelation(EntityRelationship.ResourcePoolToUnitResource, poolUnitResourceEntity.DatabaseId); + + _referencedEntities.GetByDatabaseId(poolUnitResourceEntity.DatabaseId).PostResolveConfigureLow((ResourceEntity ue) => + { + ue.AddCorrelation(EntityRelationship.UnitVaultOfResourcePool, e.Id); + }); foreach (var poolVault in twoResourcePool.Value.Vaults) { - e.AddCorrelation(EntityRelationship.ResourcePoolResource, _referencedEntities.Get((EntityAddress)poolVault.ResourceAddress).DatabaseId); + e.AddCorrelation(EntityRelationship.ResourcePoolToResource, _referencedEntities.Get((EntityAddress)poolVault.ResourceAddress).DatabaseId); _referencedEntities.Get((EntityAddress)poolVault.Vault.EntityAddress).PostResolveConfigureLow((VaultEntity ve) => { - ve.AddCorrelation(EntityRelationship.VaultResourcePool, referencedEntity.DatabaseId); + e.AddCorrelation(EntityRelationship.ResourcePoolToResourceVault, ve.Id); + ve.AddCorrelation(EntityRelationship.ResourceVaultOfResourcePool, referencedEntity.DatabaseId); }); } }); } - if (substateData is CoreModel.MultiResourcePoolFieldStateSubstate multiResourcePoolFieldStateSubstate) + if (substateData is CoreModel.MultiResourcePoolFieldStateSubstate multiResourcePool) { referencedEntity.PostResolveConfigure((GlobalMultiResourcePoolEntity e) => { - e.AddCorrelation(EntityRelationship.ResourcePoolUnit, _referencedEntities.Get((EntityAddress)multiResourcePoolFieldStateSubstate.Value.PoolUnitResourceAddress).DatabaseId); + var poolUnitResourceEntity = _referencedEntities.Get((EntityAddress)multiResourcePool.Value.PoolUnitResourceAddress); - foreach (var poolVault in multiResourcePoolFieldStateSubstate.Value.Vaults) + e.AddCorrelation(EntityRelationship.ResourcePoolToUnitResource, poolUnitResourceEntity.DatabaseId); + + _referencedEntities.GetByDatabaseId(poolUnitResourceEntity.DatabaseId).PostResolveConfigureLow((ResourceEntity ue) => { - e.AddCorrelation(EntityRelationship.ResourcePoolResource, _referencedEntities.Get((EntityAddress)poolVault.ResourceAddress).DatabaseId); + ue.AddCorrelation(EntityRelationship.UnitVaultOfResourcePool, e.Id); + }); - _referencedEntities.Get((EntityAddress)poolVault.Vault.EntityAddress).PostResolveConfigureLow((VaultEntity ve) => + foreach (var vault in multiResourcePool.Value.Vaults) + { + e.AddCorrelation(EntityRelationship.ResourcePoolToResource, _referencedEntities.Get((EntityAddress)vault.ResourceAddress).DatabaseId); + + _referencedEntities.Get((EntityAddress)vault.Vault.EntityAddress).PostResolveConfigureLow((VaultEntity ve) => { - ve.AddCorrelation(EntityRelationship.VaultResourcePool, referencedEntity.DatabaseId); + e.AddCorrelation(EntityRelationship.ResourcePoolToResourceVault, ve.Id); + ve.AddCorrelation(EntityRelationship.ResourceVaultOfResourcePool, referencedEntity.DatabaseId); }); } }); @@ -183,8 +232,8 @@ public void ScanUpsert(CoreModel.Substate substateData, ReferencedEntity referen .GetOrAdd((EntityAddress)keyValueStore.EntityAddress, ea => new ReferencedEntity(ea, keyValueStore.EntityType, stateVersion)) .PostResolveConfigure((InternalKeyValueStoreEntity e) => { - e.AddCorrelation(EntityRelationship.AccountLockerLocker, referencedEntity.DatabaseId); - e.AddCorrelation(EntityRelationship.AccountLockerAccount, _referencedEntities.Get((EntityAddress)account).DatabaseId); + e.AddCorrelation(EntityRelationship.AccountLockerOfLocker, referencedEntity.DatabaseId); + e.AddCorrelation(EntityRelationship.AccountLockerOfAccount, _referencedEntities.Get((EntityAddress)account).DatabaseId); }); } @@ -209,8 +258,8 @@ public void ScanUpsert(CoreModel.Substate substateData, ReferencedEntity referen // as we're running in the context of PostResolveConfigure with regular priority we must fall back to low priority action referencedEntity.PostResolveConfigureLow((VaultEntity ve) => { - ve.AddCorrelation(EntityRelationship.AccountLockerLocker, lookup.LockerEntityId); - ve.AddCorrelation(EntityRelationship.AccountLockerAccount, lookup.AccountEntityId); + ve.AddCorrelation(EntityRelationship.AccountLockerOfLocker, lookup.LockerEntityId); + ve.AddCorrelation(EntityRelationship.AccountLockerOfAccount, lookup.AccountEntityId); }); } } diff --git a/src/RadixDlt.NetworkGateway.PostgresIntegration/Migrations/20240806143403_InitialCreate.Designer.cs b/src/RadixDlt.NetworkGateway.PostgresIntegration/Migrations/20240812074026_InitialCreate.Designer.cs similarity index 99% rename from src/RadixDlt.NetworkGateway.PostgresIntegration/Migrations/20240806143403_InitialCreate.Designer.cs rename to src/RadixDlt.NetworkGateway.PostgresIntegration/Migrations/20240812074026_InitialCreate.Designer.cs index e13df3b40..a603b5ceb 100644 --- a/src/RadixDlt.NetworkGateway.PostgresIntegration/Migrations/20240806143403_InitialCreate.Designer.cs +++ b/src/RadixDlt.NetworkGateway.PostgresIntegration/Migrations/20240812074026_InitialCreate.Designer.cs @@ -62,7 +62,7 @@ * permissions under this License. */ -// +// using System; using System.Collections.Generic; using System.Numerics; @@ -81,7 +81,7 @@ namespace RadixDlt.NetworkGateway.PostgresIntegration.Migrations { [DbContext(typeof(MigrationsDbContext))] - [Migration("20240806143403_InitialCreate")] + [Migration("20240812074026_InitialCreate")] partial class InitialCreate { /// @@ -95,7 +95,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "account_default_deposit_rule", new[] { "accept", "reject", "allow_existing" }); NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "account_resource_preference_rule", new[] { "allowed", "disallowed" }); NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "authorized_depositor_badge_type", new[] { "resource", "non_fungible" }); - NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "entity_relationship", new[] { "component_package", "validator_stake_vault", "validator_pending_xrd_withdraw_vault", "validator_locked_owner_stake_unit_vault", "validator_pending_owner_stake_unit_unlock_vault", "vault_resource", "vault_royalty", "vault_resource_pool", "account_locker_locker", "account_locker_account", "resource_pool_unit", "resource_pool_resource" }); + NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "entity_relationship", new[] { "component_to_instantiating_package", "vault_to_resource", "royalty_vault_of_component", "validator_to_stake_vault", "validator_to_pending_xrd_withdraw_vault", "validator_to_locked_owner_stake_unit_vault", "validator_to_pending_owner_stake_unit_unlock_vault", "stake_vault_of_validator", "claim_token_of_validator", "account_locker_of_locker", "account_locker_of_account", "resource_pool_to_unit_resource", "resource_pool_to_resource", "resource_pool_to_resource_vault", "unit_vault_of_resource_pool", "resource_vault_of_resource_pool", "access_controller_to_recovery_badge", "recovery_badge_of_access_controller" }); NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "entity_type", new[] { "global_consensus_manager", "global_fungible_resource", "global_non_fungible_resource", "global_generic_component", "internal_generic_component", "global_account_component", "global_package", "internal_key_value_store", "internal_fungible_vault", "internal_non_fungible_vault", "global_validator", "global_access_controller", "global_identity", "global_one_resource_pool", "global_two_resource_pool", "global_multi_resource_pool", "global_transaction_tracker", "global_account_locker" }); NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "ledger_transaction_manifest_class", new[] { "general", "transfer", "validator_stake", "validator_unstake", "validator_claim", "account_deposit_settings_update", "pool_contribution", "pool_redemption" }); NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "ledger_transaction_marker_event_type", new[] { "withdrawal", "deposit" }); diff --git a/src/RadixDlt.NetworkGateway.PostgresIntegration/Migrations/20240806143403_InitialCreate.cs b/src/RadixDlt.NetworkGateway.PostgresIntegration/Migrations/20240812074026_InitialCreate.cs similarity index 99% rename from src/RadixDlt.NetworkGateway.PostgresIntegration/Migrations/20240806143403_InitialCreate.cs rename to src/RadixDlt.NetworkGateway.PostgresIntegration/Migrations/20240812074026_InitialCreate.cs index f0a557099..ac1de06ab 100644 --- a/src/RadixDlt.NetworkGateway.PostgresIntegration/Migrations/20240806143403_InitialCreate.cs +++ b/src/RadixDlt.NetworkGateway.PostgresIntegration/Migrations/20240812074026_InitialCreate.cs @@ -85,7 +85,7 @@ protected override void Up(MigrationBuilder migrationBuilder) .Annotation("Npgsql:Enum:account_default_deposit_rule", "accept,reject,allow_existing") .Annotation("Npgsql:Enum:account_resource_preference_rule", "allowed,disallowed") .Annotation("Npgsql:Enum:authorized_depositor_badge_type", "resource,non_fungible") - .Annotation("Npgsql:Enum:entity_relationship", "component_package,validator_stake_vault,validator_pending_xrd_withdraw_vault,validator_locked_owner_stake_unit_vault,validator_pending_owner_stake_unit_unlock_vault,vault_resource,vault_royalty,vault_resource_pool,account_locker_locker,account_locker_account,resource_pool_unit,resource_pool_resource") + .Annotation("Npgsql:Enum:entity_relationship", "component_to_instantiating_package,vault_to_resource,royalty_vault_of_component,validator_to_stake_vault,validator_to_pending_xrd_withdraw_vault,validator_to_locked_owner_stake_unit_vault,validator_to_pending_owner_stake_unit_unlock_vault,stake_vault_of_validator,claim_token_of_validator,account_locker_of_locker,account_locker_of_account,resource_pool_to_unit_resource,resource_pool_to_resource,resource_pool_to_resource_vault,unit_vault_of_resource_pool,resource_vault_of_resource_pool,access_controller_to_recovery_badge,recovery_badge_of_access_controller") .Annotation("Npgsql:Enum:entity_type", "global_consensus_manager,global_fungible_resource,global_non_fungible_resource,global_generic_component,internal_generic_component,global_account_component,global_package,internal_key_value_store,internal_fungible_vault,internal_non_fungible_vault,global_validator,global_access_controller,global_identity,global_one_resource_pool,global_two_resource_pool,global_multi_resource_pool,global_transaction_tracker,global_account_locker") .Annotation("Npgsql:Enum:ledger_transaction_manifest_class", "general,transfer,validator_stake,validator_unstake,validator_claim,account_deposit_settings_update,pool_contribution,pool_redemption") .Annotation("Npgsql:Enum:ledger_transaction_marker_event_type", "withdrawal,deposit") diff --git a/src/RadixDlt.NetworkGateway.PostgresIntegration/Migrations/IdempotentApplyMigrations.sql b/src/RadixDlt.NetworkGateway.PostgresIntegration/Migrations/IdempotentApplyMigrations.sql index 9bad92f8a..6b617af47 100644 --- a/src/RadixDlt.NetworkGateway.PostgresIntegration/Migrations/IdempotentApplyMigrations.sql +++ b/src/RadixDlt.NetworkGateway.PostgresIntegration/Migrations/IdempotentApplyMigrations.sql @@ -9,11 +9,11 @@ START TRANSACTION; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240806143403_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240812074026_InitialCreate') THEN CREATE TYPE account_default_deposit_rule AS ENUM ('accept', 'reject', 'allow_existing'); CREATE TYPE account_resource_preference_rule AS ENUM ('allowed', 'disallowed'); CREATE TYPE authorized_depositor_badge_type AS ENUM ('resource', 'non_fungible'); - CREATE TYPE entity_relationship AS ENUM ('component_package', 'validator_stake_vault', 'validator_pending_xrd_withdraw_vault', 'validator_locked_owner_stake_unit_vault', 'validator_pending_owner_stake_unit_unlock_vault', 'vault_resource', 'vault_royalty', 'vault_resource_pool', 'account_locker_locker', 'account_locker_account', 'resource_pool_unit', 'resource_pool_resource'); + CREATE TYPE entity_relationship AS ENUM ('component_to_instantiating_package', 'vault_to_resource', 'royalty_vault_of_component', 'validator_to_stake_vault', 'validator_to_pending_xrd_withdraw_vault', 'validator_to_locked_owner_stake_unit_vault', 'validator_to_pending_owner_stake_unit_unlock_vault', 'stake_vault_of_validator', 'claim_token_of_validator', 'account_locker_of_locker', 'account_locker_of_account', 'resource_pool_to_unit_resource', 'resource_pool_to_resource', 'resource_pool_to_resource_vault', 'unit_vault_of_resource_pool', 'resource_vault_of_resource_pool', 'access_controller_to_recovery_badge', 'recovery_badge_of_access_controller'); CREATE TYPE entity_type AS ENUM ('global_consensus_manager', 'global_fungible_resource', 'global_non_fungible_resource', 'global_generic_component', 'internal_generic_component', 'global_account_component', 'global_package', 'internal_key_value_store', 'internal_fungible_vault', 'internal_non_fungible_vault', 'global_validator', 'global_access_controller', 'global_identity', 'global_one_resource_pool', 'global_two_resource_pool', 'global_multi_resource_pool', 'global_transaction_tracker', 'global_account_locker'); CREATE TYPE ledger_transaction_manifest_class AS ENUM ('general', 'transfer', 'validator_stake', 'validator_unstake', 'validator_claim', 'account_deposit_settings_update', 'pool_contribution', 'pool_redemption'); CREATE TYPE ledger_transaction_marker_event_type AS ENUM ('withdrawal', 'deposit'); @@ -37,7 +37,7 @@ END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240806143403_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240812074026_InitialCreate') THEN CREATE TABLE account_authorized_depositor_aggregate_history ( id bigint GENERATED BY DEFAULT AS IDENTITY, from_state_version bigint NOT NULL, @@ -50,7 +50,7 @@ END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240806143403_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240812074026_InitialCreate') THEN CREATE TABLE account_authorized_depositor_entry_history ( id bigint GENERATED BY DEFAULT AS IDENTITY, from_state_version bigint NOT NULL, @@ -66,7 +66,7 @@ END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240806143403_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240812074026_InitialCreate') THEN CREATE TABLE account_default_deposit_rule_history ( id bigint GENERATED BY DEFAULT AS IDENTITY, from_state_version bigint NOT NULL, @@ -79,7 +79,7 @@ END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240806143403_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240812074026_InitialCreate') THEN CREATE TABLE account_locker_entry_definition ( id bigint GENERATED BY DEFAULT AS IDENTITY, from_state_version bigint NOT NULL, @@ -93,7 +93,7 @@ END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240806143403_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240812074026_InitialCreate') THEN CREATE TABLE account_locker_entry_resource_vault_definition ( id bigint GENERATED BY DEFAULT AS IDENTITY, from_state_version bigint NOT NULL, @@ -107,7 +107,7 @@ END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240806143403_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240812074026_InitialCreate') THEN CREATE TABLE account_locker_entry_touch_history ( id bigint GENERATED BY DEFAULT AS IDENTITY, from_state_version bigint NOT NULL, @@ -119,7 +119,7 @@ END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240806143403_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240812074026_InitialCreate') THEN CREATE TABLE account_resource_preference_rule_aggregate_history ( id bigint GENERATED BY DEFAULT AS IDENTITY, from_state_version bigint NOT NULL, @@ -132,7 +132,7 @@ END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240806143403_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240812074026_InitialCreate') THEN CREATE TABLE account_resource_preference_rule_entry_history ( id bigint GENERATED BY DEFAULT AS IDENTITY, from_state_version bigint NOT NULL, @@ -147,7 +147,7 @@ END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240806143403_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240812074026_InitialCreate') THEN CREATE TABLE component_method_royalty_aggregate_history ( id bigint GENERATED BY DEFAULT AS IDENTITY, from_state_version bigint NOT NULL, @@ -160,7 +160,7 @@ END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240806143403_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240812074026_InitialCreate') THEN CREATE TABLE component_method_royalty_entry_history ( id bigint GENERATED BY DEFAULT AS IDENTITY, from_state_version bigint NOT NULL, @@ -175,7 +175,7 @@ END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240806143403_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240812074026_InitialCreate') THEN CREATE TABLE entities ( id bigint GENERATED BY DEFAULT AS IDENTITY, from_state_version bigint NOT NULL, @@ -201,7 +201,7 @@ END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240806143403_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240812074026_InitialCreate') THEN CREATE TABLE entity_metadata_aggregate_history ( id bigint GENERATED BY DEFAULT AS IDENTITY, from_state_version bigint NOT NULL, @@ -214,7 +214,7 @@ END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240806143403_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240812074026_InitialCreate') THEN CREATE TABLE entity_metadata_history ( id bigint GENERATED BY DEFAULT AS IDENTITY, from_state_version bigint NOT NULL, @@ -230,7 +230,7 @@ END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240806143403_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240812074026_InitialCreate') THEN CREATE TABLE entity_resource_aggregate_history ( id bigint GENERATED BY DEFAULT AS IDENTITY, from_state_version bigint NOT NULL, @@ -246,7 +246,7 @@ END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240806143403_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240812074026_InitialCreate') THEN CREATE TABLE entity_resource_aggregated_vaults_history ( id bigint GENERATED BY DEFAULT AS IDENTITY, from_state_version bigint NOT NULL, @@ -262,7 +262,7 @@ END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240806143403_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240812074026_InitialCreate') THEN CREATE TABLE entity_resource_vault_aggregate_history ( id bigint GENERATED BY DEFAULT AS IDENTITY, from_state_version bigint NOT NULL, @@ -276,7 +276,7 @@ END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240806143403_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240812074026_InitialCreate') THEN CREATE TABLE entity_role_assignments_aggregate_history ( id bigint GENERATED BY DEFAULT AS IDENTITY, from_state_version bigint NOT NULL, @@ -290,7 +290,7 @@ END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240806143403_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240812074026_InitialCreate') THEN CREATE TABLE entity_role_assignments_entry_history ( id bigint GENERATED BY DEFAULT AS IDENTITY, from_state_version bigint NOT NULL, @@ -306,7 +306,7 @@ END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240806143403_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240812074026_InitialCreate') THEN CREATE TABLE entity_role_assignments_owner_role_history ( id bigint GENERATED BY DEFAULT AS IDENTITY, from_state_version bigint NOT NULL, @@ -319,7 +319,7 @@ END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240806143403_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240812074026_InitialCreate') THEN CREATE TABLE entity_vault_history ( id bigint GENERATED BY DEFAULT AS IDENTITY, from_state_version bigint NOT NULL, @@ -338,7 +338,7 @@ END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240806143403_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240812074026_InitialCreate') THEN CREATE TABLE key_value_store_entry_definition ( id bigint GENERATED BY DEFAULT AS IDENTITY, from_state_version bigint NOT NULL, @@ -351,7 +351,7 @@ END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240806143403_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240812074026_InitialCreate') THEN CREATE TABLE key_value_store_entry_history ( id bigint GENERATED BY DEFAULT AS IDENTITY, from_state_version bigint NOT NULL, @@ -366,7 +366,7 @@ END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240806143403_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240812074026_InitialCreate') THEN CREATE TABLE key_value_store_schema_history ( id bigint GENERATED BY DEFAULT AS IDENTITY, from_state_version bigint NOT NULL, @@ -386,7 +386,7 @@ END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240806143403_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240812074026_InitialCreate') THEN CREATE TABLE ledger_transaction_markers ( id bigint GENERATED BY DEFAULT AS IDENTITY, state_version bigint NOT NULL, @@ -406,7 +406,7 @@ END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240806143403_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240812074026_InitialCreate') THEN CREATE TABLE ledger_transactions ( state_version bigint NOT NULL, epoch bigint NOT NULL, @@ -454,7 +454,7 @@ END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240806143403_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240812074026_InitialCreate') THEN CREATE TABLE non_fungible_id_data_history ( id bigint GENERATED BY DEFAULT AS IDENTITY, from_state_version bigint NOT NULL, @@ -469,7 +469,7 @@ END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240806143403_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240812074026_InitialCreate') THEN CREATE TABLE non_fungible_id_definition ( id bigint GENERATED BY DEFAULT AS IDENTITY, from_state_version bigint NOT NULL, @@ -482,7 +482,7 @@ END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240806143403_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240812074026_InitialCreate') THEN CREATE TABLE non_fungible_id_location_history ( id bigint GENERATED BY DEFAULT AS IDENTITY, from_state_version bigint NOT NULL, @@ -495,7 +495,7 @@ END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240806143403_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240812074026_InitialCreate') THEN CREATE TABLE non_fungible_schema_history ( id bigint GENERATED BY DEFAULT AS IDENTITY, from_state_version bigint NOT NULL, @@ -511,7 +511,7 @@ END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240806143403_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240812074026_InitialCreate') THEN CREATE TABLE package_blueprint_aggregate_history ( id bigint GENERATED BY DEFAULT AS IDENTITY, from_state_version bigint NOT NULL, @@ -524,7 +524,7 @@ END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240806143403_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240812074026_InitialCreate') THEN CREATE TABLE package_blueprint_history ( id bigint GENERATED BY DEFAULT AS IDENTITY, from_state_version bigint NOT NULL, @@ -544,7 +544,7 @@ END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240806143403_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240812074026_InitialCreate') THEN CREATE TABLE package_code_aggregate_history ( id bigint GENERATED BY DEFAULT AS IDENTITY, from_state_version bigint NOT NULL, @@ -557,7 +557,7 @@ END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240806143403_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240812074026_InitialCreate') THEN CREATE TABLE package_code_history ( id bigint GENERATED BY DEFAULT AS IDENTITY, from_state_version bigint NOT NULL, @@ -573,7 +573,7 @@ END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240806143403_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240812074026_InitialCreate') THEN CREATE TABLE pending_transactions ( id bigint GENERATED BY DEFAULT AS IDENTITY, payload_hash text NOT NULL, @@ -601,7 +601,7 @@ END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240806143403_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240812074026_InitialCreate') THEN CREATE TABLE resource_entity_supply_history ( id bigint GENERATED BY DEFAULT AS IDENTITY, from_state_version bigint NOT NULL, @@ -616,7 +616,7 @@ END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240806143403_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240812074026_InitialCreate') THEN CREATE TABLE schema_entry_aggregate_history ( id bigint GENERATED BY DEFAULT AS IDENTITY, from_state_version bigint NOT NULL, @@ -629,7 +629,7 @@ END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240806143403_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240812074026_InitialCreate') THEN CREATE TABLE schema_entry_definition ( id bigint GENERATED BY DEFAULT AS IDENTITY, from_state_version bigint NOT NULL, @@ -643,7 +643,7 @@ END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240806143403_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240812074026_InitialCreate') THEN CREATE TABLE state_history ( id bigint GENERATED BY DEFAULT AS IDENTITY, from_state_version bigint NOT NULL, @@ -662,7 +662,7 @@ END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240806143403_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240812074026_InitialCreate') THEN CREATE TABLE unverified_standard_metadata_aggregate_history ( id bigint GENERATED BY DEFAULT AS IDENTITY, from_state_version bigint NOT NULL, @@ -675,7 +675,7 @@ END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240806143403_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240812074026_InitialCreate') THEN CREATE TABLE unverified_standard_metadata_entry_history ( id bigint GENERATED BY DEFAULT AS IDENTITY, from_state_version bigint NOT NULL, @@ -692,7 +692,7 @@ END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240806143403_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240812074026_InitialCreate') THEN CREATE TABLE validator_cumulative_emission_history ( id bigint GENERATED BY DEFAULT AS IDENTITY, from_state_version bigint NOT NULL, @@ -708,7 +708,7 @@ END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240806143403_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240812074026_InitialCreate') THEN CREATE TABLE validator_public_key_history ( id bigint GENERATED BY DEFAULT AS IDENTITY, from_state_version bigint NOT NULL, @@ -722,7 +722,7 @@ END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240806143403_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240812074026_InitialCreate') THEN CREATE TABLE pending_transaction_payloads ( id bigint GENERATED BY DEFAULT AS IDENTITY, pending_transaction_id bigint, @@ -735,7 +735,7 @@ END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240806143403_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240812074026_InitialCreate') THEN CREATE TABLE validator_active_set_history ( id bigint GENERATED BY DEFAULT AS IDENTITY, from_state_version bigint NOT NULL, @@ -750,506 +750,506 @@ END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240806143403_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240812074026_InitialCreate') THEN CREATE INDEX "IX_account_authorized_depositor_aggregate_history_account_enti~" ON account_authorized_depositor_aggregate_history (account_entity_id, from_state_version); END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240806143403_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240812074026_InitialCreate') THEN CREATE INDEX "IX_account_authorized_depositor_entry_history_account_entity_~1" ON account_authorized_depositor_entry_history (account_entity_id, resource_entity_id, non_fungible_id, from_state_version) WHERE discriminator = 'non_fungible'; END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240806143403_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240812074026_InitialCreate') THEN CREATE INDEX "IX_account_authorized_depositor_entry_history_account_entity_~2" ON account_authorized_depositor_entry_history (account_entity_id, resource_entity_id, from_state_version) WHERE discriminator = 'resource'; END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240806143403_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240812074026_InitialCreate') THEN CREATE INDEX "IX_account_authorized_depositor_entry_history_account_entity_i~" ON account_authorized_depositor_entry_history (account_entity_id, from_state_version); END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240806143403_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240812074026_InitialCreate') THEN CREATE INDEX "IX_account_default_deposit_rule_history_account_entity_id_from~" ON account_default_deposit_rule_history (account_entity_id, from_state_version); END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240806143403_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240812074026_InitialCreate') THEN CREATE UNIQUE INDEX "IX_account_locker_entry_definition_account_locker_entity_id_ac~" ON account_locker_entry_definition (account_locker_entity_id, account_entity_id); END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240806143403_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240812074026_InitialCreate') THEN CREATE UNIQUE INDEX "IX_account_locker_entry_resource_vault_definition_account_lock~" ON account_locker_entry_resource_vault_definition (account_locker_definition_id, from_state_version); END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240806143403_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240812074026_InitialCreate') THEN CREATE INDEX "IX_account_locker_entry_touch_history_account_locker_definitio~" ON account_locker_entry_touch_history (account_locker_definition_id, from_state_version); END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240806143403_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240812074026_InitialCreate') THEN CREATE INDEX "IX_account_resource_preference_rule_aggregate_history_account_~" ON account_resource_preference_rule_aggregate_history (account_entity_id, from_state_version); END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240806143403_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240812074026_InitialCreate') THEN CREATE INDEX "IX_account_resource_preference_rule_entry_history_account_enti~" ON account_resource_preference_rule_entry_history (account_entity_id, resource_entity_id, from_state_version); END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240806143403_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240812074026_InitialCreate') THEN CREATE INDEX "IX_component_method_royalty_aggregate_history_entity_id_from_s~" ON component_method_royalty_aggregate_history (entity_id, from_state_version); END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240806143403_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240812074026_InitialCreate') THEN CREATE INDEX "IX_component_method_royalty_entry_history_entity_id_from_state~" ON component_method_royalty_entry_history (entity_id, from_state_version); END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240806143403_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240812074026_InitialCreate') THEN CREATE INDEX "IX_component_method_royalty_entry_history_entity_id_method_nam~" ON component_method_royalty_entry_history (entity_id, method_name, from_state_version); END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240806143403_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240812074026_InitialCreate') THEN CREATE UNIQUE INDEX "IX_entities_address" ON entities (address); END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240806143403_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240812074026_InitialCreate') THEN CREATE INDEX "IX_entities_from_state_version" ON entities (from_state_version) WHERE discriminator = 'global_validator'; END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240806143403_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240812074026_InitialCreate') THEN CREATE INDEX "IX_entity_metadata_aggregate_history_entity_id_from_state_vers~" ON entity_metadata_aggregate_history (entity_id, from_state_version); END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240806143403_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240812074026_InitialCreate') THEN CREATE INDEX "IX_entity_metadata_history_entity_id_key_from_state_version" ON entity_metadata_history (entity_id, key, from_state_version); END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240806143403_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240812074026_InitialCreate') THEN CREATE INDEX "IX_entity_resource_aggregate_history_entity_id_from_state_vers~" ON entity_resource_aggregate_history (entity_id, from_state_version); END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240806143403_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240812074026_InitialCreate') THEN CREATE INDEX "IX_entity_resource_aggregated_vaults_history_entity_id_resourc~" ON entity_resource_aggregated_vaults_history (entity_id, resource_entity_id, from_state_version); END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240806143403_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240812074026_InitialCreate') THEN CREATE INDEX "IX_entity_resource_vault_aggregate_history_entity_id_resource_~" ON entity_resource_vault_aggregate_history (entity_id, resource_entity_id, from_state_version); END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240806143403_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240812074026_InitialCreate') THEN CREATE INDEX "IX_entity_role_assignments_aggregate_history_entity_id_from_st~" ON entity_role_assignments_aggregate_history (entity_id, from_state_version); END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240806143403_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240812074026_InitialCreate') THEN CREATE INDEX "IX_entity_role_assignments_entry_history_entity_id_key_role_ke~" ON entity_role_assignments_entry_history (entity_id, key_role, key_module, from_state_version); END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240806143403_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240812074026_InitialCreate') THEN CREATE INDEX "IX_entity_role_assignments_owner_role_history_entity_id_from_s~" ON entity_role_assignments_owner_role_history (entity_id, from_state_version); END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240806143403_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240812074026_InitialCreate') THEN CREATE INDEX "IX_entity_vault_history_global_entity_id_from_state_version" ON entity_vault_history (global_entity_id, from_state_version) WHERE is_royalty_vault = true; END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240806143403_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240812074026_InitialCreate') THEN CREATE INDEX "IX_entity_vault_history_global_entity_id_vault_entity_id_from_~" ON entity_vault_history (global_entity_id, vault_entity_id, from_state_version); END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240806143403_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240812074026_InitialCreate') THEN CREATE INDEX "IX_entity_vault_history_id_resource_entity_id_from_state_versi~" ON entity_vault_history (id, resource_entity_id, from_state_version); END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240806143403_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240812074026_InitialCreate') THEN CREATE INDEX "IX_entity_vault_history_owner_entity_id_from_state_version" ON entity_vault_history (owner_entity_id, from_state_version) WHERE is_royalty_vault = true; END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240806143403_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240812074026_InitialCreate') THEN CREATE INDEX "IX_entity_vault_history_owner_entity_id_vault_entity_id_from_s~" ON entity_vault_history (owner_entity_id, vault_entity_id, from_state_version); END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240806143403_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240812074026_InitialCreate') THEN CREATE INDEX "IX_entity_vault_history_vault_entity_id_from_state_version" ON entity_vault_history (vault_entity_id, from_state_version); END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240806143403_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240812074026_InitialCreate') THEN CREATE INDEX "IX_key_value_store_entry_definition_key_value_store_entity_id_~" ON key_value_store_entry_definition (key_value_store_entity_id, from_state_version); END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240806143403_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240812074026_InitialCreate') THEN CREATE INDEX "IX_key_value_store_entry_definition_key_value_store_entity_id~1" ON key_value_store_entry_definition (key_value_store_entity_id, key); END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240806143403_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240812074026_InitialCreate') THEN CREATE INDEX "IX_key_value_store_entry_history_key_value_store_entry_definit~" ON key_value_store_entry_history (key_value_store_entry_definition_id, from_state_version); END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240806143403_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240812074026_InitialCreate') THEN CREATE INDEX "IX_key_value_store_schema_history_key_value_store_entity_id_fr~" ON key_value_store_schema_history (key_value_store_entity_id, from_state_version); END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240806143403_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240812074026_InitialCreate') THEN CREATE INDEX "IX_ledger_transaction_markers_entity_id_state_version" ON ledger_transaction_markers (entity_id, state_version) WHERE discriminator = 'event_global_emitter'; END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240806143403_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240812074026_InitialCreate') THEN CREATE INDEX "IX_ledger_transaction_markers_entity_id_state_version1" ON ledger_transaction_markers (entity_id, state_version) WHERE discriminator = 'affected_global_entity'; END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240806143403_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240812074026_InitialCreate') THEN CREATE INDEX "IX_ledger_transaction_markers_event_type_entity_id_state_versi~" ON ledger_transaction_markers (event_type, entity_id, state_version) WHERE discriminator = 'event'; END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240806143403_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240812074026_InitialCreate') THEN CREATE INDEX "IX_ledger_transaction_markers_manifest_class" ON ledger_transaction_markers (manifest_class, state_version) WHERE discriminator = 'manifest_class'; END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240806143403_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240812074026_InitialCreate') THEN CREATE INDEX "IX_ledger_transaction_markers_manifest_class_is_most_specific" ON ledger_transaction_markers (manifest_class, state_version) WHERE discriminator = 'manifest_class' and is_most_specific = true; END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240806143403_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240812074026_InitialCreate') THEN CREATE INDEX "IX_ledger_transaction_markers_operation_type_entity_id_state_v~" ON ledger_transaction_markers (operation_type, entity_id, state_version) WHERE discriminator = 'manifest_address'; END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240806143403_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240812074026_InitialCreate') THEN CREATE INDEX "IX_ledger_transaction_markers_origin_type_state_version" ON ledger_transaction_markers (origin_type, state_version) WHERE discriminator = 'origin'; END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240806143403_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240812074026_InitialCreate') THEN CREATE INDEX "IX_ledger_transaction_markers_state_version" ON ledger_transaction_markers (state_version); END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240806143403_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240812074026_InitialCreate') THEN CREATE UNIQUE INDEX "IX_ledger_transactions_epoch_round_in_epoch" ON ledger_transactions (epoch, round_in_epoch) WHERE index_in_round = 0; END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240806143403_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240812074026_InitialCreate') THEN CREATE INDEX "IX_ledger_transactions_intent_hash" ON ledger_transactions USING hash (intent_hash) WHERE intent_hash IS NOT NULL; END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240806143403_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240812074026_InitialCreate') THEN CREATE INDEX "IX_ledger_transactions_round_timestamp" ON ledger_transactions (round_timestamp); END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240806143403_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240812074026_InitialCreate') THEN CREATE INDEX "IX_non_fungible_id_data_history_non_fungible_id_definition_id_~" ON non_fungible_id_data_history (non_fungible_id_definition_id, from_state_version); END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240806143403_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240812074026_InitialCreate') THEN CREATE INDEX "IX_non_fungible_id_definition_non_fungible_resource_entity_id_~" ON non_fungible_id_definition (non_fungible_resource_entity_id, from_state_version); END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240806143403_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240812074026_InitialCreate') THEN CREATE UNIQUE INDEX "IX_non_fungible_id_definition_non_fungible_resource_entity_id~1" ON non_fungible_id_definition (non_fungible_resource_entity_id, non_fungible_id, from_state_version); END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240806143403_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240812074026_InitialCreate') THEN CREATE INDEX "IX_non_fungible_id_location_history_non_fungible_id_definition~" ON non_fungible_id_location_history (non_fungible_id_definition_id, from_state_version); END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240806143403_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240812074026_InitialCreate') THEN CREATE INDEX "IX_non_fungible_schema_history_resource_entity_id_from_state_v~" ON non_fungible_schema_history (resource_entity_id, from_state_version); END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240806143403_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240812074026_InitialCreate') THEN CREATE INDEX "IX_package_blueprint_aggregate_history_package_entity_id_from_~" ON package_blueprint_aggregate_history (package_entity_id, from_state_version); END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240806143403_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240812074026_InitialCreate') THEN CREATE INDEX "IX_package_blueprint_history_package_entity_id_from_state_vers~" ON package_blueprint_history (package_entity_id, from_state_version); END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240806143403_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240812074026_InitialCreate') THEN CREATE INDEX "IX_package_blueprint_history_package_entity_id_name_version_fr~" ON package_blueprint_history (package_entity_id, name, version, from_state_version); END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240806143403_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240812074026_InitialCreate') THEN CREATE INDEX "IX_package_code_aggregate_history_package_entity_id_from_state~" ON package_code_aggregate_history (package_entity_id, from_state_version); END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240806143403_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240812074026_InitialCreate') THEN CREATE INDEX "IX_package_code_history_package_entity_id_from_state_version" ON package_code_history (package_entity_id, from_state_version); END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240806143403_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240812074026_InitialCreate') THEN CREATE UNIQUE INDEX "IX_pending_transaction_payloads_pending_transaction_id" ON pending_transaction_payloads (pending_transaction_id); END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240806143403_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240812074026_InitialCreate') THEN CREATE INDEX "IX_pending_transactions_first_submitted_to_gateway_timestamp" ON pending_transactions (first_submitted_to_gateway_timestamp); END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240806143403_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240812074026_InitialCreate') THEN CREATE INDEX "IX_pending_transactions_intent_hash" ON pending_transactions (intent_hash); END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240806143403_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240812074026_InitialCreate') THEN CREATE UNIQUE INDEX "IX_pending_transactions_payload_hash" ON pending_transactions (payload_hash); END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240806143403_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240812074026_InitialCreate') THEN CREATE INDEX "IX_pending_transactions_resubmit_from_timestamp" ON pending_transactions (resubmit_from_timestamp); END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240806143403_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240812074026_InitialCreate') THEN CREATE INDEX "IX_resource_entity_supply_history_resource_entity_id_from_stat~" ON resource_entity_supply_history (resource_entity_id, from_state_version); END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240806143403_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240812074026_InitialCreate') THEN CREATE INDEX "IX_schema_entry_aggregate_history_entity_id_from_state_version" ON schema_entry_aggregate_history (entity_id, from_state_version); END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240806143403_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240812074026_InitialCreate') THEN CREATE INDEX "IX_schema_entry_definition_entity_id_schema_hash" ON schema_entry_definition (entity_id, schema_hash); END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240806143403_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240812074026_InitialCreate') THEN CREATE INDEX "IX_state_history_entity_id_from_state_version" ON state_history (entity_id, from_state_version); END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240806143403_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240812074026_InitialCreate') THEN CREATE INDEX "IX_unverified_standard_metadata_aggregate_history_entity_id_fr~" ON unverified_standard_metadata_aggregate_history (entity_id, from_state_version); END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240806143403_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240812074026_InitialCreate') THEN CREATE INDEX "IX_unverified_standard_metadata_entry_history_entity_id_discri~" ON unverified_standard_metadata_entry_history (entity_id, discriminator, from_state_version); END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240806143403_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240812074026_InitialCreate') THEN CREATE INDEX "IX_validator_active_set_history_epoch" ON validator_active_set_history (epoch); END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240806143403_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240812074026_InitialCreate') THEN CREATE INDEX "IX_validator_active_set_history_from_state_version" ON validator_active_set_history (from_state_version); END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240806143403_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240812074026_InitialCreate') THEN CREATE INDEX "IX_validator_active_set_history_validator_public_key_history_id" ON validator_active_set_history (validator_public_key_history_id); END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240806143403_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240812074026_InitialCreate') THEN CREATE INDEX "IX_validator_cumulative_emission_history_validator_entity_id_e~" ON validator_cumulative_emission_history (validator_entity_id, epoch_number); END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240806143403_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240812074026_InitialCreate') THEN CREATE INDEX "IX_validator_public_key_history_validator_entity_id_from_state~" ON validator_public_key_history (validator_entity_id, from_state_version); END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240806143403_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240812074026_InitialCreate') THEN CREATE INDEX "IX_validator_public_key_history_validator_entity_id_key_type_k~" ON validator_public_key_history (validator_entity_id, key_type, key); END IF; END $EF$; DO $EF$ BEGIN - IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240806143403_InitialCreate') THEN + IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20240812074026_InitialCreate') THEN INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion") - VALUES ('20240806143403_InitialCreate', '8.0.2'); + VALUES ('20240812074026_InitialCreate', '8.0.2'); END IF; END $EF$; COMMIT; diff --git a/src/RadixDlt.NetworkGateway.PostgresIntegration/Migrations/MigrationsDbContextModelSnapshot.cs b/src/RadixDlt.NetworkGateway.PostgresIntegration/Migrations/MigrationsDbContextModelSnapshot.cs index 627c4377b..7b4fcc113 100644 --- a/src/RadixDlt.NetworkGateway.PostgresIntegration/Migrations/MigrationsDbContextModelSnapshot.cs +++ b/src/RadixDlt.NetworkGateway.PostgresIntegration/Migrations/MigrationsDbContextModelSnapshot.cs @@ -62,7 +62,7 @@ * permissions under this License. */ -// +// using System; using System.Collections.Generic; using System.Numerics; @@ -92,7 +92,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "account_default_deposit_rule", new[] { "accept", "reject", "allow_existing" }); NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "account_resource_preference_rule", new[] { "allowed", "disallowed" }); NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "authorized_depositor_badge_type", new[] { "resource", "non_fungible" }); - NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "entity_relationship", new[] { "component_package", "validator_stake_vault", "validator_pending_xrd_withdraw_vault", "validator_locked_owner_stake_unit_vault", "validator_pending_owner_stake_unit_unlock_vault", "vault_resource", "vault_royalty", "vault_resource_pool", "account_locker_locker", "account_locker_account", "resource_pool_unit", "resource_pool_resource" }); + NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "entity_relationship", new[] { "component_to_instantiating_package", "vault_to_resource", "royalty_vault_of_component", "validator_to_stake_vault", "validator_to_pending_xrd_withdraw_vault", "validator_to_locked_owner_stake_unit_vault", "validator_to_pending_owner_stake_unit_unlock_vault", "stake_vault_of_validator", "claim_token_of_validator", "account_locker_of_locker", "account_locker_of_account", "resource_pool_to_unit_resource", "resource_pool_to_resource", "resource_pool_to_resource_vault", "unit_vault_of_resource_pool", "resource_vault_of_resource_pool", "access_controller_to_recovery_badge", "recovery_badge_of_access_controller" }); NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "entity_type", new[] { "global_consensus_manager", "global_fungible_resource", "global_non_fungible_resource", "global_generic_component", "internal_generic_component", "global_account_component", "global_package", "internal_key_value_store", "internal_fungible_vault", "internal_non_fungible_vault", "global_validator", "global_access_controller", "global_identity", "global_one_resource_pool", "global_two_resource_pool", "global_multi_resource_pool", "global_transaction_tracker", "global_account_locker" }); NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "ledger_transaction_manifest_class", new[] { "general", "transfer", "validator_stake", "validator_unstake", "validator_claim", "account_deposit_settings_update", "pool_contribution", "pool_redemption" }); NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "ledger_transaction_marker_event_type", new[] { "withdrawal", "deposit" }); diff --git a/src/RadixDlt.NetworkGateway.PostgresIntegration/Models/Entity.cs b/src/RadixDlt.NetworkGateway.PostgresIntegration/Models/Entity.cs index 7c841615c..a47950076 100644 --- a/src/RadixDlt.NetworkGateway.PostgresIntegration/Models/Entity.cs +++ b/src/RadixDlt.NetworkGateway.PostgresIntegration/Models/Entity.cs @@ -179,18 +179,18 @@ internal abstract class ComponentEntity : Entity [Column("assigned_module_ids")] public List AssignedModuleIds { get; set; } - public long GetPackageId() => GetCorrelation(EntityRelationship.ComponentPackage).EntityId; + public long GetInstantiatingPackageId() => GetCorrelation(EntityRelationship.ComponentToInstantiatingPackage).EntityId; } internal class GlobalValidatorEntity : ComponentEntity { - public long GetStakeVaultEntityId() => GetCorrelation(EntityRelationship.ValidatorStakeVault).EntityId; + public long GetStakeVaultEntityId() => GetCorrelation(EntityRelationship.ValidatorToStakeVault).EntityId; - public long GetPendingXrdWithdrawVaultEntityId() => GetCorrelation(EntityRelationship.ValidatorPendingXrdWithdrawVault).EntityId; + public long GetPendingXrdWithdrawVaultEntityId() => GetCorrelation(EntityRelationship.ValidatorToPendingXrdWithdrawVault).EntityId; - public long GetLockedOwnerStakeUnitVaultEntityId() => GetCorrelation(EntityRelationship.ValidatorLockedOwnerStakeUnitVault).EntityId; + public long GetLockedOwnerStakeUnitVaultEntityId() => GetCorrelation(EntityRelationship.ValidatorToLockedOwnerStakeUnitVault).EntityId; - public long GetPendingOwnerStakeUnitUnlockVaultEntityId() => GetCorrelation(EntityRelationship.ValidatorPendingOwnerStakeUnitUnlockVault).EntityId; + public long GetPendingOwnerStakeUnitUnlockVaultEntityId() => GetCorrelation(EntityRelationship.ValidatorToPendingOwnerStakeUnitUnlockVault).EntityId; } internal class GlobalConsensusManager : ComponentEntity @@ -199,13 +199,13 @@ internal class GlobalConsensusManager : ComponentEntity internal abstract class VaultEntity : ComponentEntity { - public long GetResourceEntityId() => GetCorrelation(EntityRelationship.VaultResource).EntityId; + public long GetResourceEntityId() => GetCorrelation(EntityRelationship.VaultToResource).EntityId; public bool TryGetAccountLockerEntryDbLookup(out AccountLockerEntryDbLookup lookup) { lookup = default; - if (TryGetCorrelation(EntityRelationship.AccountLockerLocker, out var locker) && TryGetCorrelation(EntityRelationship.AccountLockerAccount, out var account)) + if (TryGetCorrelation(EntityRelationship.AccountLockerOfLocker, out var locker) && TryGetCorrelation(EntityRelationship.AccountLockerOfAccount, out var account)) { lookup = new AccountLockerEntryDbLookup(locker.EntityId, account.EntityId); @@ -218,7 +218,7 @@ public bool TryGetAccountLockerEntryDbLookup(out AccountLockerEntryDbLookup look internal class InternalFungibleVaultEntity : VaultEntity { - public bool IsRoyaltyVault => TryGetCorrelation(EntityRelationship.VaultRoyalty, out _); + public bool IsRoyaltyVault => TryGetCorrelation(EntityRelationship.RoyaltyVaultOfComponent, out _); } internal class InternalNonFungibleVaultEntity : VaultEntity @@ -277,7 +277,7 @@ public bool TryGetAccountLockerEntryDbLookup(out AccountLockerEntryDbLookup look { lookup = default; - if (TryGetCorrelation(EntityRelationship.AccountLockerLocker, out var locker) && TryGetCorrelation(EntityRelationship.AccountLockerAccount, out var account)) + if (TryGetCorrelation(EntityRelationship.AccountLockerOfLocker, out var locker) && TryGetCorrelation(EntityRelationship.AccountLockerOfAccount, out var account)) { lookup = new AccountLockerEntryDbLookup(locker.EntityId, account.EntityId); diff --git a/src/RadixDlt.NetworkGateway.PostgresIntegration/Services/EntityStateQuerier.cs b/src/RadixDlt.NetworkGateway.PostgresIntegration/Services/EntityStateQuerier.cs index 2ad9040af..d409ada7d 100644 --- a/src/RadixDlt.NetworkGateway.PostgresIntegration/Services/EntityStateQuerier.cs +++ b/src/RadixDlt.NetworkGateway.PostgresIntegration/Services/EntityStateQuerier.cs @@ -138,6 +138,7 @@ public EntityStateQuerier( { var defaultPageSize = _endpointConfiguration.Value.DefaultPageSize; var packagePageSize = _endpointConfiguration.Value.DefaultHeavyCollectionsPageSize; + var networkConfiguration = await _networkConfigurationProvider.GetNetworkConfiguration(token); var entities = await GetEntities(addresses, ledgerState, token); var componentEntities = entities.OfType().ToList(); @@ -158,8 +159,11 @@ public EntityStateQuerier( var fungibleVaultsHistory = await GetFungibleVaultsHistory(fungibleVaultEntities, ledgerState, token); var nonFungibleVaultsHistory = await GetNonFungibleVaultsHistory(nonFungibleVaultEntities, optIns.NonFungibleIncludeNfids, ledgerState, token); var resolvedTwoWayLinks = optIns.DappTwoWayLinks - ? await new StandardMetadataResolver(_dbContext, _dapperWrapper).ResolveTwoWayLinks(entities, true, true, ledgerState, token) + ? await new StandardMetadataResolver(_dbContext, _dapperWrapper).ResolveTwoWayLinks(entities, true, ledgerState, token) : ImmutableDictionary>.Empty; + var resolvedNativeResourceDetails = optIns.NativeResourceDetails + ? await new NativeResourceDetailsResolver(_dbContext, _dapperWrapper, networkConfiguration).GetNativeResourceDetails(entities, ledgerState, token) + : ImmutableDictionary.Empty; var correlatedAddresses = await GetCorrelatedEntityAddresses(entities, packageBlueprintHistory, ledgerState, token); @@ -191,6 +195,7 @@ public EntityStateQuerier( GatewayModel.StateEntityDetailsResponseItemDetails? details = null; resolvedTwoWayLinks.TryGetValue(entity.Address, out var twoWayLinks); + resolvedNativeResourceDetails.TryGetValue(entity.Address, out var nativeResourceDetails); switch (entity) { @@ -204,7 +209,8 @@ public EntityStateQuerier( totalMinted: fungibleResourceSupplyData.TotalMinted.ToString(), totalBurned: fungibleResourceSupplyData.TotalBurned.ToString(), divisibility: frme.Divisibility, - twoWayLinkedDapps: fungibleTwoWayLinkedDapps?.Any() == true ? new GatewayModel.TwoWayLinkedDappsCollection(items: fungibleTwoWayLinkedDapps) : null); + twoWayLinkedDapps: fungibleTwoWayLinkedDapps?.Any() == true ? new GatewayModel.TwoWayLinkedDappsCollection(items: fungibleTwoWayLinkedDapps) : null, + nativeResourceDetails: nativeResourceDetails); break; @@ -224,7 +230,8 @@ public EntityStateQuerier( totalBurned: nonFungibleResourceSupplyData.TotalBurned.ToString(), nonFungibleIdType: nfrme.NonFungibleIdType.ToGatewayModel(), nonFungibleDataMutableFields: nfrme.NonFungibleDataMutableFields, - twoWayLinkedDapps: nonFungibleTwoWayLinkedDapps?.Any() == true ? new GatewayModel.TwoWayLinkedDappsCollection(items: nonFungibleTwoWayLinkedDapps) : null); + twoWayLinkedDapps: nonFungibleTwoWayLinkedDapps?.Any() == true ? new GatewayModel.TwoWayLinkedDappsCollection(items: nonFungibleTwoWayLinkedDapps) : null, + nativeResourceDetails: nativeResourceDetails); break; case GlobalPackageEntity pe: @@ -338,7 +345,7 @@ public EntityStateQuerier( var componentRoyaltyVaultBalance = royaltyVaultsBalances?.SingleOrDefault(x => x.OwnerEntityId == ce.Id)?.Balance; details = new GatewayModel.StateEntityDetailsResponseComponentDetails( - packageAddress: correlatedAddresses[ce.GetPackageId()], + packageAddress: correlatedAddresses[ce.GetInstantiatingPackageId()], blueprintName: ce.BlueprintName, blueprintVersion: ce.BlueprintVersion, state: state != null ? new JRaw(state) : null, @@ -346,7 +353,8 @@ public EntityStateQuerier( royaltyVaultBalance: componentRoyaltyVaultBalance != null ? TokenAmount.FromSubUnitsString(componentRoyaltyVaultBalance).ToString() : null, royaltyConfig: optIns.ComponentRoyaltyConfig ? componentRoyaltyConfig.ToGatewayModel() : null, twoWayLinkedDappAddress: nonAccountTwoWayLinkedDapp, - twoWayLinkedDappDetails: twoWayLinkedDappOnLedgerDetails); + twoWayLinkedDappDetails: twoWayLinkedDappOnLedgerDetails, + nativeResourceDetails: nativeResourceDetails); break; } @@ -1502,7 +1510,7 @@ private async Task> GetCorrelatedEntityAddresses lookup.Add(entity.GlobalAncestorId.Value); } - if (entity.TryGetCorrelation(EntityRelationship.ComponentPackage, out var packageCorrelation)) + if (entity.TryGetCorrelation(EntityRelationship.ComponentToInstantiatingPackage, out var packageCorrelation)) { lookup.Add(packageCorrelation.EntityId); } diff --git a/src/RadixDlt.NetworkGateway.PostgresIntegration/Services/NativeResourceDetailsResolver.cs b/src/RadixDlt.NetworkGateway.PostgresIntegration/Services/NativeResourceDetailsResolver.cs new file mode 100644 index 000000000..799d14ef1 --- /dev/null +++ b/src/RadixDlt.NetworkGateway.PostgresIntegration/Services/NativeResourceDetailsResolver.cs @@ -0,0 +1,258 @@ +/* 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.Abstractions; +using RadixDlt.NetworkGateway.Abstractions.Model; +using RadixDlt.NetworkGateway.Abstractions.Network; +using RadixDlt.NetworkGateway.Abstractions.Numerics; +using RadixDlt.NetworkGateway.PostgresIntegration.LedgerExtension; +using RadixDlt.NetworkGateway.PostgresIntegration.Models; +using System; +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; +using GatewayModel = RadixDlt.NetworkGateway.GatewayApiSdk.Model; + +namespace RadixDlt.NetworkGateway.PostgresIntegration.Services; + +internal class NativeResourceDetailsResolver +{ + private static IDictionary? _wellKnownStaticCache; + + private readonly ReadOnlyDbContext _dbContext; + private readonly IDapperWrapper _dapperWrapper; + private readonly NetworkConfiguration _networkConfiguration; + + public NativeResourceDetailsResolver(ReadOnlyDbContext dbContext, IDapperWrapper dapperWrapper, NetworkConfiguration networkConfiguration) + { + _dbContext = dbContext; + _dapperWrapper = dapperWrapper; + _networkConfiguration = networkConfiguration; + } + + public async Task> GetNativeResourceDetails(ICollection entities, GatewayModel.LedgerState ledgerState, CancellationToken token) + { + var result = new Dictionary(entities.Count); + var missingEntities = new List(); + + foreach (var entity in entities) + { + if (TryGetWellKnown(entity.Address, out var nativeResourceDetails)) + { + result[entity.Address] = nativeResourceDetails; + } + else + { + missingEntities.Add(entity.Address); + } + } + + if (missingEntities.Any()) + { + result.AddRange(await GetFromDatabase(missingEntities, ledgerState, token)); + } + + return result; + } + + private record struct DbRow(EntityRelationship BaseRelationship, string BaseEntityAddress, string? BaseTotalSupply, EntityType RootEntityType, string RootEntityAddress, string? ResourceEntityAddress, string? ResourceBalance); + + private async Task> GetFromDatabase(List addresses, GatewayModel.LedgerState ledgerState, CancellationToken token) + { + var rows = await _dapperWrapper.ToList( + _dbContext, + @"WITH +variables AS ( + SELECT + @stateVersion AS state_version, + @addresses AS addresses +), +base_entities AS ( + SELECT + e.address AS base_address, + s.total_supply AS base_total_supply, + unnest(e.correlated_entity_relationships) AS base_correlated_entity_relationship, + unnest(e.correlated_entity_ids) AS base_correlated_entity_id + FROM variables var, entities e + LEFT JOIN LATERAL ( + SELECT total_supply + FROM resource_entity_supply_history + WHERE from_state_version <= var.state_version AND resource_entity_id = e.id + ORDER BY from_state_version DESC + LIMIT 1 + ) s ON TRUE + WHERE + e.from_state_version <= var.state_version + AND e.address = ANY(var.addresses) + AND e.correlated_entity_relationships && '{unit_vault_of_resource_pool, stake_vault_of_validator, claim_token_of_validator, recovery_badge_of_access_controller}'::entity_relationship[] +), +base_with_root AS ( + SELECT + base.*, + root.discriminator AS root_discriminator, + root.address AS root_address, + unnest(root.correlated_entity_relationships) as root_correlated_entity_relationship, + unnest(root.correlated_entity_ids) AS root_correlated_entity_id + FROM base_entities base + INNER JOIN entities root ON root.id = base.base_correlated_entity_id + WHERE base.base_correlated_entity_relationship = ANY('{unit_vault_of_resource_pool, stake_vault_of_validator, claim_token_of_validator, recovery_badge_of_access_controller}'::entity_relationship[]) +) +SELECT + bwr.base_correlated_entity_relationship AS BaseRelationship, + bwr.base_address AS BaseEntityAddress, + CAST(bwr.base_total_supply AS TEXT) AS BaseTotalSupply, + bwr.root_discriminator AS RootEntityType, + bwr.root_address AS RootEntityAddress, + re.address AS ResourceEntityAddress, + CAST(vault.balance AS TEXT) AS ResourceBalance +FROM variables var, base_with_root bwr +LEFT JOIN LATERAL ( + SELECT * + FROM entity_vault_history + WHERE from_state_version <= var.state_version AND vault_entity_id = bwr.root_correlated_entity_id + ORDER BY from_state_version DESC + LIMIT 1 +) vault ON TRUE +LEFT JOIN entities re ON re.id = vault.resource_entity_id +WHERE bwr.root_correlated_entity_relationship = ANY('{resource_pool_to_resource_vault, validator_to_stake_vault, access_controller_to_recovery_badge}'::entity_relationship[]);", + new + { + addresses = addresses.Select(e => (string)e).ToList(), + stateVersion = ledgerState.StateVersion, + }, + token); + + return rows.GroupBy(r => (EntityAddress)r.BaseEntityAddress).ToDictionary(g => g.Key, grouping => + { + var rootEntityType = grouping.First().RootEntityType; + var rootEntityAddress = grouping.First().RootEntityAddress; + var baseRelationship = grouping.First().BaseRelationship; + + if (rootEntityType == EntityType.GlobalAccessController) + { + return new GatewayModel.NativeResourceAccessControllerRecoveryBadgeValue(rootEntityAddress); + } + + if (rootEntityType == EntityType.GlobalValidator && baseRelationship == EntityRelationship.ClaimTokenOfValidator) + { + return new GatewayModel.NativeResourceValidatorClaimNftValue(rootEntityAddress); + } + + var baseTotalSupply = TokenAmount.FromSubUnitsString(grouping.First().BaseTotalSupply ?? throw new InvalidOperationException($"BaseTotalSupply cannot be empty on {grouping.Key}")); + var redemptionValues = new List(); + + foreach (var entry in grouping) + { + var resourceAddress = entry.ResourceEntityAddress ?? throw new InvalidOperationException($"ResourceEntityAddress cannot be empty on {grouping.Key}"); + TokenAmount? amount = null; + + if (baseTotalSupply > TokenAmount.Zero) + { + var resourceBalance = entry.ResourceBalance ?? throw new InvalidOperationException($"ResourceBalance cannot be empty on {grouping.Key}"); + amount = TokenAmount.FromSubUnitsString(resourceBalance) / baseTotalSupply; + } + + redemptionValues.Add(new GatewayModel.NativeResourceRedemptionValueItem(resourceAddress, amount?.ToString())); + } + + GatewayModel.NativeResourceDetails result = rootEntityType switch + { + EntityType.GlobalValidator => new GatewayModel.NativeResourceValidatorLiquidStakeUnitValue(rootEntityAddress, redemptionValues.Count, redemptionValues), + EntityType.GlobalOneResourcePool => new GatewayModel.NativeResourceOneResourcePoolUnitValue(rootEntityAddress, redemptionValues.Count, redemptionValues), + EntityType.GlobalTwoResourcePool => new GatewayModel.NativeResourceTwoResourcePoolUnitValue(rootEntityAddress, redemptionValues.Count, redemptionValues), + EntityType.GlobalMultiResourcePool => new GatewayModel.NativeResourceMultiResourcePoolUnitValue(rootEntityAddress, redemptionValues.Count, redemptionValues), + _ => throw new ArgumentOutOfRangeException(nameof(rootEntityType), rootEntityType, null), + }; + + return result; + }); + } + + private bool TryGetWellKnown(EntityAddress entityAddress, [NotNullWhen(true)] out GatewayModel.NativeResourceDetails? result) + { + // might get executed multiple times, but it doesn't really matter + if (_wellKnownStaticCache == null) + { + var wka = _networkConfiguration.WellKnownAddresses; + + _wellKnownStaticCache = new Dictionary + { + [wka.Xrd] = new GatewayModel.NativeResourceXrdValue(), + [wka.PackageOwnerBadge] = new GatewayModel.NativeResourcePackageOwnerBadgeValue(), + [wka.AccountOwnerBadge] = new GatewayModel.NativeResourceAccountOwnerBadgeValue(), + [wka.IdentityOwnerBadge] = new GatewayModel.NativeResourceIdentityOwnerBadgeValue(), + [wka.ValidatorOwnerBadge] = new GatewayModel.NativeResourceValidatorOwnerBadgeValue(), + [wka.Secp256k1SignatureVirtualBadge] = new GatewayModel.NativeResourceSecp256k1SignatureResourceValue(), + [wka.Ed25519SignatureVirtualBadge] = new GatewayModel.NativeResourceEd25519SignatureResourceValue(), + [wka.GlobalCallerVirtualBadge] = new GatewayModel.NativeResourceGlobalCallerResourceValue(), + [wka.PackageOfDirectCallerVirtualBadge] = new GatewayModel.NativeResourcePackageOfDirectCallerResourceValue(), + [wka.SystemTransactionBadge] = new GatewayModel.NativeResourceSystemExecutionResourceValue(), // TODO is it even valid? + }; + } + + return _wellKnownStaticCache.TryGetValue(entityAddress, out result); + } +} diff --git a/src/RadixDlt.NetworkGateway.PostgresIntegration/Services/RoleAssignmentQuerier.cs b/src/RadixDlt.NetworkGateway.PostgresIntegration/Services/RoleAssignmentQuerier.cs index 5386a4806..afb2e11e3 100644 --- a/src/RadixDlt.NetworkGateway.PostgresIntegration/Services/RoleAssignmentQuerier.cs +++ b/src/RadixDlt.NetworkGateway.PostgresIntegration/Services/RoleAssignmentQuerier.cs @@ -107,7 +107,7 @@ public RoleAssignmentQuerier( var componentLookup = componentEntities.Select(x => x.Id).ToHashSet(); var aggregates = await GetEntityRoleAssignmentsAggregateHistory(componentLookup, ledgerState, token); - var blueprintLookup = componentEntities.Select(x => new BlueprintDefinitionIdentifier(x.BlueprintName, x.BlueprintVersion, x.GetPackageId())).ToHashSet(); + var blueprintLookup = componentEntities.Select(x => new BlueprintDefinitionIdentifier(x.BlueprintName, x.BlueprintVersion, x.GetInstantiatingPackageId())).ToHashSet(); var blueprintDefinitions = await _blueprintProvider.GetBlueprints(blueprintLookup, ledgerState, token); var blueprintAuthConfigs = ExtractAuthConfigurationFromBlueprint(blueprintDefinitions); diff --git a/src/RadixDlt.NetworkGateway.PostgresIntegration/Services/RoleAssignmentsMapper.cs b/src/RadixDlt.NetworkGateway.PostgresIntegration/Services/RoleAssignmentsMapper.cs index 4bd0824b9..3f3b6c9a4 100644 --- a/src/RadixDlt.NetworkGateway.PostgresIntegration/Services/RoleAssignmentsMapper.cs +++ b/src/RadixDlt.NetworkGateway.PostgresIntegration/Services/RoleAssignmentsMapper.cs @@ -107,11 +107,11 @@ public RoleAssignmentsMapper(IRoleAssignmentsKeyProvider roleAssignmentsKeyProvi throw new UnreachableException($"No owner role defined for entity: {entity.Address}"); } - var authConfigFound = blueprintAuthConfigs.TryGetValue(new BlueprintDefinitionIdentifier(entity.BlueprintName, entity.BlueprintVersion, entity.GetPackageId()), out var authConfig); + var authConfigFound = blueprintAuthConfigs.TryGetValue(new BlueprintDefinitionIdentifier(entity.BlueprintName, entity.BlueprintVersion, entity.GetInstantiatingPackageId()), out var authConfig); if (!authConfigFound) { - throw new UnreachableException($"blueprint: {entity.BlueprintName} {entity.BlueprintVersion} in package: {entity.GetPackageId()} not found"); + throw new UnreachableException($"blueprint: {entity.BlueprintName} {entity.BlueprintVersion} in package: {entity.GetInstantiatingPackageId()} not found"); } var mainModuleKeys = _roleAssignmentsKeyProvider.ExtractKeysFromBlueprintAuthConfig(authConfig!); diff --git a/src/RadixDlt.NetworkGateway.PostgresIntegration/Services/StandardMetadataResolver.cs b/src/RadixDlt.NetworkGateway.PostgresIntegration/Services/StandardMetadataResolver.cs index 107fd8773..357639373 100644 --- a/src/RadixDlt.NetworkGateway.PostgresIntegration/Services/StandardMetadataResolver.cs +++ b/src/RadixDlt.NetworkGateway.PostgresIntegration/Services/StandardMetadataResolver.cs @@ -70,6 +70,7 @@ using System.Collections.Concurrent; using System.Collections.Generic; using System.Collections.Immutable; +using System.Diagnostics.CodeAnalysis; using System.Linq; using System.Threading; using System.Threading.Tasks; @@ -79,7 +80,24 @@ namespace RadixDlt.NetworkGateway.PostgresIntegration.Services; internal class StandardMetadataResolver { - private record PartiallyValidatedTwoWayLink(long FromStateVersion, StandardMetadataKey Discriminator, bool IsLocked, string EntityAddress, string TargetValue, string ValidationResult); + private record struct PartiallyValidatedTwoWayLink(long FromStateVersion, StandardMetadataKey Discriminator, bool IsLocked, string EntityAddress, string TargetValue, string ValidationResult); + + private record struct ValidatedTwoWayLink(PartiallyValidatedTwoWayLink Link, ResolvedTwoWayLink? ResolvedTwoWayLink, string? ValidationError) + { + public bool IsSuccessfullyResolved([NotNullWhen(true)] out ResolvedTwoWayLink? resolved) + { + resolved = null; + + if (ValidationError == null && ResolvedTwoWayLink != null) + { + resolved = ResolvedTwoWayLink; + + return true; + } + + return false; + } + } private readonly ReadOnlyDbContext _dbContext; private readonly IDapperWrapper _dapperWrapper; @@ -92,7 +110,6 @@ public StandardMetadataResolver(ReadOnlyDbContext dbContext, IDapperWrapper dapp public async Task>> ResolveTwoWayLinks( ICollection entities, - bool resolveValidOnly, bool validateOnLedgerOnly, GatewayModel.LedgerState ledgerState, CancellationToken token = default) @@ -104,7 +121,6 @@ public async Task>> R return ImmutableDictionary>.Empty; } -#pragma warning disable SA1118 var partiallyValidatedEntries = await _dapperWrapper.ToList( _dbContext, @" @@ -256,8 +272,9 @@ ELSE @validationOnLedgerSucceeded WHEN 'dapp_account_locker' THEN CASE FALSE WHEN source_discriminator = 'global_account_component' THEN 'account expected' - WHEN target_entity_discriminator = 'global_account_locker' THEN 'target locker expected' + WHEN dapp_marker_check_valid = TRUE THEN 'dapp marker invalid' WHEN target_entity_check_valid = TRUE THEN 'target link broken' + WHEN target_entity_discriminator = 'global_account_locker' THEN 'target locker expected' ELSE @validationOnLedgerAppCheck END WHEN 'dapp_claimed_websites' THEN @@ -274,7 +291,6 @@ FROM candidates c coalesce(target_value, target_entity_address) AS TargetValue, validation_result AS ValidationResult FROM resolved", -#pragma warning restore SA1118 new { dappAccountTypeDappDefinition = StandardMetadataConstants.DappAccountTypeDappDefinition, @@ -296,65 +312,71 @@ validation_result AS ValidationResult await Parallel.ForEachAsync(partiallyValidatedEntries, options, async (pv, innerToken) => { - var resolved = await ResolveTwoWayLink(pv, validateOnLedgerOnly, partiallyValidatedEntries, innerToken); + var validated = await ResolveTwoWayLink(pv, validateOnLedgerOnly, partiallyValidatedEntries, innerToken); - if (resolved == null) + if (validated.IsSuccessfullyResolved(out var resolved)) { - return; + result.GetOrAdd((EntityAddress)pv.EntityAddress, _ => new ConcurrentQueue()).Enqueue(resolved); } - - if (resolveValidOnly && !resolved.IsValid) - { - return; - } - - result.GetOrAdd((EntityAddress)pv.EntityAddress, _ => new ConcurrentQueue()).Enqueue(resolved); }); return result.ToDictionary(e => e.Key, e => (ICollection)e.Value.ToList()); } - private async ValueTask ResolveTwoWayLink(PartiallyValidatedTwoWayLink entry, bool validateOnLedgerOnly, ICollection allEntries, CancellationToken token) + private async ValueTask ResolveTwoWayLink(PartiallyValidatedTwoWayLink link, bool validateOnLedgerOnly, ICollection allEntries, CancellationToken token) { - if (entry.ValidationResult == StandardMetadataConstants.ValidationUnknown) + if (link.ValidationResult == StandardMetadataConstants.ValidationUnknown) { - throw CreateException(entry, "unknown validation result"); + throw CreateException(link, "unknown validation result"); } - if (entry.Discriminator == StandardMetadataKey.DappClaimedWebsites) + if (link.Discriminator == StandardMetadataKey.DappClaimedWebsites) { - if (entry.ValidationResult != StandardMetadataConstants.ValidationOffLedgerAppCheck) + if (link.ValidationResult == StandardMetadataConstants.ValidationOffLedgerAppCheck) { - throw CreateException(entry, "expected off-ledger app-check validation result"); + return await ResolveDappClaimedWebsite(link, validateOnLedgerOnly, token); } - return await ResolveDappClaimedWebsite((EntityAddress)entry.EntityAddress, entry.TargetValue, validateOnLedgerOnly, token); + return new ValidatedTwoWayLink(link, null, "expected off-ledger app-check validation result, got: " + link.ValidationResult); } - if (entry.Discriminator == StandardMetadataKey.DappAccountLocker) + if (link.Discriminator == StandardMetadataKey.DappAccountLocker) { - if (entry.ValidationResult != StandardMetadataConstants.ValidationOnLedgerAppCheck) + if (link.ValidationResult == StandardMetadataConstants.ValidationOnLedgerAppCheck) { - throw CreateException(entry, "expected on-ledger app-check validation result"); + return ResolveDappAccountLocker(link, allEntries); } - return ResolveDappAccountLocker((EntityAddress)entry.EntityAddress, (EntityAddress)entry.TargetValue, allEntries); + return new ValidatedTwoWayLink(link, null, "expected on-ledger app-check validation result, got: " + link.ValidationResult); + } + + if (link.ValidationResult != StandardMetadataConstants.ValidationOnLedgerSucceeded) + { + return new ValidatedTwoWayLink(link, null, link.ValidationResult); + } + + if (link.Discriminator == StandardMetadataKey.DappAccountType) + { + return new ValidatedTwoWayLink(link, null, null); } - var invalidReason = entry.ValidationResult == StandardMetadataConstants.ValidationOnLedgerSucceeded ? null : entry.ValidationResult; + var target = (EntityAddress)link.TargetValue; - return entry.Discriminator switch + ResolvedTwoWayLink resolved = link.Discriminator switch { - StandardMetadataKey.DappAccountType => null, - StandardMetadataKey.DappDefinition => new DappDefinitionResolvedTwoWayLink((EntityAddress)entry.TargetValue, invalidReason), - StandardMetadataKey.DappDefinitions => new DappDefinitionsResolvedTwoWayLink((EntityAddress)entry.TargetValue, invalidReason), - StandardMetadataKey.DappClaimedEntities => new DappClaimedEntityResolvedTwoWayLink((EntityAddress)entry.TargetValue, invalidReason), - _ => throw CreateException(entry, "unsupported entry discriminator"), + StandardMetadataKey.DappDefinition => new DappDefinitionResolvedTwoWayLink(target), + StandardMetadataKey.DappDefinitions => new DappDefinitionsResolvedTwoWayLink(target), + StandardMetadataKey.DappClaimedEntities => new DappClaimedEntityResolvedTwoWayLink(target), + _ => throw CreateException(link, "unsupported entry discriminator"), }; + + return new ValidatedTwoWayLink(link, resolved, null); } - private async ValueTask ResolveDappClaimedWebsite(EntityAddress entityAddress, string claimedWebsite, bool validateOnLedgerOnly, CancellationToken token) + private async ValueTask ResolveDappClaimedWebsite(PartiallyValidatedTwoWayLink link, bool validateOnLedgerOnly, CancellationToken token) { + var claimedWebsite = link.TargetValue; + async Task Validate() { if (validateOnLedgerOnly) @@ -379,19 +401,25 @@ private async ValueTask ResolveDappClaimed await Task.CompletedTask; - throw new NotImplementedException($"unsupported; URL = {radixJsonUrl}, entity_addr = {entityAddress}"); + throw new NotImplementedException($"unsupported; URL = {radixJsonUrl}, entity_addr = {link.EntityAddress}"); } var invalidReason = await Validate(); - return new DappClaimedWebsiteResolvedTwoWayLink(new Uri(claimedWebsite), invalidReason); + return invalidReason == null + ? new ValidatedTwoWayLink(link, new DappClaimedWebsiteResolvedTwoWayLink(new Uri(claimedWebsite)), null) + : new ValidatedTwoWayLink(link, null, invalidReason); } - private DappAccountLockerResolvedTwoWayLink ResolveDappAccountLocker(EntityAddress entityAddress, EntityAddress lockerAddress, ICollection allEntries) + private ValidatedTwoWayLink ResolveDappAccountLocker(PartiallyValidatedTwoWayLink link, ICollection allEntries) { - var valid = allEntries.Any(x => x.EntityAddress == entityAddress && x.Discriminator == StandardMetadataKey.DappClaimedEntities && x.TargetValue == lockerAddress); + var entityAddress = (EntityAddress)link.EntityAddress; + var lockerAddress = (EntityAddress)link.TargetValue; + var isValid = allEntries.Any(x => x.EntityAddress == entityAddress && x.Discriminator == StandardMetadataKey.DappClaimedEntities && x.TargetValue == lockerAddress); - return new DappAccountLockerResolvedTwoWayLink(entityAddress, valid ? null : "claimed_entities entry with the locker address missing"); + return isValid + ? new ValidatedTwoWayLink(link, new DappAccountLockerResolvedTwoWayLink(lockerAddress), null) + : new ValidatedTwoWayLink(link, null, "claimed_entities entry with the locker address missing"); } private Exception CreateException(PartiallyValidatedTwoWayLink entry, string details) diff --git a/tests/RadixDlt.NetworkGateway.UnitTests/Abstractions/Numerics/TokenAmountTests.cs b/tests/RadixDlt.NetworkGateway.UnitTests/Abstractions/Numerics/TokenAmountTests.cs index ae2cd5ae9..e41e87977 100644 --- a/tests/RadixDlt.NetworkGateway.UnitTests/Abstractions/Numerics/TokenAmountTests.cs +++ b/tests/RadixDlt.NetworkGateway.UnitTests/Abstractions/Numerics/TokenAmountTests.cs @@ -66,6 +66,7 @@ using RadixDlt.NetworkGateway.Abstractions.Numerics; using System; using System.Collections.Generic; +using System.Globalization; using System.Numerics; using Xunit; @@ -214,4 +215,31 @@ public void GivenTokenAmount_IsNaN_ReturnsCorrectly(TokenAmount tokenAmount, boo { tokenAmount.IsNaN().Should().Be(expectedIsNaN); } + + [Theory] + [InlineData("1", "1", "1")] + [InlineData("100", "10", "10")] + [InlineData("32", "4", "8")] + [InlineData("5000000000", "0.2", "25000000000")] + [InlineData("5000000000", "0.00005", "100000000000000")] + public void Divide_ExactValue(string dividend, string divisor, string expected) + { + var result = TokenAmount.FromDecimalString(dividend) / TokenAmount.FromDecimalString(divisor); + + result.ToString().Should().Be(expected); + } + + [Theory] + [InlineData("141", "100", "1.410")] + [InlineData("100", "141", "0.709")] + [InlineData("100", "33", "3.030")] + [InlineData("50000000000", "0.123456789", "405000003685")] + public void Divide_ApproximateValue(string dividend, string divisor, string expected) + { + var result = TokenAmount.FromDecimalString(dividend) / TokenAmount.FromDecimalString(divisor); + var resultAsNumber = decimal.Parse(result.ToString(), NumberFormatInfo.InvariantInfo); + var expectedAsNumber = decimal.Parse(expected, NumberFormatInfo.InvariantInfo); + + resultAsNumber.Should().BeApproximately(expectedAsNumber, 100); + } }