From 3358b08113603d28f617a3a464263701ef64da91 Mon Sep 17 00:00:00 2001 From: Tanveer Wahid Date: Tue, 28 Jul 2026 14:51:31 -0700 Subject: [PATCH 1/2] feat(asset-movement): base updates from anchor-rs v0.4.0 --- scripts/pins.env | 4 +- .../AssetMovement/AssetMovementClient.cs | 42 ++++++- .../AssetMovement/AssetMovementModels.cs | 116 +++++++++++++++++- .../AssetFlowTests.cs | 50 ++++++-- .../KeetaNet.Anchor.Tests/AssetModelTests.cs | 96 +++++++++++++++ tests/node-harness/package-lock.json | 47 ++++--- tests/node-harness/package.json | 6 +- tests/node-harness/src/asset.ts | 18 ++- 8 files changed, 346 insertions(+), 33 deletions(-) diff --git a/scripts/pins.env b/scripts/pins.env index ed4e4db..69bbc9e 100644 --- a/scripts/pins.env +++ b/scripts/pins.env @@ -3,8 +3,8 @@ # The wasm core (scripts/build-wasm.sh). ANCHOR_WASI_CRATE="keetanetwork-anchor-client-wasi" -ANCHOR_WASI_VERSION="0.2.2" -ANCHOR_WASI_SHA256="ec7e987bb55b98efca8ad071f983135161d6fd19aec7780ee563674454c1051e" +ANCHOR_WASI_VERSION="0.4.0" +ANCHOR_WASI_SHA256="45dc1b0968dc41a2feda63e47d7a20e7536d218e49c5cd4a2bc7fcf3e336d348" # The canonical node OpenAPI spec (scripts/generate-node-api.sh). NODE_CLIENT_CRATE="keetanetwork-client" diff --git a/src/KeetaNet.Anchor/Services/AssetMovement/AssetMovementClient.cs b/src/KeetaNet.Anchor/Services/AssetMovement/AssetMovementClient.cs index 2d963cc..54b13dc 100644 --- a/src/KeetaNet.Anchor/Services/AssetMovement/AssetMovementClient.cs +++ b/src/KeetaNet.Anchor/Services/AssetMovement/AssetMovementClient.cs @@ -105,6 +105,44 @@ public async Task> GetProvidersForTransfer( return disclaimers; } + /// + /// The provider's identifying details published under + /// legal.anchorDetails, or null when its metadata carries none. A + /// malformed description is dropped while the name and logo are kept. + /// + public AssetAnchorDetails? GetProviderAnchorDetails(AssetProvider provider) + { + if (provider.Legal is not { } legal + || legal.ValueKind != JsonValueKind.Object + || !legal.TryGetProperty("anchorDetails", out JsonElement details) + || details.ValueKind != JsonValueKind.Object) + { + return null; + } + + string? name = ReadOptionalString(details, "name"); + string? logo = ReadOptionalString(details, "logo"); + + AssetRenderableContent? description = null; + if (details.TryGetProperty("description", out JsonElement rawDescription)) + { + TryDeserialize(rawDescription, out description); + } + + return new AssetAnchorDetails(name, description, logo); + } + + /// The member's string value, or null when absent or not a string. + private static string? ReadOptionalString(JsonElement element, string name) + { + if (!element.TryGetProperty(name, out JsonElement found) || found.ValueKind != JsonValueKind.String) + { + return null; + } + + return found.GetString(); + } + /// /// The legal disclaimers advertised by the provider with /// , or null when the provider or its disclaimers are @@ -236,11 +274,11 @@ public Task ListForwardingAddressTemplates( ReadOperationAsync(Runtime.AssetListForwardingAddressTemplates, provider, request, cancellationToken); /// Create a persistent-forwarding address, returning its (obfuscated) details. - public Task CreatePersistentForwardingAddress( + public Task CreatePersistentForwardingAddress( AssetProvider provider, AssetCreateAddressRequest request, CancellationToken cancellationToken = default) => - ReadOperationAsync(Runtime.AssetCreatePersistentForwardingAddress, provider, request, cancellationToken); + ReadOperationAsync(Runtime.AssetCreatePersistentForwardingAddress, provider, request, cancellationToken); /// List persistent-forwarding addresses. public Task ListForwardingAddresses( diff --git a/src/KeetaNet.Anchor/Services/AssetMovement/AssetMovementModels.cs b/src/KeetaNet.Anchor/Services/AssetMovement/AssetMovementModels.cs index afcc216..c467e15 100644 --- a/src/KeetaNet.Anchor/Services/AssetMovement/AssetMovementModels.cs +++ b/src/KeetaNet.Anchor/Services/AssetMovement/AssetMovementModels.cs @@ -96,11 +96,15 @@ public sealed record AssetCreateAddressRequest( object? DestinationAddress = null, string? PersistentAddressTemplateId = null); -/// One filter over persistent-forwarding addresses. +/// +/// One filter over persistent-forwarding addresses. is a +/// single canonical asset or a { from, to } conversion pair, matching +/// . +/// public sealed record AssetAddressFilter( string? SourceLocation = null, string? DestinationLocation = null, - string? Asset = null, + AssetOrPair? Asset = null, string? DestinationAddress = null, string? PersistentAddressTemplateId = null); @@ -161,8 +165,104 @@ public sealed record AssetForwardingTemplate(string Id, JsonElement Location, Js /// A page of persistent-forwarding templates. public sealed record AssetTemplatePage(IReadOnlyList Templates, string Total); +/// +/// A canonical asset id, or an id located at a canonical location (the +/// reference AssetOrAssetWithLocation). A bare id crosses the wire as a +/// string, a located id as { id, location }. +/// +[JsonConverter(typeof(AssetOrAssetWithLocationConverter))] +public sealed record AssetOrAssetWithLocation(string Id, string? Location = null); + +/// +/// Reads and writes the reference wire form: a bare id string when +/// is absent, otherwise an +/// { id, location } object. +/// +internal sealed class AssetOrAssetWithLocationConverter : JsonConverter +{ + public override AssetOrAssetWithLocation Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType == JsonTokenType.String) + { + return new AssetOrAssetWithLocation(reader.GetString() ?? ""); + } + + using var document = JsonDocument.ParseValue(ref reader); + JsonElement element = document.RootElement; + if (!element.TryGetProperty("id", out JsonElement id) + || !element.TryGetProperty("location", out JsonElement location) + || id.ValueKind != JsonValueKind.String + || location.ValueKind != JsonValueKind.String) + { + throw new JsonException("a located asset requires string 'id' and 'location' members"); + } + + return new AssetOrAssetWithLocation(id.GetString()!, location.GetString()); + } + + public override void Write(Utf8JsonWriter writer, AssetOrAssetWithLocation value, JsonSerializerOptions options) + { + if (value.Location is null) + { + writer.WriteStringValue(value.Id); + return; + } + + writer.WriteStartObject(); + writer.WriteString("id", value.Id); + writer.WriteString("location", value.Location); + writer.WriteEndObject(); + } +} + +/// +/// One fee line item in a breakdown (the reference resolved/unresolved fee +/// line-item union flattened): a fixed fee carries , an +/// unresolved variable fee carries , a resolved +/// variable fee carries both. +/// +public sealed record AssetFeeLineItem( + string Purpose, + string? Value = null, + double? BasisPoints = null, + AssetOrAssetWithLocation? Asset = null, + AssetRenderableContent? Details = null); + +/// +/// A fee breakdown: its line items, with an optional pre-computed total. An +/// unset is the sum of the line items; an unset +/// is the transferred asset. +/// +public sealed record AssetFeeBreakdown( + IReadOnlyList LineItems, + string? Total = null, + AssetOrAssetWithLocation? TotalPricedIn = null); + +/// The smallest transfer a persistent-forwarding address accepts. +public sealed record AssetMinimumTransferValue(string Asset, string Value); + +/// +/// One persistent-forwarding address (the reference +/// KeetaPersistentForwardingAddressDetails). and +/// the location/destination members stay raw JSON: each is resolved or +/// obfuscated at the provider's discretion; decode a resolved address with +/// . +/// +public sealed record AssetForwardingAddress( + JsonElement Address, + string? Id = null, + JsonElement? DepositMessage = null, + AssetOrPair? Asset = null, + JsonElement? SourceLocation = null, + JsonElement? DestinationLocation = null, + JsonElement? DestinationAddress = null, + string? OutgoingRail = null, + IReadOnlyList? IncomingRail = null, + AssetMinimumTransferValue? MinimumTransferValue = null, + AssetFeeBreakdown? Fees = null); + /// A page of persistent-forwarding addresses. -public sealed record AssetAddressPage(IReadOnlyList Addresses, string Total); +public sealed record AssetAddressPage(IReadOnlyList Addresses, string Total); /// A page of asset-movement transactions. public sealed record AssetTransactionPage(IReadOnlyList Transactions, string Total); @@ -204,6 +304,16 @@ public sealed record AssetRenderableContent(AssetContentType Type, string Conten /// One legal disclaimer a provider publishes under its legal metadata. public sealed record AssetDisclaimer(AssetDisclaimerPurpose Purpose, AssetRenderableContent Content); +/// +/// The identifying details a provider publishes under +/// legal.anchorDetails (the reference +/// AnchorMetadataLegalAnchorDetails). +/// +public sealed record AssetAnchorDetails( + string? Name = null, + AssetRenderableContent? Description = null, + string? Logo = null); + /// /// The token metadata a provider advertises for one asset at one location /// (the reference AnchorTokenLocationMetadata). diff --git a/tests/KeetaNet.Anchor.E2eTests/AssetFlowTests.cs b/tests/KeetaNet.Anchor.E2eTests/AssetFlowTests.cs index 885618b..0f66a7c 100644 --- a/tests/KeetaNet.Anchor.E2eTests/AssetFlowTests.cs +++ b/tests/KeetaNet.Anchor.E2eTests/AssetFlowTests.cs @@ -158,6 +158,15 @@ public async Task PublishedLegalAndTokenMetadataRoundTrip() // not an error. Assert.Null(client.GetAssetMetadataForLocation(provider, EvmLocation, "evm:0xdeadbeef")); + // The identifying details under legal.anchorDetails decode typed. + AssetAnchorDetails? details = client.GetProviderAnchorDetails(provider); + Assert.NotNull(details); + Assert.Equal("Test Anchor", details!.Name); + Assert.NotNull(details.Description); + Assert.Equal(AssetContentType.Markdown, details.Description!.Type); + Assert.Equal("A reference anchor for interop tests.", details.Description.Content); + Assert.Equal("https://anchor.test/logo.svg", details.Logo); + session.Shutdown(); } @@ -196,7 +205,7 @@ public async Task ForwardingAndListingRunAgainstTheLiveAnchor() Assert.Single(templates.Templates); Assert.Equal("1", templates.Total); - JsonElement created = await client.CreatePersistentForwardingAddress( + AssetForwardingAddress created = await client.CreatePersistentForwardingAddress( provider, new AssetCreateAddressRequest( EvmLocation, @@ -205,14 +214,22 @@ public async Task ForwardingAndListingRunAgainstTheLiveAnchor() DestinationLocation: KeetaLocation, DestinationAddress: anchor.SendToAddress), cancellationToken); - Assert.Equal(anchor.SendToAddress, created.GetProperty("address").GetString()); - Assert.Equal("10", created.GetProperty("fees").GetProperty("total").GetString()); - - JsonElement fromTemplate = await client.CreatePersistentForwardingAddress( + Assert.Equal(anchor.SendToAddress, created.Address.GetString()); + + // The fee breakdown decodes typed: one variable line item carrying its + // basis points and renderable details, plus the pre-computed total. + Assert.NotNull(created.Fees); + Assert.Equal("10", created.Fees!.Total); + AssetFeeLineItem lineItem = Assert.Single(created.Fees.LineItems); + Assert.Equal("VALUE_VARIABLE", lineItem.Purpose); + Assert.Equal(50d, lineItem.BasisPoints); + Assert.Equal(AssetContentType.Markdown, lineItem.Details!.Type); + + AssetForwardingAddress fromTemplate = await client.CreatePersistentForwardingAddress( provider, new AssetCreateAddressRequest(EvmLocation, anchor.Asset, PersistentAddressTemplateId: template.Id), cancellationToken); - Assert.Equal(anchor.SendToAddress, fromTemplate.GetProperty("address").GetString()); + Assert.Equal(anchor.SendToAddress, fromTemplate.Address.GetString()); AssetAddressPage addresses = await client.ListForwardingAddresses( provider, @@ -220,8 +237,27 @@ public async Task ForwardingAndListingRunAgainstTheLiveAnchor() new[] { new AssetAddressFilter(SourceLocation: EvmLocation, Asset: anchor.Asset) }, new AssetPagination(10, 0)), cancellationToken); - Assert.Single(addresses.Addresses); + AssetForwardingAddress listed = Assert.Single(addresses.Addresses); Assert.Equal("1", addresses.Total); + Assert.Equal("template-id", listed.Id); + Assert.Equal(anchor.SendToAddress, listed.Address.GetString()); + Assert.Equal(anchor.Asset, listed.Asset?.Asset); + Assert.Equal(EvmLocation, listed.SourceLocation?.GetString()); + Assert.Equal(KeetaLocation, listed.DestinationLocation?.GetString()); + Assert.NotNull(listed.MinimumTransferValue); + Assert.Equal("500", listed.MinimumTransferValue!.Value); + Assert.NotNull(listed.Fees); + Assert.Equal("10", listed.Fees!.Total); + + // A conversion-pair filter crosses the wire in the reference `{ from, + // to }` form and passes the live anchor's request validation. + AssetAddressPage paired = await client.ListForwardingAddresses( + provider, + new AssetListAddressesRequest( + new[] { new AssetAddressFilter(SourceLocation: EvmLocation, Asset: AssetOrPair.Pair(anchor.Asset, "USD")) }, + new AssetPagination(10, 0)), + cancellationToken); + Assert.Single(paired.Addresses); AssetTransactionPage transactions = await client.ListTransactions( provider, diff --git a/tests/KeetaNet.Anchor.Tests/AssetModelTests.cs b/tests/KeetaNet.Anchor.Tests/AssetModelTests.cs index b8e2b6a..364a3dd 100644 --- a/tests/KeetaNet.Anchor.Tests/AssetModelTests.cs +++ b/tests/KeetaNet.Anchor.Tests/AssetModelTests.cs @@ -156,6 +156,102 @@ public void AssetOrPairRoundTripsItsCanonicalTransportForms() Assert.Equal(pair, JsonSerializer.Deserialize("""{"from":"USD","to":"evm:0x5"}""", KeetaJson.Options)); } + [Fact] + public void ForwardingAddressesDecodeTheirTypedFeeAndMinimumShapes() + { + // The shape the core serializes for one listed address: typed fees, + // a minimum transfer value, and raw locations that stay opaque. + string payload = """ + { + "id": "address-1", + "address": "keeta_destination", + "asset": { "from": "USD", "to": "evm:0x5" }, + "sourceLocation": "bank-account:us", + "destinationLocation": "chain:keeta:100", + "outgoingRail": "KEETA_SEND", + "incomingRail": ["ACH_DEBIT"], + "minimumTransferValue": { "asset": "USD", "value": "500" }, + "fees": { + "lineItems": [ + { "purpose": "FIXED", "value": "5", "asset": "USD" }, + { "purpose": "VALUE_VARIABLE", "basisPoints": 50, "asset": { "id": "evm:0x5", "location": "chain:evm:100" } } + ], + "total": "10", + "totalPricedIn": "USD" + } + } + """; + + AssetForwardingAddress address = JsonSerializer.Deserialize(payload, KeetaJson.Options)!; + Assert.Equal("address-1", address.Id); + Assert.Equal("keeta_destination", address.Address.GetString()); + Assert.Equal(AssetOrPair.Pair("USD", "evm:0x5"), address.Asset); + Assert.Equal("KEETA_SEND", address.OutgoingRail); + Assert.Equal("ACH_DEBIT", Assert.Single(address.IncomingRail!)); + Assert.Equal("USD", address.MinimumTransferValue!.Asset); + Assert.Equal("500", address.MinimumTransferValue.Value); + + Assert.Equal("10", address.Fees!.Total); + Assert.Equal(new AssetOrAssetWithLocation("USD"), address.Fees.TotalPricedIn); + Assert.Equal(2, address.Fees.LineItems.Count); + Assert.Equal("5", address.Fees.LineItems[0].Value); + Assert.Null(address.Fees.LineItems[0].BasisPoints); + Assert.Equal(50d, address.Fees.LineItems[1].BasisPoints); + Assert.Equal(new AssetOrAssetWithLocation("evm:0x5", "chain:evm:100"), address.Fees.LineItems[1].Asset); + } + + // A bare id crosses as a string, a located one as { id, location }, + // exactly the reference AssetOrAssetWithLocation union. + [Theory] + [InlineData("USD", null, "\"USD\"")] + [InlineData("evm:0x5", "chain:evm:100", """{"id":"evm:0x5","location":"chain:evm:100"}""")] + public void LocatedAssetsRoundTripTheirCanonicalTransportForms(string id, string? location, string transport) + { + var asset = new AssetOrAssetWithLocation(id, location); + + Assert.Equal(transport, JsonSerializer.Serialize(asset, KeetaJson.Options)); + Assert.Equal(asset, JsonSerializer.Deserialize(transport, KeetaJson.Options)); + } + + [Fact] + public void AnchorDetailsDecodeAndDropAMalformedDescription() + { + using var runtime = WasmRuntime.Load(); + using Account account = runtime.Accounts.FromSeed(TestSeeds.Subject, 0, TestSeeds.DefaultAlgorithm); + using AssetMovementClient client = runtime.CreateAssetMovementClient(TestSeeds.NonRoutableAnchor, account.PublicKeyString, account); + + AssetProvider provider = Provider(legal: """ + { + "anchorDetails": { + "name": "Anchor Under Test", + "description": { "type": "plaintext", "content": "plain words" }, + "logo": "https://logo.test/a.svg" + } + } + """); + + AssetAnchorDetails? details = client.GetProviderAnchorDetails(provider); + Assert.NotNull(details); + Assert.Equal("Anchor Under Test", details!.Name); + Assert.Equal(AssetContentType.Plaintext, details.Description!.Type); + Assert.Equal("plain words", details.Description.Content); + Assert.Equal("https://logo.test/a.svg", details.Logo); + + // A malformed description drops while the identifying fields survive. + AssetProvider malformed = Provider(legal: """ + { "anchorDetails": { "name": "Partial", "description": { "type": "unknown-kind", "content": 5 } } } + """); + AssetAnchorDetails? partial = client.GetProviderAnchorDetails(malformed); + Assert.NotNull(partial); + Assert.Equal("Partial", partial!.Name); + Assert.Null(partial.Description); + Assert.Null(partial.Logo); + + // Legal metadata without anchor details reports none. + Assert.Null(client.GetProviderAnchorDetails(Provider(legal: """{ "disclaimers": [] }"""))); + Assert.Null(client.GetProviderAnchorDetails(Provider(legal: null))); + } + /// A minimal provider carrying only the polymorphic metadata under test. private static AssetProvider Provider(string? legal = null, string? locationMetadata = null) { diff --git a/tests/node-harness/package-lock.json b/tests/node-harness/package-lock.json index 2b25d5f..8b4e65b 100644 --- a/tests/node-harness/package-lock.json +++ b/tests/node-harness/package-lock.json @@ -7,9 +7,9 @@ "name": "@keetanetwork/anchor-csharp-harness", "license": "SEE LICENSE IN LICENSE", "dependencies": { - "@keetanetwork/anchor": "0.0.82", - "@keetanetwork/keetanet-client": "0.18.2", - "@keetanetwork/keetanet-node": "0.18.2" + "@keetanetwork/anchor": "0.0.95", + "@keetanetwork/keetanet-client": "0.18.3", + "@keetanetwork/keetanet-node": "0.18.3" }, "devDependencies": { "@keetanetwork/eslint-config-typescript": "1.4.7", @@ -1519,13 +1519,14 @@ } }, "node_modules/@keetanetwork/anchor": { - "version": "0.0.82", - "resolved": "https://npm.pkg.github.com/download/@keetanetwork/anchor/0.0.82/f1030f7f76f3f6a0bbbb8a2168ec90ba2d34871c", - "integrity": "sha512-KVaebyXmK9zHLwpjaWXQuw/NEOrtVL+HpEBHFTJkSTkX5t5iRDPF9KRUPvbdj82jiXgA/n86zwApal4C9ugK+Q==", + "version": "0.0.95", + "resolved": "https://npm.pkg.github.com/download/@keetanetwork/anchor/0.0.95/a228ebdee6aa7fb22c0dd3907d51d73f51effbb3", + "integrity": "sha512-Qs6uo6cTJCE61o/mOI4sk7J9I7wICLVtL4A+8VM6G/8VivZyXYhpRZoGMKjWbGmn4owlPzqehGibWqG65PY5AA==", "license": "SEE LICENSE IN LICENSE", "dependencies": { "@keetanetwork/currency-info": "1.2.5", - "@keetanetwork/keetanet-client": "0.18.2", + "@keetanetwork/keetanet-client": "0.18.3", + "@noble/hashes": "1.5.0", "typia": "9.5.0" }, "engines": { @@ -1573,15 +1574,31 @@ } }, "node_modules/@keetanetwork/eslint-config-typescript/plugins/eslint-plugin-prefer-bigint-literal": { - "dev": true + "version": "0.1.0", + "dev": true, + "license": "MIT", + "devDependencies": { + "eslint": "9.13.0" + }, + "peerDependencies": { + "eslint": ">=9.13.0" + } }, "node_modules/@keetanetwork/eslint-config-typescript/plugins/eslint-plugin-return-parens": { - "dev": true + "version": "1.0.13", + "dev": true, + "license": "MIT", + "devDependencies": { + "eslint": "9.13.0" + }, + "peerDependencies": { + "eslint": ">=9.0.0" + } }, "node_modules/@keetanetwork/keetanet-client": { - "version": "0.18.2", - "resolved": "https://npm.pkg.github.com/download/@KeetaNetwork/keetanet-client/0.18.2/c8afe1be6507c91b72dbb5c2a0a3117a464a7d56", - "integrity": "sha512-UiuNO74j7EmDGuZkWfNMDb5vnQqLIH5Y68GcTDU6KwK4ZO3DB7WKjUnQMTw1tO4nZidqizgRrT4vUaSzJ0PJPw==", + "version": "0.18.3", + "resolved": "https://npm.pkg.github.com/download/@KeetaNetwork/keetanet-client/0.18.3/d1b7f0d37520bebeb2db7bc35aa512ab36ea6aef", + "integrity": "sha512-MgeUMnFIB3DNnF611KmTRQ4ME1rfwUVE5HBeUTeD06/szurd7+aALcwQCBOIbtfy7YhyGR2K6HRqktMel11DpQ==", "license": "see LICENSE", "dependencies": { "secp256k1": "5.0.1" @@ -1592,9 +1609,9 @@ } }, "node_modules/@keetanetwork/keetanet-node": { - "version": "0.18.2", - "resolved": "https://npm.pkg.github.com/download/@KeetaNetwork/keetanet-node/0.18.2/bd8d017b6e45e2c5c482d3493b7afa5f86cfe4f8", - "integrity": "sha512-0OwRcZ4FjP7xZUxkzivLb/W25RL42yI9N7dXc+ANmKFm4vdkVbbWr30hnLcrW2ulN2Vh5KvDEf/yNC4Lqyn1bA==", + "version": "0.18.3", + "resolved": "https://npm.pkg.github.com/download/@KeetaNetwork/keetanet-node/0.18.3/fe7cfec8d9f1119e7f5bd2e3f94bb1809fab1a45", + "integrity": "sha512-8yjaPuvQPSMVuHNH0vQGXtthU47cP6kHjjPlgumvFB976bMQnkpKbp6GHTVwpaMmY1DDAfaxgGbwndMizctBkg==", "license": "see LICENSE", "dependencies": { "@aws-sdk/client-apigatewaymanagementapi": "3.687.0", diff --git a/tests/node-harness/package.json b/tests/node-harness/package.json index 98cd437..9bc8b37 100644 --- a/tests/node-harness/package.json +++ b/tests/node-harness/package.json @@ -12,9 +12,9 @@ "lint": "eslint" }, "dependencies": { - "@keetanetwork/anchor": "0.0.82", - "@keetanetwork/keetanet-client": "0.18.2", - "@keetanetwork/keetanet-node": "0.18.2" + "@keetanetwork/anchor": "0.0.95", + "@keetanetwork/keetanet-client": "0.18.3", + "@keetanetwork/keetanet-node": "0.18.3" }, "devDependencies": { "@keetanetwork/eslint-config-typescript": "1.4.7", diff --git a/tests/node-harness/src/asset.ts b/tests/node-harness/src/asset.ts index 04ce91c..6a9de82 100644 --- a/tests/node-harness/src/asset.ts +++ b/tests/node-harness/src/asset.ts @@ -159,6 +159,11 @@ function assetCallbacks(baseTokenAccount: TokenAccount, sendToAccount: SigningAc authenticationRequired: true, legal: { + anchorDetails: { + name: 'Test Anchor', + description: { type: 'markdown', content: 'A reference anchor for interop tests.' }, + logo: 'https://anchor.test/logo.svg' + }, disclaimers: [ { purpose: 'general', @@ -320,7 +325,18 @@ function assetCallbacks(baseTokenAccount: TokenAccount, sendToAccount: SigningAc sourceLocation: 'chain:evm:100', destinationLocation: 'chain:keeta:100', destinationAddress: sendToAddress, - id: 'template-id' + id: 'template-id', + minimumTransferValue: { asset: baseToken, value: '500' }, + fees: { + lineItems: [ + { + purpose: 'VALUE_VARIABLE', + basisPoints: 50, + details: { type: 'markdown', content: 'Variable fee of 50 basis points' } + } + ], + total: '10' + } } ], total: '1' From 5ae36f2d7ee05b90f8ff86eb21d81e323d3b6e0c Mon Sep 17 00:00:00 2001 From: Tanveer Wahid Date: Tue, 28 Jul 2026 17:41:54 -0700 Subject: [PATCH 2/2] fix: align to updates in `anchor-rs` --- scripts/pins.env | 8 +- src/KeetaNet.Anchor/Generated/Node/NodeApi.cs | 442 +++++++++--------- .../Services/Node/NodeClient.cs | 18 +- 3 files changed, 234 insertions(+), 234 deletions(-) diff --git a/scripts/pins.env b/scripts/pins.env index 69bbc9e..387f999 100644 --- a/scripts/pins.env +++ b/scripts/pins.env @@ -3,10 +3,10 @@ # The wasm core (scripts/build-wasm.sh). ANCHOR_WASI_CRATE="keetanetwork-anchor-client-wasi" -ANCHOR_WASI_VERSION="0.4.0" -ANCHOR_WASI_SHA256="45dc1b0968dc41a2feda63e47d7a20e7536d218e49c5cd4a2bc7fcf3e336d348" +ANCHOR_WASI_VERSION="0.5.0" +ANCHOR_WASI_SHA256="15f10d85fea29b6edd680d8bdca7c225f02e774e3e5b73a0db728bf6e8993a64" # The canonical node OpenAPI spec (scripts/generate-node-api.sh). NODE_CLIENT_CRATE="keetanetwork-client" -NODE_CLIENT_VERSION="0.4.0" -NODE_CLIENT_SHA256="b43d33dc69ca0571499c19046b016271b66a7f4d9b2aa5539a2351b4c3231270" +NODE_CLIENT_VERSION="0.5.1" +NODE_CLIENT_SHA256="5fec3674e8721635018576842e1f65066a16bcc6b3601f62f3c6e682a48f54c6" diff --git a/src/KeetaNet.Anchor/Generated/Node/NodeApi.cs b/src/KeetaNet.Anchor/Generated/Node/NodeApi.cs index 12d0896..88b6016 100644 --- a/src/KeetaNet.Anchor/Generated/Node/NodeApi.cs +++ b/src/KeetaNet.Anchor/Generated/Node/NodeApi.cs @@ -81,7 +81,7 @@ public string BaseUrl /// /// Vote created successfully /// A server side error occurred. - public virtual async System.Threading.Tasks.Task CreateVoteAsync(Body body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public virtual async System.Threading.Tasks.Task CreateVoteAsync(Body body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (body == null) throw new System.ArgumentNullException("body"); @@ -129,7 +129,7 @@ public string BaseUrl var status_ = (int)response_.StatusCode; if (status_ == 200) { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) { throw new NodeApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); @@ -175,7 +175,7 @@ public string BaseUrl /// /// Quote created successfully /// A server side error occurred. - public virtual async System.Threading.Tasks.Task CreateVoteQuoteAsync(Body2 body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public virtual async System.Threading.Tasks.Task CreateVoteQuoteAsync(Body2 body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (body == null) throw new System.ArgumentNullException("body"); @@ -223,7 +223,7 @@ public string BaseUrl var status_ = (int)response_.StatusCode; if (status_ == 200) { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) { throw new NodeApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); @@ -271,7 +271,7 @@ public string BaseUrl /// Which ledger storage to read votes from (defaults to main). /// Votes retrieved successfully /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetBlockVotesAsync(string blockhash, Side? side = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public virtual async System.Threading.Tasks.Task GetBlockVotesAsync(string blockhash, Side? side = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (blockhash == null) throw new System.ArgumentNullException("blockhash"); @@ -322,7 +322,7 @@ public string BaseUrl var status_ = (int)response_.StatusCode; if (status_ == 200) { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) { throw new NodeApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); @@ -368,7 +368,7 @@ public string BaseUrl /// /// Version retrieved successfully /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetNodeVersionAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public virtual async System.Threading.Tasks.Task GetNodeVersionAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { var client_ = _httpClient; var disposeClient_ = false; @@ -409,7 +409,7 @@ public string BaseUrl var status_ = (int)response_.StatusCode; if (status_ == 200) { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) { throw new NodeApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); @@ -456,7 +456,7 @@ public string BaseUrl /// Account public key /// Account state retrieved successfully /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetAccountStateAsync(string account, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public virtual async System.Threading.Tasks.Task GetAccountStateAsync(string account, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (account == null) throw new System.ArgumentNullException("account"); @@ -501,7 +501,7 @@ public string BaseUrl var status_ = (int)response_.StatusCode; if (status_ == 200) { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) { throw new NodeApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); @@ -548,7 +548,7 @@ public string BaseUrl /// Account public key /// Balances retrieved successfully /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetAccountBalancesAsync(string account, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public virtual async System.Threading.Tasks.Task GetAccountBalancesAsync(string account, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (account == null) throw new System.ArgumentNullException("account"); @@ -594,7 +594,7 @@ public string BaseUrl var status_ = (int)response_.StatusCode; if (status_ == 200) { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) { throw new NodeApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); @@ -642,7 +642,7 @@ public string BaseUrl /// Token account address /// Balance retrieved successfully /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetAccountBalanceAsync(string account, string token, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public virtual async System.Threading.Tasks.Task GetAccountBalanceAsync(string account, string token, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (account == null) throw new System.ArgumentNullException("account"); @@ -692,7 +692,7 @@ public string BaseUrl var status_ = (int)response_.StatusCode; if (status_ == 200) { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) { throw new NodeApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); @@ -739,7 +739,7 @@ public string BaseUrl /// Account public key /// Head block retrieved successfully /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetAccountHeadAsync(string account, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public virtual async System.Threading.Tasks.Task GetAccountHeadAsync(string account, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (account == null) throw new System.ArgumentNullException("account"); @@ -785,7 +785,7 @@ public string BaseUrl var status_ = (int)response_.StatusCode; if (status_ == 200) { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) { throw new NodeApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); @@ -832,7 +832,7 @@ public string BaseUrl /// Account public key /// Pending block retrieved successfully /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetPendingBlockAsync(string account, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public virtual async System.Threading.Tasks.Task GetPendingBlockAsync(string account, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (account == null) throw new System.ArgumentNullException("account"); @@ -878,7 +878,7 @@ public string BaseUrl var status_ = (int)response_.StatusCode; if (status_ == 200) { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) { throw new NodeApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); @@ -926,7 +926,7 @@ public string BaseUrl /// Which ledger storage to read from (defaults to main). /// Block retrieved successfully /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetBlockAsync(string blockhash, Side2? side = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public virtual async System.Threading.Tasks.Task GetBlockAsync(string blockhash, Side2? side = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (blockhash == null) throw new System.ArgumentNullException("blockhash"); @@ -977,7 +977,7 @@ public string BaseUrl var status_ = (int)response_.StatusCode; if (status_ == 200) { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) { throw new NodeApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); @@ -1024,7 +1024,7 @@ public string BaseUrl /// 64-character hexadecimal block hash /// Successor block retrieved successfully /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetSuccessorBlockAsync(string blockhash, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public virtual async System.Threading.Tasks.Task GetSuccessorBlockAsync(string blockhash, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (blockhash == null) throw new System.ArgumentNullException("blockhash"); @@ -1070,7 +1070,7 @@ public string BaseUrl var status_ = (int)response_.StatusCode; if (status_ == 200) { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) { throw new NodeApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); @@ -1281,7 +1281,7 @@ public string BaseUrl /// /// Checksum /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetLedgerChecksumAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public virtual async System.Threading.Tasks.Task GetLedgerChecksumAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { var client_ = _httpClient; var disposeClient_ = false; @@ -1322,7 +1322,7 @@ public string BaseUrl var status_ = (int)response_.StatusCode; if (status_ == 200) { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) { throw new NodeApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); @@ -1537,7 +1537,7 @@ public string BaseUrl /// /// Representatives /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetAllRepresentativesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public virtual async System.Threading.Tasks.Task GetAllRepresentativesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { var client_ = _httpClient; var disposeClient_ = false; @@ -1578,7 +1578,7 @@ public string BaseUrl var status_ = (int)response_.StatusCode; if (status_ == 200) { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) { throw new NodeApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); @@ -1621,7 +1621,7 @@ public string BaseUrl /// /// History /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetGlobalHistoryAsync(string start = null, int? limit = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public virtual async System.Threading.Tasks.Task GetGlobalHistoryAsync(string start = null, int? limit = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { var client_ = _httpClient; var disposeClient_ = false; @@ -1672,7 +1672,7 @@ public string BaseUrl var status_ = (int)response_.StatusCode; if (status_ == 200) { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) { throw new NodeApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); @@ -1715,7 +1715,7 @@ public string BaseUrl /// /// Chain /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetAccountChainAsync(string account, string start = null, string end = null, int? limit = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public virtual async System.Threading.Tasks.Task GetAccountChainAsync(string account, string start = null, string end = null, int? limit = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (account == null) throw new System.ArgumentNullException("account"); @@ -1775,7 +1775,7 @@ public string BaseUrl var status_ = (int)response_.StatusCode; if (status_ == 200) { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) { throw new NodeApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); @@ -1818,7 +1818,7 @@ public string BaseUrl /// /// History /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetAccountHistoryAsync(string account, string start = null, int? limit = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public virtual async System.Threading.Tasks.Task GetAccountHistoryAsync(string account, string start = null, int? limit = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (account == null) throw new System.ArgumentNullException("account"); @@ -1874,7 +1874,7 @@ public string BaseUrl var status_ = (int)response_.StatusCode; if (status_ == 200) { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) { throw new NodeApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); @@ -1917,7 +1917,7 @@ public string BaseUrl /// /// ACLs /// A server side error occurred. - public virtual async System.Threading.Tasks.Task ListAclsByPrincipalAsync(string account, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public virtual async System.Threading.Tasks.Task ListAclsByPrincipalAsync(string account, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (account == null) throw new System.ArgumentNullException("account"); @@ -1963,7 +1963,7 @@ public string BaseUrl var status_ = (int)response_.StatusCode; if (status_ == 200) { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) { throw new NodeApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); @@ -2006,7 +2006,7 @@ public string BaseUrl /// /// ACLs /// A server side error occurred. - public virtual async System.Threading.Tasks.Task ListAclsByEntityAsync(string account, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public virtual async System.Threading.Tasks.Task ListAclsByEntityAsync(string account, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (account == null) throw new System.ArgumentNullException("account"); @@ -2052,7 +2052,7 @@ public string BaseUrl var status_ = (int)response_.StatusCode; if (status_ == 200) { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) { throw new NodeApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); @@ -2184,7 +2184,7 @@ public string BaseUrl /// /// Certificates /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetAccountCertificatesAsync(string account, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public virtual async System.Threading.Tasks.Task GetAccountCertificatesAsync(string account, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (account == null) throw new System.ArgumentNullException("account"); @@ -2230,7 +2230,7 @@ public string BaseUrl var status_ = (int)response_.StatusCode; if (status_ == 200) { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) { throw new NodeApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); @@ -2273,7 +2273,7 @@ public string BaseUrl /// /// Certificate /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetCertificateByHashAsync(string account, string certificateHash, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public virtual async System.Threading.Tasks.Task GetCertificateByHashAsync(string account, string certificateHash, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (account == null) throw new System.ArgumentNullException("account"); @@ -2323,7 +2323,7 @@ public string BaseUrl var status_ = (int)response_.StatusCode; if (status_ == 200) { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) { throw new NodeApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); @@ -2367,7 +2367,7 @@ public string BaseUrl /// Which ledger storage to search (defaults to main). /// Block /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetBlockFromIdempotentAsync(string account, string idempotent, Side3? side = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public virtual async System.Threading.Tasks.Task GetBlockFromIdempotentAsync(string account, string idempotent, Side3? side = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (account == null) throw new System.ArgumentNullException("account"); @@ -2423,7 +2423,7 @@ public string BaseUrl var status_ = (int)response_.StatusCode; if (status_ == 200) { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) { throw new NodeApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); @@ -2467,7 +2467,7 @@ public string BaseUrl /// Comma-separated account public keys /// Account states /// A server side error occurred. - public virtual async System.Threading.Tasks.Task> GetAccountStatesAsync(string accounts, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public virtual async System.Threading.Tasks.Task> GetAccountStatesAsync(string accounts, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (accounts == null) throw new System.ArgumentNullException("accounts"); @@ -2512,7 +2512,7 @@ public string BaseUrl var status_ = (int)response_.StatusCode; if (status_ == 200) { - var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); + var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) { throw new NodeApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); @@ -2555,7 +2555,7 @@ public string BaseUrl /// /// Vote staples /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetVoteStaplesAfterAsync(string start, int? limit = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public virtual async System.Threading.Tasks.Task GetVoteStaplesAfterAsync(string start, int? limit = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (start == null) throw new System.ArgumentNullException("start"); @@ -2606,7 +2606,7 @@ public string BaseUrl var status_ = (int)response_.StatusCode; if (status_ == 200) { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) { throw new NodeApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); @@ -2652,7 +2652,7 @@ public string BaseUrl /// /// Publish result /// A server side error occurred. - public virtual async System.Threading.Tasks.Task PublishVoteStapleAsync(Body3 body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public virtual async System.Threading.Tasks.Task PublishVoteStapleAsync(Body3 body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (body == null) throw new System.ArgumentNullException("body"); @@ -2700,7 +2700,7 @@ public string BaseUrl var status_ = (int)response_.StatusCode; if (status_ == 200) { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) { throw new NodeApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); @@ -3253,27 +3253,11 @@ public System.Collections.Generic.IDictionary AdditionalProperti } [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.7.1.0 (NJsonSchema v11.6.1.0 (Newtonsoft.Json v13.0.0.0))")] - public partial record Body + public partial record CreateVoteResponse { - /// - /// Array of base64-encoded blocks - /// - [System.Text.Json.Serialization.JsonPropertyName("blocks")] - [System.ComponentModel.DataAnnotations.Required] - public System.Collections.Generic.ICollection Blocks { get; set; } = new System.Collections.ObjectModel.Collection(); - - /// - /// Array of base64-encoded votes - /// - [System.Text.Json.Serialization.JsonPropertyName("votes")] - public System.Collections.Generic.ICollection Votes { get; set; } - - /// - /// Base64-encoded vote quote - /// - [System.Text.Json.Serialization.JsonPropertyName("quote")] - public string Quote { get; set; } + [System.Text.Json.Serialization.JsonPropertyName("vote")] + public Vote Vote { get; set; } private System.Collections.Generic.IDictionary _additionalProperties; @@ -3287,15 +3271,11 @@ public System.Collections.Generic.IDictionary AdditionalProperti } [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.7.1.0 (NJsonSchema v11.6.1.0 (Newtonsoft.Json v13.0.0.0))")] - public partial record Body2 + public partial record CreateVoteQuoteResponse { - /// - /// Array of base64-encoded blocks - /// - [System.Text.Json.Serialization.JsonPropertyName("blocks")] - [System.ComponentModel.DataAnnotations.Required] - public System.Collections.Generic.ICollection Blocks { get; set; } = new System.Collections.ObjectModel.Collection(); + [System.Text.Json.Serialization.JsonPropertyName("quote")] + public VoteQuote Quote { get; set; } private System.Collections.Generic.IDictionary _additionalProperties; @@ -3309,75 +3289,14 @@ public System.Collections.Generic.IDictionary AdditionalProperti } [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.7.1.0 (NJsonSchema v11.6.1.0 (Newtonsoft.Json v13.0.0.0))")] - public enum Side - { - - [System.Runtime.Serialization.EnumMember(Value = @"main")] - Main = 0, - - [System.Runtime.Serialization.EnumMember(Value = @"side")] - Side = 1, - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.7.1.0 (NJsonSchema v11.6.1.0 (Newtonsoft.Json v13.0.0.0))")] - public enum Side2 + public partial record GetBlockVotesResponse { - [System.Runtime.Serialization.EnumMember(Value = @"main")] - Main = 0, - - [System.Runtime.Serialization.EnumMember(Value = @"side")] - Side = 1, - - [System.Runtime.Serialization.EnumMember(Value = @"both")] - Both = 2, - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.7.1.0 (NJsonSchema v11.6.1.0 (Newtonsoft.Json v13.0.0.0))")] - public enum Side3 - { - - [System.Runtime.Serialization.EnumMember(Value = @"main")] - Main = 0, - - [System.Runtime.Serialization.EnumMember(Value = @"side")] - Side = 1, - - [System.Runtime.Serialization.EnumMember(Value = @"both")] - Both = 2, - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.7.1.0 (NJsonSchema v11.6.1.0 (Newtonsoft.Json v13.0.0.0))")] - public partial record Body3 - { - - /// - /// Base64-encoded vote staple - /// - [System.Text.Json.Serialization.JsonPropertyName("votesAndBlocks")] - [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] - public string VotesAndBlocks { get; set; } - - private System.Collections.Generic.IDictionary _additionalProperties; - - [System.Text.Json.Serialization.JsonExtensionData] - public System.Collections.Generic.IDictionary AdditionalProperties - { - get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } - set { _additionalProperties = value; } - } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.7.1.0 (NJsonSchema v11.6.1.0 (Newtonsoft.Json v13.0.0.0))")] - public partial record Response - { + [System.Text.Json.Serialization.JsonPropertyName("blockhash")] + public string Blockhash { get; set; } - [System.Text.Json.Serialization.JsonPropertyName("vote")] - public Vote Vote { get; set; } + [System.Text.Json.Serialization.JsonPropertyName("votes")] + public System.Collections.Generic.ICollection Votes { get; set; } private System.Collections.Generic.IDictionary _additionalProperties; @@ -3391,11 +3310,11 @@ public System.Collections.Generic.IDictionary AdditionalProperti } [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.7.1.0 (NJsonSchema v11.6.1.0 (Newtonsoft.Json v13.0.0.0))")] - public partial record Response2 + public partial record GetNodeVersionResponse { - [System.Text.Json.Serialization.JsonPropertyName("quote")] - public VoteQuote Quote { get; set; } + [System.Text.Json.Serialization.JsonPropertyName("node")] + public string Node { get; set; } private System.Collections.Generic.IDictionary _additionalProperties; @@ -3409,32 +3328,32 @@ public System.Collections.Generic.IDictionary AdditionalProperti } [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.7.1.0 (NJsonSchema v11.6.1.0 (Newtonsoft.Json v13.0.0.0))")] - public partial record Response3 + public partial record GetAccountStateResponse { - [System.Text.Json.Serialization.JsonPropertyName("blockhash")] - public string Blockhash { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("votes")] - public System.Collections.Generic.ICollection Votes { get; set; } + [System.Text.Json.Serialization.JsonPropertyName("account")] + public string Account { get; set; } - private System.Collections.Generic.IDictionary _additionalProperties; + /// + /// Head block hash as hexadecimal + /// + [System.Text.Json.Serialization.JsonPropertyName("currentHeadBlock")] + public string CurrentHeadBlock { get; set; } - [System.Text.Json.Serialization.JsonExtensionData] - public System.Collections.Generic.IDictionary AdditionalProperties - { - get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } - set { _additionalProperties = value; } - } + /// + /// Head block height as a 0x-prefixed hexadecimal BigInt + /// + [System.Text.Json.Serialization.JsonPropertyName("currentHeadBlockHeight")] + public string CurrentHeadBlockHeight { get; set; } - } + [System.Text.Json.Serialization.JsonPropertyName("representative")] + public string Representative { get; set; } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.7.1.0 (NJsonSchema v11.6.1.0 (Newtonsoft.Json v13.0.0.0))")] - public partial record Response4 - { + [System.Text.Json.Serialization.JsonPropertyName("info")] + public AccountInfo Info { get; set; } - [System.Text.Json.Serialization.JsonPropertyName("node")] - public string Node { get; set; } + [System.Text.Json.Serialization.JsonPropertyName("balances")] + public System.Collections.Generic.ICollection Balances { get; set; } private System.Collections.Generic.IDictionary _additionalProperties; @@ -3448,21 +3367,15 @@ public System.Collections.Generic.IDictionary AdditionalProperti } [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.7.1.0 (NJsonSchema v11.6.1.0 (Newtonsoft.Json v13.0.0.0))")] - public partial record Response5 + public partial record GetAccountStatesResponseItem { [System.Text.Json.Serialization.JsonPropertyName("account")] public string Account { get; set; } - /// - /// Head block hash as hexadecimal - /// [System.Text.Json.Serialization.JsonPropertyName("currentHeadBlock")] public string CurrentHeadBlock { get; set; } - /// - /// Head block height as a 0x-prefixed hexadecimal BigInt - /// [System.Text.Json.Serialization.JsonPropertyName("currentHeadBlockHeight")] public string CurrentHeadBlockHeight { get; set; } @@ -3487,7 +3400,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.7.1.0 (NJsonSchema v11.6.1.0 (Newtonsoft.Json v13.0.0.0))")] - public partial record Response6 + public partial record GetAccountBalancesResponse { [System.Text.Json.Serialization.JsonPropertyName("account")] @@ -3508,7 +3421,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.7.1.0 (NJsonSchema v11.6.1.0 (Newtonsoft.Json v13.0.0.0))")] - public partial record Response7 + public partial record GetAccountBalanceResponse { [System.Text.Json.Serialization.JsonPropertyName("account")] @@ -3535,7 +3448,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.7.1.0 (NJsonSchema v11.6.1.0 (Newtonsoft.Json v13.0.0.0))")] - public partial record Response8 + public partial record GetAccountHeadResponse { [System.Text.Json.Serialization.JsonPropertyName("account")] @@ -3562,7 +3475,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.7.1.0 (NJsonSchema v11.6.1.0 (Newtonsoft.Json v13.0.0.0))")] - public partial record Response9 + public partial record GetPendingBlockResponse { [System.Text.Json.Serialization.JsonPropertyName("account")] @@ -3583,7 +3496,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.7.1.0 (NJsonSchema v11.6.1.0 (Newtonsoft.Json v13.0.0.0))")] - public partial record Response10 + public partial record GetBlockResponse { [System.Text.Json.Serialization.JsonPropertyName("blockhash")] @@ -3604,7 +3517,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.7.1.0 (NJsonSchema v11.6.1.0 (Newtonsoft.Json v13.0.0.0))")] - public partial record Response11 + public partial record GetSuccessorBlockResponse { [System.Text.Json.Serialization.JsonPropertyName("blockhash")] @@ -3625,7 +3538,25 @@ public System.Collections.Generic.IDictionary AdditionalProperti } [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.7.1.0 (NJsonSchema v11.6.1.0 (Newtonsoft.Json v13.0.0.0))")] - public partial record Response12 + public partial record GetBlockFromIdempotentResponse + { + + [System.Text.Json.Serialization.JsonPropertyName("block")] + public Block Block { get; set; } + + private System.Collections.Generic.IDictionary _additionalProperties; + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.7.1.0 (NJsonSchema v11.6.1.0 (Newtonsoft.Json v13.0.0.0))")] + public partial record GetLedgerChecksumResponse { [System.Text.Json.Serialization.JsonPropertyName("moment")] @@ -3652,7 +3583,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.7.1.0 (NJsonSchema v11.6.1.0 (Newtonsoft.Json v13.0.0.0))")] - public partial record Response13 + public partial record GetAllRepresentativesResponse { [System.Text.Json.Serialization.JsonPropertyName("representatives")] @@ -3670,7 +3601,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.7.1.0 (NJsonSchema v11.6.1.0 (Newtonsoft.Json v13.0.0.0))")] - public partial record Response14 + public partial record GetGlobalHistoryResponse { [System.Text.Json.Serialization.JsonPropertyName("history")] @@ -3691,14 +3622,14 @@ public System.Collections.Generic.IDictionary AdditionalProperti } [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.7.1.0 (NJsonSchema v11.6.1.0 (Newtonsoft.Json v13.0.0.0))")] - public partial record Response15 + public partial record GetAccountChainResponse { [System.Text.Json.Serialization.JsonPropertyName("account")] public string Account { get; set; } [System.Text.Json.Serialization.JsonPropertyName("blocks")] - public System.Collections.Generic.ICollection Blocks { get; set; } + public System.Collections.Generic.ICollection Blocks { get; set; } [System.Text.Json.Serialization.JsonPropertyName("nextKey")] public string NextKey { get; set; } @@ -3715,7 +3646,25 @@ public System.Collections.Generic.IDictionary AdditionalProperti } [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.7.1.0 (NJsonSchema v11.6.1.0 (Newtonsoft.Json v13.0.0.0))")] - public partial record Response16 + public partial record GetAccountChainResponseBlocksItem + { + + [System.Text.Json.Serialization.JsonPropertyName("block")] + public Block Block { get; set; } + + private System.Collections.Generic.IDictionary _additionalProperties; + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.7.1.0 (NJsonSchema v11.6.1.0 (Newtonsoft.Json v13.0.0.0))")] + public partial record GetAccountHistoryResponse { [System.Text.Json.Serialization.JsonPropertyName("history")] @@ -3736,7 +3685,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.7.1.0 (NJsonSchema v11.6.1.0 (Newtonsoft.Json v13.0.0.0))")] - public partial record Response17 + public partial record ListAclsByPrincipalResponse { [System.Text.Json.Serialization.JsonPropertyName("permissions")] @@ -3754,7 +3703,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.7.1.0 (NJsonSchema v11.6.1.0 (Newtonsoft.Json v13.0.0.0))")] - public partial record Response18 + public partial record ListAclsByEntityResponse { [System.Text.Json.Serialization.JsonPropertyName("permissions")] @@ -3772,7 +3721,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.7.1.0 (NJsonSchema v11.6.1.0 (Newtonsoft.Json v13.0.0.0))")] - public partial record Response19 + public partial record GetAccountCertificatesResponse { [System.Text.Json.Serialization.JsonPropertyName("account")] @@ -3793,7 +3742,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.7.1.0 (NJsonSchema v11.6.1.0 (Newtonsoft.Json v13.0.0.0))")] - public partial record Response20 : Certificate + public partial record GetCertificateByHashResponse : Certificate { [System.Text.Json.Serialization.JsonPropertyName("account")] @@ -3802,11 +3751,11 @@ public partial record Response20 : Certificate } [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.7.1.0 (NJsonSchema v11.6.1.0 (Newtonsoft.Json v13.0.0.0))")] - public partial record Response21 + public partial record GetVoteStaplesAfterResponse { - [System.Text.Json.Serialization.JsonPropertyName("block")] - public Block Block { get; set; } + [System.Text.Json.Serialization.JsonPropertyName("voteStaples")] + public System.Collections.Generic.ICollection VoteStaples { get; set; } private System.Collections.Generic.IDictionary _additionalProperties; @@ -3820,26 +3769,14 @@ public System.Collections.Generic.IDictionary AdditionalProperti } [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.7.1.0 (NJsonSchema v11.6.1.0 (Newtonsoft.Json v13.0.0.0))")] - public partial record Anonymous + public partial record PublishVoteStapleResponse { - [System.Text.Json.Serialization.JsonPropertyName("account")] - public string Account { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("currentHeadBlock")] - public string CurrentHeadBlock { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("currentHeadBlockHeight")] - public string CurrentHeadBlockHeight { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("representative")] - public string Representative { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("info")] - public AccountInfo Info { get; set; } - - [System.Text.Json.Serialization.JsonPropertyName("balances")] - public System.Collections.Generic.ICollection Balances { get; set; } + /// + /// Whether the vote staple was successfully published + /// + [System.Text.Json.Serialization.JsonPropertyName("publish")] + public bool Publish { get; set; } private System.Collections.Generic.IDictionary _additionalProperties; @@ -3853,11 +3790,27 @@ public System.Collections.Generic.IDictionary AdditionalProperti } [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.7.1.0 (NJsonSchema v11.6.1.0 (Newtonsoft.Json v13.0.0.0))")] - public partial record Response22 + public partial record Body { - [System.Text.Json.Serialization.JsonPropertyName("voteStaples")] - public System.Collections.Generic.ICollection VoteStaples { get; set; } + /// + /// Array of base64-encoded blocks + /// + [System.Text.Json.Serialization.JsonPropertyName("blocks")] + [System.ComponentModel.DataAnnotations.Required] + public System.Collections.Generic.ICollection Blocks { get; set; } = new System.Collections.ObjectModel.Collection(); + + /// + /// Array of base64-encoded votes + /// + [System.Text.Json.Serialization.JsonPropertyName("votes")] + public System.Collections.Generic.ICollection Votes { get; set; } + + /// + /// Base64-encoded vote quote + /// + [System.Text.Json.Serialization.JsonPropertyName("quote")] + public string Quote { get; set; } private System.Collections.Generic.IDictionary _additionalProperties; @@ -3871,14 +3824,15 @@ public System.Collections.Generic.IDictionary AdditionalProperti } [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.7.1.0 (NJsonSchema v11.6.1.0 (Newtonsoft.Json v13.0.0.0))")] - public partial record Response23 + public partial record Body2 { /// - /// Whether the vote staple was successfully published + /// Array of base64-encoded blocks /// - [System.Text.Json.Serialization.JsonPropertyName("publish")] - public bool Publish { get; set; } + [System.Text.Json.Serialization.JsonPropertyName("blocks")] + [System.ComponentModel.DataAnnotations.Required] + public System.Collections.Generic.ICollection Blocks { get; set; } = new System.Collections.ObjectModel.Collection(); private System.Collections.Generic.IDictionary _additionalProperties; @@ -3892,23 +3846,57 @@ public System.Collections.Generic.IDictionary AdditionalProperti } [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.7.1.0 (NJsonSchema v11.6.1.0 (Newtonsoft.Json v13.0.0.0))")] - public enum ACLRowPrincipalType + public enum Side { - [System.Runtime.Serialization.EnumMember(Value = @"ACCOUNT")] - ACCOUNT = 0, + [System.Runtime.Serialization.EnumMember(Value = @"main")] + Main = 0, - [System.Runtime.Serialization.EnumMember(Value = @"CERTIFICATE")] - CERTIFICATE = 1, + [System.Runtime.Serialization.EnumMember(Value = @"side")] + Side = 1, } [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.7.1.0 (NJsonSchema v11.6.1.0 (Newtonsoft.Json v13.0.0.0))")] - public partial record Blocks + public enum Side2 { - [System.Text.Json.Serialization.JsonPropertyName("block")] - public Block Block { get; set; } + [System.Runtime.Serialization.EnumMember(Value = @"main")] + Main = 0, + + [System.Runtime.Serialization.EnumMember(Value = @"side")] + Side = 1, + + [System.Runtime.Serialization.EnumMember(Value = @"both")] + Both = 2, + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.7.1.0 (NJsonSchema v11.6.1.0 (Newtonsoft.Json v13.0.0.0))")] + public enum Side3 + { + + [System.Runtime.Serialization.EnumMember(Value = @"main")] + Main = 0, + + [System.Runtime.Serialization.EnumMember(Value = @"side")] + Side = 1, + + [System.Runtime.Serialization.EnumMember(Value = @"both")] + Both = 2, + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.7.1.0 (NJsonSchema v11.6.1.0 (Newtonsoft.Json v13.0.0.0))")] + public partial record Body3 + { + + /// + /// Base64-encoded vote staple + /// + [System.Text.Json.Serialization.JsonPropertyName("votesAndBlocks")] + [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] + public string VotesAndBlocks { get; set; } private System.Collections.Generic.IDictionary _additionalProperties; @@ -3921,6 +3909,18 @@ public System.Collections.Generic.IDictionary AdditionalProperti } + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.7.1.0 (NJsonSchema v11.6.1.0 (Newtonsoft.Json v13.0.0.0))")] + public enum ACLRowPrincipalType + { + + [System.Runtime.Serialization.EnumMember(Value = @"ACCOUNT")] + ACCOUNT = 0, + + [System.Runtime.Serialization.EnumMember(Value = @"CERTIFICATE")] + CERTIFICATE = 1, + + } + [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.7.1.0 (NJsonSchema v11.6.1.0 (Newtonsoft.Json v13.0.0.0))")] diff --git a/src/KeetaNet.Anchor/Services/Node/NodeClient.cs b/src/KeetaNet.Anchor/Services/Node/NodeClient.cs index 794ce87..f465e7b 100644 --- a/src/KeetaNet.Anchor/Services/Node/NodeClient.cs +++ b/src/KeetaNet.Anchor/Services/Node/NodeClient.cs @@ -43,7 +43,7 @@ internal NodeClient(WasmRuntime runtime, string nodeUrl, HttpClient? http = null /// The node software version string. public async Task GetNodeVersion(CancellationToken cancellationToken = default) { - Response4 response = await Attempt(() => _api.GetNodeVersionAsync(cancellationToken)).ConfigureAwait(false); + GetNodeVersionResponse response = await Attempt(() => _api.GetNodeVersionAsync(cancellationToken)).ConfigureAwait(false); return response.Node ?? ""; } @@ -55,7 +55,7 @@ public async Task GetAccountState( Crypto.Account account, CancellationToken cancellationToken = default) { - Response5 state = await Attempt(() => _api.GetAccountStateAsync(account.PublicKeyString, cancellationToken)).ConfigureAwait(false); + GetAccountStateResponse state = await Attempt(() => _api.GetAccountStateAsync(account.PublicKeyString, cancellationToken)).ConfigureAwait(false); return DecodeState(state.CurrentHeadBlock, state.CurrentHeadBlockHeight, state.Representative, state.Info, state.Balances); } @@ -68,7 +68,7 @@ public async Task> GetAccountStates( CancellationToken cancellationToken = default) { string joined = string.Join(",", accounts.Select(account => account.PublicKeyString)); - ICollection states = await Attempt(() => _api.GetAccountStatesAsync(joined, cancellationToken)).ConfigureAwait(false); + ICollection states = await Attempt(() => _api.GetAccountStatesAsync(joined, cancellationToken)).ConfigureAwait(false); return states .Select(item => DecodeState(item.CurrentHeadBlock, item.CurrentHeadBlockHeight, item.Representative, item.Info, item.Balances)) @@ -90,7 +90,7 @@ public async Task> GetAccountStates( /// The point-in-time XOR checksum of the node's ledger. public async Task GetLedgerChecksum(CancellationToken cancellationToken = default) { - Response12 checksum = await Attempt(() => _api.GetLedgerChecksumAsync(cancellationToken)).ConfigureAwait(false); + GetLedgerChecksumResponse checksum = await Attempt(() => _api.GetLedgerChecksumAsync(cancellationToken)).ConfigureAwait(false); DateTimeOffset? moment = null; if (!string.IsNullOrEmpty(checksum.Moment)) @@ -123,7 +123,7 @@ public async Task GetRepresentative( /// Every representative the node knows, with advertised endpoints. public async Task> GetAllRepresentatives(CancellationToken cancellationToken = default) { - Response13 response = await Attempt(() => _api.GetAllRepresentativesAsync(cancellationToken)).ConfigureAwait(false); + GetAllRepresentativesResponse response = await Attempt(() => _api.GetAllRepresentativesAsync(cancellationToken)).ConfigureAwait(false); ICollection representatives = response.Representatives ?? Array.Empty(); return representatives.Select(DecodeRepresentative).ToArray(); @@ -148,7 +148,7 @@ public async Task> GetAccountBalances( Crypto.Account account, CancellationToken cancellationToken = default) { - Response6 response = await Attempt(() => _api.GetAccountBalancesAsync(account.PublicKeyString, cancellationToken)).ConfigureAwait(false); + GetAccountBalancesResponse response = await Attempt(() => _api.GetAccountBalancesAsync(account.PublicKeyString, cancellationToken)).ConfigureAwait(false); return DecodeBalances(response.Balances); } @@ -158,7 +158,7 @@ public async Task GetAccountBalance( Crypto.Account token, CancellationToken cancellationToken = default) { - Response7 response = await Attempt(() => _api.GetAccountBalanceAsync(account.PublicKeyString, token.PublicKeyString, cancellationToken)).ConfigureAwait(false); + GetAccountBalanceResponse response = await Attempt(() => _api.GetAccountBalanceAsync(account.PublicKeyString, token.PublicKeyString, cancellationToken)).ConfigureAwait(false); return OptionalHexAmount(response.Balance) ?? BigInteger.Zero; } @@ -171,7 +171,7 @@ public async Task> GetAllCertificates( Crypto.Account account, CancellationToken cancellationToken = default) { - Response19 response = await Attempt(() => _api.GetAccountCertificatesAsync(account.PublicKeyString, cancellationToken)).ConfigureAwait(false); + GetAccountCertificatesResponse response = await Attempt(() => _api.GetAccountCertificatesAsync(account.PublicKeyString, cancellationToken)).ConfigureAwait(false); ICollection records = response.Certificates ?? Array.Empty(); // A record with no certificate body is the node's "not found" shape. @@ -192,7 +192,7 @@ public async Task> GetAllCertificates( Crypto.CertificateHash certificateHash, CancellationToken cancellationToken = default) { - Response20 record = await Attempt(() => _api.GetCertificateByHashAsync(account.PublicKeyString, certificateHash.ToString(), cancellationToken)).ConfigureAwait(false); + GetCertificateByHashResponse record = await Attempt(() => _api.GetCertificateByHashAsync(account.PublicKeyString, certificateHash.ToString(), cancellationToken)).ConfigureAwait(false); if (record.Certificate1 is null) { return null;