public void TestRpcNep5Balances() { JObject json = TestUtils.RpcTestCases.Find(p => p.Name == nameof(RpcClient.GetNep5BalancesAsync).ToLower()).Response.Result; var item = RpcNep5Balances.FromJson(json); Assert.AreEqual(json.ToString(), item.ToJson().ToString()); }
/// <summary> /// Returns the balance of all NEP-5 assets in the specified address. /// This method is provided by the plugin RpcNep5Tracker. /// </summary> public async Task <RpcNep5Balances> GetNep5BalancesAsync(string address) { var result = await RpcSendAsync(GetRpcName(), address.AsScriptHash()) .ConfigureAwait(false); return(RpcNep5Balances.FromJson(result)); }
public void TestFromJson() { var json = balances.ToJson(); var rpcNep5Balances = RpcNep5Balances.FromJson(json); rpcNep5Balances.Address.Should().Be("abc"); rpcNep5Balances.Balances.Length.Should().Be(2); }
/// <summary> /// Returns the balance of all NEP-5 assets in the specified address. /// This method is provided by the plugin RpcNep5Tracker. /// </summary> public RpcNep5Balances GetNep5Balances(string address) { return(RpcNep5Balances.FromJson(RpcSend("getnep5balances", address))); }