diff --git a/src/Agent/Standards/ICRC1/ICRC1Client.cs b/src/Agent/Standards/ICRC1/ICRC1Client.cs new file mode 100644 index 00000000..2a75f2db --- /dev/null +++ b/src/Agent/Standards/ICRC1/ICRC1Client.cs @@ -0,0 +1,131 @@ +using EdjCase.ICP.Agent.Agents; +using EdjCase.ICP.Agent.Standards.ICRC1.Models; +using EdjCase.ICP.Candid.Mapping; +using EdjCase.ICP.Candid.Models; +using System.Collections.Generic; +using System.Threading.Tasks; + +namespace EdjCase.ICP.Agent.Standards.ICRC1 +{ + public class ICRC1Client + { + public IAgent Agent { get; } + + public Principal CanisterId { get; } + + public ICRC1Client(IAgent agent, Principal canisterId) + { + this.Agent = agent; + this.CanisterId = canisterId; + } + + public async Task> MetaData() + { + CandidArg arg = CandidArg.FromCandid(); + Responses.QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "icrc1_meta_data", arg); + CandidArg reply = response.ThrowOrGetReply(); + return reply.ToObjects>(); + } + + public async Task Name() + { + CandidArg arg = CandidArg.FromCandid(); + Responses.QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "icrc1_name", arg); + CandidArg reply = response.ThrowOrGetReply(); + return reply.ToObjects(); + } + + public async Task Symbol() + { + CandidArg arg = CandidArg.FromCandid(); + Responses.QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "icrc1_symbol", arg); + CandidArg reply = response.ThrowOrGetReply(); + return reply.ToObjects(); + } + + public async Task Decimals() + { + CandidArg arg = CandidArg.FromCandid(); + Responses.QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "icrc1_decimals", arg); + CandidArg reply = response.ThrowOrGetReply(); + return reply.ToObjects(); + } + + public async Task Fee() + { + CandidArg arg = CandidArg.FromCandid(); + Responses.QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "icrc1_fee", arg); + CandidArg reply = response.ThrowOrGetReply(); + return reply.ToObjects(); + } + + public async Task TotalSupply() + { + CandidArg arg = CandidArg.FromCandid(); + Responses.QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "icrc1_total_supply", arg); + CandidArg reply = response.ThrowOrGetReply(); + return reply.ToObjects(); + } + + public async Task> MintingAccount() + { + CandidArg arg = CandidArg.FromCandid(); + Responses.QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "icrc1_minting_account", arg); + CandidArg reply = response.ThrowOrGetReply(); + return reply.ToObjects>(); + } + + public async Task BalanceOf(Account arg0) + { + CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); + Responses.QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "icrc1_balance_of", arg); + CandidArg reply = response.ThrowOrGetReply(); + return reply.ToObjects(); + } + + public async Task Transfer(TransferArgs arg0) + { + CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); + CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "icrc1_transfer", arg); + return reply.ToObjects(); + } + + public async Task> SupportedStandards() + { + CandidArg arg = CandidArg.FromCandid(); + Responses.QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "icrc1_supported_standards", arg); + CandidArg reply = response.ThrowOrGetReply(); + return reply.ToObjects>(); + } + } + + public class SupportedStandard + { + [CandidName("name")] + public string Name { get; } + + [CandidName("url")] + public string Url { get; } + } + + public class MetaData + { + [CandidName("0")] + public string Key { get; set; } + + [CandidName("1")] + public MetaDataValue Value { get; set; } + + public MetaData(string key, MetaDataValue value) + { + this.Key = key; + this.Value = value; + } + } + + public class MetaDataValue + { + + } + +} \ No newline at end of file diff --git a/src/Agent/Standards/ICRC1/Models/Account.cs b/src/Agent/Standards/ICRC1/Models/Account.cs new file mode 100644 index 00000000..5f1de4e5 --- /dev/null +++ b/src/Agent/Standards/ICRC1/Models/Account.cs @@ -0,0 +1,22 @@ +using Timestamp = System.UInt64; +using Duration = System.UInt64; +using Subaccount = System.Collections.Generic.List; +using EdjCase.ICP.Agent.Agents; + +namespace EdjCase.ICP.Agent.Standards.ICRC1.Models +{ + public class Account + { + [Candid.Mapping.CandidName("owner")] + public Candid.Models.Principal Owner { get; set; } + + [Candid.Mapping.CandidName("subaccount")] + public Candid.Models.OptionalValue Subaccount { get; set; } + + public Account(Candid.Models.Principal owner, Candid.Models.OptionalValue subaccount) + { + this.Owner = owner; + this.Subaccount = subaccount; + } + } +} \ No newline at end of file diff --git a/src/Agent/Standards/ICRC1/Models/MetaDataValue.cs b/src/Agent/Standards/ICRC1/Models/MetaDataValue.cs new file mode 100644 index 00000000..cdc62f1e --- /dev/null +++ b/src/Agent/Standards/ICRC1/Models/MetaDataValue.cs @@ -0,0 +1,97 @@ +using Timestamp = System.UInt64; +using Duration = System.UInt64; +using Subaccount = System.Collections.Generic.List; +using EdjCase.ICP.Agent.Agents; +using EdjCase.ICP.Candid.Mapping; +using EdjCase.ICP.Candid.Models; + +namespace EdjCase.ICP.Agent.Standards.ICRC1.Models +{ + [Variant(typeof(ValueTag))] + public class MetaDataValue + { + [VariantTagProperty] + public ValueTag Tag { get; set; } + + [VariantValueProperty] + private object? Value { get; set; } + + public MetaDataValue(ValueTag tag, object? value) + { + this.Tag = tag; + this.Value = value; + } + + protected MetaDataValue() + { + } + + public static MetaDataValue Nat(UnboundedUInt info) + { + return new MetaDataValue(ValueTag.Nat, info); + } + + public static MetaDataValue Int(UnboundedInt info) + { + return new MetaDataValue(ValueTag.Int, info); + } + + public static MetaDataValue Text(string info) + { + return new MetaDataValue(ValueTag.Text, info); + } + + public static MetaDataValue Blob(Subaccount info) + { + return new MetaDataValue(ValueTag.Blob, info); + } + + public UnboundedUInt AsNat() + { + this.ValidateTag(ValueTag.Nat); + return (UnboundedUInt)this.Value!; + } + + public UnboundedInt AsInt() + { + this.ValidateTag(ValueTag.Int); + return (UnboundedInt)this.Value!; + } + + public string AsText() + { + this.ValidateTag(ValueTag.Text); + return (string)this.Value!; + } + + public Subaccount AsBlob() + { + this.ValidateTag(ValueTag.Blob); + return (Subaccount)this.Value!; + } + + private void ValidateTag(ValueTag tag) + { + if (!this.Tag.Equals(tag)) + { + throw new System.InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); + } + } + } + + public enum ValueTag + { + [CandidName("Nat")] + [VariantOptionType(typeof(UnboundedUInt))] + Nat, + [CandidName("Int")] + [VariantOptionType(typeof(UnboundedInt))] + Int, + [CandidName("Text")] + [VariantOptionType(typeof(string))] + Text, + [CandidName("Blob")] + [VariantOptionType(typeof(Subaccount))] + Blob + } +} \ No newline at end of file diff --git a/src/Agent/Standards/ICRC1/Models/TransferArgs.cs b/src/Agent/Standards/ICRC1/Models/TransferArgs.cs new file mode 100644 index 00000000..3d4a938f --- /dev/null +++ b/src/Agent/Standards/ICRC1/Models/TransferArgs.cs @@ -0,0 +1,40 @@ +using Timestamp = System.UInt64; +using Duration = System.UInt64; +using Subaccount = System.Collections.Generic.List; +using EdjCase.ICP.Agent.Agents; +using EdjCase.ICP.Candid.Models; +using EdjCase.ICP.Candid.Mapping; + +namespace EdjCase.ICP.Agent.Standards.ICRC1.Models +{ + public class TransferArgs + { + [CandidName("from_subaccount")] + public OptionalValue FromSubaccount { get; set; } + + [CandidName("to")] + public Account To { get; set; } + + [CandidName("amount")] + public UnboundedUInt Amount { get; set; } + + [CandidName("fee")] + public OptionalValue Fee { get; set; } + + [CandidName("memo")] + public OptionalValue Memo { get; set; } + + [CandidName("created_at_time")] + public OptionalValue CreatedAtTime { get; set; } + + public TransferArgs(OptionalValue fromSubaccount, Account to, UnboundedUInt amount, OptionalValue fee, OptionalValue memo, OptionalValue createdAtTime) + { + this.FromSubaccount = fromSubaccount; + this.To = to; + this.Amount = amount; + this.Fee = fee; + this.Memo = memo; + this.CreatedAtTime = createdAtTime; + } + } +} \ No newline at end of file diff --git a/src/Agent/Standards/ICRC1/Models/TransferError.cs b/src/Agent/Standards/ICRC1/Models/TransferError.cs new file mode 100644 index 00000000..45fc8658 --- /dev/null +++ b/src/Agent/Standards/ICRC1/Models/TransferError.cs @@ -0,0 +1,209 @@ +using Timestamp = System.UInt64; +using Duration = System.UInt64; +using Subaccount = System.Collections.Generic.List; +using EdjCase.ICP.Agent.Agents; +using EdjCase.ICP.Candid.Mapping; +using EdjCase.ICP.Candid.Models; + +namespace EdjCase.ICP.Agent.Standards.ICRC1.Models +{ + [Variant(typeof(TransferErrorTag))] + public class TransferError + { + [VariantTagProperty()] + public TransferErrorTag Tag { get; set; } + + [VariantValueProperty()] + private object? Value { get; set; } + + public TransferError(TransferErrorTag tag, object? value) + { + this.Tag = tag; + this.Value = value; + } + + protected TransferError() + { + } + + public static TransferError BadFee(BadFeeError info) + { + return new TransferError(TransferErrorTag.BadFee, info); + } + + public static TransferError BadBurn(BadBurnError info) + { + return new TransferError(TransferErrorTag.BadBurn, info); + } + + public static TransferError InsufficientFunds(InsufficientFundsError info) + { + return new TransferError(TransferErrorTag.InsufficientFunds, info); + } + + public static TransferError TooOld() + { + return new TransferError(TransferErrorTag.TooOld, null); + } + + public static TransferError CreatedInFuture(CreatedInFutureError info) + { + return new TransferError(TransferErrorTag.CreatedInFuture, info); + } + + public static TransferError Duplicate(DuplicateError info) + { + return new TransferError(TransferErrorTag.Duplicate, info); + } + + public static TransferError TemporarilyUnavailable() + { + return new TransferError(TransferErrorTag.TemporarilyUnavailable, null); + } + + public static TransferError GenericError(GenericError info) + { + return new TransferError(TransferErrorTag.GenericError, info); + } + + public BadFeeError AsBadFee() + { + this.ValidateTag(TransferErrorTag.BadFee); + return (BadFeeError)this.Value!; + } + + public BadBurnError AsBadBurn() + { + this.ValidateTag(TransferErrorTag.BadBurn); + return (BadBurnError)this.Value!; + } + + public InsufficientFundsError AsInsufficientFunds() + { + this.ValidateTag(TransferErrorTag.InsufficientFunds); + return (InsufficientFundsError)this.Value!; + } + + public CreatedInFutureError AsCreatedInFuture() + { + this.ValidateTag(TransferErrorTag.CreatedInFuture); + return (CreatedInFutureError)this.Value!; + } + + public DuplicateError AsDuplicate() + { + this.ValidateTag(TransferErrorTag.Duplicate); + return (DuplicateError)this.Value!; + } + + public GenericError AsGenericError() + { + this.ValidateTag(TransferErrorTag.GenericError); + return (GenericError)this.Value!; + } + + private void ValidateTag(TransferErrorTag tag) + { + if (!this.Tag.Equals(tag)) + { + throw new System.InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); + } + } + } + + public class BadFeeError + { + [CandidName("expected_fee")] + public UnboundedUInt ExpectedFee { get; set; } + + public BadFeeError(UnboundedUInt expectedFee) + { + this.ExpectedFee = expectedFee; + } + } + + public class BadBurnError + { + [CandidName("min_burn_amount")] + public UnboundedUInt MinBurnAmount { get; set; } + + public BadBurnError(UnboundedUInt minBurnAmount) + { + this.MinBurnAmount = minBurnAmount; + } + } + + public class InsufficientFundsError + { + [CandidName("balance")] + public UnboundedUInt Balance { get; set; } + + public InsufficientFundsError(UnboundedUInt balance) + { + this.Balance = balance; + } + } + + public class CreatedInFutureError + { + [CandidName("ledger_time")] + public Timestamp LedgerTime { get; set; } + + public CreatedInFutureError(Timestamp ledgerTime) + { + this.LedgerTime = ledgerTime; + } + } + + public class DuplicateError + { + [CandidName("duplicate_of")] + public UnboundedUInt DuplicateOf { get; set; } + + public DuplicateError(UnboundedUInt duplicateOf) + { + this.DuplicateOf = duplicateOf; + } + } + + public class GenericError + { + [CandidName("error_code")] + public UnboundedUInt ErrorCode { get; set; } + + [CandidName("message")] + public string Message { get; set; } + + public GenericError(UnboundedUInt errorCode, string message) + { + this.ErrorCode = errorCode; + this.Message = message; + } + } + + public enum TransferErrorTag + { + [CandidName("BadFee")] + [VariantOptionType(typeof(BadFeeError))] + BadFee, + [CandidName("BadBurn")] + [VariantOptionType(typeof(BadBurnError))] + BadBurn, + [CandidName("InsufficientFunds")] + [VariantOptionType(typeof(InsufficientFundsError))] + InsufficientFunds, + [CandidName("TooOld")] + TooOld, + [CandidName("CreatedInFuture")] + [VariantOptionType(typeof(CreatedInFutureError))] + CreatedInFuture, + [CandidName("Duplicate")] + [VariantOptionType(typeof(DuplicateError))] + Duplicate, + [CandidName("TemporarilyUnavailable")] + TemporarilyUnavailable, + [CandidName("GenericError")] + [VariantOptionType(typeof(GenericError))] + GenericError + } +} \ No newline at end of file diff --git a/src/Agent/Standards/ICRC1/Models/TransferResult.cs b/src/Agent/Standards/ICRC1/Models/TransferResult.cs new file mode 100644 index 00000000..2bd3f175 --- /dev/null +++ b/src/Agent/Standards/ICRC1/Models/TransferResult.cs @@ -0,0 +1,71 @@ +using EdjCase.ICP.Candid.Mapping; +using EdjCase.ICP.Candid.Models; +using System; +using System.Collections.Generic; +using System.Text; + +namespace EdjCase.ICP.Agent.Standards.ICRC1.Models +{ + + [Variant(typeof(TransferResultTag))] + public class TransferResult + { + [VariantTagProperty] + public TransferResultTag Tag { get; set; } + + [VariantValueProperty] + private object? Value { get; set; } + + private TransferResult(TransferResultTag tag, object? value) + { + this.Tag = tag; + this.Value = value; + } + + private TransferResult() + { + } + + public static TransferResult Ok(UnboundedUInt info) + { + return new TransferResult(TransferResultTag.Ok, info); + } + + public static TransferResult Err(TransferError info) + { + return new TransferResult(TransferResultTag.Err, info); + } + + public UnboundedUInt AsOk() + { + this.ValidateTag(TransferResultTag.Ok); + return (UnboundedUInt)this.Value!; + } + + public TransferError AsErr() + { + this.ValidateTag(TransferResultTag.Err); + return (TransferError)this.Value!; + } + + private void ValidateTag(TransferResultTag tag) + { + if (!this.Tag.Equals(tag)) + { + throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); + } + } + } + + public enum TransferResultTag + { + [CandidName("Ok")] + [VariantOptionType(typeof(UnboundedUInt))] + Ok, + [CandidName("Err")] + [VariantOptionType(typeof(TransferError))] + Err + } + + +} diff --git a/src/ClientGenerator/RoslynTypeResolver.cs b/src/ClientGenerator/RoslynTypeResolver.cs index e021a2cb..111e7750 100644 --- a/src/ClientGenerator/RoslynTypeResolver.cs +++ b/src/ClientGenerator/RoslynTypeResolver.cs @@ -683,7 +683,7 @@ RoslynTypeResolver typeResolver .ToList(); BlockSyntax body = GenerateFuncMethodBody( - methodName: name.PascalCaseValue, + methodName: name, argTypes, returnTypes, isQuery: info.IsQuery, @@ -711,7 +711,7 @@ RoslynTypeResolver typeResolver } private static BlockSyntax GenerateFuncMethodBody( - string methodName, + ValueName methodName, List argTypes, List returnTypes, bool isQuery, @@ -794,7 +794,7 @@ RoslynTypeResolver typeResolver { const string responseName = "response"; // `QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, {methodName}, arg);` - StatementSyntax invokeQueryCall = GenerateQueryCall(methodName, argName, responseName); + StatementSyntax invokeQueryCall = GenerateQueryCall(methodName.CandidName, argName, responseName); statements.Add(invokeQueryCall); // `CandidArg reply = response.ThrowOrGetReply();` @@ -805,7 +805,7 @@ RoslynTypeResolver typeResolver else { // `CandidArg reply = this.Agent.CallAndWaitAsync(this.CanisterId, {methodName}, arg)` - StatementSyntax invokeCallAndWait = GenerateCallAndWait(methodName, argName, variableName); + StatementSyntax invokeCallAndWait = GenerateCallAndWait(methodName.CandidName, argName, variableName); statements.Add(invokeCallAndWait); } diff --git a/test/Common.Tests/Generators/__snapshots__/Dex.snap b/test/Common.Tests/Generators/__snapshots__/Dex.snap index 33b1a7c7..f87215ed 100644 --- a/test/Common.Tests/Generators/__snapshots__/Dex.snap +++ b/test/Common.Tests/Generators/__snapshots__/Dex.snap @@ -2,7 +2,7 @@ "Name": { "HasPrefix": false }, - "ClientFile": "using Token = EdjCase.ICP.Candid.Models.Principal;\nusing OrderId = System.UInt32;\nusing EdjCase.ICP.Agent.Agents;\n\nnamespace Test\n{\n\tpublic class DexApiClient\n\t{\n\t\tpublic EdjCase.ICP.Agent.Agents.IAgent Agent { get; }\n\n\t\tpublic EdjCase.ICP.Candid.Models.Principal CanisterId { get; }\n\n\t\tpublic DexApiClient(EdjCase.ICP.Agent.Agents.IAgent agent, EdjCase.ICP.Candid.Models.Principal canisterId)\n\t\t{\n\t\t\tthis.Agent = agent;\n\t\t\tthis.CanisterId = canisterId;\n\t\t}\n\n\t\tpublic async System.Threading.Tasks.Task CancelOrder(OrderId arg0)\n\t\t{\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg arg = EdjCase.ICP.Candid.Models.CandidArg.FromCandid(EdjCase.ICP.Candid.Models.CandidTypedValue.FromObject(arg0));\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, \"CancelOrder\", arg);\n\t\t\treturn reply.ToObjects();\n\t\t}\n\n\t\tpublic async System.Threading.Tasks.Task Clear()\n\t\t{\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg arg = EdjCase.ICP.Candid.Models.CandidArg.FromCandid();\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, \"Clear\", arg);\n\t\t}\n\n\t\tpublic async System.Threading.Tasks.Task Credit(EdjCase.ICP.Candid.Models.Principal arg0, Token arg1, EdjCase.ICP.Candid.Models.UnboundedUInt arg2)\n\t\t{\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg arg = EdjCase.ICP.Candid.Models.CandidArg.FromCandid(EdjCase.ICP.Candid.Models.CandidTypedValue.FromObject(arg0), EdjCase.ICP.Candid.Models.CandidTypedValue.FromObject(arg1), EdjCase.ICP.Candid.Models.CandidTypedValue.FromObject(arg2));\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, \"Credit\", arg);\n\t\t}\n\n\t\tpublic async System.Threading.Tasks.Task Deposit(Token arg0)\n\t\t{\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg arg = EdjCase.ICP.Candid.Models.CandidArg.FromCandid(EdjCase.ICP.Candid.Models.CandidTypedValue.FromObject(arg0));\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, \"Deposit\", arg);\n\t\t\treturn reply.ToObjects();\n\t\t}\n\n\t\tpublic async System.Threading.Tasks.Task> GetAllBalances()\n\t\t{\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg arg = EdjCase.ICP.Candid.Models.CandidArg.FromCandid();\n\t\t\tEdjCase.ICP.Agent.Responses.QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, \"GetAllBalances\", arg);\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg reply = response.ThrowOrGetReply();\n\t\t\treturn reply.ToObjects>();\n\t\t}\n\n\t\tpublic async System.Threading.Tasks.Task GetBalance(Token arg0)\n\t\t{\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg arg = EdjCase.ICP.Candid.Models.CandidArg.FromCandid(EdjCase.ICP.Candid.Models.CandidTypedValue.FromObject(arg0));\n\t\t\tEdjCase.ICP.Agent.Responses.QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, \"GetBalance\", arg);\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg reply = response.ThrowOrGetReply();\n\t\t\treturn reply.ToObjects();\n\t\t}\n\n\t\tpublic async System.Threading.Tasks.Task> GetBalances()\n\t\t{\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg arg = EdjCase.ICP.Candid.Models.CandidArg.FromCandid();\n\t\t\tEdjCase.ICP.Agent.Responses.QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, \"GetBalances\", arg);\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg reply = response.ThrowOrGetReply();\n\t\t\treturn reply.ToObjects>();\n\t\t}\n\n\t\tpublic async System.Threading.Tasks.Task> GetDepositAddress()\n\t\t{\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg arg = EdjCase.ICP.Candid.Models.CandidArg.FromCandid();\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, \"GetDepositAddress\", arg);\n\t\t\treturn reply.ToObjects>();\n\t\t}\n\n\t\tpublic async System.Threading.Tasks.Task> GetOrder(OrderId arg0)\n\t\t{\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg arg = EdjCase.ICP.Candid.Models.CandidArg.FromCandid(EdjCase.ICP.Candid.Models.CandidTypedValue.FromObject(arg0));\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, \"GetOrder\", arg);\n\t\t\treturn reply.ToObjects>();\n\t\t}\n\n\t\tpublic async System.Threading.Tasks.Task> GetOrders()\n\t\t{\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg arg = EdjCase.ICP.Candid.Models.CandidArg.FromCandid();\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, \"GetOrders\", arg);\n\t\t\treturn reply.ToObjects>();\n\t\t}\n\n\t\tpublic async System.Threading.Tasks.Task GetSymbol(Token arg0)\n\t\t{\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg arg = EdjCase.ICP.Candid.Models.CandidArg.FromCandid(EdjCase.ICP.Candid.Models.CandidTypedValue.FromObject(arg0));\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, \"GetSymbol\", arg);\n\t\t\treturn reply.ToObjects();\n\t\t}\n\n\t\tpublic async System.Threading.Tasks.Task PlaceOrder(Token arg0, EdjCase.ICP.Candid.Models.UnboundedUInt arg1, Token arg2, EdjCase.ICP.Candid.Models.UnboundedUInt arg3)\n\t\t{\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg arg = EdjCase.ICP.Candid.Models.CandidArg.FromCandid(EdjCase.ICP.Candid.Models.CandidTypedValue.FromObject(arg0), EdjCase.ICP.Candid.Models.CandidTypedValue.FromObject(arg1), EdjCase.ICP.Candid.Models.CandidTypedValue.FromObject(arg2), EdjCase.ICP.Candid.Models.CandidTypedValue.FromObject(arg3));\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, \"PlaceOrder\", arg);\n\t\t\treturn reply.ToObjects();\n\t\t}\n\n\t\tpublic async System.Threading.Tasks.Task Whoami()\n\t\t{\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg arg = EdjCase.ICP.Candid.Models.CandidArg.FromCandid();\n\t\t\tEdjCase.ICP.Agent.Responses.QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, \"Whoami\", arg);\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg reply = response.ThrowOrGetReply();\n\t\t\treturn reply.ToObjects();\n\t\t}\n\n\t\tpublic async System.Threading.Tasks.Task Withdraw(Token arg0, EdjCase.ICP.Candid.Models.UnboundedUInt arg1, EdjCase.ICP.Candid.Models.Principal arg2)\n\t\t{\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg arg = EdjCase.ICP.Candid.Models.CandidArg.FromCandid(EdjCase.ICP.Candid.Models.CandidTypedValue.FromObject(arg0), EdjCase.ICP.Candid.Models.CandidTypedValue.FromObject(arg1), EdjCase.ICP.Candid.Models.CandidTypedValue.FromObject(arg2));\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, \"Withdraw\", arg);\n\t\t\treturn reply.ToObjects();\n\t\t}\n\t}\n}", + "ClientFile": "using Token = EdjCase.ICP.Candid.Models.Principal;\nusing OrderId = System.UInt32;\nusing EdjCase.ICP.Agent.Agents;\n\nnamespace Test\n{\n\tpublic class DexApiClient\n\t{\n\t\tpublic EdjCase.ICP.Agent.Agents.IAgent Agent { get; }\n\n\t\tpublic EdjCase.ICP.Candid.Models.Principal CanisterId { get; }\n\n\t\tpublic DexApiClient(EdjCase.ICP.Agent.Agents.IAgent agent, EdjCase.ICP.Candid.Models.Principal canisterId)\n\t\t{\n\t\t\tthis.Agent = agent;\n\t\t\tthis.CanisterId = canisterId;\n\t\t}\n\n\t\tpublic async System.Threading.Tasks.Task CancelOrder(OrderId arg0)\n\t\t{\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg arg = EdjCase.ICP.Candid.Models.CandidArg.FromCandid(EdjCase.ICP.Candid.Models.CandidTypedValue.FromObject(arg0));\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, \"cancelOrder\", arg);\n\t\t\treturn reply.ToObjects();\n\t\t}\n\n\t\tpublic async System.Threading.Tasks.Task Clear()\n\t\t{\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg arg = EdjCase.ICP.Candid.Models.CandidArg.FromCandid();\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, \"clear\", arg);\n\t\t}\n\n\t\tpublic async System.Threading.Tasks.Task Credit(EdjCase.ICP.Candid.Models.Principal arg0, Token arg1, EdjCase.ICP.Candid.Models.UnboundedUInt arg2)\n\t\t{\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg arg = EdjCase.ICP.Candid.Models.CandidArg.FromCandid(EdjCase.ICP.Candid.Models.CandidTypedValue.FromObject(arg0), EdjCase.ICP.Candid.Models.CandidTypedValue.FromObject(arg1), EdjCase.ICP.Candid.Models.CandidTypedValue.FromObject(arg2));\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, \"credit\", arg);\n\t\t}\n\n\t\tpublic async System.Threading.Tasks.Task Deposit(Token arg0)\n\t\t{\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg arg = EdjCase.ICP.Candid.Models.CandidArg.FromCandid(EdjCase.ICP.Candid.Models.CandidTypedValue.FromObject(arg0));\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, \"deposit\", arg);\n\t\t\treturn reply.ToObjects();\n\t\t}\n\n\t\tpublic async System.Threading.Tasks.Task> GetAllBalances()\n\t\t{\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg arg = EdjCase.ICP.Candid.Models.CandidArg.FromCandid();\n\t\t\tEdjCase.ICP.Agent.Responses.QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, \"getAllBalances\", arg);\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg reply = response.ThrowOrGetReply();\n\t\t\treturn reply.ToObjects>();\n\t\t}\n\n\t\tpublic async System.Threading.Tasks.Task GetBalance(Token arg0)\n\t\t{\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg arg = EdjCase.ICP.Candid.Models.CandidArg.FromCandid(EdjCase.ICP.Candid.Models.CandidTypedValue.FromObject(arg0));\n\t\t\tEdjCase.ICP.Agent.Responses.QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, \"getBalance\", arg);\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg reply = response.ThrowOrGetReply();\n\t\t\treturn reply.ToObjects();\n\t\t}\n\n\t\tpublic async System.Threading.Tasks.Task> GetBalances()\n\t\t{\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg arg = EdjCase.ICP.Candid.Models.CandidArg.FromCandid();\n\t\t\tEdjCase.ICP.Agent.Responses.QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, \"getBalances\", arg);\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg reply = response.ThrowOrGetReply();\n\t\t\treturn reply.ToObjects>();\n\t\t}\n\n\t\tpublic async System.Threading.Tasks.Task> GetDepositAddress()\n\t\t{\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg arg = EdjCase.ICP.Candid.Models.CandidArg.FromCandid();\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, \"getDepositAddress\", arg);\n\t\t\treturn reply.ToObjects>();\n\t\t}\n\n\t\tpublic async System.Threading.Tasks.Task> GetOrder(OrderId arg0)\n\t\t{\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg arg = EdjCase.ICP.Candid.Models.CandidArg.FromCandid(EdjCase.ICP.Candid.Models.CandidTypedValue.FromObject(arg0));\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, \"getOrder\", arg);\n\t\t\treturn reply.ToObjects>();\n\t\t}\n\n\t\tpublic async System.Threading.Tasks.Task> GetOrders()\n\t\t{\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg arg = EdjCase.ICP.Candid.Models.CandidArg.FromCandid();\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, \"getOrders\", arg);\n\t\t\treturn reply.ToObjects>();\n\t\t}\n\n\t\tpublic async System.Threading.Tasks.Task GetSymbol(Token arg0)\n\t\t{\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg arg = EdjCase.ICP.Candid.Models.CandidArg.FromCandid(EdjCase.ICP.Candid.Models.CandidTypedValue.FromObject(arg0));\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, \"getSymbol\", arg);\n\t\t\treturn reply.ToObjects();\n\t\t}\n\n\t\tpublic async System.Threading.Tasks.Task PlaceOrder(Token arg0, EdjCase.ICP.Candid.Models.UnboundedUInt arg1, Token arg2, EdjCase.ICP.Candid.Models.UnboundedUInt arg3)\n\t\t{\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg arg = EdjCase.ICP.Candid.Models.CandidArg.FromCandid(EdjCase.ICP.Candid.Models.CandidTypedValue.FromObject(arg0), EdjCase.ICP.Candid.Models.CandidTypedValue.FromObject(arg1), EdjCase.ICP.Candid.Models.CandidTypedValue.FromObject(arg2), EdjCase.ICP.Candid.Models.CandidTypedValue.FromObject(arg3));\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, \"placeOrder\", arg);\n\t\t\treturn reply.ToObjects();\n\t\t}\n\n\t\tpublic async System.Threading.Tasks.Task Whoami()\n\t\t{\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg arg = EdjCase.ICP.Candid.Models.CandidArg.FromCandid();\n\t\t\tEdjCase.ICP.Agent.Responses.QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, \"whoami\", arg);\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg reply = response.ThrowOrGetReply();\n\t\t\treturn reply.ToObjects();\n\t\t}\n\n\t\tpublic async System.Threading.Tasks.Task Withdraw(Token arg0, EdjCase.ICP.Candid.Models.UnboundedUInt arg1, EdjCase.ICP.Candid.Models.Principal arg2)\n\t\t{\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg arg = EdjCase.ICP.Candid.Models.CandidArg.FromCandid(EdjCase.ICP.Candid.Models.CandidTypedValue.FromObject(arg0), EdjCase.ICP.Candid.Models.CandidTypedValue.FromObject(arg1), EdjCase.ICP.Candid.Models.CandidTypedValue.FromObject(arg2));\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, \"withdraw\", arg);\n\t\t\treturn reply.ToObjects();\n\t\t}\n\t}\n}", "DataModelFiles": [ { "Item1": "WithdrawReceipt", diff --git a/test/Common.Tests/Generators/__snapshots__/Governance.snap b/test/Common.Tests/Generators/__snapshots__/Governance.snap index 08c492b9..860e518f 100644 --- a/test/Common.Tests/Generators/__snapshots__/Governance.snap +++ b/test/Common.Tests/Generators/__snapshots__/Governance.snap @@ -2,7 +2,7 @@ "Name": { "HasPrefix": false }, - "ClientFile": "using EdjCase.ICP.Agent.Agents;\n\nnamespace Test\n{\n\tpublic class GovernanceApiClient\n\t{\n\t\tpublic EdjCase.ICP.Agent.Agents.IAgent Agent { get; }\n\n\t\tpublic EdjCase.ICP.Candid.Models.Principal CanisterId { get; }\n\n\t\tpublic GovernanceApiClient(EdjCase.ICP.Agent.Agents.IAgent agent, EdjCase.ICP.Candid.Models.Principal canisterId)\n\t\t{\n\t\t\tthis.Agent = agent;\n\t\t\tthis.CanisterId = canisterId;\n\t\t}\n\n\t\tpublic async System.Threading.Tasks.Task ClaimGtcNeurons(EdjCase.ICP.Candid.Models.Principal arg0, System.Collections.Generic.List arg1)\n\t\t{\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg arg = EdjCase.ICP.Candid.Models.CandidArg.FromCandid(EdjCase.ICP.Candid.Models.CandidTypedValue.FromObject(arg0), EdjCase.ICP.Candid.Models.CandidTypedValue.FromObject(arg1));\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, \"ClaimGtcNeurons\", arg);\n\t\t\treturn reply.ToObjects();\n\t\t}\n\n\t\tpublic async System.Threading.Tasks.Task ClaimOrRefreshNeuronFromAccount(Test.Models.ClaimOrRefreshNeuronFromAccount arg0)\n\t\t{\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg arg = EdjCase.ICP.Candid.Models.CandidArg.FromCandid(EdjCase.ICP.Candid.Models.CandidTypedValue.FromObject(arg0));\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, \"ClaimOrRefreshNeuronFromAccount\", arg);\n\t\t\treturn reply.ToObjects();\n\t\t}\n\n\t\tpublic async System.Threading.Tasks.Task GetBuildMetadata()\n\t\t{\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg arg = EdjCase.ICP.Candid.Models.CandidArg.FromCandid();\n\t\t\tEdjCase.ICP.Agent.Responses.QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, \"GetBuildMetadata\", arg);\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg reply = response.ThrowOrGetReply();\n\t\t\treturn reply.ToObjects();\n\t\t}\n\n\t\tpublic async System.Threading.Tasks.Task GetFullNeuron(System.UInt64 arg0)\n\t\t{\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg arg = EdjCase.ICP.Candid.Models.CandidArg.FromCandid(EdjCase.ICP.Candid.Models.CandidTypedValue.FromObject(arg0));\n\t\t\tEdjCase.ICP.Agent.Responses.QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, \"GetFullNeuron\", arg);\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg reply = response.ThrowOrGetReply();\n\t\t\treturn reply.ToObjects();\n\t\t}\n\n\t\tpublic async System.Threading.Tasks.Task GetFullNeuronByIdOrSubaccount(Test.Models.NeuronIdOrSubaccount arg0)\n\t\t{\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg arg = EdjCase.ICP.Candid.Models.CandidArg.FromCandid(EdjCase.ICP.Candid.Models.CandidTypedValue.FromObject(arg0));\n\t\t\tEdjCase.ICP.Agent.Responses.QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, \"GetFullNeuronByIdOrSubaccount\", arg);\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg reply = response.ThrowOrGetReply();\n\t\t\treturn reply.ToObjects();\n\t\t}\n\n\t\tpublic async System.Threading.Tasks.Task GetMonthlyNodeProviderRewards()\n\t\t{\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg arg = EdjCase.ICP.Candid.Models.CandidArg.FromCandid();\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, \"GetMonthlyNodeProviderRewards\", arg);\n\t\t\treturn reply.ToObjects();\n\t\t}\n\n\t\tpublic async System.Threading.Tasks.Task GetNetworkEconomicsParameters()\n\t\t{\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg arg = EdjCase.ICP.Candid.Models.CandidArg.FromCandid();\n\t\t\tEdjCase.ICP.Agent.Responses.QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, \"GetNetworkEconomicsParameters\", arg);\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg reply = response.ThrowOrGetReply();\n\t\t\treturn reply.ToObjects();\n\t\t}\n\n\t\tpublic async System.Threading.Tasks.Task> GetNeuronIds()\n\t\t{\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg arg = EdjCase.ICP.Candid.Models.CandidArg.FromCandid();\n\t\t\tEdjCase.ICP.Agent.Responses.QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, \"GetNeuronIds\", arg);\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg reply = response.ThrowOrGetReply();\n\t\t\treturn reply.ToObjects>();\n\t\t}\n\n\t\tpublic async System.Threading.Tasks.Task GetNeuronInfo(System.UInt64 arg0)\n\t\t{\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg arg = EdjCase.ICP.Candid.Models.CandidArg.FromCandid(EdjCase.ICP.Candid.Models.CandidTypedValue.FromObject(arg0));\n\t\t\tEdjCase.ICP.Agent.Responses.QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, \"GetNeuronInfo\", arg);\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg reply = response.ThrowOrGetReply();\n\t\t\treturn reply.ToObjects();\n\t\t}\n\n\t\tpublic async System.Threading.Tasks.Task GetNeuronInfoByIdOrSubaccount(Test.Models.NeuronIdOrSubaccount arg0)\n\t\t{\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg arg = EdjCase.ICP.Candid.Models.CandidArg.FromCandid(EdjCase.ICP.Candid.Models.CandidTypedValue.FromObject(arg0));\n\t\t\tEdjCase.ICP.Agent.Responses.QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, \"GetNeuronInfoByIdOrSubaccount\", arg);\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg reply = response.ThrowOrGetReply();\n\t\t\treturn reply.ToObjects();\n\t\t}\n\n\t\tpublic async System.Threading.Tasks.Task GetNodeProviderByCaller(EdjCase.ICP.Candid.Models.NullValue arg0)\n\t\t{\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg arg = EdjCase.ICP.Candid.Models.CandidArg.FromCandid(EdjCase.ICP.Candid.Models.CandidTypedValue.FromObject(arg0));\n\t\t\tEdjCase.ICP.Agent.Responses.QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, \"GetNodeProviderByCaller\", arg);\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg reply = response.ThrowOrGetReply();\n\t\t\treturn reply.ToObjects();\n\t\t}\n\n\t\tpublic async System.Threading.Tasks.Task> GetPendingProposals()\n\t\t{\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg arg = EdjCase.ICP.Candid.Models.CandidArg.FromCandid();\n\t\t\tEdjCase.ICP.Agent.Responses.QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, \"GetPendingProposals\", arg);\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg reply = response.ThrowOrGetReply();\n\t\t\treturn reply.ToObjects>();\n\t\t}\n\n\t\tpublic async System.Threading.Tasks.Task> GetProposalInfo(System.UInt64 arg0)\n\t\t{\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg arg = EdjCase.ICP.Candid.Models.CandidArg.FromCandid(EdjCase.ICP.Candid.Models.CandidTypedValue.FromObject(arg0));\n\t\t\tEdjCase.ICP.Agent.Responses.QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, \"GetProposalInfo\", arg);\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg reply = response.ThrowOrGetReply();\n\t\t\treturn reply.ToObjects>();\n\t\t}\n\n\t\tpublic async System.Threading.Tasks.Task ListKnownNeurons()\n\t\t{\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg arg = EdjCase.ICP.Candid.Models.CandidArg.FromCandid();\n\t\t\tEdjCase.ICP.Agent.Responses.QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, \"ListKnownNeurons\", arg);\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg reply = response.ThrowOrGetReply();\n\t\t\treturn reply.ToObjects();\n\t\t}\n\n\t\tpublic async System.Threading.Tasks.Task ListNeurons(Test.Models.ListNeurons arg0)\n\t\t{\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg arg = EdjCase.ICP.Candid.Models.CandidArg.FromCandid(EdjCase.ICP.Candid.Models.CandidTypedValue.FromObject(arg0));\n\t\t\tEdjCase.ICP.Agent.Responses.QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, \"ListNeurons\", arg);\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg reply = response.ThrowOrGetReply();\n\t\t\treturn reply.ToObjects();\n\t\t}\n\n\t\tpublic async System.Threading.Tasks.Task ListNodeProviders()\n\t\t{\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg arg = EdjCase.ICP.Candid.Models.CandidArg.FromCandid();\n\t\t\tEdjCase.ICP.Agent.Responses.QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, \"ListNodeProviders\", arg);\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg reply = response.ThrowOrGetReply();\n\t\t\treturn reply.ToObjects();\n\t\t}\n\n\t\tpublic async System.Threading.Tasks.Task ListProposals(Test.Models.ListProposalInfo arg0)\n\t\t{\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg arg = EdjCase.ICP.Candid.Models.CandidArg.FromCandid(EdjCase.ICP.Candid.Models.CandidTypedValue.FromObject(arg0));\n\t\t\tEdjCase.ICP.Agent.Responses.QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, \"ListProposals\", arg);\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg reply = response.ThrowOrGetReply();\n\t\t\treturn reply.ToObjects();\n\t\t}\n\n\t\tpublic async System.Threading.Tasks.Task ManageNeuron(Test.Models.ManageNeuron arg0)\n\t\t{\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg arg = EdjCase.ICP.Candid.Models.CandidArg.FromCandid(EdjCase.ICP.Candid.Models.CandidTypedValue.FromObject(arg0));\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, \"ManageNeuron\", arg);\n\t\t\treturn reply.ToObjects();\n\t\t}\n\n\t\tpublic async System.Threading.Tasks.Task TransferGtcNeuron(Test.Models.NeuronId arg0, Test.Models.NeuronId arg1)\n\t\t{\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg arg = EdjCase.ICP.Candid.Models.CandidArg.FromCandid(EdjCase.ICP.Candid.Models.CandidTypedValue.FromObject(arg0), EdjCase.ICP.Candid.Models.CandidTypedValue.FromObject(arg1));\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, \"TransferGtcNeuron\", arg);\n\t\t\treturn reply.ToObjects();\n\t\t}\n\n\t\tpublic async System.Threading.Tasks.Task UpdateNodeProvider(Test.Models.UpdateNodeProvider arg0)\n\t\t{\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg arg = EdjCase.ICP.Candid.Models.CandidArg.FromCandid(EdjCase.ICP.Candid.Models.CandidTypedValue.FromObject(arg0));\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, \"UpdateNodeProvider\", arg);\n\t\t\treturn reply.ToObjects();\n\t\t}\n\t}\n}", + "ClientFile": "using EdjCase.ICP.Agent.Agents;\n\nnamespace Test\n{\n\tpublic class GovernanceApiClient\n\t{\n\t\tpublic EdjCase.ICP.Agent.Agents.IAgent Agent { get; }\n\n\t\tpublic EdjCase.ICP.Candid.Models.Principal CanisterId { get; }\n\n\t\tpublic GovernanceApiClient(EdjCase.ICP.Agent.Agents.IAgent agent, EdjCase.ICP.Candid.Models.Principal canisterId)\n\t\t{\n\t\t\tthis.Agent = agent;\n\t\t\tthis.CanisterId = canisterId;\n\t\t}\n\n\t\tpublic async System.Threading.Tasks.Task ClaimGtcNeurons(EdjCase.ICP.Candid.Models.Principal arg0, System.Collections.Generic.List arg1)\n\t\t{\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg arg = EdjCase.ICP.Candid.Models.CandidArg.FromCandid(EdjCase.ICP.Candid.Models.CandidTypedValue.FromObject(arg0), EdjCase.ICP.Candid.Models.CandidTypedValue.FromObject(arg1));\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, \"claim_gtc_neurons\", arg);\n\t\t\treturn reply.ToObjects();\n\t\t}\n\n\t\tpublic async System.Threading.Tasks.Task ClaimOrRefreshNeuronFromAccount(Test.Models.ClaimOrRefreshNeuronFromAccount arg0)\n\t\t{\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg arg = EdjCase.ICP.Candid.Models.CandidArg.FromCandid(EdjCase.ICP.Candid.Models.CandidTypedValue.FromObject(arg0));\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, \"claim_or_refresh_neuron_from_account\", arg);\n\t\t\treturn reply.ToObjects();\n\t\t}\n\n\t\tpublic async System.Threading.Tasks.Task GetBuildMetadata()\n\t\t{\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg arg = EdjCase.ICP.Candid.Models.CandidArg.FromCandid();\n\t\t\tEdjCase.ICP.Agent.Responses.QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, \"get_build_metadata\", arg);\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg reply = response.ThrowOrGetReply();\n\t\t\treturn reply.ToObjects();\n\t\t}\n\n\t\tpublic async System.Threading.Tasks.Task GetFullNeuron(System.UInt64 arg0)\n\t\t{\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg arg = EdjCase.ICP.Candid.Models.CandidArg.FromCandid(EdjCase.ICP.Candid.Models.CandidTypedValue.FromObject(arg0));\n\t\t\tEdjCase.ICP.Agent.Responses.QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, \"get_full_neuron\", arg);\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg reply = response.ThrowOrGetReply();\n\t\t\treturn reply.ToObjects();\n\t\t}\n\n\t\tpublic async System.Threading.Tasks.Task GetFullNeuronByIdOrSubaccount(Test.Models.NeuronIdOrSubaccount arg0)\n\t\t{\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg arg = EdjCase.ICP.Candid.Models.CandidArg.FromCandid(EdjCase.ICP.Candid.Models.CandidTypedValue.FromObject(arg0));\n\t\t\tEdjCase.ICP.Agent.Responses.QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, \"get_full_neuron_by_id_or_subaccount\", arg);\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg reply = response.ThrowOrGetReply();\n\t\t\treturn reply.ToObjects();\n\t\t}\n\n\t\tpublic async System.Threading.Tasks.Task GetMonthlyNodeProviderRewards()\n\t\t{\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg arg = EdjCase.ICP.Candid.Models.CandidArg.FromCandid();\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, \"get_monthly_node_provider_rewards\", arg);\n\t\t\treturn reply.ToObjects();\n\t\t}\n\n\t\tpublic async System.Threading.Tasks.Task GetNetworkEconomicsParameters()\n\t\t{\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg arg = EdjCase.ICP.Candid.Models.CandidArg.FromCandid();\n\t\t\tEdjCase.ICP.Agent.Responses.QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, \"get_network_economics_parameters\", arg);\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg reply = response.ThrowOrGetReply();\n\t\t\treturn reply.ToObjects();\n\t\t}\n\n\t\tpublic async System.Threading.Tasks.Task> GetNeuronIds()\n\t\t{\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg arg = EdjCase.ICP.Candid.Models.CandidArg.FromCandid();\n\t\t\tEdjCase.ICP.Agent.Responses.QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, \"get_neuron_ids\", arg);\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg reply = response.ThrowOrGetReply();\n\t\t\treturn reply.ToObjects>();\n\t\t}\n\n\t\tpublic async System.Threading.Tasks.Task GetNeuronInfo(System.UInt64 arg0)\n\t\t{\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg arg = EdjCase.ICP.Candid.Models.CandidArg.FromCandid(EdjCase.ICP.Candid.Models.CandidTypedValue.FromObject(arg0));\n\t\t\tEdjCase.ICP.Agent.Responses.QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, \"get_neuron_info\", arg);\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg reply = response.ThrowOrGetReply();\n\t\t\treturn reply.ToObjects();\n\t\t}\n\n\t\tpublic async System.Threading.Tasks.Task GetNeuronInfoByIdOrSubaccount(Test.Models.NeuronIdOrSubaccount arg0)\n\t\t{\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg arg = EdjCase.ICP.Candid.Models.CandidArg.FromCandid(EdjCase.ICP.Candid.Models.CandidTypedValue.FromObject(arg0));\n\t\t\tEdjCase.ICP.Agent.Responses.QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, \"get_neuron_info_by_id_or_subaccount\", arg);\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg reply = response.ThrowOrGetReply();\n\t\t\treturn reply.ToObjects();\n\t\t}\n\n\t\tpublic async System.Threading.Tasks.Task GetNodeProviderByCaller(EdjCase.ICP.Candid.Models.NullValue arg0)\n\t\t{\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg arg = EdjCase.ICP.Candid.Models.CandidArg.FromCandid(EdjCase.ICP.Candid.Models.CandidTypedValue.FromObject(arg0));\n\t\t\tEdjCase.ICP.Agent.Responses.QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, \"get_node_provider_by_caller\", arg);\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg reply = response.ThrowOrGetReply();\n\t\t\treturn reply.ToObjects();\n\t\t}\n\n\t\tpublic async System.Threading.Tasks.Task> GetPendingProposals()\n\t\t{\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg arg = EdjCase.ICP.Candid.Models.CandidArg.FromCandid();\n\t\t\tEdjCase.ICP.Agent.Responses.QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, \"get_pending_proposals\", arg);\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg reply = response.ThrowOrGetReply();\n\t\t\treturn reply.ToObjects>();\n\t\t}\n\n\t\tpublic async System.Threading.Tasks.Task> GetProposalInfo(System.UInt64 arg0)\n\t\t{\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg arg = EdjCase.ICP.Candid.Models.CandidArg.FromCandid(EdjCase.ICP.Candid.Models.CandidTypedValue.FromObject(arg0));\n\t\t\tEdjCase.ICP.Agent.Responses.QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, \"get_proposal_info\", arg);\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg reply = response.ThrowOrGetReply();\n\t\t\treturn reply.ToObjects>();\n\t\t}\n\n\t\tpublic async System.Threading.Tasks.Task ListKnownNeurons()\n\t\t{\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg arg = EdjCase.ICP.Candid.Models.CandidArg.FromCandid();\n\t\t\tEdjCase.ICP.Agent.Responses.QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, \"list_known_neurons\", arg);\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg reply = response.ThrowOrGetReply();\n\t\t\treturn reply.ToObjects();\n\t\t}\n\n\t\tpublic async System.Threading.Tasks.Task ListNeurons(Test.Models.ListNeurons arg0)\n\t\t{\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg arg = EdjCase.ICP.Candid.Models.CandidArg.FromCandid(EdjCase.ICP.Candid.Models.CandidTypedValue.FromObject(arg0));\n\t\t\tEdjCase.ICP.Agent.Responses.QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, \"list_neurons\", arg);\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg reply = response.ThrowOrGetReply();\n\t\t\treturn reply.ToObjects();\n\t\t}\n\n\t\tpublic async System.Threading.Tasks.Task ListNodeProviders()\n\t\t{\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg arg = EdjCase.ICP.Candid.Models.CandidArg.FromCandid();\n\t\t\tEdjCase.ICP.Agent.Responses.QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, \"list_node_providers\", arg);\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg reply = response.ThrowOrGetReply();\n\t\t\treturn reply.ToObjects();\n\t\t}\n\n\t\tpublic async System.Threading.Tasks.Task ListProposals(Test.Models.ListProposalInfo arg0)\n\t\t{\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg arg = EdjCase.ICP.Candid.Models.CandidArg.FromCandid(EdjCase.ICP.Candid.Models.CandidTypedValue.FromObject(arg0));\n\t\t\tEdjCase.ICP.Agent.Responses.QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, \"list_proposals\", arg);\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg reply = response.ThrowOrGetReply();\n\t\t\treturn reply.ToObjects();\n\t\t}\n\n\t\tpublic async System.Threading.Tasks.Task ManageNeuron(Test.Models.ManageNeuron arg0)\n\t\t{\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg arg = EdjCase.ICP.Candid.Models.CandidArg.FromCandid(EdjCase.ICP.Candid.Models.CandidTypedValue.FromObject(arg0));\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, \"manage_neuron\", arg);\n\t\t\treturn reply.ToObjects();\n\t\t}\n\n\t\tpublic async System.Threading.Tasks.Task TransferGtcNeuron(Test.Models.NeuronId arg0, Test.Models.NeuronId arg1)\n\t\t{\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg arg = EdjCase.ICP.Candid.Models.CandidArg.FromCandid(EdjCase.ICP.Candid.Models.CandidTypedValue.FromObject(arg0), EdjCase.ICP.Candid.Models.CandidTypedValue.FromObject(arg1));\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, \"transfer_gtc_neuron\", arg);\n\t\t\treturn reply.ToObjects();\n\t\t}\n\n\t\tpublic async System.Threading.Tasks.Task UpdateNodeProvider(Test.Models.UpdateNodeProvider arg0)\n\t\t{\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg arg = EdjCase.ICP.Candid.Models.CandidArg.FromCandid(EdjCase.ICP.Candid.Models.CandidTypedValue.FromObject(arg0));\n\t\t\tEdjCase.ICP.Candid.Models.CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, \"update_node_provider\", arg);\n\t\t\treturn reply.ToObjects();\n\t\t}\n\t}\n}", "DataModelFiles": [ { "Item1": "AccountIdentifier",