From 9c3010ed9c6406844cf615db5995b504674aaae7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Novo?= <34069419+TeknoPT@users.noreply.github.com> Date: Tue, 26 Dec 2023 17:43:08 +0000 Subject: [PATCH] Update Events. - Update Events --- Phantasma.RPC.Sharp/Model/EventResult.cs | 8 ++++++++ Phantasma.RPC.Sharp/Phantasma.RPC.Sharp.csproj | 2 +- SampleClient/SampleClient.cs | 10 ++++++++++ 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/Phantasma.RPC.Sharp/Model/EventResult.cs b/Phantasma.RPC.Sharp/Model/EventResult.cs index add52ba..205b7ef 100644 --- a/Phantasma.RPC.Sharp/Model/EventResult.cs +++ b/Phantasma.RPC.Sharp/Model/EventResult.cs @@ -23,6 +23,13 @@ public class EventResult [DataMember(Name = "contract", EmitDefaultValue = false)] [JsonProperty(PropertyName = "contract")] public string Contract { get; set; } + + /// + /// Gets or Sets Contract + /// + [DataMember(Name = "name", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } /// /// Gets or Sets Kind @@ -49,6 +56,7 @@ public override string ToString() sb.Append("class EventResult {\n"); sb.Append(" Address: ").Append(Address).Append("\n"); sb.Append(" Contract: ").Append(Contract).Append("\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); sb.Append(" Kind: ").Append(Kind).Append("\n"); sb.Append(" Data: ").Append(Data).Append("\n"); sb.Append("}\n"); diff --git a/Phantasma.RPC.Sharp/Phantasma.RPC.Sharp.csproj b/Phantasma.RPC.Sharp/Phantasma.RPC.Sharp.csproj index ec7bd68..b471379 100644 --- a/Phantasma.RPC.Sharp/Phantasma.RPC.Sharp.csproj +++ b/Phantasma.RPC.Sharp/Phantasma.RPC.Sharp.csproj @@ -10,7 +10,7 @@ www.phantasma.io logo.png https://github.com/phantasma-io/PhantasmaRpcClient - 1.0.4 + 1.0.5 Phantasma, blockchain, smartnfts diff --git a/SampleClient/SampleClient.cs b/SampleClient/SampleClient.cs index f542b58..280a1a6 100644 --- a/SampleClient/SampleClient.cs +++ b/SampleClient/SampleClient.cs @@ -43,6 +43,7 @@ static void Main(string[] args) var account = accountAPI.GetAccount("P2K9zmyFDNGN6n6hHiTUAz6jqn29s5G1SWLiXwCVQcpHcQb"); + GetTransaction(client); Console.WriteLine("Result: " + account.Name); foreach (var balance in account.Balances) { @@ -51,5 +52,14 @@ static void Main(string[] args) Console.WriteLine($"{amount} {balance.Symbol}"); } } + + static void GetTransaction(ApiClient client) + { + var transactionApi = new TransactionApi(client); + var transaction = + transactionApi.GetTransaction("59B903FAE1864EBE9CBA0C767C1D1568138652A97D522FA7B3AE0F38CC6D1CD0"); + + Console.WriteLine("Result: " + transaction); + } } } \ No newline at end of file