コード例 #1
0
        public void TestRpcNep17Transfers()
        {
            JObject json = TestUtils.RpcTestCases.Find(p => p.Name == nameof(RpcClient.GetNep17TransfersAsync).ToLower()).Response.Result;
            var     item = RpcNep17Transfers.FromJson(json);

            Assert.AreEqual(json.ToString(), item.ToJson().ToString());
        }
コード例 #2
0
ファイル: RpcClient.cs プロジェクト: devhawk/neo-monorepo
        /// <summary>
        /// Returns all the NEP-17 transaction information occurred in the specified address.
        /// This method is provided by the plugin RpcNep17Tracker.
        /// </summary>
        /// <param name="address">The address to query the transaction information.</param>
        /// <param name="startTimestamp">The start block Timestamp, default to seven days before UtcNow</param>
        /// <param name="endTimestamp">The end block Timestamp, default to UtcNow</param>
        public async Task <RpcNep17Transfers> GetNep17TransfersAsync(string address, ulong?startTimestamp = default, ulong?endTimestamp = default)
        {
            startTimestamp ??= 0;
            endTimestamp ??= DateTime.UtcNow.ToTimestampMS();
            var result = await RpcSendAsync(GetRpcName(), address.AsScriptHash(), startTimestamp, endTimestamp)
                         .ConfigureAwait(false);

            return(RpcNep17Transfers.FromJson(result, protocolSettings));
        }