From f0eaaf0c20c0b8f1205eb7591d51cf07e502462e Mon Sep 17 00:00:00 2001 From: Jason Elie Bou Kheir <5115126+jasonboukheir@users.noreply.github.com> Date: Wed, 16 Nov 2022 08:19:24 -0800 Subject: [PATCH] feat(services): add StateProof APIs Update Algod and Indexer clients with the latest state proof APIs. Also add implicit conversions between Unity and Dotnet model types. BREAKING CHANGE: Algod no longer has `GetProof` method fix #160, fix #162 --- Runtime/CareBoo.AlgoSdk/Accounts/Address.cs | 10 + .../AlgodTypes.gen.Formatters.gen.cs | 126 +- .../IndexerTypes.gen.Formatters.gen.cs | 196 +- .../NodeServices/Algod/AlgodClient.cs | 8 - .../NodeServices/Algod/AlgodClient.gen.cs | 235 ++- .../NodeServices/Algod/AlgodTypes.gen.cs | 1234 ++++++++--- .../NodeServices/Indexer/IndexerClient.cs | 7 +- .../NodeServices/Indexer/IndexerClient.gen.cs | 30 +- .../NodeServices/Indexer/IndexerTypes.gen.cs | 1874 +++++++++++++---- .../NodeServices/Kmd/KmdClient.cs | 1 - .../SmartContracts/CompiledTeal.cs | 10 + .../Algod/AlgodClientTest.cs | 9 - .../DotnetSdk/Algod/DotnetAlgodClient.cs | 30 +- .../DotnetSdk/UnityHttpMessageHandler.cs | 26 +- .../PackageManagerSettings.asset | 4 +- .../ProjectSettings/ProjectVersion.txt | 4 +- .../ProjectSettings/TimelineSettings.asset | 4 +- 17 files changed, 2977 insertions(+), 831 deletions(-) diff --git a/Runtime/CareBoo.AlgoSdk/Accounts/Address.cs b/Runtime/CareBoo.AlgoSdk/Accounts/Address.cs index 22b6e69b5..33c03c0df 100644 --- a/Runtime/CareBoo.AlgoSdk/Accounts/Address.cs +++ b/Runtime/CareBoo.AlgoSdk/Accounts/Address.cs @@ -150,6 +150,16 @@ public static Address FromPublicKey(Ed25519.PublicKey publicKey) return result; } + public static implicit operator Algorand.Address(Address unityAddress) + { + return unityAddress.Convert().ToDotnet(); + } + + public static implicit operator Address(Algorand.Address from) + { + return from.Convert().ToUnity
(); + } + public static bool operator ==(in Address a1, in Address a2) { return a1.Equals(a2); diff --git a/Runtime/CareBoo.AlgoSdk/Formatters.gen/AlgodTypes.gen.Formatters.gen.cs b/Runtime/CareBoo.AlgoSdk/Formatters.gen/AlgodTypes.gen.Formatters.gen.cs index 7ca8e6f0b..b5b9e6044 100644 --- a/Runtime/CareBoo.AlgoSdk/Formatters.gen/AlgodTypes.gen.Formatters.gen.cs +++ b/Runtime/CareBoo.AlgoSdk/Formatters.gen/AlgodTypes.gen.Formatters.gen.cs @@ -12,6 +12,22 @@ namespace AlgoSdk.Algod { + public partial struct StateProofMessage + { + + private static bool @__generated__IsValid = StateProofMessage.@__generated__InitializeAlgoApiFormatters(); + + private static bool @__generated__InitializeAlgoApiFormatters() + { + AlgoSdk.AlgoApiFormatterLookup.Add(new AlgoSdk.AlgoApiObjectFormatter(false).Assign("BlockHeadersCommitment", (AlgoSdk.Algod.StateProofMessage x) => x.BlockHeadersCommitment, (ref AlgoSdk.Algod.StateProofMessage x, System.Byte[] value) => x.BlockHeadersCommitment = value, AlgoSdk.ArrayComparer.Instance).Assign("VotersCommitment", (AlgoSdk.Algod.StateProofMessage x) => x.VotersCommitment, (ref AlgoSdk.Algod.StateProofMessage x, System.Byte[] value) => x.VotersCommitment = value, AlgoSdk.ArrayComparer.Instance).Assign("LnProvenWeight", (AlgoSdk.Algod.StateProofMessage x) => x.LnProvenWeight, (ref AlgoSdk.Algod.StateProofMessage x, System.UInt64 value) => x.LnProvenWeight = value).Assign("FirstAttestedRound", (AlgoSdk.Algod.StateProofMessage x) => x.FirstAttestedRound, (ref AlgoSdk.Algod.StateProofMessage x, System.UInt64 value) => x.FirstAttestedRound = value).Assign("LastAttestedRound", (AlgoSdk.Algod.StateProofMessage x) => x.LastAttestedRound, (ref AlgoSdk.Algod.StateProofMessage x, System.UInt64 value) => x.LastAttestedRound = value)); + return true; + } + } +} +namespace AlgoSdk.Algod +{ + + public partial struct ApplicationParams { @@ -140,6 +156,22 @@ namespace AlgoSdk.Algod { + public partial struct StateProof + { + + private static bool @__generated__IsValid = StateProof.@__generated__InitializeAlgoApiFormatters(); + + private static bool @__generated__InitializeAlgoApiFormatters() + { + AlgoSdk.AlgoApiFormatterLookup.Add(new AlgoSdk.AlgoApiObjectFormatter(false).Assign("Message", (AlgoSdk.Algod.StateProof x) => x.Message, (ref AlgoSdk.Algod.StateProof x, AlgoSdk.Algod.StateProofMessage value) => x.Message = value).Assign("StateProof", (AlgoSdk.Algod.StateProof x) => x.EncodedStateProof, (ref AlgoSdk.Algod.StateProof x, System.Byte[] value) => x.EncodedStateProof = value, AlgoSdk.ArrayComparer.Instance)); + return true; + } + } +} +namespace AlgoSdk.Algod +{ + + public partial struct Asset { @@ -268,6 +300,22 @@ namespace AlgoSdk.Algod { + public partial struct LightBlockHeaderProof + { + + private static bool @__generated__IsValid = LightBlockHeaderProof.@__generated__InitializeAlgoApiFormatters(); + + private static bool @__generated__InitializeAlgoApiFormatters() + { + AlgoSdk.AlgoApiFormatterLookup.Add(new AlgoSdk.AlgoApiObjectFormatter(false).Assign("index", (AlgoSdk.Algod.LightBlockHeaderProof x) => x.Index, (ref AlgoSdk.Algod.LightBlockHeaderProof x, System.UInt64 value) => x.Index = value).Assign("treedepth", (AlgoSdk.Algod.LightBlockHeaderProof x) => x.Treedepth, (ref AlgoSdk.Algod.LightBlockHeaderProof x, System.UInt64 value) => x.Treedepth = value).Assign("proof", (AlgoSdk.Algod.LightBlockHeaderProof x) => x.Proof, (ref AlgoSdk.Algod.LightBlockHeaderProof x, System.Byte[] value) => x.Proof = value, AlgoSdk.ArrayComparer.Instance)); + return true; + } + } +} +namespace AlgoSdk.Algod +{ + + public partial struct Application { @@ -412,14 +460,14 @@ namespace AlgoSdk.Algod { - public partial struct CatchpointStartResponse + public partial struct TransactionProofResponse { - private static bool @__generated__IsValid = CatchpointStartResponse.@__generated__InitializeAlgoApiFormatters(); + private static bool @__generated__IsValid = TransactionProofResponse.@__generated__InitializeAlgoApiFormatters(); private static bool @__generated__InitializeAlgoApiFormatters() { - AlgoSdk.AlgoApiFormatterLookup.Add(new AlgoSdk.AlgoApiObjectFormatter(false).Assign("catchup-message", (AlgoSdk.Algod.CatchpointStartResponse x) => x.CatchupMessage, (ref AlgoSdk.Algod.CatchpointStartResponse x, System.String value) => x.CatchupMessage = value, AlgoSdk.StringComparer.Instance)); + AlgoSdk.AlgoApiFormatterLookup.Add(new AlgoSdk.AlgoApiObjectFormatter(false).Assign("proof", (AlgoSdk.Algod.TransactionProofResponse x) => x.Proof, (ref AlgoSdk.Algod.TransactionProofResponse x, System.Byte[] value) => x.Proof = value, AlgoSdk.ArrayComparer.Instance).Assign("stibhash", (AlgoSdk.Algod.TransactionProofResponse x) => x.Stibhash, (ref AlgoSdk.Algod.TransactionProofResponse x, System.Byte[] value) => x.Stibhash = value, AlgoSdk.ArrayComparer.Instance).Assign("treedepth", (AlgoSdk.Algod.TransactionProofResponse x) => x.Treedepth, (ref AlgoSdk.Algod.TransactionProofResponse x, System.UInt64 value) => x.Treedepth = value).Assign("idx", (AlgoSdk.Algod.TransactionProofResponse x) => x.Idx, (ref AlgoSdk.Algod.TransactionProofResponse x, System.UInt64 value) => x.Idx = value).Assign("hashtype", (AlgoSdk.Algod.TransactionProofResponse x) => x.Hashtype, (ref AlgoSdk.Algod.TransactionProofResponse x, System.String value) => x.Hashtype = value, AlgoSdk.StringComparer.Instance)); return true; } } @@ -428,14 +476,14 @@ namespace AlgoSdk.Algod { - public partial struct PostParticipationResponse + public partial struct BlockHashResponse { - private static bool @__generated__IsValid = PostParticipationResponse.@__generated__InitializeAlgoApiFormatters(); + private static bool @__generated__IsValid = BlockHashResponse.@__generated__InitializeAlgoApiFormatters(); private static bool @__generated__InitializeAlgoApiFormatters() { - AlgoSdk.AlgoApiFormatterLookup.Add(new AlgoSdk.AlgoApiObjectFormatter(false).Assign("partId", (AlgoSdk.Algod.PostParticipationResponse x) => x.PartId, (ref AlgoSdk.Algod.PostParticipationResponse x, System.String value) => x.PartId = value, AlgoSdk.StringComparer.Instance)); + AlgoSdk.AlgoApiFormatterLookup.Add(new AlgoSdk.AlgoApiObjectFormatter(false).Assign("blockHash", (AlgoSdk.Algod.BlockHashResponse x) => x.BlockHash, (ref AlgoSdk.Algod.BlockHashResponse x, System.String value) => x.BlockHash = value, AlgoSdk.StringComparer.Instance)); return true; } } @@ -444,14 +492,14 @@ namespace AlgoSdk.Algod { - public partial struct CompileResponse + public partial struct CatchpointStartResponse { - private static bool @__generated__IsValid = CompileResponse.@__generated__InitializeAlgoApiFormatters(); + private static bool @__generated__IsValid = CatchpointStartResponse.@__generated__InitializeAlgoApiFormatters(); private static bool @__generated__InitializeAlgoApiFormatters() { - AlgoSdk.AlgoApiFormatterLookup.Add(new AlgoSdk.AlgoApiObjectFormatter(false).Assign("hash", (AlgoSdk.Algod.CompileResponse x) => x.Hash, (ref AlgoSdk.Algod.CompileResponse x, System.String value) => x.Hash = value, AlgoSdk.StringComparer.Instance).Assign("result", (AlgoSdk.Algod.CompileResponse x) => x.Result, (ref AlgoSdk.Algod.CompileResponse x, System.String value) => x.Result = value, AlgoSdk.StringComparer.Instance).Assign("sourcemap", (AlgoSdk.Algod.CompileResponse x) => x.Sourcemap, (ref AlgoSdk.Algod.CompileResponse x, AlgoSdk.AlgoApiObject value) => x.Sourcemap = value)); + AlgoSdk.AlgoApiFormatterLookup.Add(new AlgoSdk.AlgoApiObjectFormatter(false).Assign("catchup-message", (AlgoSdk.Algod.CatchpointStartResponse x) => x.CatchupMessage, (ref AlgoSdk.Algod.CatchpointStartResponse x, System.String value) => x.CatchupMessage = value, AlgoSdk.StringComparer.Instance)); return true; } } @@ -460,14 +508,30 @@ namespace AlgoSdk.Algod { - public partial struct DisassembleResponse + public partial struct PostParticipationResponse { - private static bool @__generated__IsValid = DisassembleResponse.@__generated__InitializeAlgoApiFormatters(); + private static bool @__generated__IsValid = PostParticipationResponse.@__generated__InitializeAlgoApiFormatters(); private static bool @__generated__InitializeAlgoApiFormatters() { - AlgoSdk.AlgoApiFormatterLookup.Add(new AlgoSdk.AlgoApiObjectFormatter(false).Assign("result", (AlgoSdk.Algod.DisassembleResponse x) => x.Result, (ref AlgoSdk.Algod.DisassembleResponse x, System.String value) => x.Result = value, AlgoSdk.StringComparer.Instance)); + AlgoSdk.AlgoApiFormatterLookup.Add(new AlgoSdk.AlgoApiObjectFormatter(false).Assign("partId", (AlgoSdk.Algod.PostParticipationResponse x) => x.PartId, (ref AlgoSdk.Algod.PostParticipationResponse x, System.String value) => x.PartId = value, AlgoSdk.StringComparer.Instance)); + return true; + } + } +} +namespace AlgoSdk.Algod +{ + + + public partial struct CompileResponse + { + + private static bool @__generated__IsValid = CompileResponse.@__generated__InitializeAlgoApiFormatters(); + + private static bool @__generated__InitializeAlgoApiFormatters() + { + AlgoSdk.AlgoApiFormatterLookup.Add(new AlgoSdk.AlgoApiObjectFormatter(false).Assign("hash", (AlgoSdk.Algod.CompileResponse x) => x.Hash, (ref AlgoSdk.Algod.CompileResponse x, System.String value) => x.Hash = value, AlgoSdk.StringComparer.Instance).Assign("result", (AlgoSdk.Algod.CompileResponse x) => x.Result, (ref AlgoSdk.Algod.CompileResponse x, System.String value) => x.Result = value, AlgoSdk.StringComparer.Instance).Assign("sourcemap", (AlgoSdk.Algod.CompileResponse x) => x.Sourcemap, (ref AlgoSdk.Algod.CompileResponse x, AlgoSdk.AlgoApiObject value) => x.Sourcemap = value)); return true; } } @@ -476,14 +540,14 @@ namespace AlgoSdk.Algod { - public partial struct ProofResponse + public partial struct DisassembleResponse { - private static bool @__generated__IsValid = ProofResponse.@__generated__InitializeAlgoApiFormatters(); + private static bool @__generated__IsValid = DisassembleResponse.@__generated__InitializeAlgoApiFormatters(); private static bool @__generated__InitializeAlgoApiFormatters() { - AlgoSdk.AlgoApiFormatterLookup.Add(new AlgoSdk.AlgoApiObjectFormatter(false).Assign("proof", (AlgoSdk.Algod.ProofResponse x) => x.Proof, (ref AlgoSdk.Algod.ProofResponse x, System.Byte[] value) => x.Proof = value, AlgoSdk.ArrayComparer.Instance).Assign("stibhash", (AlgoSdk.Algod.ProofResponse x) => x.Stibhash, (ref AlgoSdk.Algod.ProofResponse x, System.Byte[] value) => x.Stibhash = value, AlgoSdk.ArrayComparer.Instance).Assign("treedepth", (AlgoSdk.Algod.ProofResponse x) => x.Treedepth, (ref AlgoSdk.Algod.ProofResponse x, System.UInt64 value) => x.Treedepth = value).Assign("idx", (AlgoSdk.Algod.ProofResponse x) => x.Idx, (ref AlgoSdk.Algod.ProofResponse x, System.UInt64 value) => x.Idx = value).Assign("hashtype", (AlgoSdk.Algod.ProofResponse x) => x.Hashtype, (ref AlgoSdk.Algod.ProofResponse x, System.String value) => x.Hashtype = value, AlgoSdk.StringComparer.Instance)); + AlgoSdk.AlgoApiFormatterLookup.Add(new AlgoSdk.AlgoApiObjectFormatter(false).Assign("result", (AlgoSdk.Algod.DisassembleResponse x) => x.Result, (ref AlgoSdk.Algod.DisassembleResponse x, System.String value) => x.Result = value, AlgoSdk.StringComparer.Instance)); return true; } } @@ -668,6 +732,22 @@ namespace AlgoSdk.Algod { + public partial struct LightBlockHeaderProofResponse + { + + private static bool @__generated__IsValid = LightBlockHeaderProofResponse.@__generated__InitializeAlgoApiFormatters(); + + private static bool @__generated__InitializeAlgoApiFormatters() + { + AlgoSdk.AlgoApiFormatterLookup.Add(new AlgoSdk.WrappedValueFormatter()); + return true; + } + } +} +namespace AlgoSdk.Algod +{ + + public partial struct AssetResponse { @@ -700,6 +780,22 @@ namespace AlgoSdk.Algod { + public partial struct StateProofResponse + { + + private static bool @__generated__IsValid = StateProofResponse.@__generated__InitializeAlgoApiFormatters(); + + private static bool @__generated__InitializeAlgoApiFormatters() + { + AlgoSdk.AlgoApiFormatterLookup.Add(new AlgoSdk.WrappedValueFormatter()); + return true; + } + } +} +namespace AlgoSdk.Algod +{ + + public partial struct ParticipationKeysResponse { diff --git a/Runtime/CareBoo.AlgoSdk/Formatters.gen/IndexerTypes.gen.Formatters.gen.cs b/Runtime/CareBoo.AlgoSdk/Formatters.gen/IndexerTypes.gen.Formatters.gen.cs index d0a287760..48c65587a 100644 --- a/Runtime/CareBoo.AlgoSdk/Formatters.gen/IndexerTypes.gen.Formatters.gen.cs +++ b/Runtime/CareBoo.AlgoSdk/Formatters.gen/IndexerTypes.gen.Formatters.gen.cs @@ -19,7 +19,23 @@ public partial struct Block private static bool @__generated__InitializeAlgoApiFormatters() { - AlgoSdk.AlgoApiFormatterLookup.Add(new AlgoSdk.AlgoApiObjectFormatter(false).Assign("rewards", (AlgoSdk.Indexer.Block x) => x.Rewards, (ref AlgoSdk.Indexer.Block x, AlgoSdk.Indexer.BlockRewards value) => x.Rewards = value).Assign("genesis-hash", (AlgoSdk.Indexer.Block x) => x.GenesisHash, (ref AlgoSdk.Indexer.Block x, System.Byte[] value) => x.GenesisHash = value, AlgoSdk.ArrayComparer.Instance).Assign("upgrade-state", (AlgoSdk.Indexer.Block x) => x.UpgradeState, (ref AlgoSdk.Indexer.Block x, AlgoSdk.Indexer.BlockUpgradeState value) => x.UpgradeState = value).Assign("previous-block-hash", (AlgoSdk.Indexer.Block x) => x.PreviousBlockHash, (ref AlgoSdk.Indexer.Block x, System.Byte[] value) => x.PreviousBlockHash = value, AlgoSdk.ArrayComparer.Instance).Assign("seed", (AlgoSdk.Indexer.Block x) => x.Seed, (ref AlgoSdk.Indexer.Block x, System.Byte[] value) => x.Seed = value, AlgoSdk.ArrayComparer.Instance).Assign("round", (AlgoSdk.Indexer.Block x) => x.Round, (ref AlgoSdk.Indexer.Block x, System.UInt64 value) => x.Round = value).Assign("transactions-root", (AlgoSdk.Indexer.Block x) => x.TransactionsRoot, (ref AlgoSdk.Indexer.Block x, System.Byte[] value) => x.TransactionsRoot = value, AlgoSdk.ArrayComparer.Instance).Assign("genesis-id", (AlgoSdk.Indexer.Block x) => x.GenesisId, (ref AlgoSdk.Indexer.Block x, System.String value) => x.GenesisId = value, AlgoSdk.StringComparer.Instance).Assign("upgrade-vote", (AlgoSdk.Indexer.Block x) => x.UpgradeVote, (ref AlgoSdk.Indexer.Block x, AlgoSdk.Indexer.BlockUpgradeVote value) => x.UpgradeVote = value).Assign("transactions", (AlgoSdk.Indexer.Block x) => x.Transactions, (ref AlgoSdk.Indexer.Block x, AlgoSdk.Indexer.Transaction[] value) => x.Transactions = value, AlgoSdk.ArrayComparer.Instance).Assign("timestamp", (AlgoSdk.Indexer.Block x) => x.Timestamp, (ref AlgoSdk.Indexer.Block x, System.UInt64 value) => x.Timestamp = value).Assign("txn-counter", (AlgoSdk.Indexer.Block x) => x.TxnCounter, (ref AlgoSdk.Indexer.Block x, AlgoSdk.Optional value) => x.TxnCounter = value)); + AlgoSdk.AlgoApiFormatterLookup.Add(new AlgoSdk.AlgoApiObjectFormatter(false).Assign("rewards", (AlgoSdk.Indexer.Block x) => x.Rewards, (ref AlgoSdk.Indexer.Block x, AlgoSdk.Indexer.BlockRewards value) => x.Rewards = value).Assign("genesis-hash", (AlgoSdk.Indexer.Block x) => x.GenesisHash, (ref AlgoSdk.Indexer.Block x, System.Byte[] value) => x.GenesisHash = value, AlgoSdk.ArrayComparer.Instance).Assign("upgrade-state", (AlgoSdk.Indexer.Block x) => x.UpgradeState, (ref AlgoSdk.Indexer.Block x, AlgoSdk.Indexer.BlockUpgradeState value) => x.UpgradeState = value).Assign("previous-block-hash", (AlgoSdk.Indexer.Block x) => x.PreviousBlockHash, (ref AlgoSdk.Indexer.Block x, System.Byte[] value) => x.PreviousBlockHash = value, AlgoSdk.ArrayComparer.Instance).Assign("seed", (AlgoSdk.Indexer.Block x) => x.Seed, (ref AlgoSdk.Indexer.Block x, System.Byte[] value) => x.Seed = value, AlgoSdk.ArrayComparer.Instance).Assign("round", (AlgoSdk.Indexer.Block x) => x.Round, (ref AlgoSdk.Indexer.Block x, System.UInt64 value) => x.Round = value).Assign("transactions-root", (AlgoSdk.Indexer.Block x) => x.TransactionsRoot, (ref AlgoSdk.Indexer.Block x, System.Byte[] value) => x.TransactionsRoot = value, AlgoSdk.ArrayComparer.Instance).Assign("state-proof-tracking", (AlgoSdk.Indexer.Block x) => x.StateProofTracking, (ref AlgoSdk.Indexer.Block x, AlgoSdk.Indexer.StateProofTracking[] value) => x.StateProofTracking = value, AlgoSdk.ArrayComparer.Instance).Assign("genesis-id", (AlgoSdk.Indexer.Block x) => x.GenesisId, (ref AlgoSdk.Indexer.Block x, System.String value) => x.GenesisId = value, AlgoSdk.StringComparer.Instance).Assign("transactions-root-sha256", (AlgoSdk.Indexer.Block x) => x.TransactionsRootSha256, (ref AlgoSdk.Indexer.Block x, System.Byte[] value) => x.TransactionsRootSha256 = value, AlgoSdk.ArrayComparer.Instance).Assign("upgrade-vote", (AlgoSdk.Indexer.Block x) => x.UpgradeVote, (ref AlgoSdk.Indexer.Block x, AlgoSdk.Indexer.BlockUpgradeVote value) => x.UpgradeVote = value).Assign("participation-updates", (AlgoSdk.Indexer.Block x) => x.ParticipationUpdates, (ref AlgoSdk.Indexer.Block x, AlgoSdk.Indexer.ParticipationUpdates value) => x.ParticipationUpdates = value).Assign("transactions", (AlgoSdk.Indexer.Block x) => x.Transactions, (ref AlgoSdk.Indexer.Block x, AlgoSdk.Indexer.Transaction[] value) => x.Transactions = value, AlgoSdk.ArrayComparer.Instance).Assign("timestamp", (AlgoSdk.Indexer.Block x) => x.Timestamp, (ref AlgoSdk.Indexer.Block x, System.UInt64 value) => x.Timestamp = value).Assign("txn-counter", (AlgoSdk.Indexer.Block x) => x.TxnCounter, (ref AlgoSdk.Indexer.Block x, AlgoSdk.Optional value) => x.TxnCounter = value)); + return true; + } + } +} +namespace AlgoSdk.Indexer +{ + + + public partial struct HashFactory + { + + private static bool @__generated__IsValid = HashFactory.@__generated__InitializeAlgoApiFormatters(); + + private static bool @__generated__InitializeAlgoApiFormatters() + { + AlgoSdk.AlgoApiFormatterLookup.Add(new AlgoSdk.AlgoApiObjectFormatter(false).Assign("hash-type", (AlgoSdk.Indexer.HashFactory x) => x.HashType, (ref AlgoSdk.Indexer.HashFactory x, AlgoSdk.Optional value) => x.HashType = value)); return true; } } @@ -44,6 +60,22 @@ namespace AlgoSdk.Indexer { + public partial struct ParticipationUpdates + { + + private static bool @__generated__IsValid = ParticipationUpdates.@__generated__InitializeAlgoApiFormatters(); + + private static bool @__generated__InitializeAlgoApiFormatters() + { + AlgoSdk.AlgoApiFormatterLookup.Add(new AlgoSdk.AlgoApiObjectFormatter(false).Assign("expired-participation-accounts", (AlgoSdk.Indexer.ParticipationUpdates x) => x.ExpiredParticipationAccounts, (ref AlgoSdk.Indexer.ParticipationUpdates x, System.String[] value) => x.ExpiredParticipationAccounts = value, AlgoSdk.ArrayComparer.Instance)); + return true; + } + } +} +namespace AlgoSdk.Indexer +{ + + public partial struct ApplicationParams { @@ -60,6 +92,22 @@ namespace AlgoSdk.Indexer { + public partial struct StateProofTracking + { + + private static bool @__generated__IsValid = StateProofTracking.@__generated__InitializeAlgoApiFormatters(); + + private static bool @__generated__InitializeAlgoApiFormatters() + { + AlgoSdk.AlgoApiFormatterLookup.Add(new AlgoSdk.AlgoApiObjectFormatter(false).Assign("type", (AlgoSdk.Indexer.StateProofTracking x) => x.Type, (ref AlgoSdk.Indexer.StateProofTracking x, AlgoSdk.Optional value) => x.Type = value).Assign("voters-commitment", (AlgoSdk.Indexer.StateProofTracking x) => x.VotersCommitment, (ref AlgoSdk.Indexer.StateProofTracking x, System.Byte[] value) => x.VotersCommitment = value, AlgoSdk.ArrayComparer.Instance).Assign("online-total-weight", (AlgoSdk.Indexer.StateProofTracking x) => x.OnlineTotalWeight, (ref AlgoSdk.Indexer.StateProofTracking x, AlgoSdk.Optional value) => x.OnlineTotalWeight = value).Assign("next-round", (AlgoSdk.Indexer.StateProofTracking x) => x.NextRound, (ref AlgoSdk.Indexer.StateProofTracking x, AlgoSdk.Optional value) => x.NextRound = value)); + return true; + } + } +} +namespace AlgoSdk.Indexer +{ + + public partial struct TealValue { @@ -172,6 +220,22 @@ namespace AlgoSdk.Indexer { + public partial struct StateProofFields + { + + private static bool @__generated__IsValid = StateProofFields.@__generated__InitializeAlgoApiFormatters(); + + private static bool @__generated__InitializeAlgoApiFormatters() + { + AlgoSdk.AlgoApiFormatterLookup.Add(new AlgoSdk.AlgoApiObjectFormatter(false).Assign("sig-commit", (AlgoSdk.Indexer.StateProofFields x) => x.SigCommit, (ref AlgoSdk.Indexer.StateProofFields x, System.Byte[] value) => x.SigCommit = value, AlgoSdk.ArrayComparer.Instance).Assign("signed-weight", (AlgoSdk.Indexer.StateProofFields x) => x.SignedWeight, (ref AlgoSdk.Indexer.StateProofFields x, AlgoSdk.Optional value) => x.SignedWeight = value).Assign("sig-proofs", (AlgoSdk.Indexer.StateProofFields x) => x.SigProofs, (ref AlgoSdk.Indexer.StateProofFields x, AlgoSdk.Indexer.MerkleArrayProof value) => x.SigProofs = value).Assign("part-proofs", (AlgoSdk.Indexer.StateProofFields x) => x.PartProofs, (ref AlgoSdk.Indexer.StateProofFields x, AlgoSdk.Indexer.MerkleArrayProof value) => x.PartProofs = value).Assign("salt-version", (AlgoSdk.Indexer.StateProofFields x) => x.SaltVersion, (ref AlgoSdk.Indexer.StateProofFields x, AlgoSdk.Optional value) => x.SaltVersion = value).Assign("reveals", (AlgoSdk.Indexer.StateProofFields x) => x.Reveals, (ref AlgoSdk.Indexer.StateProofFields x, AlgoSdk.Indexer.StateProofReveal[] value) => x.Reveals = value, AlgoSdk.ArrayComparer.Instance).Assign("positions-to-reveal", (AlgoSdk.Indexer.StateProofFields x) => x.PositionsToReveal, (ref AlgoSdk.Indexer.StateProofFields x, System.UInt64[] value) => x.PositionsToReveal = value, AlgoSdk.ArrayComparer.Instance)); + return true; + } + } +} +namespace AlgoSdk.Indexer +{ + + public partial struct MiniAssetHolding { @@ -188,6 +252,22 @@ namespace AlgoSdk.Indexer { + public partial struct StateProofParticipant + { + + private static bool @__generated__IsValid = StateProofParticipant.@__generated__InitializeAlgoApiFormatters(); + + private static bool @__generated__InitializeAlgoApiFormatters() + { + AlgoSdk.AlgoApiFormatterLookup.Add(new AlgoSdk.AlgoApiObjectFormatter(false).Assign("verifier", (AlgoSdk.Indexer.StateProofParticipant x) => x.Verifier, (ref AlgoSdk.Indexer.StateProofParticipant x, AlgoSdk.Indexer.StateProofVerifier value) => x.Verifier = value).Assign("weight", (AlgoSdk.Indexer.StateProofParticipant x) => x.Weight, (ref AlgoSdk.Indexer.StateProofParticipant x, AlgoSdk.Optional value) => x.Weight = value)); + return true; + } + } +} +namespace AlgoSdk.Indexer +{ + + public partial struct ApplicationLogData { @@ -268,6 +348,22 @@ namespace AlgoSdk.Indexer { + public partial struct StateProofReveal + { + + private static bool @__generated__IsValid = StateProofReveal.@__generated__InitializeAlgoApiFormatters(); + + private static bool @__generated__InitializeAlgoApiFormatters() + { + AlgoSdk.AlgoApiFormatterLookup.Add(new AlgoSdk.AlgoApiObjectFormatter(false).Assign("position", (AlgoSdk.Indexer.StateProofReveal x) => x.Position, (ref AlgoSdk.Indexer.StateProofReveal x, AlgoSdk.Optional value) => x.Position = value).Assign("sig-slot", (AlgoSdk.Indexer.StateProofReveal x) => x.SigSlot, (ref AlgoSdk.Indexer.StateProofReveal x, AlgoSdk.Indexer.StateProofSigSlot value) => x.SigSlot = value).Assign("participant", (AlgoSdk.Indexer.StateProofReveal x) => x.Participant, (ref AlgoSdk.Indexer.StateProofReveal x, AlgoSdk.Indexer.StateProofParticipant value) => x.Participant = value)); + return true; + } + } +} +namespace AlgoSdk.Indexer +{ + + public partial struct TealKeyValue { @@ -364,6 +460,22 @@ namespace AlgoSdk.Indexer { + public partial struct StateProofSignature + { + + private static bool @__generated__IsValid = StateProofSignature.@__generated__InitializeAlgoApiFormatters(); + + private static bool @__generated__InitializeAlgoApiFormatters() + { + AlgoSdk.AlgoApiFormatterLookup.Add(new AlgoSdk.AlgoApiObjectFormatter(false).Assign("falcon-signature", (AlgoSdk.Indexer.StateProofSignature x) => x.FalconSignature, (ref AlgoSdk.Indexer.StateProofSignature x, System.Byte[] value) => x.FalconSignature = value, AlgoSdk.ArrayComparer.Instance).Assign("merkle-array-index", (AlgoSdk.Indexer.StateProofSignature x) => x.MerkleArrayIndex, (ref AlgoSdk.Indexer.StateProofSignature x, AlgoSdk.Optional value) => x.MerkleArrayIndex = value).Assign("proof", (AlgoSdk.Indexer.StateProofSignature x) => x.Proof, (ref AlgoSdk.Indexer.StateProofSignature x, AlgoSdk.Indexer.MerkleArrayProof value) => x.Proof = value).Assign("verifying-key", (AlgoSdk.Indexer.StateProofSignature x) => x.VerifyingKey, (ref AlgoSdk.Indexer.StateProofSignature x, System.Byte[] value) => x.VerifyingKey = value, AlgoSdk.ArrayComparer.Instance)); + return true; + } + } +} +namespace AlgoSdk.Indexer +{ + + public partial struct AccountStateDelta { @@ -499,7 +611,55 @@ public partial struct Transaction private static bool @__generated__InitializeAlgoApiFormatters() { - AlgoSdk.AlgoApiFormatterLookup.Add(new AlgoSdk.AlgoApiObjectFormatter(false).Assign("fee", (AlgoSdk.Indexer.Transaction x) => x.Fee, (ref AlgoSdk.Indexer.Transaction x, System.UInt64 value) => x.Fee = value).Assign("asset-transfer-transaction", (AlgoSdk.Indexer.Transaction x) => x.AssetTransferTransaction, (ref AlgoSdk.Indexer.Transaction x, AlgoSdk.Indexer.TransactionAssetTransfer value) => x.AssetTransferTransaction = value).Assign("group", (AlgoSdk.Indexer.Transaction x) => x.Group, (ref AlgoSdk.Indexer.Transaction x, System.Byte[] value) => x.Group = value, AlgoSdk.ArrayComparer.Instance).Assign("created-application-index", (AlgoSdk.Indexer.Transaction x) => x.CreatedApplicationIndex, (ref AlgoSdk.Indexer.Transaction x, AlgoSdk.Optional value) => x.CreatedApplicationIndex = value).Assign("lease", (AlgoSdk.Indexer.Transaction x) => x.Lease, (ref AlgoSdk.Indexer.Transaction x, System.Byte[] value) => x.Lease = value, AlgoSdk.ArrayComparer.Instance).Assign("genesis-hash", (AlgoSdk.Indexer.Transaction x) => x.GenesisHash, (ref AlgoSdk.Indexer.Transaction x, System.Byte[] value) => x.GenesisHash = value, AlgoSdk.ArrayComparer.Instance).Assign("logs", (AlgoSdk.Indexer.Transaction x) => x.Logs, (ref AlgoSdk.Indexer.Transaction x, System.Byte[][] value) => x.Logs = value, AlgoSdk.ArrayComparer>.Instance).Assign("sender-rewards", (AlgoSdk.Indexer.Transaction x) => x.SenderRewards, (ref AlgoSdk.Indexer.Transaction x, AlgoSdk.Optional value) => x.SenderRewards = value).Assign("closing-amount", (AlgoSdk.Indexer.Transaction x) => x.ClosingAmount, (ref AlgoSdk.Indexer.Transaction x, AlgoSdk.Optional value) => x.ClosingAmount = value).Assign("signature", (AlgoSdk.Indexer.Transaction x) => x.Signature, (ref AlgoSdk.Indexer.Transaction x, AlgoSdk.Indexer.TransactionSignature value) => x.Signature = value).Assign("global-state-delta", (AlgoSdk.Indexer.Transaction x) => x.GlobalStateDelta, (ref AlgoSdk.Indexer.Transaction x, AlgoSdk.Indexer.StateDelta value) => x.GlobalStateDelta = value).Assign("tx-type", (AlgoSdk.Indexer.Transaction x) => x.TxType, (ref AlgoSdk.Indexer.Transaction x, AlgoSdk.TransactionType value) => x.TxType = value, AlgoSdk.ByteEnumComparer.Instance).Assign("intra-round-offset", (AlgoSdk.Indexer.Transaction x) => x.IntraRoundOffset, (ref AlgoSdk.Indexer.Transaction x, AlgoSdk.Optional value) => x.IntraRoundOffset = value).Assign("payment-transaction", (AlgoSdk.Indexer.Transaction x) => x.PaymentTransaction, (ref AlgoSdk.Indexer.Transaction x, AlgoSdk.Indexer.TransactionPayment value) => x.PaymentTransaction = value).Assign("keyreg-transaction", (AlgoSdk.Indexer.Transaction x) => x.KeyregTransaction, (ref AlgoSdk.Indexer.Transaction x, AlgoSdk.Indexer.TransactionKeyreg value) => x.KeyregTransaction = value).Assign("confirmed-round", (AlgoSdk.Indexer.Transaction x) => x.ConfirmedRound, (ref AlgoSdk.Indexer.Transaction x, AlgoSdk.Optional value) => x.ConfirmedRound = value).Assign("note", (AlgoSdk.Indexer.Transaction x) => x.Note, (ref AlgoSdk.Indexer.Transaction x, System.Byte[] value) => x.Note = value, AlgoSdk.ArrayComparer.Instance).Assign("receiver-rewards", (AlgoSdk.Indexer.Transaction x) => x.ReceiverRewards, (ref AlgoSdk.Indexer.Transaction x, AlgoSdk.Optional value) => x.ReceiverRewards = value).Assign("round-time", (AlgoSdk.Indexer.Transaction x) => x.RoundTime, (ref AlgoSdk.Indexer.Transaction x, AlgoSdk.Optional value) => x.RoundTime = value).Assign("inner-txns", (AlgoSdk.Indexer.Transaction x) => x.InnerTxns, (ref AlgoSdk.Indexer.Transaction x, AlgoSdk.Indexer.Transaction[] value) => x.InnerTxns = value, AlgoSdk.ArrayComparer.Instance).Assign("asset-config-transaction", (AlgoSdk.Indexer.Transaction x) => x.AssetConfigTransaction, (ref AlgoSdk.Indexer.Transaction x, AlgoSdk.Indexer.TransactionAssetConfig value) => x.AssetConfigTransaction = value).Assign("last-valid", (AlgoSdk.Indexer.Transaction x) => x.LastValid, (ref AlgoSdk.Indexer.Transaction x, System.UInt64 value) => x.LastValid = value).Assign("close-rewards", (AlgoSdk.Indexer.Transaction x) => x.CloseRewards, (ref AlgoSdk.Indexer.Transaction x, AlgoSdk.Optional value) => x.CloseRewards = value).Assign("local-state-delta", (AlgoSdk.Indexer.Transaction x) => x.LocalStateDelta, (ref AlgoSdk.Indexer.Transaction x, AlgoSdk.Indexer.AccountStateDelta[] value) => x.LocalStateDelta = value, AlgoSdk.ArrayComparer.Instance).Assign("id", (AlgoSdk.Indexer.Transaction x) => x.Id, (ref AlgoSdk.Indexer.Transaction x, System.String value) => x.Id = value, AlgoSdk.StringComparer.Instance).Assign("auth-addr", (AlgoSdk.Indexer.Transaction x) => x.AuthAddr, (ref AlgoSdk.Indexer.Transaction x, AlgoSdk.Address value) => x.AuthAddr = value).Assign("genesis-id", (AlgoSdk.Indexer.Transaction x) => x.GenesisId, (ref AlgoSdk.Indexer.Transaction x, System.String value) => x.GenesisId = value, AlgoSdk.StringComparer.Instance).Assign("sender", (AlgoSdk.Indexer.Transaction x) => x.Sender, (ref AlgoSdk.Indexer.Transaction x, System.String value) => x.Sender = value, AlgoSdk.StringComparer.Instance).Assign("application-transaction", (AlgoSdk.Indexer.Transaction x) => x.ApplicationTransaction, (ref AlgoSdk.Indexer.Transaction x, AlgoSdk.Indexer.TransactionApplication value) => x.ApplicationTransaction = value).Assign("created-asset-index", (AlgoSdk.Indexer.Transaction x) => x.CreatedAssetIndex, (ref AlgoSdk.Indexer.Transaction x, AlgoSdk.Optional value) => x.CreatedAssetIndex = value).Assign("first-valid", (AlgoSdk.Indexer.Transaction x) => x.FirstValid, (ref AlgoSdk.Indexer.Transaction x, System.UInt64 value) => x.FirstValid = value).Assign("rekey-to", (AlgoSdk.Indexer.Transaction x) => x.RekeyTo, (ref AlgoSdk.Indexer.Transaction x, AlgoSdk.Address value) => x.RekeyTo = value).Assign("asset-freeze-transaction", (AlgoSdk.Indexer.Transaction x) => x.AssetFreezeTransaction, (ref AlgoSdk.Indexer.Transaction x, AlgoSdk.Indexer.TransactionAssetFreeze value) => x.AssetFreezeTransaction = value)); + AlgoSdk.AlgoApiFormatterLookup.Add(new AlgoSdk.AlgoApiObjectFormatter(false).Assign("state-proof-transaction", (AlgoSdk.Indexer.Transaction x) => x.StateProofTransaction, (ref AlgoSdk.Indexer.Transaction x, AlgoSdk.Indexer.TransactionStateProof value) => x.StateProofTransaction = value).Assign("fee", (AlgoSdk.Indexer.Transaction x) => x.Fee, (ref AlgoSdk.Indexer.Transaction x, System.UInt64 value) => x.Fee = value).Assign("asset-transfer-transaction", (AlgoSdk.Indexer.Transaction x) => x.AssetTransferTransaction, (ref AlgoSdk.Indexer.Transaction x, AlgoSdk.Indexer.TransactionAssetTransfer value) => x.AssetTransferTransaction = value).Assign("group", (AlgoSdk.Indexer.Transaction x) => x.Group, (ref AlgoSdk.Indexer.Transaction x, System.Byte[] value) => x.Group = value, AlgoSdk.ArrayComparer.Instance).Assign("created-application-index", (AlgoSdk.Indexer.Transaction x) => x.CreatedApplicationIndex, (ref AlgoSdk.Indexer.Transaction x, AlgoSdk.Optional value) => x.CreatedApplicationIndex = value).Assign("lease", (AlgoSdk.Indexer.Transaction x) => x.Lease, (ref AlgoSdk.Indexer.Transaction x, System.Byte[] value) => x.Lease = value, AlgoSdk.ArrayComparer.Instance).Assign("genesis-hash", (AlgoSdk.Indexer.Transaction x) => x.GenesisHash, (ref AlgoSdk.Indexer.Transaction x, System.Byte[] value) => x.GenesisHash = value, AlgoSdk.ArrayComparer.Instance).Assign("logs", (AlgoSdk.Indexer.Transaction x) => x.Logs, (ref AlgoSdk.Indexer.Transaction x, System.Byte[][] value) => x.Logs = value, AlgoSdk.ArrayComparer>.Instance).Assign("sender-rewards", (AlgoSdk.Indexer.Transaction x) => x.SenderRewards, (ref AlgoSdk.Indexer.Transaction x, AlgoSdk.Optional value) => x.SenderRewards = value).Assign("closing-amount", (AlgoSdk.Indexer.Transaction x) => x.ClosingAmount, (ref AlgoSdk.Indexer.Transaction x, AlgoSdk.Optional value) => x.ClosingAmount = value).Assign("signature", (AlgoSdk.Indexer.Transaction x) => x.Signature, (ref AlgoSdk.Indexer.Transaction x, AlgoSdk.Indexer.TransactionSignature value) => x.Signature = value).Assign("global-state-delta", (AlgoSdk.Indexer.Transaction x) => x.GlobalStateDelta, (ref AlgoSdk.Indexer.Transaction x, AlgoSdk.Indexer.StateDelta value) => x.GlobalStateDelta = value).Assign("tx-type", (AlgoSdk.Indexer.Transaction x) => x.TxType, (ref AlgoSdk.Indexer.Transaction x, System.String value) => x.TxType = value, AlgoSdk.StringComparer.Instance).Assign("intra-round-offset", (AlgoSdk.Indexer.Transaction x) => x.IntraRoundOffset, (ref AlgoSdk.Indexer.Transaction x, AlgoSdk.Optional value) => x.IntraRoundOffset = value).Assign("payment-transaction", (AlgoSdk.Indexer.Transaction x) => x.PaymentTransaction, (ref AlgoSdk.Indexer.Transaction x, AlgoSdk.Indexer.TransactionPayment value) => x.PaymentTransaction = value).Assign("keyreg-transaction", (AlgoSdk.Indexer.Transaction x) => x.KeyregTransaction, (ref AlgoSdk.Indexer.Transaction x, AlgoSdk.Indexer.TransactionKeyreg value) => x.KeyregTransaction = value).Assign("confirmed-round", (AlgoSdk.Indexer.Transaction x) => x.ConfirmedRound, (ref AlgoSdk.Indexer.Transaction x, AlgoSdk.Optional value) => x.ConfirmedRound = value).Assign("note", (AlgoSdk.Indexer.Transaction x) => x.Note, (ref AlgoSdk.Indexer.Transaction x, System.Byte[] value) => x.Note = value, AlgoSdk.ArrayComparer.Instance).Assign("receiver-rewards", (AlgoSdk.Indexer.Transaction x) => x.ReceiverRewards, (ref AlgoSdk.Indexer.Transaction x, AlgoSdk.Optional value) => x.ReceiverRewards = value).Assign("round-time", (AlgoSdk.Indexer.Transaction x) => x.RoundTime, (ref AlgoSdk.Indexer.Transaction x, AlgoSdk.Optional value) => x.RoundTime = value).Assign("inner-txns", (AlgoSdk.Indexer.Transaction x) => x.InnerTxns, (ref AlgoSdk.Indexer.Transaction x, AlgoSdk.Indexer.Transaction[] value) => x.InnerTxns = value, AlgoSdk.ArrayComparer.Instance).Assign("asset-config-transaction", (AlgoSdk.Indexer.Transaction x) => x.AssetConfigTransaction, (ref AlgoSdk.Indexer.Transaction x, AlgoSdk.Indexer.TransactionAssetConfig value) => x.AssetConfigTransaction = value).Assign("last-valid", (AlgoSdk.Indexer.Transaction x) => x.LastValid, (ref AlgoSdk.Indexer.Transaction x, System.UInt64 value) => x.LastValid = value).Assign("close-rewards", (AlgoSdk.Indexer.Transaction x) => x.CloseRewards, (ref AlgoSdk.Indexer.Transaction x, AlgoSdk.Optional value) => x.CloseRewards = value).Assign("local-state-delta", (AlgoSdk.Indexer.Transaction x) => x.LocalStateDelta, (ref AlgoSdk.Indexer.Transaction x, AlgoSdk.Indexer.AccountStateDelta[] value) => x.LocalStateDelta = value, AlgoSdk.ArrayComparer.Instance).Assign("id", (AlgoSdk.Indexer.Transaction x) => x.Id, (ref AlgoSdk.Indexer.Transaction x, System.String value) => x.Id = value, AlgoSdk.StringComparer.Instance).Assign("auth-addr", (AlgoSdk.Indexer.Transaction x) => x.AuthAddr, (ref AlgoSdk.Indexer.Transaction x, AlgoSdk.Address value) => x.AuthAddr = value).Assign("genesis-id", (AlgoSdk.Indexer.Transaction x) => x.GenesisId, (ref AlgoSdk.Indexer.Transaction x, System.String value) => x.GenesisId = value, AlgoSdk.StringComparer.Instance).Assign("sender", (AlgoSdk.Indexer.Transaction x) => x.Sender, (ref AlgoSdk.Indexer.Transaction x, System.String value) => x.Sender = value, AlgoSdk.StringComparer.Instance).Assign("application-transaction", (AlgoSdk.Indexer.Transaction x) => x.ApplicationTransaction, (ref AlgoSdk.Indexer.Transaction x, AlgoSdk.Indexer.TransactionApplication value) => x.ApplicationTransaction = value).Assign("created-asset-index", (AlgoSdk.Indexer.Transaction x) => x.CreatedAssetIndex, (ref AlgoSdk.Indexer.Transaction x, AlgoSdk.Optional value) => x.CreatedAssetIndex = value).Assign("first-valid", (AlgoSdk.Indexer.Transaction x) => x.FirstValid, (ref AlgoSdk.Indexer.Transaction x, System.UInt64 value) => x.FirstValid = value).Assign("rekey-to", (AlgoSdk.Indexer.Transaction x) => x.RekeyTo, (ref AlgoSdk.Indexer.Transaction x, AlgoSdk.Address value) => x.RekeyTo = value).Assign("asset-freeze-transaction", (AlgoSdk.Indexer.Transaction x) => x.AssetFreezeTransaction, (ref AlgoSdk.Indexer.Transaction x, AlgoSdk.Indexer.TransactionAssetFreeze value) => x.AssetFreezeTransaction = value)); + return true; + } + } +} +namespace AlgoSdk.Indexer +{ + + + public partial struct TransactionStateProof + { + + private static bool @__generated__IsValid = TransactionStateProof.@__generated__InitializeAlgoApiFormatters(); + + private static bool @__generated__InitializeAlgoApiFormatters() + { + AlgoSdk.AlgoApiFormatterLookup.Add(new AlgoSdk.AlgoApiObjectFormatter(false).Assign("state-proof-type", (AlgoSdk.Indexer.TransactionStateProof x) => x.StateProofType, (ref AlgoSdk.Indexer.TransactionStateProof x, AlgoSdk.Optional value) => x.StateProofType = value).Assign("state-proof", (AlgoSdk.Indexer.TransactionStateProof x) => x.StateProof, (ref AlgoSdk.Indexer.TransactionStateProof x, AlgoSdk.Indexer.StateProofFields value) => x.StateProof = value).Assign("message", (AlgoSdk.Indexer.TransactionStateProof x) => x.Message, (ref AlgoSdk.Indexer.TransactionStateProof x, AlgoSdk.Indexer.IndexerStateProofMessage value) => x.Message = value)); + return true; + } + } +} +namespace AlgoSdk.Indexer +{ + + + public partial struct StateProofSigSlot + { + + private static bool @__generated__IsValid = StateProofSigSlot.@__generated__InitializeAlgoApiFormatters(); + + private static bool @__generated__InitializeAlgoApiFormatters() + { + AlgoSdk.AlgoApiFormatterLookup.Add(new AlgoSdk.AlgoApiObjectFormatter(false).Assign("signature", (AlgoSdk.Indexer.StateProofSigSlot x) => x.Signature, (ref AlgoSdk.Indexer.StateProofSigSlot x, AlgoSdk.Indexer.StateProofSignature value) => x.Signature = value).Assign("lower-sig-weight", (AlgoSdk.Indexer.StateProofSigSlot x) => x.LowerSigWeight, (ref AlgoSdk.Indexer.StateProofSigSlot x, AlgoSdk.Optional value) => x.LowerSigWeight = value)); + return true; + } + } +} +namespace AlgoSdk.Indexer +{ + + + public partial struct StateProofVerifier + { + + private static bool @__generated__IsValid = StateProofVerifier.@__generated__InitializeAlgoApiFormatters(); + + private static bool @__generated__InitializeAlgoApiFormatters() + { + AlgoSdk.AlgoApiFormatterLookup.Add(new AlgoSdk.AlgoApiObjectFormatter(false).Assign("commitment", (AlgoSdk.Indexer.StateProofVerifier x) => x.Commitment, (ref AlgoSdk.Indexer.StateProofVerifier x, System.Byte[] value) => x.Commitment = value, AlgoSdk.ArrayComparer.Instance).Assign("key-lifetime", (AlgoSdk.Indexer.StateProofVerifier x) => x.KeyLifetime, (ref AlgoSdk.Indexer.StateProofVerifier x, AlgoSdk.Optional value) => x.KeyLifetime = value)); return true; } } @@ -524,6 +684,22 @@ namespace AlgoSdk.Indexer { + public partial struct IndexerStateProofMessage + { + + private static bool @__generated__IsValid = IndexerStateProofMessage.@__generated__InitializeAlgoApiFormatters(); + + private static bool @__generated__InitializeAlgoApiFormatters() + { + AlgoSdk.AlgoApiFormatterLookup.Add(new AlgoSdk.AlgoApiObjectFormatter(false).Assign("block-headers-commitment", (AlgoSdk.Indexer.IndexerStateProofMessage x) => x.BlockHeadersCommitment, (ref AlgoSdk.Indexer.IndexerStateProofMessage x, System.Byte[] value) => x.BlockHeadersCommitment = value, AlgoSdk.ArrayComparer.Instance).Assign("voters-commitment", (AlgoSdk.Indexer.IndexerStateProofMessage x) => x.VotersCommitment, (ref AlgoSdk.Indexer.IndexerStateProofMessage x, System.Byte[] value) => x.VotersCommitment = value, AlgoSdk.ArrayComparer.Instance).Assign("ln-proven-weight", (AlgoSdk.Indexer.IndexerStateProofMessage x) => x.LnProvenWeight, (ref AlgoSdk.Indexer.IndexerStateProofMessage x, AlgoSdk.Optional value) => x.LnProvenWeight = value).Assign("first-attested-round", (AlgoSdk.Indexer.IndexerStateProofMessage x) => x.FirstAttestedRound, (ref AlgoSdk.Indexer.IndexerStateProofMessage x, AlgoSdk.Optional value) => x.FirstAttestedRound = value).Assign("latest-attested-round", (AlgoSdk.Indexer.IndexerStateProofMessage x) => x.LatestAttestedRound, (ref AlgoSdk.Indexer.IndexerStateProofMessage x, AlgoSdk.Optional value) => x.LatestAttestedRound = value)); + return true; + } + } +} +namespace AlgoSdk.Indexer +{ + + public partial struct BlockUpgradeState { @@ -540,6 +716,22 @@ namespace AlgoSdk.Indexer { + public partial struct MerkleArrayProof + { + + private static bool @__generated__IsValid = MerkleArrayProof.@__generated__InitializeAlgoApiFormatters(); + + private static bool @__generated__InitializeAlgoApiFormatters() + { + AlgoSdk.AlgoApiFormatterLookup.Add(new AlgoSdk.AlgoApiObjectFormatter(false).Assign("path", (AlgoSdk.Indexer.MerkleArrayProof x) => x.Path, (ref AlgoSdk.Indexer.MerkleArrayProof x, System.Byte[][] value) => x.Path = value, AlgoSdk.ArrayComparer>.Instance).Assign("hash-factory", (AlgoSdk.Indexer.MerkleArrayProof x) => x.HashFactory, (ref AlgoSdk.Indexer.MerkleArrayProof x, AlgoSdk.Indexer.HashFactory value) => x.HashFactory = value).Assign("tree-depth", (AlgoSdk.Indexer.MerkleArrayProof x) => x.TreeDepth, (ref AlgoSdk.Indexer.MerkleArrayProof x, AlgoSdk.Optional value) => x.TreeDepth = value)); + return true; + } + } +} +namespace AlgoSdk.Indexer +{ + + public partial struct AssetHoldingsResponse { diff --git a/Runtime/CareBoo.AlgoSdk/NodeServices/Algod/AlgodClient.cs b/Runtime/CareBoo.AlgoSdk/NodeServices/Algod/AlgodClient.cs index 1f7a2b108..9aedbcccd 100644 --- a/Runtime/CareBoo.AlgoSdk/NodeServices/Algod/AlgodClient.cs +++ b/Runtime/CareBoo.AlgoSdk/NodeServices/Algod/AlgodClient.cs @@ -16,7 +16,6 @@ namespace AlgoSdk /// required to create and send transactions. /// [Serializable] - [Obsolete("Please use Algorand.Algod.DefaultApi instead.")] public partial struct AlgodClient : IAlgodClient { [SerializeField] @@ -170,13 +169,6 @@ public AlgoApiRequest.Sent GetAsset(ulong assetId) return GetAssetByID(assetId); } - - [Obsolete("Call GetProof instead.")] - public AlgoApiRequest.Sent GetMerkleProof(ulong round, TransactionId txid) - { - return GetProof(round, txid); - } - [Obsolete("Call GetSupply instead.")] public AlgoApiRequest.Sent GetLedgerSupply() { diff --git a/Runtime/CareBoo.AlgoSdk/NodeServices/Algod/AlgodClient.gen.cs b/Runtime/CareBoo.AlgoSdk/NodeServices/Algod/AlgodClient.gen.cs index 4d78abc81..821973d91 100644 --- a/Runtime/CareBoo.AlgoSdk/NodeServices/Algod/AlgodClient.gen.cs +++ b/Runtime/CareBoo.AlgoSdk/NodeServices/Algod/AlgodClient.gen.cs @@ -15,10 +15,10 @@ namespace AlgoSdk { - public partial interface IAlgodClient : IAlgoApiClient + public interface IAlgodClient : IAlgoApiClient { /// - /// Get a Merkle proof for a transaction in a block. + /// Get a proof for a transaction in a block. /// /// /// @@ -40,13 +40,13 @@ public partial interface IAlgodClient : IAlgoApiClient /// /// /// - AlgoApiRequest.Sent GetProof( + AlgoApiRequest.Sent GetTransactionProof( ulong round, - + string txid, - + string hashtype = default, - + ResponseFormat format = default ); @@ -115,7 +115,7 @@ string catchpoint /// AlgoApiRequest.Sent GetBlock( ulong round, - + ResponseFormat format = default ); @@ -132,7 +132,23 @@ string catchpoint /// /// AlgoApiRequest.Sent TransactionParams( + + ); + /// + /// Gets a proof for a given light block header inside a state proof commitment + /// + /// + /// + /// + /// + /// The round to which the light block header belongs. + /// + /// + /// + /// + AlgoApiRequest.Sent GetLightBlockHeaderProof( + ulong round ); /// @@ -171,12 +187,28 @@ string catchpoint /// AlgoApiRequest.Sent GetPendingTransactionsByAddress( string address, - + Optional max = default, - + ResponseFormat format = default ); + /// + /// Get a state proof that covers a given round + /// + /// + /// + /// + /// + /// The round for which a state proof is desired. + /// + /// + /// + /// + AlgoApiRequest.Sent GetStateProof( + ulong round + ); + /// /// Broadcasts a raw transaction to the network. /// @@ -226,7 +258,7 @@ ulong assetId /// AlgoApiRequest.Sent GetPendingTransactions( Optional max = default, - + ResponseFormat format = default ); @@ -243,7 +275,7 @@ ulong assetId /// /// AlgoApiRequest.Sent GetSupply( - + ); /// @@ -291,7 +323,7 @@ ulong round /// /// AlgoApiRequest.Sent GetStatus( - + ); /// @@ -307,7 +339,23 @@ ulong round /// The current swagger spec /// AlgoApiRequest.Sent SwaggerJSON( + + ); + /// + /// Get the block hash for the block on the given round. + /// + /// + /// + /// + /// + /// The round from which to fetch block hash information. + /// + /// + /// + /// + AlgoApiRequest.Sent GetBlockHash( + ulong round ); /// @@ -356,7 +404,7 @@ string participationId /// AlgoApiRequest.Sent AppendKeys( byte[] keymap, - + string participationId ); @@ -373,7 +421,7 @@ string participationId /// /// AlgoApiRequest.Sent GetParticipationKeys( - + ); /// @@ -409,7 +457,7 @@ byte[] participationkey /// AlgoApiRequest.Sent TealCompile( byte[] source, - + Optional sourcemap = default ); @@ -433,9 +481,9 @@ byte[] participationkey /// AlgoApiRequest.Sent AccountInformation( string address, - + ExcludeFields exclude = default, - + ResponseFormat format = default ); @@ -449,7 +497,7 @@ byte[] participationkey /// /// AlgoApiRequest.Sent HealthCheck( - + ); /// @@ -478,7 +526,7 @@ byte[] participationkey /// AlgoApiRequest.Sent PendingTransactionInformation( string txid, - + ResponseFormat format = default ); @@ -502,9 +550,9 @@ byte[] participationkey /// AlgoApiRequest.Sent AccountApplicationInformation( string address, - + ulong applicationId, - + ResponseFormat format = default ); @@ -521,7 +569,7 @@ byte[] participationkey /// The genesis file in json. /// AlgoApiRequest.Sent GetGenesis( - + ); /// @@ -537,7 +585,7 @@ byte[] participationkey /// /// AlgoApiRequest.Sent GetVersion( - + ); /// @@ -566,7 +614,7 @@ byte[] source /// /// AlgoApiRequest.Sent Metrics( - + ); /// @@ -589,9 +637,9 @@ byte[] source /// AlgoApiRequest.Sent AccountAssetInformation( string address, - + ulong assetId, - + ResponseFormat format = default ); @@ -601,13 +649,13 @@ public partial struct AlgodClient : IAlgodClient { /// - public AlgoApiRequest.Sent GetProof( + public AlgoApiRequest.Sent GetTransactionProof( ulong round, - + string txid, - + string hashtype = default, - + ResponseFormat format = default ) { @@ -618,7 +666,7 @@ public partial struct AlgodClient var path = $"/v2/blocks/{round}/transactions/{txid}/proof{queryBuilder}"; return this .Get(path) - + .Send() ; } @@ -634,7 +682,7 @@ public partial struct AlgodClient var path = $"/v2/shutdown{queryBuilder}"; return this .Post(path) - + .Send() ; } @@ -647,7 +695,7 @@ string catchpoint var path = $"/v2/catchup/{catchpoint}"; return this .Post(path) - + .Send() ; } @@ -660,7 +708,7 @@ string catchpoint var path = $"/v2/catchup/{catchpoint}"; return this .Delete(path) - + .Send() ; } @@ -668,7 +716,7 @@ string catchpoint /// public AlgoApiRequest.Sent GetBlock( ulong round, - + ResponseFormat format = default ) { @@ -678,20 +726,33 @@ string catchpoint var path = $"/v2/blocks/{round}{queryBuilder}"; return this .Get(path) - + .Send() ; } /// public AlgoApiRequest.Sent TransactionParams( - + ) { var path = $"/v2/transactions/params"; return this .Get(path) + + .Send() + ; + } + /// + public AlgoApiRequest.Sent GetLightBlockHeaderProof( + ulong round + ) + { + var path = $"/v2/blocks/{round}/lightheader/proof"; + return this + .Get(path) + .Send() ; } @@ -712,9 +773,9 @@ string catchpoint /// public AlgoApiRequest.Sent GetPendingTransactionsByAddress( string address, - + Optional max = default, - + ResponseFormat format = default ) { @@ -725,7 +786,20 @@ string catchpoint var path = $"/v2/accounts/{address}/transactions/pending{queryBuilder}"; return this .Get(path) + + .Send() + ; + } + /// + public AlgoApiRequest.Sent GetStateProof( + ulong round + ) + { + var path = $"/v2/stateproofs/{round}"; + return this + .Get(path) + .Send() ; } @@ -751,7 +825,7 @@ ulong assetId var path = $"/v2/assets/{assetId}"; return this .Get(path) - + .Send() ; } @@ -759,7 +833,7 @@ ulong assetId /// public AlgoApiRequest.Sent GetPendingTransactions( Optional max = default, - + ResponseFormat format = default ) { @@ -770,20 +844,20 @@ ulong assetId var path = $"/v2/transactions/pending{queryBuilder}"; return this .Get(path) - + .Send() ; } /// public AlgoApiRequest.Sent GetSupply( - + ) { var path = $"/v2/ledger/supply"; return this .Get(path) - + .Send() ; } @@ -796,7 +870,7 @@ ulong applicationId var path = $"/v2/applications/{applicationId}"; return this .Get(path) - + .Send() ; } @@ -809,33 +883,46 @@ ulong round var path = $"/v2/status/wait-for-block-after/{round}"; return this .Get(path) - + .Send() ; } /// public AlgoApiRequest.Sent GetStatus( - + ) { var path = $"/v2/status"; return this .Get(path) - + .Send() ; } /// public AlgoApiRequest.Sent SwaggerJSON( - + ) { var path = $"/swagger.json"; return this .Get(path) + + .Send() + ; + } + /// + public AlgoApiRequest.Sent GetBlockHash( + ulong round + ) + { + var path = $"/v2/blocks/{round}/hash"; + return this + .Get(path) + .Send() ; } @@ -848,7 +935,7 @@ string participationId var path = $"/v2/participation/{participationId}"; return this .Delete(path) - + .Send() ; } @@ -861,7 +948,7 @@ string participationId var path = $"/v2/participation/{participationId}"; return this .Get(path) - + .Send() ; } @@ -869,7 +956,7 @@ string participationId /// public AlgoApiRequest.Sent AppendKeys( byte[] keymap, - + string participationId ) { @@ -883,13 +970,13 @@ string participationId /// public AlgoApiRequest.Sent GetParticipationKeys( - + ) { var path = $"/v2/participation"; return this .Get(path) - + .Send() ; } @@ -910,7 +997,7 @@ byte[] participationkey /// public AlgoApiRequest.Sent TealCompile( byte[] source, - + Optional sourcemap = default ) { @@ -928,9 +1015,9 @@ byte[] participationkey /// public AlgoApiRequest.Sent AccountInformation( string address, - + ExcludeFields exclude = default, - + ResponseFormat format = default ) { @@ -941,20 +1028,20 @@ byte[] participationkey var path = $"/v2/accounts/{address}{queryBuilder}"; return this .Get(path) - + .Send() ; } /// public AlgoApiRequest.Sent HealthCheck( - + ) { var path = $"/health"; return this .Get(path) - + .Send() ; } @@ -962,7 +1049,7 @@ byte[] participationkey /// public AlgoApiRequest.Sent PendingTransactionInformation( string txid, - + ResponseFormat format = default ) { @@ -972,7 +1059,7 @@ byte[] participationkey var path = $"/v2/transactions/pending/{txid}{queryBuilder}"; return this .Get(path) - + .Send() ; } @@ -980,9 +1067,9 @@ byte[] participationkey /// public AlgoApiRequest.Sent AccountApplicationInformation( string address, - + ulong applicationId, - + ResponseFormat format = default ) { @@ -992,33 +1079,33 @@ byte[] participationkey var path = $"/v2/accounts/{address}/applications/{applicationId}{queryBuilder}"; return this .Get(path) - + .Send() ; } /// public AlgoApiRequest.Sent GetGenesis( - + ) { var path = $"/genesis"; return this .Get(path) - + .Send() ; } /// public AlgoApiRequest.Sent GetVersion( - + ) { var path = $"/versions"; return this .Get(path) - + .Send() ; } @@ -1038,13 +1125,13 @@ byte[] source /// public AlgoApiRequest.Sent Metrics( - + ) { var path = $"/metrics"; return this .Get(path) - + .Send() ; } @@ -1052,9 +1139,9 @@ byte[] source /// public AlgoApiRequest.Sent AccountAssetInformation( string address, - + ulong assetId, - + ResponseFormat format = default ) { @@ -1064,7 +1151,7 @@ byte[] source var path = $"/v2/accounts/{address}/assets/{assetId}{queryBuilder}"; return this .Get(path) - + .Send() ; } diff --git a/Runtime/CareBoo.AlgoSdk/NodeServices/Algod/AlgodTypes.gen.cs b/Runtime/CareBoo.AlgoSdk/NodeServices/Algod/AlgodTypes.gen.cs index 812815d84..b02184e36 100644 --- a/Runtime/CareBoo.AlgoSdk/NodeServices/Algod/AlgodTypes.gen.cs +++ b/Runtime/CareBoo.AlgoSdk/NodeServices/Algod/AlgodTypes.gen.cs @@ -13,33 +13,116 @@ using Unity.Collections; using UnityEngine; +using Dotnet = Algorand.Algod.Model; + namespace AlgoSdk.Algod { + [AlgoApiObject, Serializable] + public partial struct StateProofMessage + : IEquatable + { + [SerializeField, Tooltip(@"The vector commitment root on all light block headers within a state proof interval.")] + byte[] @blockHeadersCommitment; + + [SerializeField, Tooltip(@"The vector commitment root of the top N accounts to sign the next StateProof.")] + byte[] @votersCommitment; + + [SerializeField, Tooltip(@"An integer value representing the natural log of the proven weight with 16 bits of precision. This value would be used to verify the next state proof.")] + ulong @lnProvenWeight; + + [SerializeField, Tooltip(@"The first round the message attests to.")] + ulong @firstAttestedRound; + + [SerializeField, Tooltip(@"The last round the message attests to.")] + ulong @lastAttestedRound; + + /// + /// The vector commitment root on all light block headers within a state proof interval. + /// + [AlgoApiField("BlockHeadersCommitment")] + public byte[] BlockHeadersCommitment + { + get => this.@blockHeadersCommitment; + set => this.@blockHeadersCommitment = value; + } + + /// + /// The vector commitment root of the top N accounts to sign the next StateProof. + /// + [AlgoApiField("VotersCommitment")] + public byte[] VotersCommitment + { + get => this.@votersCommitment; + set => this.@votersCommitment = value; + } + + /// + /// An integer value representing the natural log of the proven weight with 16 bits of precision. This value would be used to verify the next state proof. + /// + [AlgoApiField("LnProvenWeight")] + public ulong LnProvenWeight + { + get => this.@lnProvenWeight; + set => this.@lnProvenWeight = value; + } + + /// + /// The first round the message attests to. + /// + [AlgoApiField("FirstAttestedRound")] + public ulong FirstAttestedRound + { + get => this.@firstAttestedRound; + set => this.@firstAttestedRound = value; + } + + /// + /// The last round the message attests to. + /// + [AlgoApiField("LastAttestedRound")] + public ulong LastAttestedRound + { + get => this.@lastAttestedRound; + set => this.@lastAttestedRound = value; + } + + public bool Equals(StateProofMessage other) + { + return + ArrayComparer.Equals(BlockHeadersCommitment, other.BlockHeadersCommitment) && + ArrayComparer.Equals(VotersCommitment, other.VotersCommitment) && + LnProvenWeight.Equals(other.LnProvenWeight) && + FirstAttestedRound.Equals(other.FirstAttestedRound) && + LastAttestedRound.Equals(other.LastAttestedRound) + ; + } + } + [AlgoApiObject, Serializable] public partial struct ApplicationParams : IEquatable { [SerializeField, Tooltip(@"The address that created this application. This is the address where the parameters and global state for this application can be found.")] Address @creator; - + [SerializeField, Tooltip(@"[approv] approval program.")] CompiledTeal @approvalProgram; - + [SerializeField, Tooltip(@"[clearp] approval program.")] CompiledTeal @clearStateProgram; - + [SerializeField, Tooltip(@"[epp] the amount of extra program pages available to this app.")] Optional @extraProgramPages; - + [SerializeField, Tooltip(@"[lsch] local schema")] ApplicationStateSchema @localStateSchema; - + [SerializeField, Tooltip(@"[gsch] global schema")] ApplicationStateSchema @globalStateSchema; - + [SerializeField, Tooltip(@"[gs] global schema")] TealKeyValueStore @globalState; - + /// /// The address that created this application. This is the address where the parameters and global state for this application can be found. /// @@ -112,7 +195,7 @@ public TealKeyValueStore GlobalState public bool Equals(ApplicationParams other) { - return + return Creator.Equals(other.Creator) && ApprovalProgram.Equals(other.ApprovalProgram) && ClearStateProgram.Equals(other.ClearStateProgram) && @@ -122,6 +205,16 @@ public bool Equals(ApplicationParams other) GlobalState.Equals(other.GlobalState) ; } + + public static implicit operator Dotnet.ApplicationParams(ApplicationParams from) + { + return from.Convert().ToDotnet(); + } + + public static implicit operator ApplicationParams(Dotnet.ApplicationParams from) + { + return from.Convert().ToUnity(); + } } [AlgoApiObject, Serializable] @@ -130,13 +223,13 @@ public partial struct TealValue { [SerializeField, Tooltip(@"[tt] value type. Value `1` refers to **bytes**, value `2` refers to **uint**")] ulong @type; - + [SerializeField, Tooltip(@"[tb] bytes value.")] string @bytes; - + [SerializeField, Tooltip(@"[ui] uint value.")] ulong @uint; - + /// /// [tt] value type. Value `1` refers to **bytes**, value `2` refers to **uint** /// @@ -169,12 +262,22 @@ public ulong Uint public bool Equals(TealValue other) { - return + return Type.Equals(other.Type) && StringComparer.Equals(Bytes, other.Bytes) && Uint.Equals(other.Uint) ; } + + public static implicit operator Dotnet.TealValue(TealValue from) + { + return from.Convert().ToDotnet(); + } + + public static implicit operator TealValue(Dotnet.TealValue from) + { + return from.Convert().ToUnity(); + } } [AlgoApiObject, Serializable] @@ -183,28 +286,28 @@ public partial struct ParticipationKey { [SerializeField, Tooltip(@"The key's ParticipationID.")] string @id; - + [SerializeField, Tooltip(@"Address the key was generated for.")] Address @address; - + [SerializeField, Tooltip(@"When registered, this is the first round it may be used.")] Optional @effectiveFirstValid; - + [SerializeField, Tooltip(@"When registered, this is the last round it may be used.")] Optional @effectiveLastValid; - + [SerializeField, Tooltip(@"Round when this key was last used to vote.")] Optional @lastVote; - + [SerializeField, Tooltip(@"Round when this key was last used to propose a block.")] Optional @lastBlockProposal; - + [SerializeField, Tooltip(@"Round when this key was last used to generate a state proof.")] Optional @lastStateProof; - + [SerializeField, Tooltip(@"Key information stored on the account.")] AccountParticipation @key; - + /// /// The key's ParticipationID. /// @@ -287,7 +390,7 @@ public AccountParticipation Key public bool Equals(ParticipationKey other) { - return + return StringComparer.Equals(Id, other.Id) && Address.Equals(other.Address) && EffectiveFirstValid.Equals(other.EffectiveFirstValid) && @@ -298,6 +401,16 @@ public bool Equals(ParticipationKey other) Key.Equals(other.Key) ; } + + public static implicit operator Dotnet.ParticipationKey(ParticipationKey from) + { + return from.Convert().ToDotnet(); + } + + public static implicit operator ParticipationKey(Dotnet.ParticipationKey from) + { + return from.Convert().ToUnity(); + } } [AlgoApiObject, Serializable] @@ -306,13 +419,13 @@ public partial struct EvalDelta { [SerializeField, Tooltip(@"[at] delta action.")] ulong @action; - + [SerializeField, Tooltip(@"[bs] bytes value.")] string @bytes; - + [SerializeField, Tooltip(@"[ui] uint value.")] Optional @uint; - + /// /// [at] delta action. /// @@ -345,12 +458,22 @@ public Optional Uint public bool Equals(EvalDelta other) { - return + return Action.Equals(other.Action) && StringComparer.Equals(Bytes, other.Bytes) && Uint.Equals(other.Uint) ; } + + public static implicit operator Dotnet.EvalDelta(EvalDelta from) + { + return from.Convert().ToDotnet(); + } + + public static implicit operator EvalDelta(Dotnet.EvalDelta from) + { + return from.Convert().ToUnity(); + } } [AlgoApiObject, Serializable] @@ -359,10 +482,10 @@ public partial struct ApplicationStateSchema { [SerializeField, Tooltip(@"[nui] num of uints.")] ulong @numUint; - + [SerializeField, Tooltip(@"[nbs] num of byte slices.")] ulong @numByteSlice; - + /// /// [nui] num of uints. /// @@ -385,11 +508,21 @@ public ulong NumByteSlice public bool Equals(ApplicationStateSchema other) { - return + return NumUint.Equals(other.NumUint) && NumByteSlice.Equals(other.NumByteSlice) ; } + + public static implicit operator Dotnet.ApplicationStateSchema(ApplicationStateSchema from) + { + return from.Convert().ToDotnet(); + } + + public static implicit operator ApplicationStateSchema(Dotnet.ApplicationStateSchema from) + { + return from.Convert().ToUnity(); + } } [AlgoApiObject, Serializable] @@ -398,19 +531,19 @@ public partial struct DryrunState { [SerializeField, Tooltip(@"Line number")] ulong @line; - + [SerializeField, Tooltip(@"Program counter")] ulong @pc; - + [SerializeField, Tooltip(@"")] TealValue[] @stack; - + [SerializeField, Tooltip(@"")] TealValue[] @scratch; - + [SerializeField, Tooltip(@"Evaluation error if any")] string @error; - + /// /// Line number /// @@ -463,7 +596,7 @@ public string Error public bool Equals(DryrunState other) { - return + return Line.Equals(other.Line) && Pc.Equals(other.Pc) && ArrayComparer.Equals(Stack, other.Stack) && @@ -471,6 +604,16 @@ public bool Equals(DryrunState other) StringComparer.Equals(Error, other.Error) ; } + + public static implicit operator Dotnet.DryrunState(DryrunState from) + { + return from.Convert().ToDotnet(); + } + + public static implicit operator DryrunState(Dotnet.DryrunState from) + { + return from.Convert().ToUnity(); + } } [AlgoApiObject, Serializable] @@ -479,22 +622,22 @@ public partial struct BuildVersion { [SerializeField, Tooltip(@"")] string @branch; - + [SerializeField, Tooltip(@"")] ulong @build_number; - + [SerializeField, Tooltip(@"")] string @channel; - + [SerializeField, Tooltip(@"")] string @commit_hash; - + [SerializeField, Tooltip(@"")] ulong @major; - + [SerializeField, Tooltip(@"")] ulong @minor; - + /// /// /// @@ -557,7 +700,7 @@ public ulong Minor public bool Equals(BuildVersion other) { - return + return StringComparer.Equals(Branch, other.Branch) && Build_number.Equals(other.Build_number) && StringComparer.Equals(Channel, other.Channel) && @@ -566,6 +709,16 @@ public bool Equals(BuildVersion other) Minor.Equals(other.Minor) ; } + + public static implicit operator Dotnet.BuildVersion(BuildVersion from) + { + return from.Convert().ToDotnet(); + } + + public static implicit operator BuildVersion(Dotnet.BuildVersion from) + { + return from.Convert().ToUnity(); + } } [AlgoApiObject, Serializable] @@ -574,25 +727,25 @@ public partial struct DryrunRequest { [SerializeField, Tooltip(@"")] byte[][] @txns; - + [SerializeField, Tooltip(@"")] Account[] @accounts; - + [SerializeField, Tooltip(@"")] Application[] @apps; - + [SerializeField, Tooltip(@"ProtocolVersion specifies a specific version string to operate under, otherwise whatever the current protocol of the network this algod is running in.")] string @protocolVersion; - + [SerializeField, Tooltip(@"Round is available to some TEAL scripts. Defaults to the current round on the network this algod is attached to.")] ulong @round; - + [SerializeField, Tooltip(@"LatestTimestamp is available to some TEAL scripts. Defaults to the latest confirmed timestamp this algod is attached to.")] ulong @latestTimestamp; - + [SerializeField, Tooltip(@"")] DryrunSource[] @sources; - + /// /// /// @@ -665,7 +818,7 @@ public DryrunSource[] Sources public bool Equals(DryrunRequest other) { - return + return ArrayComparer.Equals(Txns, other.Txns) && ArrayComparer.Equals(Accounts, other.Accounts) && ArrayComparer.Equals(Apps, other.Apps) && @@ -675,6 +828,55 @@ public bool Equals(DryrunRequest other) ArrayComparer.Equals(Sources, other.Sources) ; } + + public static implicit operator Dotnet.DryrunRequest(DryrunRequest from) + { + return from.Convert().ToDotnet(); + } + + public static implicit operator DryrunRequest(Dotnet.DryrunRequest from) + { + return from.Convert().ToUnity(); + } + } + + [AlgoApiObject, Serializable] + public partial struct StateProof + : IEquatable + { + [SerializeField, Tooltip(@"")] + StateProofMessage @message; + + [SerializeField, Tooltip(@"The encoded StateProof for the message.")] + byte[] @stateProof; + + /// + /// + /// + [AlgoApiField("Message")] + public StateProofMessage Message + { + get => this.@message; + set => this.@message = value; + } + + /// + /// The encoded StateProof for the message. + /// + [AlgoApiField("StateProof")] + public byte[] EncodedStateProof + { + get => this.@stateProof; + set => this.@stateProof = value; + } + + public bool Equals(StateProof other) + { + return + Message.Equals(other.Message) && + ArrayComparer.Equals(EncodedStateProof, other.EncodedStateProof) + ; + } } [AlgoApiObject, Serializable] @@ -683,10 +885,10 @@ public partial struct Asset { [SerializeField, Tooltip(@"unique asset identifier")] ulong @index; - + [SerializeField, Tooltip(@"")] AssetParams @params; - + /// /// unique asset identifier /// @@ -709,11 +911,21 @@ public AssetParams Params public bool Equals(Asset other) { - return + return Index.Equals(other.Index) && Params.Equals(other.Params) ; } + + public static implicit operator Dotnet.Asset(Asset from) + { + return from.Convert().ToDotnet(); + } + + public static implicit operator Asset(Dotnet.Asset from) + { + return from.Convert().ToUnity(); + } } [AlgoApiObject, Serializable] @@ -722,10 +934,10 @@ public partial struct TealKeyValue { [SerializeField, Tooltip(@"")] string @key; - + [SerializeField, Tooltip(@"")] TealValue @value; - + /// /// /// @@ -748,11 +960,21 @@ public TealValue Value public bool Equals(TealKeyValue other) { - return + return StringComparer.Equals(Key, other.Key) && Value.Equals(other.Value) ; } + + public static implicit operator Dotnet.TealKeyValue(TealKeyValue from) + { + return from.Convert().ToDotnet(); + } + + public static implicit operator TealKeyValue(Dotnet.TealKeyValue from) + { + return from.Convert().ToUnity(); + } } [AlgoApiObject, Serializable] @@ -762,46 +984,46 @@ public partial struct PendingTransactionResponse [SerializeField, Tooltip(@"Indicates that the transaction was kicked out of this node's transaction pool (and specifies why that happened). An empty string indicates the transaction wasn't kicked out of this node's txpool due to an error. ")] string @poolError; - + [SerializeField, Tooltip(@"[lg] Logs for the application being executed by this transaction.")] byte[][] @logs; - + [SerializeField, Tooltip(@"Rewards in microalgos applied to the sender account.")] Optional @senderRewards; - + [SerializeField, Tooltip(@"Closing amount for the transaction.")] Optional @closingAmount; - + [SerializeField, Tooltip(@"The raw signed transaction.")] SignedTxn @txn; - + [SerializeField, Tooltip(@"[gd] Global state key/value changes for the application being executed by this transaction.")] StateDelta @globalStateDelta; - + [SerializeField, Tooltip(@"The number of the asset's unit that were transferred to the close-to address.")] Optional @assetClosingAmount; - + [SerializeField, Tooltip(@"The round where this transaction was confirmed, if present.")] Optional @confirmedRound; - + [SerializeField, Tooltip(@"The application index if the transaction was found and it created an application.")] Optional @applicationIndex; - + [SerializeField, Tooltip(@"Rewards in microalgos applied to the receiver account.")] Optional @receiverRewards; - + [SerializeField, Tooltip(@"Inner transactions produced by application execution.")] PendingTransactionResponse[] @innerTxns; - + [SerializeField, Tooltip(@"The asset index if the transaction was found and it created an asset.")] Optional @assetIndex; - + [SerializeField, Tooltip(@"Rewards in microalgos applied to the close remainder to account.")] Optional @closeRewards; - + [SerializeField, Tooltip(@"[ld] Local state key/value changes for the application being executed by this transaction.")] AccountStateDelta[] @localStateDelta; - + /// /// Indicates that the transaction was kicked out of this node's transaction pool (and specifies why that happened). An empty string indicates the transaction wasn't kicked out of this node's txpool due to an error. /// @@ -944,7 +1166,7 @@ public AccountStateDelta[] LocalStateDelta public bool Equals(PendingTransactionResponse other) { - return + return StringComparer.Equals(PoolError, other.PoolError) && ArrayComparer.Equals(Logs, other.Logs) && SenderRewards.Equals(other.SenderRewards) && @@ -969,16 +1191,16 @@ public partial struct DryrunSource { [SerializeField, Tooltip(@"FieldName is what kind of sources this is. If lsig then it goes into the transactions[this.TxnIndex].LogicSig. If approv or clearp it goes into the Approval Program or Clear State Program of application[this.AppIndex].")] string @fieldName; - + [SerializeField, Tooltip(@"")] string @source; - + [SerializeField, Tooltip(@"")] ulong @txnIndex; - + [SerializeField, Tooltip(@"")] ulong @appIndex; - + /// /// FieldName is what kind of sources this is. If lsig then it goes into the transactions[this.TxnIndex].LogicSig. If approv or clearp it goes into the Approval Program or Clear State Program of application[this.AppIndex]. /// @@ -1021,13 +1243,23 @@ public ulong AppIndex public bool Equals(DryrunSource other) { - return + return StringComparer.Equals(FieldName, other.FieldName) && StringComparer.Equals(Source, other.Source) && TxnIndex.Equals(other.TxnIndex) && AppIndex.Equals(other.AppIndex) ; } + + public static implicit operator Dotnet.DryrunSource(DryrunSource from) + { + return from.Convert().ToDotnet(); + } + + public static implicit operator DryrunSource(Dotnet.DryrunSource from) + { + return from.Convert().ToUnity(); + } } [AlgoApiObject, Serializable] @@ -1036,10 +1268,10 @@ public partial struct EvalDeltaKeyValue { [SerializeField, Tooltip(@"")] string @key; - + [SerializeField, Tooltip(@"")] EvalDelta @value; - + /// /// /// @@ -1062,11 +1294,21 @@ public EvalDelta Value public bool Equals(EvalDeltaKeyValue other) { - return + return StringComparer.Equals(Key, other.Key) && Value.Equals(other.Value) ; } + + public static implicit operator Dotnet.EvalDeltaKeyValue(EvalDeltaKeyValue from) + { + return from.Convert().ToDotnet(); + } + + public static implicit operator EvalDeltaKeyValue(Dotnet.EvalDeltaKeyValue from) + { + return from.Convert().ToUnity(); + } } [AlgoApiObject, Serializable] @@ -1075,13 +1317,13 @@ public partial struct AssetHolding { [SerializeField, Tooltip(@"[a] number of units held.")] ulong @amount; - + [SerializeField, Tooltip(@"Asset ID of the holding.")] AssetIndex @assetId; - + [SerializeField, Tooltip(@"[f] whether or not the holding is frozen.")] bool @isFrozen; - + /// /// [a] number of units held. /// @@ -1114,12 +1356,22 @@ public bool IsFrozen public bool Equals(AssetHolding other) { - return + return Amount.Equals(other.Amount) && AssetId.Equals(other.AssetId) && IsFrozen.Equals(other.IsFrozen) ; } + + public static implicit operator Dotnet.AssetHolding(AssetHolding from) + { + return from.Convert().ToDotnet(); + } + + public static implicit operator AssetHolding(Dotnet.AssetHolding from) + { + return from.Convert().ToUnity(); + } } [AlgoApiObject, Serializable] @@ -1128,88 +1380,88 @@ public partial struct Account { [SerializeField, Tooltip(@"[algo] total number of MicroAlgos in the account")] ulong @amount; - + [SerializeField, Tooltip(@"the account public key")] string @address; - + [SerializeField, Tooltip(@"[ern] total rewards of MicroAlgos the account has received, including pending rewards.")] ulong @rewards; - + [SerializeField, Tooltip(@"specifies the amount of MicroAlgos in the account, without the pending rewards.")] ulong @amountWithoutPendingRewards; - + [SerializeField, Tooltip(@"[teap] the sum of all extra application program pages for this account.")] Optional @appsTotalExtraPages; - + [SerializeField, Tooltip(@"The count of all assets that have been opted in, equivalent to the count of AssetHolding objects held by this account.")] ulong @totalAssetsOptedIn; - + [SerializeField, Tooltip(@"[asset] assets held by this account. Note the raw object uses `map[int] -> AssetHolding` for this type.")] AssetHolding[] @assets; - + [SerializeField, Tooltip(@"")] AccountParticipation @participation; - + [SerializeField, Tooltip(@"[tsch] stores the sum of all of the local schemas and global schemas in this account. Note: the raw account uses `StateSchema` for this type.")] ApplicationStateSchema @appsTotalSchema; - + [SerializeField, Tooltip(@"The count of all applications that have been opted in, equivalent to the count of application local data (AppLocalState objects) stored in this account.")] ulong @totalAppsOptedIn; - + [SerializeField, Tooltip(@"The round for which this information is relevant.")] ulong @round; - + [SerializeField, Tooltip(@"amount of MicroAlgos of pending rewards in this account.")] ulong @pendingRewards; - + [SerializeField, Tooltip(@"[appp] parameters of applications created by this account including app global data. Note: the raw account uses `map[int] -> AppParams` for this type.")] Application[] @createdApps; - + [SerializeField, Tooltip(@"[onl] delegation status of the account's MicroAlgos * Offline - indicates that the associated account is delegated. * Online - indicates that the associated account used as part of the delegation pool. * NotParticipating - indicates that the associated account is neither a delegator nor a delegate.")] string @status; - + [SerializeField, Tooltip(@"Indicates what type of signature is used by this account, must be one of: * sig * msig * lsig")] SignatureType @sigType; - + [SerializeField, Tooltip(@"[spend] the address against which signing should be checked. If empty, the address of the current account is used. This field can be updated in any transaction by setting the RekeyTo field.")] Address @authAddr; - + [SerializeField, Tooltip(@"The count of all assets (AssetParams objects) created by this account.")] ulong @totalCreatedAssets; - + [SerializeField, Tooltip(@"MicroAlgo balance required by the account. The requirement grows based on asset and application usage.")] ulong @minBalance; - + [SerializeField, Tooltip(@"[ebase] used as part of the rewards computation. Only applicable to accounts which are participating.")] Optional @rewardBase; - + [SerializeField, Tooltip(@"[apar] parameters of assets created by this account. Note: the raw account uses `map[int] -> Asset` for this type.")] Asset[] @createdAssets; - + [SerializeField, Tooltip(@"[appl] applications local data stored in this account. Note the raw object uses `map[int] -> AppLocalState` for this type.")] ApplicationLocalState[] @appsLocalState; - + [SerializeField, Tooltip(@"The count of all apps (AppParams objects) created by this account.")] ulong @totalCreatedApps; - + /// /// [algo] total number of MicroAlgos in the account /// @@ -1450,7 +1702,7 @@ public ulong TotalCreatedApps public bool Equals(Account other) { - return + return Amount.Equals(other.Amount) && StringComparer.Equals(Address, other.Address) && Rewards.Equals(other.Rewards) && @@ -1475,6 +1727,16 @@ public bool Equals(Account other) TotalCreatedApps.Equals(other.TotalCreatedApps) ; } + + public static implicit operator Dotnet.Account(Account from) + { + return from.Convert().ToDotnet(); + } + + public static implicit operator Account(Dotnet.Account from) + { + return from.Convert().ToUnity(); + } } [AlgoApiObject, Serializable] @@ -1483,10 +1745,10 @@ public partial struct AccountStateDelta { [SerializeField, Tooltip(@"")] string @address; - + [SerializeField, Tooltip(@"")] StateDelta @delta; - + /// /// /// @@ -1509,27 +1771,90 @@ public StateDelta Delta public bool Equals(AccountStateDelta other) { - return + return StringComparer.Equals(Address, other.Address) && Delta.Equals(other.Delta) ; } + + public static implicit operator Dotnet.AccountStateDelta(AccountStateDelta from) + { + return from.Convert().ToDotnet(); + } + + public static implicit operator AccountStateDelta(Dotnet.AccountStateDelta from) + { + return from.Convert().ToUnity(); + } } [AlgoApiObject, Serializable] - public partial struct Application - : IEquatable + public partial struct LightBlockHeaderProof + : IEquatable { - [SerializeField, Tooltip(@"[appidx] application index.")] - ulong @id; - - [SerializeField, Tooltip(@"[appparams] application parameters.")] - ApplicationParams @params; - + [SerializeField, Tooltip(@"The index of the light block header in the vector commitment tree")] + ulong @index; + + [SerializeField, Tooltip(@"Represents the depth of the tree that is being proven, i.e. the number of edges from a leaf to the root.")] + ulong @treedepth; + + [SerializeField, Tooltip(@"The encoded proof.")] + byte[] @proof; + /// - /// [appidx] application index. + /// The index of the light block header in the vector commitment tree /// - [AlgoApiField("id")] + [AlgoApiField("index")] + public ulong Index + { + get => this.@index; + set => this.@index = value; + } + + /// + /// Represents the depth of the tree that is being proven, i.e. the number of edges from a leaf to the root. + /// + [AlgoApiField("treedepth")] + public ulong Treedepth + { + get => this.@treedepth; + set => this.@treedepth = value; + } + + /// + /// The encoded proof. + /// + [AlgoApiField("proof")] + public byte[] Proof + { + get => this.@proof; + set => this.@proof = value; + } + + public bool Equals(LightBlockHeaderProof other) + { + return + Index.Equals(other.Index) && + Treedepth.Equals(other.Treedepth) && + ArrayComparer.Equals(Proof, other.Proof) + ; + } + } + + [AlgoApiObject, Serializable] + public partial struct Application + : IEquatable + { + [SerializeField, Tooltip(@"[appidx] application index.")] + ulong @id; + + [SerializeField, Tooltip(@"[appparams] application parameters.")] + ApplicationParams @params; + + /// + /// [appidx] application index. + /// + [AlgoApiField("id")] public ulong Id { get => this.@id; @@ -1548,11 +1873,21 @@ public ApplicationParams Params public bool Equals(Application other) { - return + return Id.Equals(other.Id) && Params.Equals(other.Params) ; } + + public static implicit operator Dotnet.Application(Application from) + { + return from.Convert().ToDotnet(); + } + + public static implicit operator Application(Dotnet.Application from) + { + return from.Convert().ToUnity(); + } } [AlgoApiObject, Serializable] @@ -1561,13 +1896,13 @@ public partial struct ApplicationLocalState { [SerializeField, Tooltip(@"The application which this local state is for.")] ulong @id; - + [SerializeField, Tooltip(@"[hsch] schema.")] ApplicationStateSchema @schema; - + [SerializeField, Tooltip(@"[tkv] storage.")] TealKeyValueStore @keyValue; - + /// /// The application which this local state is for. /// @@ -1600,12 +1935,22 @@ public TealKeyValueStore KeyValue public bool Equals(ApplicationLocalState other) { - return + return Id.Equals(other.Id) && Schema.Equals(other.Schema) && KeyValue.Equals(other.KeyValue) ; } + + public static implicit operator Dotnet.ApplicationLocalState(ApplicationLocalState from) + { + return from.Convert().ToDotnet(); + } + + public static implicit operator ApplicationLocalState(Dotnet.ApplicationLocalState from) + { + return from.Convert().ToUnity(); + } } [AlgoApiObject, Serializable] @@ -1614,22 +1959,22 @@ public partial struct AccountParticipation { [SerializeField, Tooltip(@"[sel] Selection public key (if any) currently registered for this round.")] byte[] @selectionParticipationKey; - + [SerializeField, Tooltip(@"[voteFst] First round for which this participation is valid.")] ulong @voteFirstValid; - + [SerializeField, Tooltip(@"[voteKD] Number of subkeys in each batch of participation keys.")] ulong @voteKeyDilution; - + [SerializeField, Tooltip(@"[voteLst] Last round for which this participation is valid.")] ulong @voteLastValid; - + [SerializeField, Tooltip(@"[vote] root participation public key (if any) currently registered for this round.")] byte[] @voteParticipationKey; - + [SerializeField, Tooltip(@"[stprf] Root of the state proof key (if any)")] byte[] @stateProofKey; - + /// /// [sel] Selection public key (if any) currently registered for this round. /// @@ -1692,7 +2037,7 @@ public byte[] StateProofKey public bool Equals(AccountParticipation other) { - return + return ArrayComparer.Equals(SelectionParticipationKey, other.SelectionParticipationKey) && VoteFirstValid.Equals(other.VoteFirstValid) && VoteKeyDilution.Equals(other.VoteKeyDilution) && @@ -1701,6 +2046,16 @@ public bool Equals(AccountParticipation other) ArrayComparer.Equals(StateProofKey, other.StateProofKey) ; } + + public static implicit operator Dotnet.AccountParticipation(AccountParticipation from) + { + return from.Convert().ToDotnet(); + } + + public static implicit operator AccountParticipation(Dotnet.AccountParticipation from) + { + return from.Convert().ToUnity(); + } } [AlgoApiObject, Serializable] @@ -1709,16 +2064,16 @@ public partial struct Version { [SerializeField, Tooltip(@"")] BuildVersion @build; - + [SerializeField, Tooltip(@"")] byte[] @genesis_hash_b64; - + [SerializeField, Tooltip(@"")] string @genesis_id; - + [SerializeField, Tooltip(@"")] string[] @versions; - + /// /// /// @@ -1761,13 +2116,23 @@ public string[] Versions public bool Equals(Version other) { - return + return Build.Equals(other.Build) && ArrayComparer.Equals(Genesis_hash_b64, other.Genesis_hash_b64) && StringComparer.Equals(Genesis_id, other.Genesis_id) && ArrayComparer.Equals(Versions, other.Versions) ; } + + public static implicit operator Dotnet.Version(Version from) + { + return from.Convert().ToDotnet(); + } + + public static implicit operator Version(Dotnet.Version from) + { + return from.Convert().ToUnity(); + } } [AlgoApiObject, Serializable] @@ -1776,49 +2141,49 @@ public partial struct AssetParams { [SerializeField, Tooltip(@"[df] Whether holdings of this asset are frozen by default.")] Optional @defaultFrozen; - + [SerializeField, Tooltip(@"The address that created this asset. This is the address where the parameters for this asset can be found, and also the address where unwanted asset units can be sent in the worst case.")] string @creator; - + [SerializeField, Tooltip(@"[dc] The number of digits to use after the decimal point when displaying this asset. If 0, the asset is not divisible. If 1, the base unit of the asset is in tenths. If 2, the base unit of the asset is in hundredths, and so on. This value must be between 0 and 19 (inclusive).")] ulong @decimals; - + [SerializeField, Tooltip(@"[f] Address of account used to freeze holdings of this asset. If empty, freezing is not permitted.")] string @freeze; - + [SerializeField, Tooltip(@"[r] Address of account holding reserve (non-minted) units of this asset.")] string @reserve; - + [SerializeField, Tooltip(@"Base64 encoded name of a unit of this asset, as supplied by the creator.")] byte[] @unitNameB64; - + [SerializeField, Tooltip(@"[an] Name of this asset, as supplied by the creator. Included only when the asset name is composed of printable utf-8 characters.")] string @name; - + [SerializeField, Tooltip(@"Base64 encoded URL where more information about the asset can be retrieved.")] byte[] @urlB64; - + [SerializeField, Tooltip(@"[t] The total number of units of this asset.")] ulong @total; - + [SerializeField, Tooltip(@"[m] Address of account used to manage the keys of this asset and to destroy it.")] string @manager; - + [SerializeField, Tooltip(@"Base64 encoded name of this asset, as supplied by the creator.")] byte[] @nameB64; - + [SerializeField, Tooltip(@"[au] URL where more information about the asset can be retrieved. Included only when the URL is composed of printable utf-8 characters.")] string @url; - + [SerializeField, Tooltip(@"[un] Name of a unit of this asset, as supplied by the creator. Included only when the name of a unit of this asset is composed of printable utf-8 characters.")] string @unitName; - + [SerializeField, Tooltip(@"[c] Address of account used to clawback holdings of this asset. If empty, clawback is not permitted.")] string @clawback; - + [SerializeField, Tooltip(@"[am] A commitment to some unspecified asset metadata. The format of this metadata is up to the application.")] byte[] @metadataHash; - + /// /// [df] Whether holdings of this asset are frozen by default. /// @@ -1971,7 +2336,7 @@ public byte[] MetadataHash public bool Equals(AssetParams other) { - return + return DefaultFrozen.Equals(other.DefaultFrozen) && StringComparer.Equals(Creator, other.Creator) && Decimals.Equals(other.Decimals) && @@ -1989,6 +2354,16 @@ public bool Equals(AssetParams other) ArrayComparer.Equals(MetadataHash, other.MetadataHash) ; } + + public static implicit operator Dotnet.AssetParams(AssetParams from) + { + return from.Convert().ToDotnet(); + } + + public static implicit operator AssetParams(Dotnet.AssetParams from) + { + return from.Convert().ToUnity(); + } } [AlgoApiObject, Serializable] @@ -1997,40 +2372,40 @@ public partial struct DryrunTxnResult { [SerializeField, Tooltip(@"")] string[] @appCallMessages; - + [SerializeField, Tooltip(@"Disassembled program line by line.")] string[] @disassembly; - + [SerializeField, Tooltip(@"")] byte[][] @logs; - + [SerializeField, Tooltip(@"Disassembled lsig program line by line.")] string[] @logicSigDisassembly; - + [SerializeField, Tooltip(@"")] AccountStateDelta[] @localDeltas; - + [SerializeField, Tooltip(@"")] DryrunState[] @logicSigTrace; - + [SerializeField, Tooltip(@"Net cost of app execution. Field is DEPRECATED and is subject for removal. Instead, use `budget-added` and `budget-consumed.")] Optional @cost; - + [SerializeField, Tooltip(@"Budget consumed during execution of app call transaction.")] Optional @budgetConsumed; - + [SerializeField, Tooltip(@"")] string[] @logicSigMessages; - + [SerializeField, Tooltip(@"")] DryrunState[] @appCallTrace; - + [SerializeField, Tooltip(@"")] StateDelta @globalDelta; - + [SerializeField, Tooltip(@"Budget added during execution of app call transaction.")] Optional @budgetAdded; - + /// /// /// @@ -2153,7 +2528,7 @@ public Optional BudgetAdded public bool Equals(DryrunTxnResult other) { - return + return ArrayComparer.Equals(AppCallMessages, other.AppCallMessages) && ArrayComparer.Equals(Disassembly, other.Disassembly) && ArrayComparer.Equals(Logs, other.Logs) && @@ -2168,6 +2543,16 @@ public bool Equals(DryrunTxnResult other) BudgetAdded.Equals(other.BudgetAdded) ; } + + public static implicit operator Dotnet.DryrunTxnResult(DryrunTxnResult from) + { + return from.Convert().ToDotnet(); + } + + public static implicit operator DryrunTxnResult(Dotnet.DryrunTxnResult from) + { + return from.Convert().ToUnity(); + } } [AlgoApiObject, Serializable] @@ -2176,7 +2561,7 @@ public partial struct CatchpointAbortResponse { [SerializeField, Tooltip(@"Catchup abort response string")] string @catchupMessage; - + /// /// Catchup abort response string /// @@ -2189,10 +2574,20 @@ public string CatchupMessage public bool Equals(CatchpointAbortResponse other) { - return + return StringComparer.Equals(CatchupMessage, other.CatchupMessage) ; } + + public static implicit operator Dotnet.CatchpointAbortResponse(CatchpointAbortResponse from) + { + return from.Convert().ToDotnet(); + } + + public static implicit operator CatchpointAbortResponse(Dotnet.CatchpointAbortResponse from) + { + return from.Convert().ToUnity(); + } } [AlgoApiObject, Serializable] @@ -2201,17 +2596,17 @@ public partial struct AccountAssetResponse { [SerializeField, Tooltip(@"The round for which this information is relevant.")] ulong @round; - + [SerializeField, Tooltip(@"[asset] Details about the asset held by this account. The raw account uses `AssetHolding` for this type.")] AssetHolding @assetHolding; - + [SerializeField, Tooltip(@"[apar] parameters of the asset created by this account. The raw account uses `AssetParams` for this type.")] AssetParams @createdAsset; - + /// /// The round for which this information is relevant. /// @@ -2248,12 +2643,22 @@ public AssetParams CreatedAsset public bool Equals(AccountAssetResponse other) { - return + return Round.Equals(other.Round) && AssetHolding.Equals(other.AssetHolding) && CreatedAsset.Equals(other.CreatedAsset) ; } + + public static implicit operator Dotnet.AccountAssetResponse(AccountAssetResponse from) + { + return from.Convert().ToDotnet(); + } + + public static implicit operator AccountAssetResponse(Dotnet.AccountAssetResponse from) + { + return from.Convert().ToUnity(); + } } [AlgoApiObject, Serializable] @@ -2262,10 +2667,10 @@ public partial struct BlockResponse { [SerializeField, Tooltip(@"Block header data.")] BlockHeader @block; - + [SerializeField, Tooltip(@"Optional certificate object. This is only included when the format is set to message pack.")] BlockCertificate @cert; - + /// /// Block header data. /// @@ -2288,20 +2693,130 @@ public BlockCertificate Cert public bool Equals(BlockResponse other) { - return + return Block.Equals(other.Block) && Cert.Equals(other.Cert) ; } } + [AlgoApiObject, Serializable] + public partial struct TransactionProofResponse + : IEquatable + { + [SerializeField, Tooltip(@"Proof of transaction membership.")] + byte[] @proof; + + [SerializeField, Tooltip(@"Hash of SignedTxnInBlock for verifying proof.")] + byte[] @stibhash; + + [SerializeField, Tooltip(@"Represents the depth of the tree that is being proven, i.e. the number of edges from a leaf to the root.")] + ulong @treedepth; + + [SerializeField, Tooltip(@"Index of the transaction in the block's payset.")] + ulong @idx; + + [SerializeField, Tooltip(@"The type of hash function used to create the proof, must be one of: +* sha512_256 +* sha256")] + string @hashtype; + + /// + /// Proof of transaction membership. + /// + [AlgoApiField("proof")] + public byte[] Proof + { + get => this.@proof; + set => this.@proof = value; + } + + /// + /// Hash of SignedTxnInBlock for verifying proof. + /// + [AlgoApiField("stibhash")] + public byte[] Stibhash + { + get => this.@stibhash; + set => this.@stibhash = value; + } + + /// + /// Represents the depth of the tree that is being proven, i.e. the number of edges from a leaf to the root. + /// + [AlgoApiField("treedepth")] + public ulong Treedepth + { + get => this.@treedepth; + set => this.@treedepth = value; + } + + /// + /// Index of the transaction in the block's payset. + /// + [AlgoApiField("idx")] + public ulong Idx + { + get => this.@idx; + set => this.@idx = value; + } + + /// + /// The type of hash function used to create the proof, must be one of: + /// * sha512_256 + /// * sha256 + /// + [AlgoApiField("hashtype")] + public string Hashtype + { + get => this.@hashtype; + set => this.@hashtype = value; + } + + public bool Equals(TransactionProofResponse other) + { + return + ArrayComparer.Equals(Proof, other.Proof) && + ArrayComparer.Equals(Stibhash, other.Stibhash) && + Treedepth.Equals(other.Treedepth) && + Idx.Equals(other.Idx) && + StringComparer.Equals(Hashtype, other.Hashtype) + ; + } + } + + [AlgoApiObject, Serializable] + public partial struct BlockHashResponse + : IEquatable + { + [SerializeField, Tooltip(@"Block header hash.")] + string @blockHash; + + /// + /// Block header hash. + /// + [AlgoApiField("blockHash")] + public string BlockHash + { + get => this.@blockHash; + set => this.@blockHash = value; + } + + public bool Equals(BlockHashResponse other) + { + return + StringComparer.Equals(BlockHash, other.BlockHash) + ; + } + } + [AlgoApiObject, Serializable] public partial struct CatchpointStartResponse : IEquatable { [SerializeField, Tooltip(@"Catchup start response string")] string @catchupMessage; - + /// /// Catchup start response string /// @@ -2314,10 +2829,20 @@ public string CatchupMessage public bool Equals(CatchpointStartResponse other) { - return + return StringComparer.Equals(CatchupMessage, other.CatchupMessage) ; } + + public static implicit operator Dotnet.CatchpointStartResponse(CatchpointStartResponse from) + { + return from.Convert().ToDotnet(); + } + + public static implicit operator CatchpointStartResponse(Dotnet.CatchpointStartResponse from) + { + return from.Convert().ToUnity(); + } } [AlgoApiObject, Serializable] @@ -2326,7 +2851,7 @@ public partial struct PostParticipationResponse { [SerializeField, Tooltip(@"encoding of the participation ID.")] string @partId; - + /// /// encoding of the participation ID. /// @@ -2339,7 +2864,7 @@ public string PartId public bool Equals(PostParticipationResponse other) { - return + return StringComparer.Equals(PartId, other.PartId) ; } @@ -2351,13 +2876,13 @@ public partial struct CompileResponse { [SerializeField, Tooltip(@"base32 SHA512_256 of program bytes (Address style)")] string @hash; - + [SerializeField, Tooltip(@"base64 encoded program bytes")] string @result; - + [SerializeField, Tooltip(@"JSON of the source map")] AlgoApiObject @sourcemap; - + /// /// base32 SHA512_256 of program bytes (Address style) /// @@ -2390,12 +2915,22 @@ public AlgoApiObject Sourcemap public bool Equals(CompileResponse other) { - return + return StringComparer.Equals(Hash, other.Hash) && StringComparer.Equals(Result, other.Result) && Sourcemap.Equals(other.Sourcemap) ; } + + public static implicit operator Dotnet.CompileResponse(CompileResponse from) + { + return from.Convert().ToDotnet(); + } + + public static implicit operator CompileResponse(Dotnet.CompileResponse from) + { + return from.Convert().ToUnity(); + } } [AlgoApiObject, Serializable] @@ -2404,7 +2939,7 @@ public partial struct DisassembleResponse { [SerializeField, Tooltip(@"disassembled Teal code")] string @result; - + /// /// disassembled Teal code /// @@ -2417,146 +2952,61 @@ public string Result public bool Equals(DisassembleResponse other) { - return + return StringComparer.Equals(Result, other.Result) ; } } - [AlgoApiObject, Serializable] - public partial struct ProofResponse - : IEquatable - { - [SerializeField, Tooltip(@"Merkle proof of transaction membership.")] - byte[] @proof; - - [SerializeField, Tooltip(@"Hash of SignedTxnInBlock for verifying proof.")] - byte[] @stibhash; - - [SerializeField, Tooltip(@"Represents the depth of the tree that is being proven, i.e. the number of edges from a leaf to the root.")] - ulong @treedepth; - - [SerializeField, Tooltip(@"Index of the transaction in the block's payset.")] - ulong @idx; - - [SerializeField, Tooltip(@"The type of hash function used to create the proof, must be one of: -* sha512_256 -* sha256")] - string @hashtype; - - /// - /// Merkle proof of transaction membership. - /// - [AlgoApiField("proof")] - public byte[] Proof - { - get => this.@proof; - set => this.@proof = value; - } - - /// - /// Hash of SignedTxnInBlock for verifying proof. - /// - [AlgoApiField("stibhash")] - public byte[] Stibhash - { - get => this.@stibhash; - set => this.@stibhash = value; - } - - /// - /// Represents the depth of the tree that is being proven, i.e. the number of edges from a leaf to the root. - /// - [AlgoApiField("treedepth")] - public ulong Treedepth - { - get => this.@treedepth; - set => this.@treedepth = value; - } - - /// - /// Index of the transaction in the block's payset. - /// - [AlgoApiField("idx")] - public ulong Idx - { - get => this.@idx; - set => this.@idx = value; - } - - /// - /// The type of hash function used to create the proof, must be one of: - /// * sha512_256 - /// * sha256 - /// - [AlgoApiField("hashtype")] - public string Hashtype - { - get => this.@hashtype; - set => this.@hashtype = value; - } - - public bool Equals(ProofResponse other) - { - return - ArrayComparer.Equals(Proof, other.Proof) && - ArrayComparer.Equals(Stibhash, other.Stibhash) && - Treedepth.Equals(other.Treedepth) && - Idx.Equals(other.Idx) && - StringComparer.Equals(Hashtype, other.Hashtype) - ; - } - } - [AlgoApiObject, Serializable] public partial struct NodeStatusResponse : IEquatable { [SerializeField, Tooltip(@"StoppedAtUnsupportedRound indicates that the node does not support the new rounds and has stopped making progress")] bool @stoppedAtUnsupportedRound; - + [SerializeField, Tooltip(@"The total number of blocks that are required to complete the current catchpoint catchup")] Optional @catchpointTotalBlocks; - + [SerializeField, Tooltip(@"LastVersion indicates the last consensus version supported")] string @lastVersion; - + [SerializeField, Tooltip(@"NextVersionRound is the round at which the next consensus version will apply")] ulong @nextVersionRound; - + [SerializeField, Tooltip(@"The total number of accounts included in the current catchpoint")] Optional @catchpointTotalAccounts; - + [SerializeField, Tooltip(@"TimeSinceLastRound in nanoseconds")] ulong @timeSinceLastRound; - + [SerializeField, Tooltip(@"NextVersion of consensus protocol to use")] string @nextVersion; - + [SerializeField, Tooltip(@"The number of accounts from the current catchpoint that have been verified so far as part of the catchup")] Optional @catchpointVerifiedAccounts; - + [SerializeField, Tooltip(@"CatchupTime in nanoseconds")] ulong @catchupTime; - + [SerializeField, Tooltip(@"The last catchpoint seen by the node")] string @lastCatchpoint; - + [SerializeField, Tooltip(@"LastRound indicates the last round seen")] ulong @lastRound; - + [SerializeField, Tooltip(@"NextVersionSupported indicates whether the next consensus version is supported by this node")] bool @nextVersionSupported; - + [SerializeField, Tooltip(@"The current catchpoint that is being caught up to")] string @catchpoint; - + [SerializeField, Tooltip(@"The number of blocks that have already been obtained by the node as part of the catchup")] Optional @catchpointAcquiredBlocks; - + [SerializeField, Tooltip(@"The number of accounts from the current catchpoint that have been processed so far as part of the catchup")] Optional @catchpointProcessedAccounts; - + /// /// StoppedAtUnsupportedRound indicates that the node does not support the new rounds and has stopped making progress /// @@ -2709,7 +3159,7 @@ public Optional CatchpointProcessedAccounts public bool Equals(NodeStatusResponse other) { - return + return StoppedAtUnsupportedRound.Equals(other.StoppedAtUnsupportedRound) && CatchpointTotalBlocks.Equals(other.CatchpointTotalBlocks) && StringComparer.Equals(LastVersion, other.LastVersion) && @@ -2727,6 +3177,16 @@ public bool Equals(NodeStatusResponse other) CatchpointProcessedAccounts.Equals(other.CatchpointProcessedAccounts) ; } + + public static implicit operator Dotnet.NodeStatusResponse(NodeStatusResponse from) + { + return from.Convert().ToDotnet(); + } + + public static implicit operator NodeStatusResponse(Dotnet.NodeStatusResponse from) + { + return from.Convert().ToUnity(); + } } [AlgoApiObject, Serializable] @@ -2736,26 +3196,26 @@ public partial struct TransactionParametersResponse [SerializeField, Tooltip(@"ConsensusVersion indicates the consensus protocol version as of LastRound.")] string @consensusVersion; - + [SerializeField, Tooltip(@"Fee is the suggested transaction fee Fee is in units of micro-Algos per byte. Fee may fall to zero but transactions must still have a fee of at least MinTxnFee for the current network protocol.")] ulong @fee; - + [SerializeField, Tooltip(@"GenesisHash is the hash of the genesis block.")] byte[] @genesisHash; - + [SerializeField, Tooltip(@"GenesisID is an ID listed in the genesis block.")] string @genesisId; - + [SerializeField, Tooltip(@"LastRound indicates the last round seen")] ulong @lastRound; - + [SerializeField, Tooltip(@"The minimum transaction fee (not per byte) required for the txn to validate for the current network protocol.")] ulong @minFee; - + /// /// ConsensusVersion indicates the consensus protocol version /// as of LastRound. @@ -2823,7 +3283,7 @@ public ulong MinFee public bool Equals(TransactionParametersResponse other) { - return + return StringComparer.Equals(ConsensusVersion, other.ConsensusVersion) && Fee.Equals(other.Fee) && ArrayComparer.Equals(GenesisHash, other.GenesisHash) && @@ -2832,6 +3292,16 @@ public bool Equals(TransactionParametersResponse other) MinFee.Equals(other.MinFee) ; } + + public static implicit operator Dotnet.TransactionParametersResponse(TransactionParametersResponse from) + { + return from.Convert().ToDotnet(); + } + + public static implicit operator TransactionParametersResponse(Dotnet.TransactionParametersResponse from) + { + return from.Convert().ToUnity(); + } } [AlgoApiObject, Serializable] @@ -2840,13 +3310,13 @@ public partial struct SupplyResponse { [SerializeField, Tooltip(@"Round")] ulong @current_round; - + [SerializeField, Tooltip(@"OnlineMoney")] ulong @onlineMoney; - + [SerializeField, Tooltip(@"TotalMoney")] ulong @totalMoney; - + /// /// Round /// @@ -2879,12 +3349,22 @@ public ulong TotalMoney public bool Equals(SupplyResponse other) { - return + return Current_round.Equals(other.Current_round) && OnlineMoney.Equals(other.OnlineMoney) && TotalMoney.Equals(other.TotalMoney) ; } + + public static implicit operator Dotnet.SupplyResponse(SupplyResponse from) + { + return from.Convert().ToDotnet(); + } + + public static implicit operator SupplyResponse(Dotnet.SupplyResponse from) + { + return from.Convert().ToUnity(); + } } [AlgoApiObject, Serializable] @@ -2893,10 +3373,10 @@ public partial struct PendingTransactionsResponse { [SerializeField, Tooltip(@"An array of signed transaction objects.")] SignedTxn[] @topTransactions; - + [SerializeField, Tooltip(@"Total number of transactions in the pool.")] ulong @totalTransactions; - + /// /// An array of signed transaction objects. /// @@ -2919,7 +3399,7 @@ public ulong TotalTransactions public bool Equals(PendingTransactionsResponse other) { - return + return ArrayComparer.Equals(TopTransactions, other.TopTransactions) && TotalTransactions.Equals(other.TotalTransactions) ; @@ -2932,17 +3412,17 @@ public partial struct AccountApplicationResponse { [SerializeField, Tooltip(@"The round for which this information is relevant.")] ulong @round; - + [SerializeField, Tooltip(@"[appl] the application local data stored in this account. The raw account uses `AppLocalState` for this type.")] ApplicationLocalState @appLocalState; - + [SerializeField, Tooltip(@"[appp] parameters of the application created by this account including app global data. The raw account uses `AppParams` for this type.")] ApplicationParams @createdApp; - + /// /// The round for which this information is relevant. /// @@ -2979,12 +3459,22 @@ public ApplicationParams CreatedApp public bool Equals(AccountApplicationResponse other) { - return + return Round.Equals(other.Round) && AppLocalState.Equals(other.AppLocalState) && CreatedApp.Equals(other.CreatedApp) ; } + + public static implicit operator Dotnet.AccountApplicationResponse(AccountApplicationResponse from) + { + return from.Convert().ToDotnet(); + } + + public static implicit operator AccountApplicationResponse(Dotnet.AccountApplicationResponse from) + { + return from.Convert().ToUnity(); + } } [AlgoApiObject, Serializable] @@ -2993,7 +3483,7 @@ public partial struct PostTransactionsResponse { [SerializeField, Tooltip(@"encoding of the transaction hash.")] string @txId; - + /// /// encoding of the transaction hash. /// @@ -3006,10 +3496,20 @@ public string TxId public bool Equals(PostTransactionsResponse other) { - return + return StringComparer.Equals(TxId, other.TxId) ; } + + public static implicit operator Dotnet.PostTransactionsResponse(PostTransactionsResponse from) + { + return from.Convert().ToDotnet(); + } + + public static implicit operator PostTransactionsResponse(Dotnet.PostTransactionsResponse from) + { + return from.Convert().ToUnity(); + } } [AlgoApiObject, Serializable] @@ -3018,13 +3518,13 @@ public partial struct DryrunResponse { [SerializeField, Tooltip(@"")] DryrunTxnResult[] @txns; - + [SerializeField, Tooltip(@"")] string @error; - + [SerializeField, Tooltip(@"Protocol version is the protocol version Dryrun was operated under.")] string @protocolVersion; - + /// /// /// @@ -3057,12 +3557,22 @@ public string ProtocolVersion public bool Equals(DryrunResponse other) { - return + return ArrayComparer.Equals(Txns, other.Txns) && StringComparer.Equals(Error, other.Error) && StringComparer.Equals(ProtocolVersion, other.ProtocolVersion) ; } + + public static implicit operator Dotnet.DryrunResponse(DryrunResponse from) + { + return from.Convert().ToDotnet(); + } + + public static implicit operator DryrunResponse(Dotnet.DryrunResponse from) + { + return from.Convert().ToUnity(); + } } /// @@ -3091,7 +3601,7 @@ public bool Equals(StateDelta other) { return ArrayComparer.Equals(WrappedValue, other.WrappedValue); } - + public static implicit operator EvalDeltaKeyValue[](StateDelta wrapper) { return wrapper.WrappedValue; @@ -3102,7 +3612,7 @@ public bool Equals(StateDelta other) return new StateDelta(value); } } - + /// /// Represents a key-value store for use in an application. /// @@ -3129,7 +3639,7 @@ public bool Equals(TealKeyValueStore other) { return ArrayComparer.Equals(WrappedValue, other.WrappedValue); } - + public static implicit operator TealKeyValue[](TealKeyValueStore wrapper) { return wrapper.WrappedValue; @@ -3140,7 +3650,7 @@ public bool Equals(TealKeyValueStore other) return new TealKeyValueStore(value); } } - + /// /// Application information /// @@ -3167,7 +3677,7 @@ public bool Equals(ApplicationResponse other) { return ArrayComparer.Equals(WrappedValue, other.WrappedValue); } - + public static implicit operator Application(ApplicationResponse wrapper) { return wrapper.WrappedValue; @@ -3178,7 +3688,45 @@ public bool Equals(ApplicationResponse other) return new ApplicationResponse(value); } } - + + /// + /// Proof of a light block header. + /// + [Serializable, AlgoApiFormatter(typeof(WrappedValueFormatter))] + public partial struct LightBlockHeaderProofResponse + : IEquatable + , IWrappedValue + { + [SerializeField] + LightBlockHeaderProof @value; + + public LightBlockHeaderProofResponse(LightBlockHeaderProof value) + { + this.@value = value; + } + + public LightBlockHeaderProof WrappedValue + { + get => this.@value; + set => this.@value = value; + } + + public bool Equals(LightBlockHeaderProofResponse other) + { + return ArrayComparer.Equals(WrappedValue, other.WrappedValue); + } + + public static implicit operator LightBlockHeaderProof(LightBlockHeaderProofResponse wrapper) + { + return wrapper.WrappedValue; + } + + public static implicit operator LightBlockHeaderProofResponse(LightBlockHeaderProof value) + { + return new LightBlockHeaderProofResponse(value); + } + } + /// /// Asset information /// @@ -3205,7 +3753,7 @@ public bool Equals(AssetResponse other) { return ArrayComparer.Equals(WrappedValue, other.WrappedValue); } - + public static implicit operator Asset(AssetResponse wrapper) { return wrapper.WrappedValue; @@ -3216,7 +3764,7 @@ public bool Equals(AssetResponse other) return new AssetResponse(value); } } - + /// /// A detailed description of a participation ID /// @@ -3243,7 +3791,7 @@ public bool Equals(ParticipationKeyResponse other) { return ArrayComparer.Equals(WrappedValue, other.WrappedValue); } - + public static implicit operator ParticipationKey(ParticipationKeyResponse wrapper) { return wrapper.WrappedValue; @@ -3254,7 +3802,45 @@ public bool Equals(ParticipationKeyResponse other) return new ParticipationKeyResponse(value); } } - + + /// + /// StateProofResponse wraps the StateProof type in a response. + /// + [Serializable, AlgoApiFormatter(typeof(WrappedValueFormatter))] + public partial struct StateProofResponse + : IEquatable + , IWrappedValue + { + [SerializeField] + StateProof @value; + + public StateProofResponse(StateProof value) + { + this.@value = value; + } + + public StateProof WrappedValue + { + get => this.@value; + set => this.@value = value; + } + + public bool Equals(StateProofResponse other) + { + return ArrayComparer.Equals(WrappedValue, other.WrappedValue); + } + + public static implicit operator StateProof(StateProofResponse wrapper) + { + return wrapper.WrappedValue; + } + + public static implicit operator StateProofResponse(StateProof value) + { + return new StateProofResponse(value); + } + } + /// /// A list of participation keys /// @@ -3281,7 +3867,7 @@ public bool Equals(ParticipationKeysResponse other) { return ArrayComparer.Equals(WrappedValue, other.WrappedValue); } - + public static implicit operator ParticipationKey[](ParticipationKeysResponse wrapper) { return wrapper.WrappedValue; @@ -3292,7 +3878,7 @@ public bool Equals(ParticipationKeysResponse other) return new ParticipationKeysResponse(value); } } - + /// /// AccountResponse wraps the Account type in a response. /// @@ -3319,7 +3905,7 @@ public bool Equals(AccountResponse other) { return ArrayComparer.Equals(WrappedValue, other.WrappedValue); } - + public static implicit operator Account(AccountResponse wrapper) { return wrapper.WrappedValue; @@ -3330,7 +3916,7 @@ public bool Equals(AccountResponse other) return new AccountResponse(value); } } - + /// /// VersionsResponse is the response to 'GET /versions' /// @@ -3357,7 +3943,7 @@ public bool Equals(VersionsResponse other) { return ArrayComparer.Equals(WrappedValue, other.WrappedValue); } - + public static implicit operator Version(VersionsResponse wrapper) { return wrapper.WrappedValue; @@ -3368,5 +3954,5 @@ public bool Equals(VersionsResponse other) return new VersionsResponse(value); } } - + } diff --git a/Runtime/CareBoo.AlgoSdk/NodeServices/Indexer/IndexerClient.cs b/Runtime/CareBoo.AlgoSdk/NodeServices/Indexer/IndexerClient.cs index 4ec3a5136..aa87a078d 100644 --- a/Runtime/CareBoo.AlgoSdk/NodeServices/Indexer/IndexerClient.cs +++ b/Runtime/CareBoo.AlgoSdk/NodeServices/Indexer/IndexerClient.cs @@ -13,7 +13,6 @@ namespace AlgoSdk /// The indexer service is responsible for querying the blockchain /// [Serializable] - [Obsolete("Please use Algorand.Indexer.DefaultApi instead.")] public partial struct IndexerClient { [SerializeField] @@ -133,7 +132,7 @@ public AlgoApiRequest.Sent GetHealth() notePrefix: notePrefix != null ? Encoding.UTF8.GetBytes(notePrefix) : null, rekeyTo: rekeyTo, round: round, - txType: txType, + txType: txType.ToString(), txid: txid.Equals(default) ? null : txid ); } @@ -254,7 +253,7 @@ public AlgoApiRequest.Sent GetHealth() rekeyTo: rekeyTo, round: round, sigType: sigType, - txType: txType, + txType: txType.ToString(), txid: txid.Equals(default) ? null : txid.ToString() ); } @@ -304,7 +303,7 @@ public AlgoApiRequest.Sent GetBlock(ulong round) rekeyTo: rekeyTo, round: round, sigType: sigType, - txType: txType, + txType: txType.ToString(), txid: txid.Equals(default) ? null : txid.ToString() ); } diff --git a/Runtime/CareBoo.AlgoSdk/NodeServices/Indexer/IndexerClient.gen.cs b/Runtime/CareBoo.AlgoSdk/NodeServices/Indexer/IndexerClient.gen.cs index b0d892196..3697e4fd7 100644 --- a/Runtime/CareBoo.AlgoSdk/NodeServices/Indexer/IndexerClient.gen.cs +++ b/Runtime/CareBoo.AlgoSdk/NodeServices/Indexer/IndexerClient.gen.cs @@ -132,7 +132,7 @@ public interface IIndexerClient : IAlgoApiClient DateTime afterTime = default, - TransactionType txType = default, + string txType = default, Optional excludeCloseTo = default, @@ -383,7 +383,7 @@ public interface IIndexerClient : IAlgoApiClient /// Results should have an amount less than this value. MicroAlgos are the default currency unless an asset-id is provided, in which case the asset will be used. /// /// - /// Include results for the specified round. For performance reasons, this parameter may be disabled on some configurations. + /// Include results for the specified round. For performance reasons, this parameter may be disabled on some configurations. Using application-id or asset-id filters will return both creator and opt-in accounts. Filtering by include-all will return creator and opt-in accounts for deleted assets and accounts. Non-opt-in managers are not included in the results when asset-id is used. /// /// /// Include all items including closed accounts, deleted applications, destroyed assets, opted-out asset holdings, and closed-out application localstates. @@ -486,7 +486,7 @@ public interface IIndexerClient : IAlgoApiClient DateTime afterTime = default, - TransactionType txType = default, + string txType = default, Optional limit = default, @@ -589,7 +589,7 @@ public interface IIndexerClient : IAlgoApiClient Optional applicationId = default, - TransactionType txType = default, + string txType = default, Optional excludeCloseTo = default, @@ -796,11 +796,16 @@ public interface IIndexerClient : IAlgoApiClient /// /// Round number /// + /// + /// Header only flag. When this is set to true, returned block does not contain the transactions + /// /// /// /// AlgoApiRequest.Sent LookupBlock( - ulong roundNumber + ulong roundNumber, + + Optional headerOnly = default ); /// @@ -865,7 +870,7 @@ public partial struct IndexerClient DateTime afterTime = default, - TransactionType txType = default, + string txType = default, Optional excludeCloseTo = default, @@ -1120,7 +1125,7 @@ public partial struct IndexerClient DateTime afterTime = default, - TransactionType txType = default, + string txType = default, Optional limit = default, @@ -1180,7 +1185,7 @@ public partial struct IndexerClient Optional applicationId = default, - TransactionType txType = default, + string txType = default, Optional excludeCloseTo = default, @@ -1371,10 +1376,15 @@ public partial struct IndexerClient /// public AlgoApiRequest.Sent LookupBlock( - ulong roundNumber + ulong roundNumber, + + Optional headerOnly = default ) { - var path = $"/v2/blocks/{roundNumber}"; + using var queryBuilder = new QueryBuilder(Allocator.Persistent) + .Add("header-only", headerOnly) + ; + var path = $"/v2/blocks/{roundNumber}{queryBuilder}"; return this .Get(path) diff --git a/Runtime/CareBoo.AlgoSdk/NodeServices/Indexer/IndexerTypes.gen.cs b/Runtime/CareBoo.AlgoSdk/NodeServices/Indexer/IndexerTypes.gen.cs index c16010bf3..8fc367171 100644 --- a/Runtime/CareBoo.AlgoSdk/NodeServices/Indexer/IndexerTypes.gen.cs +++ b/Runtime/CareBoo.AlgoSdk/NodeServices/Indexer/IndexerTypes.gen.cs @@ -13,6 +13,8 @@ using Unity.Collections; using UnityEngine; +using Dotnet = Algorand.Indexer.Model; + namespace AlgoSdk.Indexer { [AlgoApiObject, Serializable] @@ -21,42 +23,51 @@ public partial struct Block { [SerializeField, Tooltip(@"")] BlockRewards @rewards; - + [SerializeField, Tooltip(@"[gh] hash to which this block belongs.")] byte[] @genesisHash; - + [SerializeField, Tooltip(@"")] BlockUpgradeState @upgradeState; - + [SerializeField, Tooltip(@"[prev] Previous block hash.")] byte[] @previousBlockHash; - + [SerializeField, Tooltip(@"[seed] Sortition seed.")] byte[] @seed; - + [SerializeField, Tooltip(@"[rnd] Current round on which this block was appended to the chain.")] ulong @round; - + [SerializeField, Tooltip(@"[txn] TransactionsRoot authenticates the set of transactions appearing in the block. More specifically, it's the root of a merkle tree whose leaves are the block's Txids, in lexicographic order. For the empty block, it's 0. Note that the TxnRoot does not authenticate the signatures on the transactions, only the transactions themselves. Two blocks with the same transactions but in a different order and with different signatures will have the same TxnRoot.")] byte[] @transactionsRoot; - + + [SerializeField, Tooltip(@"Tracks the status of state proofs.")] + StateProofTracking[] @stateProofTracking; + [SerializeField, Tooltip(@"[gen] ID to which this block belongs.")] string @genesisId; - + + [SerializeField, Tooltip(@"[txn256] TransactionsRootSHA256 is an auxiliary TransactionRoot, built using a vector commitment instead of a merkle tree, and SHA256 hash function instead of the default SHA512_256. This commitment can be used on environments where only the SHA256 function exists.")] + byte[] @transactionsRootSha256; + [SerializeField, Tooltip(@"")] BlockUpgradeVote @upgradeVote; - + + [SerializeField, Tooltip(@"")] + ParticipationUpdates @participationUpdates; + [SerializeField, Tooltip(@"[txns] list of transactions corresponding to a given round.")] Transaction[] @transactions; - + [SerializeField, Tooltip(@"[ts] Block creation timestamp in seconds since eposh")] ulong @timestamp; - + [SerializeField, Tooltip(@"[tc] TxnCounter counts the number of transactions committed in the ledger, from the time at which support for this feature was introduced. Specifically, TxnCounter is the number of the next transaction that will be committed after this block. It is 0 when no transactions have ever been committed (since TxnCounter started being supported).")] Optional @txnCounter; - + /// /// /// @@ -127,6 +138,16 @@ public byte[] TransactionsRoot set => this.@transactionsRoot = value; } + /// + /// Tracks the status of state proofs. + /// + [AlgoApiField("state-proof-tracking")] + public StateProofTracking[] StateProofTracking + { + get => this.@stateProofTracking; + set => this.@stateProofTracking = value; + } + /// /// [gen] ID to which this block belongs. /// @@ -137,6 +158,16 @@ public string GenesisId set => this.@genesisId = value; } + /// + /// [txn256] TransactionsRootSHA256 is an auxiliary TransactionRoot, built using a vector commitment instead of a merkle tree, and SHA256 hash function instead of the default SHA512_256. This commitment can be used on environments where only the SHA256 function exists. + /// + [AlgoApiField("transactions-root-sha256")] + public byte[] TransactionsRootSha256 + { + get => this.@transactionsRootSha256; + set => this.@transactionsRootSha256 = value; + } + /// /// /// @@ -147,6 +178,16 @@ public BlockUpgradeVote UpgradeVote set => this.@upgradeVote = value; } + /// + /// + /// + [AlgoApiField("participation-updates")] + public ParticipationUpdates ParticipationUpdates + { + get => this.@participationUpdates; + set => this.@participationUpdates = value; + } + /// /// [txns] list of transactions corresponding to a given round. /// @@ -181,7 +222,7 @@ public Optional TxnCounter public bool Equals(Block other) { - return + return Rewards.Equals(other.Rewards) && ArrayComparer.Equals(GenesisHash, other.GenesisHash) && UpgradeState.Equals(other.UpgradeState) && @@ -189,13 +230,51 @@ public bool Equals(Block other) ArrayComparer.Equals(Seed, other.Seed) && Round.Equals(other.Round) && ArrayComparer.Equals(TransactionsRoot, other.TransactionsRoot) && + ArrayComparer.Equals(StateProofTracking, other.StateProofTracking) && StringComparer.Equals(GenesisId, other.GenesisId) && + ArrayComparer.Equals(TransactionsRootSha256, other.TransactionsRootSha256) && UpgradeVote.Equals(other.UpgradeVote) && + ParticipationUpdates.Equals(other.ParticipationUpdates) && ArrayComparer.Equals(Transactions, other.Transactions) && Timestamp.Equals(other.Timestamp) && TxnCounter.Equals(other.TxnCounter) ; } + + public static implicit operator Dotnet.Block(Block from) + { + return from.Convert().ToDotnet(); + } + + public static implicit operator Block(Dotnet.Block from) + { + return from.Convert().ToUnity(); + } + } + + [AlgoApiObject, Serializable] + public partial struct HashFactory + : IEquatable + { + [SerializeField, Tooltip(@"[t]")] + Optional @hashType; + + /// + /// [t] + /// + [AlgoApiField("hash-type")] + public Optional HashType + { + get => this.@hashType; + set => this.@hashType = value; + } + + public bool Equals(HashFactory other) + { + return + HashType.Equals(other.HashType) + ; + } } [AlgoApiObject, Serializable] @@ -204,13 +283,13 @@ public partial struct TransactionSignatureMultisig { [SerializeField, Tooltip(@"[subsig] holds pairs of public key and signatures.")] TransactionSignatureMultisigSubsignature[] @subsignature; - + [SerializeField, Tooltip(@"[thr]")] Optional @threshold; - + [SerializeField, Tooltip(@"[v]")] Optional @version; - + /// /// [subsig] holds pairs of public key and signatures. /// @@ -243,12 +322,47 @@ public Optional Version public bool Equals(TransactionSignatureMultisig other) { - return + return ArrayComparer.Equals(Subsignature, other.Subsignature) && Threshold.Equals(other.Threshold) && Version.Equals(other.Version) ; } + + public static implicit operator Dotnet.TransactionSignatureMultisig(TransactionSignatureMultisig from) + { + return from.Convert().ToDotnet(); + } + + public static implicit operator TransactionSignatureMultisig(Dotnet.TransactionSignatureMultisig from) + { + return from.Convert().ToUnity(); + } + } + + [AlgoApiObject, Serializable] + public partial struct ParticipationUpdates + : IEquatable + { + [SerializeField, Tooltip(@"[partupdrmv] a list of online accounts that needs to be converted to offline since their participation key expired.")] + string[] @expiredParticipationAccounts; + + /// + /// [partupdrmv] a list of online accounts that needs to be converted to offline since their participation key expired. + /// + [AlgoApiField("expired-participation-accounts")] + public string[] ExpiredParticipationAccounts + { + get => this.@expiredParticipationAccounts; + set => this.@expiredParticipationAccounts = value; + } + + public bool Equals(ParticipationUpdates other) + { + return + ArrayComparer.Equals(ExpiredParticipationAccounts, other.ExpiredParticipationAccounts) + ; + } } [AlgoApiObject, Serializable] @@ -257,25 +371,25 @@ public partial struct ApplicationParams { [SerializeField, Tooltip(@"The address that created this application. This is the address where the parameters and global state for this application can be found.")] Address @creator; - + [SerializeField, Tooltip(@"[approv] approval program.")] CompiledTeal @approvalProgram; - + [SerializeField, Tooltip(@"[clearp] approval program.")] CompiledTeal @clearStateProgram; - + [SerializeField, Tooltip(@"[lsch] local schema")] ApplicationStateSchema @localStateSchema; - + [SerializeField, Tooltip(@"[gsch] global schema")] ApplicationStateSchema @globalStateSchema; - + [SerializeField, Tooltip(@"[gs] global schema")] TealKeyValueStore @globalState; - + [SerializeField, Tooltip(@"[epp] the amount of extra program pages available to this app.")] Optional @extraProgramPages; - + /// /// The address that created this application. This is the address where the parameters and global state for this application can be found. /// @@ -348,7 +462,7 @@ public Optional ExtraProgramPages public bool Equals(ApplicationParams other) { - return + return Creator.Equals(other.Creator) && ApprovalProgram.Equals(other.ApprovalProgram) && ClearStateProgram.Equals(other.ClearStateProgram) && @@ -358,6 +472,83 @@ public bool Equals(ApplicationParams other) ExtraProgramPages.Equals(other.ExtraProgramPages) ; } + + public static implicit operator Dotnet.ApplicationParams(ApplicationParams from) + { + return from.Convert().ToDotnet(); + } + + public static implicit operator ApplicationParams(Dotnet.ApplicationParams from) + { + return from.Convert().ToUnity(); + } + } + + [AlgoApiObject, Serializable] + public partial struct StateProofTracking + : IEquatable + { + [SerializeField, Tooltip(@"State Proof Type. Note the raw object uses map with this as key.")] + Optional @type; + + [SerializeField, Tooltip(@"[v] Root of a vector commitment containing online accounts that will help sign the proof.")] + byte[] @votersCommitment; + + [SerializeField, Tooltip(@"[t] The total number of microalgos held by the online accounts during the StateProof round.")] + Optional @onlineTotalWeight; + + [SerializeField, Tooltip(@"[n] Next round for which we will accept a state proof transaction.")] + Optional @nextRound; + + /// + /// State Proof Type. Note the raw object uses map with this as key. + /// + [AlgoApiField("type")] + public Optional Type + { + get => this.@type; + set => this.@type = value; + } + + /// + /// [v] Root of a vector commitment containing online accounts that will help sign the proof. + /// + [AlgoApiField("voters-commitment")] + public byte[] VotersCommitment + { + get => this.@votersCommitment; + set => this.@votersCommitment = value; + } + + /// + /// [t] The total number of microalgos held by the online accounts during the StateProof round. + /// + [AlgoApiField("online-total-weight")] + public Optional OnlineTotalWeight + { + get => this.@onlineTotalWeight; + set => this.@onlineTotalWeight = value; + } + + /// + /// [n] Next round for which we will accept a state proof transaction. + /// + [AlgoApiField("next-round")] + public Optional NextRound + { + get => this.@nextRound; + set => this.@nextRound = value; + } + + public bool Equals(StateProofTracking other) + { + return + Type.Equals(other.Type) && + ArrayComparer.Equals(VotersCommitment, other.VotersCommitment) && + OnlineTotalWeight.Equals(other.OnlineTotalWeight) && + NextRound.Equals(other.NextRound) + ; + } } [AlgoApiObject, Serializable] @@ -366,13 +557,13 @@ public partial struct TealValue { [SerializeField, Tooltip(@"[tt] value type. Value `1` refers to **bytes**, value `2` refers to **uint**")] ulong @type; - + [SerializeField, Tooltip(@"[tb] bytes value.")] string @bytes; - + [SerializeField, Tooltip(@"[ui] uint value.")] ulong @uint; - + /// /// [tt] value type. Value `1` refers to **bytes**, value `2` refers to **uint** /// @@ -405,12 +596,22 @@ public ulong Uint public bool Equals(TealValue other) { - return + return Type.Equals(other.Type) && StringComparer.Equals(Bytes, other.Bytes) && Uint.Equals(other.Uint) ; } + + public static implicit operator Dotnet.TealValue(TealValue from) + { + return from.Convert().ToDotnet(); + } + + public static implicit operator TealValue(Dotnet.TealValue from) + { + return from.Convert().ToUnity(); + } } [AlgoApiObject, Serializable] @@ -419,16 +620,16 @@ public partial struct TransactionSignatureLogicsig { [SerializeField, Tooltip(@"[arg] Logic arguments, base64 encoded.")] string[] @args; - + [SerializeField, Tooltip(@"[l] Program signed by a signature or multi signature, or hashed to be the address of ana ccount. Base64 encoded TEAL program.")] byte[] @logic; - + [SerializeField, Tooltip(@"")] TransactionSignatureMultisig @multisigSignature; - + [SerializeField, Tooltip(@"[sig] ed25519 signature.")] byte[] @signature; - + /// /// [arg] Logic arguments, base64 encoded. /// @@ -471,13 +672,23 @@ public byte[] Signature public bool Equals(TransactionSignatureLogicsig other) { - return + return ArrayComparer.Equals(Args, other.Args) && ArrayComparer.Equals(Logic, other.Logic) && MultisigSignature.Equals(other.MultisigSignature) && ArrayComparer.Equals(Signature, other.Signature) ; } + + public static implicit operator Dotnet.TransactionSignatureLogicsig(TransactionSignatureLogicsig from) + { + return from.Convert().ToDotnet(); + } + + public static implicit operator TransactionSignatureLogicsig(Dotnet.TransactionSignatureLogicsig from) + { + return from.Convert().ToUnity(); + } } [AlgoApiObject, Serializable] @@ -486,13 +697,13 @@ public partial struct EvalDelta { [SerializeField, Tooltip(@"[at] delta action.")] ulong @action; - + [SerializeField, Tooltip(@"[bs] bytes value.")] string @bytes; - + [SerializeField, Tooltip(@"[ui] uint value.")] Optional @uint; - + /// /// [at] delta action. /// @@ -525,12 +736,22 @@ public Optional Uint public bool Equals(EvalDelta other) { - return + return Action.Equals(other.Action) && StringComparer.Equals(Bytes, other.Bytes) && Uint.Equals(other.Uint) ; } + + public static implicit operator Dotnet.EvalDelta(EvalDelta from) + { + return from.Convert().ToDotnet(); + } + + public static implicit operator EvalDelta(Dotnet.EvalDelta from) + { + return from.Convert().ToUnity(); + } } [AlgoApiObject, Serializable] @@ -539,37 +760,37 @@ public partial struct TransactionApplication { [SerializeField, Tooltip(@"[apid] ID of the application being configured or empty if creating.")] ulong @applicationId; - + [SerializeField, Tooltip(@"[apap] Logic executed for every application transaction, except when on-completion is set to 'clear'. It can read and write global state for the application, as well as account-specific local state. Approval programs may reject the transaction.")] CompiledTeal @approvalProgram; - + [SerializeField, Tooltip(@"[apfa] Lists the applications in addition to the application-id whose global states may be accessed by this application's approval-program and clear-state-program. The access is read-only.")] ulong[] @foreignApps; - + [SerializeField, Tooltip(@"[apaa] transaction specific arguments accessed from the application's approval-program and clear-state-program.")] string[] @applicationArgs; - + [SerializeField, Tooltip(@"")] OnCompletion @onCompletion; - + [SerializeField, Tooltip(@"")] StateSchema @globalStateSchema; - + [SerializeField, Tooltip(@"[epp] specifies the additional app program len requested in pages.")] Optional @extraProgramPages; - + [SerializeField, Tooltip(@"[apas] lists the assets whose parameters may be accessed by this application's ApprovalProgram and ClearStateProgram. The access is read-only.")] ulong[] @foreignAssets; - + [SerializeField, Tooltip(@"")] StateSchema @localStateSchema; - + [SerializeField, Tooltip(@"[apat] List of accounts in addition to the sender that may be accessed from the application's approval-program and clear-state-program.")] Address[] @accounts; - + [SerializeField, Tooltip(@"[apsu] Logic executed for application transactions with on-completion set to 'clear'. It can read and write global state for the application, as well as account-specific local state. Clear state programs cannot reject the transaction.")] CompiledTeal @clearStateProgram; - + /// /// [apid] ID of the application being configured or empty if creating. /// @@ -682,7 +903,7 @@ public CompiledTeal ClearStateProgram public bool Equals(TransactionApplication other) { - return + return ApplicationId.Equals(other.ApplicationId) && ApprovalProgram.Equals(other.ApprovalProgram) && ArrayComparer.Equals(ForeignApps, other.ForeignApps) && @@ -696,6 +917,16 @@ public bool Equals(TransactionApplication other) ClearStateProgram.Equals(other.ClearStateProgram) ; } + + public static implicit operator Dotnet.TransactionApplication(TransactionApplication from) + { + return from.Convert().ToDotnet(); + } + + public static implicit operator TransactionApplication(Dotnet.TransactionApplication from) + { + return from.Convert().ToUnity(); + } } [AlgoApiObject, Serializable] @@ -704,10 +935,10 @@ public partial struct ApplicationStateSchema { [SerializeField, Tooltip(@"[nui] num of uints.")] ulong @numUint; - + [SerializeField, Tooltip(@"[nbs] num of byte slices.")] ulong @numByteSlice; - + /// /// [nui] num of uints. /// @@ -730,11 +961,21 @@ public ulong NumByteSlice public bool Equals(ApplicationStateSchema other) { - return + return NumUint.Equals(other.NumUint) && NumByteSlice.Equals(other.NumByteSlice) ; } + + public static implicit operator Dotnet.ApplicationStateSchema(ApplicationStateSchema from) + { + return from.Convert().ToDotnet(); + } + + public static implicit operator ApplicationStateSchema(Dotnet.ApplicationStateSchema from) + { + return from.Convert().ToUnity(); + } } [AlgoApiObject, Serializable] @@ -743,10 +984,10 @@ public partial struct TransactionAssetConfig { [SerializeField, Tooltip(@"[xaid] ID of the asset being configured or empty if creating.")] Optional @assetId; - + [SerializeField, Tooltip(@"")] AssetParams @params; - + /// /// [xaid] ID of the asset being configured or empty if creating. /// @@ -769,11 +1010,21 @@ public AssetParams Params public bool Equals(TransactionAssetConfig other) { - return + return AssetId.Equals(other.AssetId) && Params.Equals(other.Params) ; } + + public static implicit operator Dotnet.TransactionAssetConfig(TransactionAssetConfig from) + { + return from.Convert().ToDotnet(); + } + + public static implicit operator TransactionAssetConfig(Dotnet.TransactionAssetConfig from) + { + return from.Convert().ToUnity(); + } } [AlgoApiObject, Serializable] @@ -782,16 +1033,16 @@ public partial struct TransactionPayment { [SerializeField, Tooltip(@"[amt] number of MicroAlgos intended to be transferred.")] ulong @amount; - + [SerializeField, Tooltip(@"Number of MicroAlgos that were sent to the close-remainder-to address when closing the sender account.")] Optional @closeAmount; - + [SerializeField, Tooltip(@"[close] when set, indicates that the sending account should be closed and all remaining funds be transferred to this address.")] string @closeRemainderTo; - + [SerializeField, Tooltip(@"[rcv] receiver's address.")] string @receiver; - + /// /// [amt] number of MicroAlgos intended to be transferred. /// @@ -834,13 +1085,132 @@ public string Receiver public bool Equals(TransactionPayment other) { - return + return Amount.Equals(other.Amount) && CloseAmount.Equals(other.CloseAmount) && StringComparer.Equals(CloseRemainderTo, other.CloseRemainderTo) && StringComparer.Equals(Receiver, other.Receiver) ; } + + public static implicit operator Dotnet.TransactionPayment(TransactionPayment from) + { + return from.Convert().ToDotnet(); + } + + public static implicit operator TransactionPayment(Dotnet.TransactionPayment from) + { + return from.Convert().ToUnity(); + } + } + + [AlgoApiObject, Serializable] + public partial struct StateProofFields + : IEquatable + { + [SerializeField, Tooltip(@"[c]")] + byte[] @sigCommit; + + [SerializeField, Tooltip(@"[w]")] + Optional @signedWeight; + + [SerializeField, Tooltip(@"[S]")] + MerkleArrayProof @sigProofs; + + [SerializeField, Tooltip(@"[P]")] + MerkleArrayProof @partProofs; + + [SerializeField, Tooltip(@"[v] Salt version of the merkle signature.")] + Optional @saltVersion; + + [SerializeField, Tooltip(@"[r] Note that this is actually stored as a map[uint64] - Reveal in the actual msgp")] + StateProofReveal[] @reveals; + + [SerializeField, Tooltip(@"[pr] Sequence of reveal positions.")] + ulong[] @positionsToReveal; + + /// + /// [c] + /// + [AlgoApiField("sig-commit")] + public byte[] SigCommit + { + get => this.@sigCommit; + set => this.@sigCommit = value; + } + + /// + /// [w] + /// + [AlgoApiField("signed-weight")] + public Optional SignedWeight + { + get => this.@signedWeight; + set => this.@signedWeight = value; + } + + /// + /// [S] + /// + [AlgoApiField("sig-proofs")] + public MerkleArrayProof SigProofs + { + get => this.@sigProofs; + set => this.@sigProofs = value; + } + + /// + /// [P] + /// + [AlgoApiField("part-proofs")] + public MerkleArrayProof PartProofs + { + get => this.@partProofs; + set => this.@partProofs = value; + } + + /// + /// [v] Salt version of the merkle signature. + /// + [AlgoApiField("salt-version")] + public Optional SaltVersion + { + get => this.@saltVersion; + set => this.@saltVersion = value; + } + + /// + /// [r] Note that this is actually stored as a map[uint64] - Reveal in the actual msgp + /// + [AlgoApiField("reveals")] + public StateProofReveal[] Reveals + { + get => this.@reveals; + set => this.@reveals = value; + } + + /// + /// [pr] Sequence of reveal positions. + /// + [AlgoApiField("positions-to-reveal")] + public ulong[] PositionsToReveal + { + get => this.@positionsToReveal; + set => this.@positionsToReveal = value; + } + + public bool Equals(StateProofFields other) + { + return + ArrayComparer.Equals(SigCommit, other.SigCommit) && + SignedWeight.Equals(other.SignedWeight) && + SigProofs.Equals(other.SigProofs) && + PartProofs.Equals(other.PartProofs) && + SaltVersion.Equals(other.SaltVersion) && + ArrayComparer.Equals(Reveals, other.Reveals) && + ArrayComparer.Equals(PositionsToReveal, other.PositionsToReveal) + ; + } } [AlgoApiObject, Serializable] @@ -849,22 +1219,22 @@ public partial struct MiniAssetHolding { [SerializeField, Tooltip(@"")] string @address; - + [SerializeField, Tooltip(@"")] ulong @amount; - + [SerializeField, Tooltip(@"")] bool @isFrozen; - + [SerializeField, Tooltip(@"Whether or not this asset holding is currently deleted from its account.")] Optional @deleted; - + [SerializeField, Tooltip(@"Round during which the account opted into the asset.")] Optional @optedInAtRound; - + [SerializeField, Tooltip(@"Round during which the account opted out of the asset.")] Optional @optedOutAtRound; - + /// /// /// @@ -927,7 +1297,7 @@ public Optional OptedOutAtRound public bool Equals(MiniAssetHolding other) { - return + return StringComparer.Equals(Address, other.Address) && Amount.Equals(other.Amount) && IsFrozen.Equals(other.IsFrozen) && @@ -936,6 +1306,55 @@ public bool Equals(MiniAssetHolding other) OptedOutAtRound.Equals(other.OptedOutAtRound) ; } + + public static implicit operator Dotnet.MiniAssetHolding(MiniAssetHolding from) + { + return from.Convert().ToDotnet(); + } + + public static implicit operator MiniAssetHolding(Dotnet.MiniAssetHolding from) + { + return from.Convert().ToUnity(); + } + } + + [AlgoApiObject, Serializable] + public partial struct StateProofParticipant + : IEquatable + { + [SerializeField, Tooltip(@"[p]")] + StateProofVerifier @verifier; + + [SerializeField, Tooltip(@"[w]")] + Optional @weight; + + /// + /// [p] + /// + [AlgoApiField("verifier")] + public StateProofVerifier Verifier + { + get => this.@verifier; + set => this.@verifier = value; + } + + /// + /// [w] + /// + [AlgoApiField("weight")] + public Optional Weight + { + get => this.@weight; + set => this.@weight = value; + } + + public bool Equals(StateProofParticipant other) + { + return + Verifier.Equals(other.Verifier) && + Weight.Equals(other.Weight) + ; + } } [AlgoApiObject, Serializable] @@ -944,10 +1363,10 @@ public partial struct ApplicationLogData { [SerializeField, Tooltip(@"Transaction ID")] string @txid; - + [SerializeField, Tooltip(@"[lg] Logs for the application being executed by the transaction.")] byte[][] @logs; - + /// /// Transaction ID /// @@ -970,11 +1389,21 @@ public byte[][] Logs public bool Equals(ApplicationLogData other) { - return + return StringComparer.Equals(Txid, other.Txid) && ArrayComparer.Equals(Logs, other.Logs) ; } + + public static implicit operator Dotnet.ApplicationLogData(ApplicationLogData from) + { + return from.Convert().ToDotnet(); + } + + public static implicit operator ApplicationLogData(Dotnet.ApplicationLogData from) + { + return from.Convert().ToUnity(); + } } [AlgoApiObject, Serializable] @@ -983,13 +1412,13 @@ public partial struct TransactionAssetFreeze { [SerializeField, Tooltip(@"[fadd] Address of the account whose asset is being frozen or thawed.")] string @address; - + [SerializeField, Tooltip(@"[faid] ID of the asset being frozen or thawed.")] ulong @assetId; - + [SerializeField, Tooltip(@"[afrz] The new freeze status.")] bool @newFreezeStatus; - + /// /// [fadd] Address of the account whose asset is being frozen or thawed. /// @@ -1022,12 +1451,22 @@ public bool NewFreezeStatus public bool Equals(TransactionAssetFreeze other) { - return + return StringComparer.Equals(Address, other.Address) && AssetId.Equals(other.AssetId) && NewFreezeStatus.Equals(other.NewFreezeStatus) ; } + + public static implicit operator Dotnet.TransactionAssetFreeze(TransactionAssetFreeze from) + { + return from.Convert().ToDotnet(); + } + + public static implicit operator TransactionAssetFreeze(Dotnet.TransactionAssetFreeze from) + { + return from.Convert().ToUnity(); + } } [AlgoApiObject, Serializable] @@ -1036,25 +1475,25 @@ public partial struct TransactionKeyreg { [SerializeField, Tooltip(@"[nonpart] Mark the account as participating or non-participating.")] Optional @nonParticipation; - + [SerializeField, Tooltip(@"[selkey] Public key used with the Verified Random Function (VRF) result during committee selection.")] byte[] @selectionParticipationKey; - + [SerializeField, Tooltip(@"[votefst] First round this participation key is valid.")] Optional @voteFirstValid; - + [SerializeField, Tooltip(@"[votekd] Number of subkeys in each batch of participation keys.")] Optional @voteKeyDilution; - + [SerializeField, Tooltip(@"[votelst] Last round this participation key is valid.")] Optional @voteLastValid; - + [SerializeField, Tooltip(@"[votekey] Participation public key used in key registration transactions.")] byte[] @voteParticipationKey; - + [SerializeField, Tooltip(@"[sprfkey] State proof key used in key registration transactions.")] byte[] @stateProofKey; - + /// /// [nonpart] Mark the account as participating or non-participating. /// @@ -1127,7 +1566,7 @@ public byte[] StateProofKey public bool Equals(TransactionKeyreg other) { - return + return NonParticipation.Equals(other.NonParticipation) && ArrayComparer.Equals(SelectionParticipationKey, other.SelectionParticipationKey) && VoteFirstValid.Equals(other.VoteFirstValid) && @@ -1137,6 +1576,16 @@ public bool Equals(TransactionKeyreg other) ArrayComparer.Equals(StateProofKey, other.StateProofKey) ; } + + public static implicit operator Dotnet.TransactionKeyreg(TransactionKeyreg from) + { + return from.Convert().ToDotnet(); + } + + public static implicit operator TransactionKeyreg(Dotnet.TransactionKeyreg from) + { + return from.Convert().ToUnity(); + } } [AlgoApiObject, Serializable] @@ -1145,13 +1594,13 @@ public partial struct TransactionSignature { [SerializeField, Tooltip(@"")] TransactionSignatureLogicsig @logicsig; - + [SerializeField, Tooltip(@"")] TransactionSignatureMultisig @multisig; - + [SerializeField, Tooltip(@"[sig] Standard ed25519 signature.")] byte[] @sig; - + /// /// /// @@ -1184,12 +1633,22 @@ public byte[] Sig public bool Equals(TransactionSignature other) { - return + return Logicsig.Equals(other.Logicsig) && Multisig.Equals(other.Multisig) && ArrayComparer.Equals(Sig, other.Sig) ; } + + public static implicit operator Dotnet.TransactionSignature(TransactionSignature from) + { + return from.Convert().ToDotnet(); + } + + public static implicit operator TransactionSignature(Dotnet.TransactionSignature from) + { + return from.Convert().ToUnity(); + } } [AlgoApiObject, Serializable] @@ -1198,19 +1657,19 @@ public partial struct Asset { [SerializeField, Tooltip(@"unique asset identifier")] ulong @index; - + [SerializeField, Tooltip(@"Whether or not this asset is currently deleted.")] Optional @deleted; - + [SerializeField, Tooltip(@"Round during which this asset was created.")] Optional @createdAtRound; - + [SerializeField, Tooltip(@"Round during which this asset was destroyed.")] Optional @destroyedAtRound; - + [SerializeField, Tooltip(@"")] AssetParams @params; - + /// /// unique asset identifier /// @@ -1263,7 +1722,7 @@ public AssetParams Params public bool Equals(Asset other) { - return + return Index.Equals(other.Index) && Deleted.Equals(other.Deleted) && CreatedAtRound.Equals(other.CreatedAtRound) && @@ -1271,6 +1730,69 @@ public bool Equals(Asset other) Params.Equals(other.Params) ; } + + public static implicit operator Dotnet.Asset(Asset from) + { + return from.Convert().ToDotnet(); + } + + public static implicit operator Asset(Dotnet.Asset from) + { + return from.Convert().ToUnity(); + } + } + + [AlgoApiObject, Serializable] + public partial struct StateProofReveal + : IEquatable + { + [SerializeField, Tooltip(@"The position in the signature and participants arrays corresponding to this entry.")] + Optional @position; + + [SerializeField, Tooltip(@"[s]")] + StateProofSigSlot @sigSlot; + + [SerializeField, Tooltip(@"[p]")] + StateProofParticipant @participant; + + /// + /// The position in the signature and participants arrays corresponding to this entry. + /// + [AlgoApiField("position")] + public Optional Position + { + get => this.@position; + set => this.@position = value; + } + + /// + /// [s] + /// + [AlgoApiField("sig-slot")] + public StateProofSigSlot SigSlot + { + get => this.@sigSlot; + set => this.@sigSlot = value; + } + + /// + /// [p] + /// + [AlgoApiField("participant")] + public StateProofParticipant Participant + { + get => this.@participant; + set => this.@participant = value; + } + + public bool Equals(StateProofReveal other) + { + return + Position.Equals(other.Position) && + SigSlot.Equals(other.SigSlot) && + Participant.Equals(other.Participant) + ; + } } [AlgoApiObject, Serializable] @@ -1279,10 +1801,10 @@ public partial struct TealKeyValue { [SerializeField, Tooltip(@"")] string @key; - + [SerializeField, Tooltip(@"")] TealValue @value; - + /// /// /// @@ -1305,11 +1827,21 @@ public TealValue Value public bool Equals(TealKeyValue other) { - return + return StringComparer.Equals(Key, other.Key) && Value.Equals(other.Value) ; } + + public static implicit operator Dotnet.TealKeyValue(TealKeyValue from) + { + return from.Convert().ToDotnet(); + } + + public static implicit operator TealKeyValue(Dotnet.TealKeyValue from) + { + return from.Convert().ToUnity(); + } } [AlgoApiObject, Serializable] @@ -1318,25 +1850,25 @@ public partial struct HealthCheck { [SerializeField, Tooltip(@"Current version.")] string @version; - + [SerializeField, Tooltip(@"")] AlgoApiObject @data; - + [SerializeField, Tooltip(@"")] ulong @round; - + [SerializeField, Tooltip(@"")] bool @isMigrating; - + [SerializeField, Tooltip(@"")] bool @dbAvailable; - + [SerializeField, Tooltip(@"")] string @message; - + [SerializeField, Tooltip(@"")] string[] @errors; - + /// /// Current version. /// @@ -1409,7 +1941,7 @@ public string[] Errors public bool Equals(HealthCheck other) { - return + return StringComparer.Equals(Version, other.Version) && Data.Equals(other.Data) && Round.Equals(other.Round) && @@ -1419,6 +1951,16 @@ public bool Equals(HealthCheck other) ArrayComparer.Equals(Errors, other.Errors) ; } + + public static implicit operator Dotnet.HealthCheck(HealthCheck from) + { + return from.Convert().ToDotnet(); + } + + public static implicit operator HealthCheck(Dotnet.HealthCheck from) + { + return from.Convert().ToUnity(); + } } [AlgoApiObject, Serializable] @@ -1427,10 +1969,10 @@ public partial struct EvalDeltaKeyValue { [SerializeField, Tooltip(@"")] string @key; - + [SerializeField, Tooltip(@"")] EvalDelta @value; - + /// /// /// @@ -1453,11 +1995,21 @@ public EvalDelta Value public bool Equals(EvalDeltaKeyValue other) { - return + return StringComparer.Equals(Key, other.Key) && Value.Equals(other.Value) ; } + + public static implicit operator Dotnet.EvalDeltaKeyValue(EvalDeltaKeyValue from) + { + return from.Convert().ToDotnet(); + } + + public static implicit operator EvalDeltaKeyValue(Dotnet.EvalDeltaKeyValue from) + { + return from.Convert().ToUnity(); + } } [AlgoApiObject, Serializable] @@ -1466,22 +2018,22 @@ public partial struct AssetHolding { [SerializeField, Tooltip(@"[a] number of units held.")] ulong @amount; - + [SerializeField, Tooltip(@"Asset ID of the holding.")] ulong @assetId; - + [SerializeField, Tooltip(@"[f] whether or not the holding is frozen.")] bool @isFrozen; - + [SerializeField, Tooltip(@"Whether or not the asset holding is currently deleted from its account.")] Optional @deleted; - + [SerializeField, Tooltip(@"Round during which the account opted into this asset holding.")] Optional @optedInAtRound; - + [SerializeField, Tooltip(@"Round during which the account opted out of this asset holding.")] Optional @optedOutAtRound; - + /// /// [a] number of units held. /// @@ -1544,7 +2096,7 @@ public Optional OptedOutAtRound public bool Equals(AssetHolding other) { - return + return Amount.Equals(other.Amount) && AssetId.Equals(other.AssetId) && IsFrozen.Equals(other.IsFrozen) && @@ -1553,6 +2105,16 @@ public bool Equals(AssetHolding other) OptedOutAtRound.Equals(other.OptedOutAtRound) ; } + + public static implicit operator Dotnet.AssetHolding(AssetHolding from) + { + return from.Convert().ToDotnet(); + } + + public static implicit operator AssetHolding(Dotnet.AssetHolding from) + { + return from.Convert().ToUnity(); + } } [AlgoApiObject, Serializable] @@ -1561,93 +2123,93 @@ public partial struct Account { [SerializeField, Tooltip(@"[algo] total number of MicroAlgos in the account")] ulong @amount; - + [SerializeField, Tooltip(@"Whether or not this account is currently closed.")] Optional @deleted; - + [SerializeField, Tooltip(@"the account public key")] string @address; - + [SerializeField, Tooltip(@"[ern] total rewards of MicroAlgos the account has received, including pending rewards.")] ulong @rewards; - + [SerializeField, Tooltip(@"Round during which this account was most recently closed.")] Optional @closedAtRound; - + [SerializeField, Tooltip(@"specifies the amount of MicroAlgos in the account, without the pending rewards.")] ulong @amountWithoutPendingRewards; - + [SerializeField, Tooltip(@"[teap] the sum of all extra application program pages for this account.")] Optional @appsTotalExtraPages; - + [SerializeField, Tooltip(@"The count of all assets that have been opted in, equivalent to the count of AssetHolding objects held by this account.")] ulong @totalAssetsOptedIn; - + [SerializeField, Tooltip(@"[asset] assets held by this account. Note the raw object uses `map[int] -> AssetHolding` for this type.")] AssetHolding[] @assets; - + [SerializeField, Tooltip(@"Round during which this account first appeared in a transaction.")] Optional @createdAtRound; - + [SerializeField, Tooltip(@"")] AccountParticipation @participation; - + [SerializeField, Tooltip(@"[tsch] stores the sum of all of the local schemas and global schemas in this account. Note: the raw account uses `StateSchema` for this type.")] ApplicationStateSchema @appsTotalSchema; - + [SerializeField, Tooltip(@"The count of all applications that have been opted in, equivalent to the count of application local data (AppLocalState objects) stored in this account.")] ulong @totalAppsOptedIn; - + [SerializeField, Tooltip(@"The round for which this information is relevant.")] ulong @round; - + [SerializeField, Tooltip(@"amount of MicroAlgos of pending rewards in this account.")] ulong @pendingRewards; - + [SerializeField, Tooltip(@"[appp] parameters of applications created by this account including app global data. Note: the raw account uses `map[int] -> AppParams` for this type.")] Application[] @createdApps; - + [SerializeField, Tooltip(@"[onl] delegation status of the account's MicroAlgos * Offline - indicates that the associated account is delegated. * Online - indicates that the associated account used as part of the delegation pool. * NotParticipating - indicates that the associated account is neither a delegator nor a delegate.")] string @status; - + [SerializeField, Tooltip(@"Indicates what type of signature is used by this account, must be one of: * sig * msig * lsig * or null if unknown")] SignatureType @sigType; - + [SerializeField, Tooltip(@"[spend] the address against which signing should be checked. If empty, the address of the current account is used. This field can be updated in any transaction by setting the RekeyTo field.")] Address @authAddr; - + [SerializeField, Tooltip(@"The count of all assets (AssetParams objects) created by this account.")] ulong @totalCreatedAssets; - + [SerializeField, Tooltip(@"[ebase] used as part of the rewards computation. Only applicable to accounts which are participating.")] Optional @rewardBase; - + [SerializeField, Tooltip(@"[apar] parameters of assets created by this account. Note: the raw account uses `map[int] -> Asset` for this type.")] Asset[] @createdAssets; - + [SerializeField, Tooltip(@"[appl] applications local data stored in this account. Note the raw object uses `map[int] -> AppLocalState` for this type.")] ApplicationLocalState[] @appsLocalState; - + [SerializeField, Tooltip(@"The count of all apps (AppParams objects) created by this account.")] ulong @totalCreatedApps; - + /// /// [algo] total number of MicroAlgos in the account /// @@ -1907,7 +2469,7 @@ public ulong TotalCreatedApps public bool Equals(Account other) { - return + return Amount.Equals(other.Amount) && Deleted.Equals(other.Deleted) && StringComparer.Equals(Address, other.Address) && @@ -1934,6 +2496,16 @@ public bool Equals(Account other) TotalCreatedApps.Equals(other.TotalCreatedApps) ; } + + public static implicit operator Dotnet.Account(Account from) + { + return from.Convert().ToDotnet(); + } + + public static implicit operator Account(Dotnet.Account from) + { + return from.Convert().ToUnity(); + } } [AlgoApiObject, Serializable] @@ -1942,22 +2514,22 @@ public partial struct BlockRewards { [SerializeField, Tooltip(@"[fees] accepts transaction fees, it can only spend to the incentive pool.")] string @feeSink; - + [SerializeField, Tooltip(@"[rwcalr] number of leftover MicroAlgos after the distribution of rewards-rate MicroAlgos for every reward unit in the next round.")] ulong @rewardsCalculationRound; - + [SerializeField, Tooltip(@"[earn] How many rewards, in MicroAlgos, have been distributed to each RewardUnit of MicroAlgos since genesis.")] ulong @rewardsLevel; - + [SerializeField, Tooltip(@"[rwd] accepts periodic injections from the fee-sink and continually redistributes them as rewards.")] string @rewardsPool; - + [SerializeField, Tooltip(@"[rate] Number of new MicroAlgos added to the participation stake from rewards at the next round.")] ulong @rewardsRate; - + [SerializeField, Tooltip(@"[frac] Number of leftover MicroAlgos after the distribution of RewardsRate/rewardUnits MicroAlgos for every reward unit in the next round.")] ulong @rewardsResidue; - + /// /// [fees] accepts transaction fees, it can only spend to the incentive pool. /// @@ -2004,29 +2576,106 @@ public string RewardsPool [AlgoApiField("rewards-rate")] public ulong RewardsRate { - get => this.@rewardsRate; - set => this.@rewardsRate = value; + get => this.@rewardsRate; + set => this.@rewardsRate = value; + } + + /// + /// [frac] Number of leftover MicroAlgos after the distribution of RewardsRate/rewardUnits MicroAlgos for every reward unit in the next round. + /// + [AlgoApiField("rewards-residue")] + public ulong RewardsResidue + { + get => this.@rewardsResidue; + set => this.@rewardsResidue = value; + } + + public bool Equals(BlockRewards other) + { + return + StringComparer.Equals(FeeSink, other.FeeSink) && + RewardsCalculationRound.Equals(other.RewardsCalculationRound) && + RewardsLevel.Equals(other.RewardsLevel) && + StringComparer.Equals(RewardsPool, other.RewardsPool) && + RewardsRate.Equals(other.RewardsRate) && + RewardsResidue.Equals(other.RewardsResidue) + ; + } + + public static implicit operator Dotnet.BlockRewards(BlockRewards from) + { + return from.Convert().ToDotnet(); + } + + public static implicit operator BlockRewards(Dotnet.BlockRewards from) + { + return from.Convert().ToUnity(); + } + } + + [AlgoApiObject, Serializable] + public partial struct StateProofSignature + : IEquatable + { + [SerializeField, Tooltip(@"")] + byte[] @falconSignature; + + [SerializeField, Tooltip(@"")] + Optional @merkleArrayIndex; + + [SerializeField, Tooltip(@"")] + MerkleArrayProof @proof; + + [SerializeField, Tooltip(@"[vkey]")] + byte[] @verifyingKey; + + /// + /// + /// + [AlgoApiField("falcon-signature")] + public byte[] FalconSignature + { + get => this.@falconSignature; + set => this.@falconSignature = value; + } + + /// + /// + /// + [AlgoApiField("merkle-array-index")] + public Optional MerkleArrayIndex + { + get => this.@merkleArrayIndex; + set => this.@merkleArrayIndex = value; + } + + /// + /// + /// + [AlgoApiField("proof")] + public MerkleArrayProof Proof + { + get => this.@proof; + set => this.@proof = value; } /// - /// [frac] Number of leftover MicroAlgos after the distribution of RewardsRate/rewardUnits MicroAlgos for every reward unit in the next round. + /// [vkey] /// - [AlgoApiField("rewards-residue")] - public ulong RewardsResidue + [AlgoApiField("verifying-key")] + public byte[] VerifyingKey { - get => this.@rewardsResidue; - set => this.@rewardsResidue = value; + get => this.@verifyingKey; + set => this.@verifyingKey = value; } - public bool Equals(BlockRewards other) + public bool Equals(StateProofSignature other) { - return - StringComparer.Equals(FeeSink, other.FeeSink) && - RewardsCalculationRound.Equals(other.RewardsCalculationRound) && - RewardsLevel.Equals(other.RewardsLevel) && - StringComparer.Equals(RewardsPool, other.RewardsPool) && - RewardsRate.Equals(other.RewardsRate) && - RewardsResidue.Equals(other.RewardsResidue) + return + ArrayComparer.Equals(FalconSignature, other.FalconSignature) && + MerkleArrayIndex.Equals(other.MerkleArrayIndex) && + Proof.Equals(other.Proof) && + ArrayComparer.Equals(VerifyingKey, other.VerifyingKey) ; } } @@ -2037,10 +2686,10 @@ public partial struct AccountStateDelta { [SerializeField, Tooltip(@"")] string @address; - + [SerializeField, Tooltip(@"")] StateDelta @delta; - + /// /// /// @@ -2063,11 +2712,21 @@ public StateDelta Delta public bool Equals(AccountStateDelta other) { - return + return StringComparer.Equals(Address, other.Address) && Delta.Equals(other.Delta) ; } + + public static implicit operator Dotnet.AccountStateDelta(AccountStateDelta from) + { + return from.Convert().ToDotnet(); + } + + public static implicit operator AccountStateDelta(Dotnet.AccountStateDelta from) + { + return from.Convert().ToUnity(); + } } [AlgoApiObject, Serializable] @@ -2076,13 +2735,13 @@ public partial struct BlockUpgradeVote { [SerializeField, Tooltip(@"[upgradeyes] Indicates a yes vote for the current proposal.")] Optional @upgradeApprove; - + [SerializeField, Tooltip(@"[upgradedelay] Indicates the time between acceptance and execution.")] Optional @upgradeDelay; - + [SerializeField, Tooltip(@"[upgradeprop] Indicates a proposed upgrade.")] string @upgradePropose; - + /// /// [upgradeyes] Indicates a yes vote for the current proposal. /// @@ -2115,12 +2774,22 @@ public string UpgradePropose public bool Equals(BlockUpgradeVote other) { - return + return UpgradeApprove.Equals(other.UpgradeApprove) && UpgradeDelay.Equals(other.UpgradeDelay) && StringComparer.Equals(UpgradePropose, other.UpgradePropose) ; } + + public static implicit operator Dotnet.BlockUpgradeVote(BlockUpgradeVote from) + { + return from.Convert().ToDotnet(); + } + + public static implicit operator BlockUpgradeVote(Dotnet.BlockUpgradeVote from) + { + return from.Convert().ToUnity(); + } } [AlgoApiObject, Serializable] @@ -2129,19 +2798,19 @@ public partial struct Application { [SerializeField, Tooltip(@"[appidx] application index.")] ulong @id; - + [SerializeField, Tooltip(@"Whether or not this application is currently deleted.")] Optional @deleted; - + [SerializeField, Tooltip(@"Round when this application was created.")] Optional @createdAtRound; - + [SerializeField, Tooltip(@"Round when this application was deleted.")] Optional @deletedAtRound; - + [SerializeField, Tooltip(@"[appparams] application parameters.")] ApplicationParams @params; - + /// /// [appidx] application index. /// @@ -2194,7 +2863,7 @@ public ApplicationParams Params public bool Equals(Application other) { - return + return Id.Equals(other.Id) && Deleted.Equals(other.Deleted) && CreatedAtRound.Equals(other.CreatedAtRound) && @@ -2202,6 +2871,16 @@ public bool Equals(Application other) Params.Equals(other.Params) ; } + + public static implicit operator Dotnet.Application(Application from) + { + return from.Convert().ToDotnet(); + } + + public static implicit operator Application(Dotnet.Application from) + { + return from.Convert().ToUnity(); + } } [AlgoApiObject, Serializable] @@ -2210,10 +2889,10 @@ public partial struct StateSchema { [SerializeField, Tooltip(@"Maximum number of TEAL uints that may be stored in the key/value store.")] ulong @numUint; - + [SerializeField, Tooltip(@"Maximum number of TEAL byte slices that may be stored in the key/value store.")] ulong @numByteSlice; - + /// /// Maximum number of TEAL uints that may be stored in the key/value store. /// @@ -2236,11 +2915,21 @@ public ulong NumByteSlice public bool Equals(StateSchema other) { - return + return NumUint.Equals(other.NumUint) && NumByteSlice.Equals(other.NumByteSlice) ; } + + public static implicit operator Dotnet.StateSchema(StateSchema from) + { + return from.Convert().ToDotnet(); + } + + public static implicit operator StateSchema(Dotnet.StateSchema from) + { + return from.Convert().ToUnity(); + } } [AlgoApiObject, Serializable] @@ -2249,22 +2938,22 @@ public partial struct ApplicationLocalState { [SerializeField, Tooltip(@"The application which this local state is for.")] ulong @id; - + [SerializeField, Tooltip(@"Whether or not the application local state is currently deleted from its account.")] Optional @deleted; - + [SerializeField, Tooltip(@"Round when the account opted into the application.")] Optional @optedInAtRound; - + [SerializeField, Tooltip(@"Round when account closed out of the application.")] Optional @closedOutAtRound; - + [SerializeField, Tooltip(@"[hsch] schema.")] ApplicationStateSchema @schema; - + [SerializeField, Tooltip(@"[tkv] storage.")] TealKeyValueStore @keyValue; - + /// /// The application which this local state is for. /// @@ -2327,7 +3016,7 @@ public TealKeyValueStore KeyValue public bool Equals(ApplicationLocalState other) { - return + return Id.Equals(other.Id) && Deleted.Equals(other.Deleted) && OptedInAtRound.Equals(other.OptedInAtRound) && @@ -2336,6 +3025,16 @@ public bool Equals(ApplicationLocalState other) KeyValue.Equals(other.KeyValue) ; } + + public static implicit operator Dotnet.ApplicationLocalState(ApplicationLocalState from) + { + return from.Convert().ToDotnet(); + } + + public static implicit operator ApplicationLocalState(Dotnet.ApplicationLocalState from) + { + return from.Convert().ToUnity(); + } } [AlgoApiObject, Serializable] @@ -2344,10 +3043,10 @@ public partial struct TransactionSignatureMultisigSubsignature { [SerializeField, Tooltip(@"[pk]")] byte[] @publicKey; - + [SerializeField, Tooltip(@"[s]")] byte[] @signature; - + /// /// [pk] /// @@ -2370,11 +3069,21 @@ public byte[] Signature public bool Equals(TransactionSignatureMultisigSubsignature other) { - return + return ArrayComparer.Equals(PublicKey, other.PublicKey) && ArrayComparer.Equals(Signature, other.Signature) ; } + + public static implicit operator Dotnet.TransactionSignatureMultisigSubsignature(TransactionSignatureMultisigSubsignature from) + { + return from.Convert().ToDotnet(); + } + + public static implicit operator TransactionSignatureMultisigSubsignature(Dotnet.TransactionSignatureMultisigSubsignature from) + { + return from.Convert().ToUnity(); + } } [AlgoApiObject, Serializable] @@ -2383,22 +3092,22 @@ public partial struct AccountParticipation { [SerializeField, Tooltip(@"[sel] Selection public key (if any) currently registered for this round.")] byte[] @selectionParticipationKey; - + [SerializeField, Tooltip(@"[voteFst] First round for which this participation is valid.")] ulong @voteFirstValid; - + [SerializeField, Tooltip(@"[voteKD] Number of subkeys in each batch of participation keys.")] ulong @voteKeyDilution; - + [SerializeField, Tooltip(@"[voteLst] Last round for which this participation is valid.")] ulong @voteLastValid; - + [SerializeField, Tooltip(@"[vote] root participation public key (if any) currently registered for this round.")] byte[] @voteParticipationKey; - + [SerializeField, Tooltip(@"[stprf] Root of the state proof key (if any)")] byte[] @stateProofKey; - + /// /// [sel] Selection public key (if any) currently registered for this round. /// @@ -2461,7 +3170,7 @@ public byte[] StateProofKey public bool Equals(AccountParticipation other) { - return + return ArrayComparer.Equals(SelectionParticipationKey, other.SelectionParticipationKey) && VoteFirstValid.Equals(other.VoteFirstValid) && VoteKeyDilution.Equals(other.VoteKeyDilution) && @@ -2470,6 +3179,16 @@ public bool Equals(AccountParticipation other) ArrayComparer.Equals(StateProofKey, other.StateProofKey) ; } + + public static implicit operator Dotnet.AccountParticipation(AccountParticipation from) + { + return from.Convert().ToDotnet(); + } + + public static implicit operator AccountParticipation(Dotnet.AccountParticipation from) + { + return from.Convert().ToUnity(); + } } [AlgoApiObject, Serializable] @@ -2478,22 +3197,22 @@ public partial struct TransactionAssetTransfer { [SerializeField, Tooltip(@"[aamt] Amount of asset to transfer. A zero amount transferred to self allocates that asset in the account's Assets map.")] ulong @amount; - + [SerializeField, Tooltip(@"[xaid] ID of the asset being transferred.")] ulong @assetId; - + [SerializeField, Tooltip(@"Number of assets transfered to the close-to account as part of the transaction.")] Optional @closeAmount; - + [SerializeField, Tooltip(@"[aclose] Indicates that the asset should be removed from the account's Assets map, and specifies where the remaining asset holdings should be transferred. It's always valid to transfer remaining asset holdings to the creator account.")] string @closeTo; - + [SerializeField, Tooltip(@"[arcv] Recipient address of the transfer.")] string @receiver; - + [SerializeField, Tooltip(@"[asnd] The effective sender during a clawback transactions. If this is not a zero value, the real transaction sender must be the Clawback address from the AssetParams.")] string @sender; - + /// /// [aamt] Amount of asset to transfer. A zero amount transferred to self allocates that asset in the account's Assets map. /// @@ -2556,7 +3275,7 @@ public string Sender public bool Equals(TransactionAssetTransfer other) { - return + return Amount.Equals(other.Amount) && AssetId.Equals(other.AssetId) && CloseAmount.Equals(other.CloseAmount) && @@ -2565,45 +3284,58 @@ public bool Equals(TransactionAssetTransfer other) StringComparer.Equals(Sender, other.Sender) ; } + + public static implicit operator Dotnet.TransactionAssetTransfer(TransactionAssetTransfer from) + { + return from.Convert().ToDotnet(); + } + + public static implicit operator TransactionAssetTransfer(Dotnet.TransactionAssetTransfer from) + { + return from.Convert().ToUnity(); + } } [AlgoApiObject, Serializable] public partial struct Transaction : IEquatable { + [SerializeField, Tooltip(@"")] + TransactionStateProof @stateProofTransaction; + [SerializeField, Tooltip(@"[fee] Transaction fee.")] ulong @fee; - + [SerializeField, Tooltip(@"")] TransactionAssetTransfer @assetTransferTransaction; - + [SerializeField, Tooltip(@"[grp] Base64 encoded byte array of a sha512/256 digest. When present indicates that this transaction is part of a transaction group and the value is the sha512/256 hash of the transactions in that group.")] byte[] @group; - + [SerializeField, Tooltip(@"Specifies an application index (ID) if an application was created with this transaction.")] Optional @createdApplicationIndex; - + [SerializeField, Tooltip(@"[lx] Base64 encoded 32-byte array. Lease enforces mutual exclusion of transactions. If this field is nonzero, then once the transaction is confirmed, it acquires the lease identified by the (Sender, Lease) pair of the transaction until the LastValid round passes. While this transaction possesses the lease, no other transaction specifying this lease can be confirmed.")] byte[] @lease; - + [SerializeField, Tooltip(@"[gh] Hash of genesis block.")] byte[] @genesisHash; - + [SerializeField, Tooltip(@"[lg] Logs for the application being executed by this transaction.")] byte[][] @logs; - + [SerializeField, Tooltip(@"[rs] rewards applied to sender account.")] Optional @senderRewards; - + [SerializeField, Tooltip(@"[ca] closing amount for transaction.")] Optional @closingAmount; - + [SerializeField, Tooltip(@"")] TransactionSignature @signature; - + [SerializeField, Tooltip(@"[gd] Global state key/value changes for the application being executed by this transaction.")] StateDelta @globalStateDelta; - + [SerializeField, Tooltip(@"[type] Indicates what type of transaction this is. Different types have different fields. Valid types, and where their fields are stored: @@ -2612,72 +3344,83 @@ public partial struct Transaction * [acfg] asset-config-transaction * [axfer] asset-transfer-transaction * [afrz] asset-freeze-transaction -* [appl] application-transaction")] - TransactionType @txType; - +* [appl] application-transaction +* [stpf] state-proof-transaction")] + string @txType; + [SerializeField, Tooltip(@"Offset into the round where this transaction was confirmed.")] Optional @intraRoundOffset; - + [SerializeField, Tooltip(@"")] TransactionPayment @paymentTransaction; - + [SerializeField, Tooltip(@"")] TransactionKeyreg @keyregTransaction; - + [SerializeField, Tooltip(@"Round when the transaction was confirmed.")] Optional @confirmedRound; - + [SerializeField, Tooltip(@"[note] Free form data.")] byte[] @note; - + [SerializeField, Tooltip(@"[rr] rewards applied to receiver account.")] Optional @receiverRewards; - + [SerializeField, Tooltip(@"Time when the block this transaction is in was confirmed.")] Optional @roundTime; - + [SerializeField, Tooltip(@"Inner transactions produced by application execution.")] Transaction[] @innerTxns; - + [SerializeField, Tooltip(@"")] TransactionAssetConfig @assetConfigTransaction; - + [SerializeField, Tooltip(@"[lv] Last valid round for this transaction.")] ulong @lastValid; - + [SerializeField, Tooltip(@"[rc] rewards applied to close-remainder-to account.")] Optional @closeRewards; - + [SerializeField, Tooltip(@"[ld] Local state key/value changes for the application being executed by this transaction.")] AccountStateDelta[] @localStateDelta; - + [SerializeField, Tooltip(@"Transaction ID")] string @id; - + [SerializeField, Tooltip(@"[sgnr] this is included with signed transactions when the signing address does not equal the sender. The backend can use this to ensure that auth addr is equal to the accounts auth addr.")] Address @authAddr; - + [SerializeField, Tooltip(@"[gen] genesis block ID.")] string @genesisId; - + [SerializeField, Tooltip(@"[snd] Sender's address.")] string @sender; - + [SerializeField, Tooltip(@"")] TransactionApplication @applicationTransaction; - + [SerializeField, Tooltip(@"Specifies an asset index (ID) if an asset was created with this transaction.")] Optional @createdAssetIndex; - + [SerializeField, Tooltip(@"[fv] First valid round for this transaction.")] ulong @firstValid; - + [SerializeField, Tooltip(@"[rekey] when included in a valid transaction, the accounts auth addr will be updated with this value and future signatures must be signed with the key represented by this address.")] Address @rekeyTo; - + [SerializeField, Tooltip(@"")] TransactionAssetFreeze @assetFreezeTransaction; - + + /// + /// + /// + [AlgoApiField("state-proof-transaction")] + public TransactionStateProof StateProofTransaction + { + get => this.@stateProofTransaction; + set => this.@stateProofTransaction = value; + } + /// /// [fee] Transaction fee. /// @@ -2797,10 +3540,11 @@ public StateDelta GlobalStateDelta /// * [acfg] asset-config-transaction /// * [axfer] asset-transfer-transaction /// * [afrz] asset-freeze-transaction - /// * [appl] application-transaction + /// * [appl] application-transaction + /// * [stpf] state-proof-transaction /// [AlgoApiField("tx-type")] - public TransactionType TxType + public string TxType { get => this.@txType; set => this.@txType = value; @@ -2997,61 +3741,203 @@ public ulong FirstValid } /// - /// [rekey] when included in a valid transaction, the accounts auth addr will be updated with this value and future signatures must be signed with the key represented by this address. + /// [rekey] when included in a valid transaction, the accounts auth addr will be updated with this value and future signatures must be signed with the key represented by this address. + /// + [AlgoApiField("rekey-to")] + public Address RekeyTo + { + get => this.@rekeyTo; + set => this.@rekeyTo = value; + } + + /// + /// + /// + [AlgoApiField("asset-freeze-transaction")] + public TransactionAssetFreeze AssetFreezeTransaction + { + get => this.@assetFreezeTransaction; + set => this.@assetFreezeTransaction = value; + } + + public bool Equals(Transaction other) + { + return + StateProofTransaction.Equals(other.StateProofTransaction) && + Fee.Equals(other.Fee) && + AssetTransferTransaction.Equals(other.AssetTransferTransaction) && + ArrayComparer.Equals(Group, other.Group) && + CreatedApplicationIndex.Equals(other.CreatedApplicationIndex) && + ArrayComparer.Equals(Lease, other.Lease) && + ArrayComparer.Equals(GenesisHash, other.GenesisHash) && + ArrayComparer.Equals(Logs, other.Logs) && + SenderRewards.Equals(other.SenderRewards) && + ClosingAmount.Equals(other.ClosingAmount) && + Signature.Equals(other.Signature) && + GlobalStateDelta.Equals(other.GlobalStateDelta) && + StringComparer.Equals(TxType, other.TxType) && + IntraRoundOffset.Equals(other.IntraRoundOffset) && + PaymentTransaction.Equals(other.PaymentTransaction) && + KeyregTransaction.Equals(other.KeyregTransaction) && + ConfirmedRound.Equals(other.ConfirmedRound) && + ArrayComparer.Equals(Note, other.Note) && + ReceiverRewards.Equals(other.ReceiverRewards) && + RoundTime.Equals(other.RoundTime) && + ArrayComparer.Equals(InnerTxns, other.InnerTxns) && + AssetConfigTransaction.Equals(other.AssetConfigTransaction) && + LastValid.Equals(other.LastValid) && + CloseRewards.Equals(other.CloseRewards) && + ArrayComparer.Equals(LocalStateDelta, other.LocalStateDelta) && + StringComparer.Equals(Id, other.Id) && + AuthAddr.Equals(other.AuthAddr) && + StringComparer.Equals(GenesisId, other.GenesisId) && + StringComparer.Equals(Sender, other.Sender) && + ApplicationTransaction.Equals(other.ApplicationTransaction) && + CreatedAssetIndex.Equals(other.CreatedAssetIndex) && + FirstValid.Equals(other.FirstValid) && + RekeyTo.Equals(other.RekeyTo) && + AssetFreezeTransaction.Equals(other.AssetFreezeTransaction) + ; + } + + public static implicit operator Dotnet.Transaction(Transaction from) + { + return from.Convert().ToDotnet(); + } + + public static implicit operator Transaction(Dotnet.Transaction from) + { + return from.Convert().ToUnity(); + } + } + + [AlgoApiObject, Serializable] + public partial struct TransactionStateProof + : IEquatable + { + [SerializeField, Tooltip(@"[sptype] Type of the state proof. Integer representing an entry defined in protocol/stateproof.go")] + Optional @stateProofType; + + [SerializeField, Tooltip(@"")] + StateProofFields @stateProof; + + [SerializeField, Tooltip(@"[spmsg]")] + IndexerStateProofMessage @message; + + /// + /// [sptype] Type of the state proof. Integer representing an entry defined in protocol/stateproof.go + /// + [AlgoApiField("state-proof-type")] + public Optional StateProofType + { + get => this.@stateProofType; + set => this.@stateProofType = value; + } + + /// + /// + /// + [AlgoApiField("state-proof")] + public StateProofFields StateProof + { + get => this.@stateProof; + set => this.@stateProof = value; + } + + /// + /// [spmsg] + /// + [AlgoApiField("message")] + public IndexerStateProofMessage Message + { + get => this.@message; + set => this.@message = value; + } + + public bool Equals(TransactionStateProof other) + { + return + StateProofType.Equals(other.StateProofType) && + StateProof.Equals(other.StateProof) && + Message.Equals(other.Message) + ; + } + } + + [AlgoApiObject, Serializable] + public partial struct StateProofSigSlot + : IEquatable + { + [SerializeField, Tooltip(@"")] + StateProofSignature @signature; + + [SerializeField, Tooltip(@"[l] The total weight of signatures in the lower-numbered slots.")] + Optional @lowerSigWeight; + + /// + /// + /// + [AlgoApiField("signature")] + public StateProofSignature Signature + { + get => this.@signature; + set => this.@signature = value; + } + + /// + /// [l] The total weight of signatures in the lower-numbered slots. + /// + [AlgoApiField("lower-sig-weight")] + public Optional LowerSigWeight + { + get => this.@lowerSigWeight; + set => this.@lowerSigWeight = value; + } + + public bool Equals(StateProofSigSlot other) + { + return + Signature.Equals(other.Signature) && + LowerSigWeight.Equals(other.LowerSigWeight) + ; + } + } + + [AlgoApiObject, Serializable] + public partial struct StateProofVerifier + : IEquatable + { + [SerializeField, Tooltip(@"[cmt] Represents the root of the vector commitment tree.")] + byte[] @commitment; + + [SerializeField, Tooltip(@"[lf] Key lifetime.")] + Optional @keyLifetime; + + /// + /// [cmt] Represents the root of the vector commitment tree. /// - [AlgoApiField("rekey-to")] - public Address RekeyTo + [AlgoApiField("commitment")] + public byte[] Commitment { - get => this.@rekeyTo; - set => this.@rekeyTo = value; + get => this.@commitment; + set => this.@commitment = value; } /// - /// + /// [lf] Key lifetime. /// - [AlgoApiField("asset-freeze-transaction")] - public TransactionAssetFreeze AssetFreezeTransaction + [AlgoApiField("key-lifetime")] + public Optional KeyLifetime { - get => this.@assetFreezeTransaction; - set => this.@assetFreezeTransaction = value; + get => this.@keyLifetime; + set => this.@keyLifetime = value; } - public bool Equals(Transaction other) + public bool Equals(StateProofVerifier other) { - return - Fee.Equals(other.Fee) && - AssetTransferTransaction.Equals(other.AssetTransferTransaction) && - ArrayComparer.Equals(Group, other.Group) && - CreatedApplicationIndex.Equals(other.CreatedApplicationIndex) && - ArrayComparer.Equals(Lease, other.Lease) && - ArrayComparer.Equals(GenesisHash, other.GenesisHash) && - ArrayComparer.Equals(Logs, other.Logs) && - SenderRewards.Equals(other.SenderRewards) && - ClosingAmount.Equals(other.ClosingAmount) && - Signature.Equals(other.Signature) && - GlobalStateDelta.Equals(other.GlobalStateDelta) && - TxType.Equals(other.TxType) && - IntraRoundOffset.Equals(other.IntraRoundOffset) && - PaymentTransaction.Equals(other.PaymentTransaction) && - KeyregTransaction.Equals(other.KeyregTransaction) && - ConfirmedRound.Equals(other.ConfirmedRound) && - ArrayComparer.Equals(Note, other.Note) && - ReceiverRewards.Equals(other.ReceiverRewards) && - RoundTime.Equals(other.RoundTime) && - ArrayComparer.Equals(InnerTxns, other.InnerTxns) && - AssetConfigTransaction.Equals(other.AssetConfigTransaction) && - LastValid.Equals(other.LastValid) && - CloseRewards.Equals(other.CloseRewards) && - ArrayComparer.Equals(LocalStateDelta, other.LocalStateDelta) && - StringComparer.Equals(Id, other.Id) && - AuthAddr.Equals(other.AuthAddr) && - StringComparer.Equals(GenesisId, other.GenesisId) && - StringComparer.Equals(Sender, other.Sender) && - ApplicationTransaction.Equals(other.ApplicationTransaction) && - CreatedAssetIndex.Equals(other.CreatedAssetIndex) && - FirstValid.Equals(other.FirstValid) && - RekeyTo.Equals(other.RekeyTo) && - AssetFreezeTransaction.Equals(other.AssetFreezeTransaction) + return + ArrayComparer.Equals(Commitment, other.Commitment) && + KeyLifetime.Equals(other.KeyLifetime) ; } } @@ -3062,49 +3948,49 @@ public partial struct AssetParams { [SerializeField, Tooltip(@"[df] Whether holdings of this asset are frozen by default.")] Optional @defaultFrozen; - + [SerializeField, Tooltip(@"The address that created this asset. This is the address where the parameters for this asset can be found, and also the address where unwanted asset units can be sent in the worst case.")] string @creator; - + [SerializeField, Tooltip(@"[dc] The number of digits to use after the decimal point when displaying this asset. If 0, the asset is not divisible. If 1, the base unit of the asset is in tenths. If 2, the base unit of the asset is in hundredths, and so on. This value must be between 0 and 19 (inclusive).")] ulong @decimals; - + [SerializeField, Tooltip(@"[f] Address of account used to freeze holdings of this asset. If empty, freezing is not permitted.")] string @freeze; - + [SerializeField, Tooltip(@"[r] Address of account holding reserve (non-minted) units of this asset.")] string @reserve; - + [SerializeField, Tooltip(@"Base64 encoded name of a unit of this asset, as supplied by the creator.")] byte[] @unitNameB64; - + [SerializeField, Tooltip(@"[an] Name of this asset, as supplied by the creator. Included only when the asset name is composed of printable utf-8 characters.")] string @name; - + [SerializeField, Tooltip(@"Base64 encoded URL where more information about the asset can be retrieved.")] byte[] @urlB64; - + [SerializeField, Tooltip(@"[t] The total number of units of this asset.")] ulong @total; - + [SerializeField, Tooltip(@"[m] Address of account used to manage the keys of this asset and to destroy it.")] string @manager; - + [SerializeField, Tooltip(@"Base64 encoded name of this asset, as supplied by the creator.")] byte[] @nameB64; - + [SerializeField, Tooltip(@"[au] URL where more information about the asset can be retrieved. Included only when the URL is composed of printable utf-8 characters.")] string @url; - + [SerializeField, Tooltip(@"[un] Name of a unit of this asset, as supplied by the creator. Included only when the name of a unit of this asset is composed of printable utf-8 characters.")] string @unitName; - + [SerializeField, Tooltip(@"[c] Address of account used to clawback holdings of this asset. If empty, clawback is not permitted.")] string @clawback; - + [SerializeField, Tooltip(@"[am] A commitment to some unspecified asset metadata. The format of this metadata is up to the application.")] byte[] @metadataHash; - + /// /// [df] Whether holdings of this asset are frozen by default. /// @@ -3257,7 +4143,7 @@ public byte[] MetadataHash public bool Equals(AssetParams other) { - return + return DefaultFrozen.Equals(other.DefaultFrozen) && StringComparer.Equals(Creator, other.Creator) && Decimals.Equals(other.Decimals) && @@ -3275,6 +4161,97 @@ public bool Equals(AssetParams other) ArrayComparer.Equals(MetadataHash, other.MetadataHash) ; } + + public static implicit operator Dotnet.AssetParams(AssetParams from) + { + return from.Convert().ToDotnet(); + } + + public static implicit operator AssetParams(Dotnet.AssetParams from) + { + return from.Convert().ToUnity(); + } + } + + [AlgoApiObject, Serializable] + public partial struct IndexerStateProofMessage + : IEquatable + { + [SerializeField, Tooltip(@"[b]")] + byte[] @blockHeadersCommitment; + + [SerializeField, Tooltip(@"[v]")] + byte[] @votersCommitment; + + [SerializeField, Tooltip(@"[P]")] + Optional @lnProvenWeight; + + [SerializeField, Tooltip(@"[f]")] + Optional @firstAttestedRound; + + [SerializeField, Tooltip(@"[l]")] + Optional @latestAttestedRound; + + /// + /// [b] + /// + [AlgoApiField("block-headers-commitment")] + public byte[] BlockHeadersCommitment + { + get => this.@blockHeadersCommitment; + set => this.@blockHeadersCommitment = value; + } + + /// + /// [v] + /// + [AlgoApiField("voters-commitment")] + public byte[] VotersCommitment + { + get => this.@votersCommitment; + set => this.@votersCommitment = value; + } + + /// + /// [P] + /// + [AlgoApiField("ln-proven-weight")] + public Optional LnProvenWeight + { + get => this.@lnProvenWeight; + set => this.@lnProvenWeight = value; + } + + /// + /// [f] + /// + [AlgoApiField("first-attested-round")] + public Optional FirstAttestedRound + { + get => this.@firstAttestedRound; + set => this.@firstAttestedRound = value; + } + + /// + /// [l] + /// + [AlgoApiField("latest-attested-round")] + public Optional LatestAttestedRound + { + get => this.@latestAttestedRound; + set => this.@latestAttestedRound = value; + } + + public bool Equals(IndexerStateProofMessage other) + { + return + ArrayComparer.Equals(BlockHeadersCommitment, other.BlockHeadersCommitment) && + ArrayComparer.Equals(VotersCommitment, other.VotersCommitment) && + LnProvenWeight.Equals(other.LnProvenWeight) && + FirstAttestedRound.Equals(other.FirstAttestedRound) && + LatestAttestedRound.Equals(other.LatestAttestedRound) + ; + } } [AlgoApiObject, Serializable] @@ -3283,19 +4260,19 @@ public partial struct BlockUpgradeState { [SerializeField, Tooltip(@"[proto] The current protocol version.")] string @currentProtocol; - + [SerializeField, Tooltip(@"[nextproto] The next proposed protocol version.")] string @nextProtocol; - + [SerializeField, Tooltip(@"[nextyes] Number of blocks which approved the protocol upgrade.")] Optional @nextProtocolApprovals; - + [SerializeField, Tooltip(@"[nextswitch] Round on which the protocol upgrade will take effect.")] Optional @nextProtocolSwitchOn; - + [SerializeField, Tooltip(@"[nextbefore] Deadline round for this protocol upgrade (No votes will be consider after this round).")] Optional @nextProtocolVoteBefore; - + /// /// [proto] The current protocol version. /// @@ -3348,7 +4325,7 @@ public Optional NextProtocolVoteBefore public bool Equals(BlockUpgradeState other) { - return + return StringComparer.Equals(CurrentProtocol, other.CurrentProtocol) && StringComparer.Equals(NextProtocol, other.NextProtocol) && NextProtocolApprovals.Equals(other.NextProtocolApprovals) && @@ -3356,6 +4333,69 @@ public bool Equals(BlockUpgradeState other) NextProtocolVoteBefore.Equals(other.NextProtocolVoteBefore) ; } + + public static implicit operator Dotnet.BlockUpgradeState(BlockUpgradeState from) + { + return from.Convert().ToDotnet(); + } + + public static implicit operator BlockUpgradeState(Dotnet.BlockUpgradeState from) + { + return from.Convert().ToUnity(); + } + } + + [AlgoApiObject, Serializable] + public partial struct MerkleArrayProof + : IEquatable + { + [SerializeField, Tooltip(@"[pth]")] + byte[][] @path; + + [SerializeField, Tooltip(@"")] + HashFactory @hashFactory; + + [SerializeField, Tooltip(@"[td]")] + Optional @treeDepth; + + /// + /// [pth] + /// + [AlgoApiField("path")] + public byte[][] Path + { + get => this.@path; + set => this.@path = value; + } + + /// + /// + /// + [AlgoApiField("hash-factory")] + public HashFactory HashFactory + { + get => this.@hashFactory; + set => this.@hashFactory = value; + } + + /// + /// [td] + /// + [AlgoApiField("tree-depth")] + public Optional TreeDepth + { + get => this.@treeDepth; + set => this.@treeDepth = value; + } + + public bool Equals(MerkleArrayProof other) + { + return + ArrayComparer.Equals(Path, other.Path) && + HashFactory.Equals(other.HashFactory) && + TreeDepth.Equals(other.TreeDepth) + ; + } } [AlgoApiObject, Serializable] @@ -3364,13 +4404,13 @@ public partial struct AssetHoldingsResponse { [SerializeField, Tooltip(@"Round at which the results were computed.")] ulong @currentRound; - + [SerializeField, Tooltip(@"Used for pagination, when making another request provide this token with the next parameter.")] string @nextToken; - + [SerializeField, Tooltip(@"")] AssetHolding[] @assets; - + /// /// Round at which the results were computed. /// @@ -3403,12 +4443,22 @@ public AssetHolding[] Assets public bool Equals(AssetHoldingsResponse other) { - return + return CurrentRound.Equals(other.CurrentRound) && StringComparer.Equals(NextToken, other.NextToken) && ArrayComparer.Equals(Assets, other.Assets) ; } + + public static implicit operator Dotnet.AssetHoldingsResponse(AssetHoldingsResponse from) + { + return from.Convert().ToDotnet(); + } + + public static implicit operator AssetHoldingsResponse(Dotnet.AssetHoldingsResponse from) + { + return from.Convert().ToUnity(); + } } [AlgoApiObject, Serializable] @@ -3417,10 +4467,10 @@ public partial struct ApplicationResponse { [SerializeField, Tooltip(@"")] Application @application; - + [SerializeField, Tooltip(@"Round at which the results were computed.")] ulong @currentRound; - + /// /// /// @@ -3443,11 +4493,21 @@ public ulong CurrentRound public bool Equals(ApplicationResponse other) { - return + return Application.Equals(other.Application) && CurrentRound.Equals(other.CurrentRound) ; } + + public static implicit operator Dotnet.ApplicationResponse(ApplicationResponse from) + { + return from.Convert().ToDotnet(); + } + + public static implicit operator ApplicationResponse(Dotnet.ApplicationResponse from) + { + return from.Convert().ToUnity(); + } } [AlgoApiObject, Serializable] @@ -3456,13 +4516,13 @@ public partial struct TransactionsResponse { [SerializeField, Tooltip(@"Round at which the results were computed.")] ulong @currentRound; - + [SerializeField, Tooltip(@"Used for pagination, when making another request provide this token with the next parameter.")] string @nextToken; - + [SerializeField, Tooltip(@"")] Transaction[] @transactions; - + /// /// Round at which the results were computed. /// @@ -3495,12 +4555,22 @@ public Transaction[] Transactions public bool Equals(TransactionsResponse other) { - return + return CurrentRound.Equals(other.CurrentRound) && StringComparer.Equals(NextToken, other.NextToken) && ArrayComparer.Equals(Transactions, other.Transactions) ; } + + public static implicit operator Dotnet.TransactionsResponse(TransactionsResponse from) + { + return from.Convert().ToDotnet(); + } + + public static implicit operator TransactionsResponse(Dotnet.TransactionsResponse from) + { + return from.Convert().ToUnity(); + } } [AlgoApiObject, Serializable] @@ -3509,13 +4579,13 @@ public partial struct AccountsResponse { [SerializeField, Tooltip(@"")] Account[] @accounts; - + [SerializeField, Tooltip(@"Round at which the results were computed.")] ulong @currentRound; - + [SerializeField, Tooltip(@"Used for pagination, when making another request provide this token with the next parameter.")] string @nextToken; - + /// /// /// @@ -3548,12 +4618,22 @@ public string NextToken public bool Equals(AccountsResponse other) { - return + return ArrayComparer.Equals(Accounts, other.Accounts) && CurrentRound.Equals(other.CurrentRound) && StringComparer.Equals(NextToken, other.NextToken) ; } + + public static implicit operator Dotnet.AccountsResponse(AccountsResponse from) + { + return from.Convert().ToDotnet(); + } + + public static implicit operator AccountsResponse(Dotnet.AccountsResponse from) + { + return from.Convert().ToUnity(); + } } [AlgoApiObject, Serializable] @@ -3562,10 +4642,10 @@ public partial struct AssetResponse { [SerializeField, Tooltip(@"")] Asset @asset; - + [SerializeField, Tooltip(@"Round at which the results were computed.")] ulong @currentRound; - + /// /// /// @@ -3588,11 +4668,21 @@ public ulong CurrentRound public bool Equals(AssetResponse other) { - return + return Asset.Equals(other.Asset) && CurrentRound.Equals(other.CurrentRound) ; } + + public static implicit operator Dotnet.AssetResponse(AssetResponse from) + { + return from.Convert().ToDotnet(); + } + + public static implicit operator AssetResponse(Dotnet.AssetResponse from) + { + return from.Convert().ToUnity(); + } } [AlgoApiObject, Serializable] @@ -3601,13 +4691,13 @@ public partial struct AssetBalancesResponse { [SerializeField, Tooltip(@"")] MiniAssetHolding[] @balances; - + [SerializeField, Tooltip(@"Round at which the results were computed.")] ulong @currentRound; - + [SerializeField, Tooltip(@"Used for pagination, when making another request provide this token with the next parameter.")] string @nextToken; - + /// /// /// @@ -3640,12 +4730,22 @@ public string NextToken public bool Equals(AssetBalancesResponse other) { - return + return ArrayComparer.Equals(Balances, other.Balances) && CurrentRound.Equals(other.CurrentRound) && StringComparer.Equals(NextToken, other.NextToken) ; } + + public static implicit operator Dotnet.AssetBalancesResponse(AssetBalancesResponse from) + { + return from.Convert().ToDotnet(); + } + + public static implicit operator AssetBalancesResponse(Dotnet.AssetBalancesResponse from) + { + return from.Convert().ToUnity(); + } } [AlgoApiObject, Serializable] @@ -3654,10 +4754,10 @@ public partial struct AccountResponse { [SerializeField, Tooltip(@"")] Account @account; - + [SerializeField, Tooltip(@"Round at which the results were computed.")] ulong @currentRound; - + /// /// /// @@ -3680,11 +4780,21 @@ public ulong CurrentRound public bool Equals(AccountResponse other) { - return + return Account.Equals(other.Account) && CurrentRound.Equals(other.CurrentRound) ; } + + public static implicit operator Dotnet.AccountResponse(AccountResponse from) + { + return from.Convert().ToDotnet(); + } + + public static implicit operator AccountResponse(Dotnet.AccountResponse from) + { + return from.Convert().ToUnity(); + } } [AlgoApiObject, Serializable] @@ -3693,13 +4803,13 @@ public partial struct ApplicationsResponse { [SerializeField, Tooltip(@"")] Application[] @applications; - + [SerializeField, Tooltip(@"Round at which the results were computed.")] ulong @currentRound; - + [SerializeField, Tooltip(@"Used for pagination, when making another request provide this token with the next parameter.")] string @nextToken; - + /// /// /// @@ -3732,12 +4842,22 @@ public string NextToken public bool Equals(ApplicationsResponse other) { - return + return ArrayComparer.Equals(Applications, other.Applications) && CurrentRound.Equals(other.CurrentRound) && StringComparer.Equals(NextToken, other.NextToken) ; } + + public static implicit operator Dotnet.ApplicationsResponse(ApplicationsResponse from) + { + return from.Convert().ToDotnet(); + } + + public static implicit operator ApplicationsResponse(Dotnet.ApplicationsResponse from) + { + return from.Convert().ToUnity(); + } } [AlgoApiObject, Serializable] @@ -3746,10 +4866,10 @@ public partial struct TransactionResponse { [SerializeField, Tooltip(@"")] Transaction @transaction; - + [SerializeField, Tooltip(@"Round at which the results were computed.")] ulong @currentRound; - + /// /// /// @@ -3772,11 +4892,21 @@ public ulong CurrentRound public bool Equals(TransactionResponse other) { - return + return Transaction.Equals(other.Transaction) && CurrentRound.Equals(other.CurrentRound) ; } + + public static implicit operator Dotnet.TransactionResponse(TransactionResponse from) + { + return from.Convert().ToDotnet(); + } + + public static implicit operator TransactionResponse(Dotnet.TransactionResponse from) + { + return from.Convert().ToUnity(); + } } [AlgoApiObject, Serializable] @@ -3785,16 +4915,16 @@ public partial struct ApplicationLogsResponse { [SerializeField, Tooltip(@"[appidx] application index.")] ulong @applicationId; - + [SerializeField, Tooltip(@"Round at which the results were computed.")] ulong @currentRound; - + [SerializeField, Tooltip(@"Used for pagination, when making another request provide this token with the next parameter.")] string @nextToken; - + [SerializeField, Tooltip(@"")] ApplicationLogData[] @logData; - + /// /// [appidx] application index. /// @@ -3837,13 +4967,23 @@ public ApplicationLogData[] LogData public bool Equals(ApplicationLogsResponse other) { - return + return ApplicationId.Equals(other.ApplicationId) && CurrentRound.Equals(other.CurrentRound) && StringComparer.Equals(NextToken, other.NextToken) && ArrayComparer.Equals(LogData, other.LogData) ; } + + public static implicit operator Dotnet.ApplicationLogsResponse(ApplicationLogsResponse from) + { + return from.Convert().ToDotnet(); + } + + public static implicit operator ApplicationLogsResponse(Dotnet.ApplicationLogsResponse from) + { + return from.Convert().ToUnity(); + } } [AlgoApiObject, Serializable] @@ -3852,13 +4992,13 @@ public partial struct AssetsResponse { [SerializeField, Tooltip(@"")] Asset[] @assets; - + [SerializeField, Tooltip(@"Round at which the results were computed.")] ulong @currentRound; - + [SerializeField, Tooltip(@"Used for pagination, when making another request provide this token with the next parameter.")] string @nextToken; - + /// /// /// @@ -3891,12 +5031,22 @@ public string NextToken public bool Equals(AssetsResponse other) { - return + return ArrayComparer.Equals(Assets, other.Assets) && CurrentRound.Equals(other.CurrentRound) && StringComparer.Equals(NextToken, other.NextToken) ; } + + public static implicit operator Dotnet.AssetsResponse(AssetsResponse from) + { + return from.Convert().ToDotnet(); + } + + public static implicit operator AssetsResponse(Dotnet.AssetsResponse from) + { + return from.Convert().ToUnity(); + } } [AlgoApiObject, Serializable] @@ -3905,13 +5055,13 @@ public partial struct ApplicationLocalStatesResponse { [SerializeField, Tooltip(@"")] ApplicationLocalState[] @appsLocalStates; - + [SerializeField, Tooltip(@"Round at which the results were computed.")] ulong @currentRound; - + [SerializeField, Tooltip(@"Used for pagination, when making another request provide this token with the next parameter.")] string @nextToken; - + /// /// /// @@ -3944,12 +5094,22 @@ public string NextToken public bool Equals(ApplicationLocalStatesResponse other) { - return + return ArrayComparer.Equals(AppsLocalStates, other.AppsLocalStates) && CurrentRound.Equals(other.CurrentRound) && StringComparer.Equals(NextToken, other.NextToken) ; } + + public static implicit operator Dotnet.ApplicationLocalStatesResponse(ApplicationLocalStatesResponse from) + { + return from.Convert().ToDotnet(); + } + + public static implicit operator ApplicationLocalStatesResponse(Dotnet.ApplicationLocalStatesResponse from) + { + return from.Convert().ToUnity(); + } } /// @@ -3978,7 +5138,7 @@ public bool Equals(StateDelta other) { return ArrayComparer.Equals(WrappedValue, other.WrappedValue); } - + public static implicit operator EvalDeltaKeyValue[](StateDelta wrapper) { return wrapper.WrappedValue; @@ -3989,7 +5149,7 @@ public bool Equals(StateDelta other) return new StateDelta(value); } } - + /// /// Represents a key-value store for use in an application. /// @@ -4016,7 +5176,7 @@ public bool Equals(TealKeyValueStore other) { return ArrayComparer.Equals(WrappedValue, other.WrappedValue); } - + public static implicit operator TealKeyValue[](TealKeyValueStore wrapper) { return wrapper.WrappedValue; @@ -4027,7 +5187,7 @@ public bool Equals(TealKeyValueStore other) return new TealKeyValueStore(value); } } - + /// /// (empty) /// @@ -4054,7 +5214,7 @@ public bool Equals(BlockResponse other) { return ArrayComparer.Equals(WrappedValue, other.WrappedValue); } - + public static implicit operator Block(BlockResponse wrapper) { return wrapper.WrappedValue; @@ -4065,7 +5225,7 @@ public bool Equals(BlockResponse other) return new BlockResponse(value); } } - + /// /// (empty) /// @@ -4092,7 +5252,7 @@ public bool Equals(HealthCheckResponse other) { return ArrayComparer.Equals(WrappedValue, other.WrappedValue); } - + public static implicit operator HealthCheck(HealthCheckResponse wrapper) { return wrapper.WrappedValue; @@ -4103,5 +5263,5 @@ public bool Equals(HealthCheckResponse other) return new HealthCheckResponse(value); } } - + } diff --git a/Runtime/CareBoo.AlgoSdk/NodeServices/Kmd/KmdClient.cs b/Runtime/CareBoo.AlgoSdk/NodeServices/Kmd/KmdClient.cs index d0d806970..26d0c2b06 100644 --- a/Runtime/CareBoo.AlgoSdk/NodeServices/Kmd/KmdClient.cs +++ b/Runtime/CareBoo.AlgoSdk/NodeServices/Kmd/KmdClient.cs @@ -13,7 +13,6 @@ namespace AlgoSdk /// The kmd service is responsible for managing keys and wallets /// [Serializable] - [Obsolete("Please use Algorand.Kmd.DefaultApi instead.")] public partial struct KmdClient : IKmdClient { [SerializeField] diff --git a/Runtime/CareBoo.AlgoSdk/SmartContracts/CompiledTeal.cs b/Runtime/CareBoo.AlgoSdk/SmartContracts/CompiledTeal.cs index 8d217f65b..2c8d774cd 100644 --- a/Runtime/CareBoo.AlgoSdk/SmartContracts/CompiledTeal.cs +++ b/Runtime/CareBoo.AlgoSdk/SmartContracts/CompiledTeal.cs @@ -73,5 +73,15 @@ public bool Equals(byte[] other) public static implicit operator CompiledTeal(NativeArray.ReadOnly x) => x.ToArray(); public static implicit operator CompiledTeal(NativeList x) => x.ToArray(); + + public static implicit operator Algorand.TEALProgram(CompiledTeal from) + { + return from.Convert().ToDotnet(); + } + + public static implicit operator CompiledTeal(Algorand.TEALProgram from) + { + return from.Convert().ToUnity(); + } } } diff --git a/Tests/Runtime/CareBoo.AlgoSdk.IntegrationTests/Algod/AlgodClientTest.cs b/Tests/Runtime/CareBoo.AlgoSdk.IntegrationTests/Algod/AlgodClientTest.cs index 035308307..041f2059a 100644 --- a/Tests/Runtime/CareBoo.AlgoSdk.IntegrationTests/Algod/AlgodClientTest.cs +++ b/Tests/Runtime/CareBoo.AlgoSdk.IntegrationTests/Algod/AlgodClientTest.cs @@ -81,15 +81,6 @@ public class AlgodClientTest : AlgodClientTestFixture AssertOkay(response.Error); }); - [UnityTest] - public IEnumerator GetMerkleProofShouldReturnOkay() => UniTask.ToCoroutine(async () => - { - PostTransactionsResponse txid = await MakePaymentTransaction(100000); - var pendingTxn = await WaitForTransaction(txid.TxId); - var response = await AlgoApiClientSettings.Algod.GetProof(pendingTxn.ConfirmedRound, txid.TxId); - AssertOkay(response.Error); - }); - [UnityTest] public IEnumerator TransferFundsShouldReturnTransactionId() => UniTask.ToCoroutine(async () => { diff --git a/Tests/Runtime/CareBoo.AlgoSdk.IntegrationTests/DotnetSdk/Algod/DotnetAlgodClient.cs b/Tests/Runtime/CareBoo.AlgoSdk.IntegrationTests/DotnetSdk/Algod/DotnetAlgodClient.cs index 88dd0ac81..2a51dd6a6 100644 --- a/Tests/Runtime/CareBoo.AlgoSdk.IntegrationTests/DotnetSdk/Algod/DotnetAlgodClient.cs +++ b/Tests/Runtime/CareBoo.AlgoSdk.IntegrationTests/DotnetSdk/Algod/DotnetAlgodClient.cs @@ -134,16 +134,6 @@ public AlgoApiRequest.Sent GetPendingTransactionsBy return new AlgoApiRequest.Sent(oneTimeClient.SentWebRequest); } - public AlgoApiRequest.Sent GetProof(ulong round, string txid, string hashtype = null, ResponseFormat format = ResponseFormat.None) - { - if (!string.IsNullOrEmpty(hashtype)) - throw new NotImplementedException(); - var oneTimeClient = new AlgodApiClient(address, token, headers); - oneTimeClient.Api.GetProofAsync(round, txid, format.ToDotNetFormat()); - oneTimeClient.DisposeOnFinish().Forget(); - return new AlgoApiRequest.Sent(oneTimeClient.SentWebRequest); - } - public AlgoApiRequest.Sent GetStatus() { var oneTimeClient = new AlgodApiClient(address, token, headers); @@ -246,4 +236,24 @@ public AlgoApiRequest.Sent WaitForBlock(ulong round) oneTimeClient.DisposeOnFinish().Forget(); return new AlgoApiRequest.Sent(oneTimeClient.SentWebRequest); } + + public AlgoApiRequest.Sent GetTransactionProof(ulong round, string txid, string hashtype = null, ResponseFormat format = ResponseFormat.None) + { + throw new NotImplementedException(); + } + + public AlgoApiRequest.Sent GetLightBlockHeaderProof(ulong round) + { + throw new NotImplementedException(); + } + + public AlgoApiRequest.Sent GetStateProof(ulong round) + { + throw new NotImplementedException(); + } + + public AlgoApiRequest.Sent GetBlockHash(ulong round) + { + throw new NotImplementedException(); + } } diff --git a/Tests/Runtime/CareBoo.AlgoSdk.IntegrationTests/DotnetSdk/UnityHttpMessageHandler.cs b/Tests/Runtime/CareBoo.AlgoSdk.IntegrationTests/DotnetSdk/UnityHttpMessageHandler.cs index e0f36b83d..5d30c1435 100644 --- a/Tests/Runtime/CareBoo.AlgoSdk.IntegrationTests/DotnetSdk/UnityHttpMessageHandler.cs +++ b/Tests/Runtime/CareBoo.AlgoSdk.IntegrationTests/DotnetSdk/UnityHttpMessageHandler.cs @@ -1,13 +1,13 @@ using System.Collections; using System.Collections.Generic; +using System.Linq; +using System.Net; using System.Net.Http; using System.Threading; using System.Threading.Tasks; +using Cysharp.Threading.Tasks; using UnityEngine; using UnityEngine.Networking; -using Cysharp.Threading.Tasks; -using System.Net; -using System.Linq; public class UnityHttpMessageHandler : HttpMessageHandler { @@ -41,19 +41,17 @@ CancellationToken cancellationToken LastAsyncOperation = unityWebRequest.SendWebRequest(); Debug.Log("Sent webrequest"); await LastAsyncOperation.WithCancellation(cancellationToken); - var responseMessage = new HttpResponseMessage((HttpStatusCode)unityWebRequest.responseCode) - { - Content = new ByteArrayContent(unityWebRequest.downloadHandler.data) - }; + var responseCode = (HttpStatusCode)unityWebRequest.responseCode; + var responseContent = new ByteArrayContent(unityWebRequest.downloadHandler.data); + var responseMessage = new HttpResponseMessage(responseCode) { Content = responseContent }; foreach (var header in unityWebRequest.GetResponseHeaders()) { try { - var headerLower = header.Key.ToLower(); - if (headerLower is not "content-type" && headerLower is not "content-length") - responseMessage.Headers.Add(header.Key, header.Value); - else + if (IsContentHeader(header)) responseMessage.Content.Headers.Add(header.Key, header.Value); + else + responseMessage.Headers.Add(header.Key, header.Value); } catch { @@ -63,4 +61,10 @@ CancellationToken cancellationToken } return responseMessage; } + + private static bool IsContentHeader(KeyValuePair header) + { + var headerKeyLower = header.Key.ToLower(); + return headerKeyLower == "content-type" || headerKeyLower == "content-Length"; + } } diff --git a/Unity.AlgoSdk.Package/ProjectSettings/PackageManagerSettings.asset b/Unity.AlgoSdk.Package/ProjectSettings/PackageManagerSettings.asset index 7ab44f7fb..04343c4a9 100644 --- a/Unity.AlgoSdk.Package/ProjectSettings/PackageManagerSettings.asset +++ b/Unity.AlgoSdk.Package/ProjectSettings/PackageManagerSettings.asset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d7d0aa56f19c95798f2d05a44940309b9676fe02dc7ec5453d3ee3b434713bbe -size 1136 +oid sha256:00a1b3d48b465d8c8db53f20da1f87d8a65b96f51f96a7e2d980681ce350fecb +size 1188 diff --git a/Unity.AlgoSdk.Package/ProjectSettings/ProjectVersion.txt b/Unity.AlgoSdk.Package/ProjectSettings/ProjectVersion.txt index 8d9054dca..e83d161a1 100755 --- a/Unity.AlgoSdk.Package/ProjectSettings/ProjectVersion.txt +++ b/Unity.AlgoSdk.Package/ProjectSettings/ProjectVersion.txt @@ -1,2 +1,2 @@ -m_EditorVersion: 2021.3.9f1 -m_EditorVersionWithRevision: 2021.3.9f1 (ad3870b89536) +m_EditorVersion: 2021.3.13f1 +m_EditorVersionWithRevision: 2021.3.13f1 (9e7d58001ecf) diff --git a/Unity.AlgoSdk.Package/ProjectSettings/TimelineSettings.asset b/Unity.AlgoSdk.Package/ProjectSettings/TimelineSettings.asset index c6c19d580..bec00b3aa 100644 --- a/Unity.AlgoSdk.Package/ProjectSettings/TimelineSettings.asset +++ b/Unity.AlgoSdk.Package/ProjectSettings/TimelineSettings.asset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:4333bb60f63529ab4ad88b65fe5dfaf7af05a7b4f2b9d64ad4e970ad17cc1514 -size 411 +oid sha256:1c63fbda5a79fb6a2ee33f5c664a234633dd0f9524e8669cb28dc82132047309 +size 436