예제 #1
0
        /// <summary>
        /// Returns the number of the most recent block the in3 network can collect signatures to verify.
        /// Can be changed by <see cref="Configuration.ClientConfiguration.ReplaceLatestBlock" />.
        /// If you need the very latest block, change <see cref="Configuration.ClientConfiguration.SignatureCount" /> to <see langword="0"/>.
        /// </summary>
        /// <returns>The number of the block.</returns>
        public async Task <BigInteger> BlockNumber()
        {
            string jsonResponse = await _in3.SendRpc(EthBlockNumber, new object[] { });

            return(DataTypeConverter.HexStringToBigint(RpcHandler.From <string>(jsonResponse)));
        }
예제 #2
0
파일: Api.cs 프로젝트: iosifgogolos/in3
        /// <summary>
        /// Derives an address from the given private (<paramref name="pk"/>) key using SHA-3 algorithm.
        /// </summary>
        /// <param name="pk">Private key.</param>
        /// <returns>The address.</returns>
        public async Task <string> Pk2Address(string pk)
        {
            string jsonResponse = await in3.SendRpc(CryptoPk2Address, new object[] { pk });

            return(RpcHandler.From <string>(jsonResponse));
        }
예제 #3
0
파일: Api.cs 프로젝트: iosifgogolos/in3
        /// <summary>
        /// Retrieves the transaction and returns the data as json.
        /// </summary>
        /// <param name="txid">The transaction Id.</param>
        /// <returns>The transaction object.</returns>
        /// <example>
        ///   <code>
        ///   Transaction desiredTransaction = in3.Btc.GetTransaction("1427c7d1698e61afe061950226f1c149990b8c1e1b157320b0c4acf7d6b5605d");
        ///   </code>
        /// </example>
        public async Task <Transaction> GetTransaction(string txid)
        {
            string jsonResponse = await _in3.SendRpc(BtcGetRawTransaction, new object[] { txid, true });

            return(RpcHandler.From <Transaction>(jsonResponse));
        }