/// <summary> /// Retrieves the byte array representing teh serialized blockheader data. /// </summary> /// <param name="blockHash">The hash of the Block.</param> /// <returns>The Block header in bytes.</returns> /// <example> /// <code> /// byte[] header = in3.Btc.GetBlockHeaderBytes("0000000000000000000cd3c5d7638014e78a5fba33be5fa5cb10ef9f03d99e60"); /// </code> /// </example> public async Task <byte[]> GetBlockHeaderBytes(string blockHash) { string jsonResponse = await _in3.SendRpc(BtcGetBlockHeader, new object[] { blockHash, false }); return(DataTypeConverter.HexStringToByteArray(RpcHandler.From <string>(jsonResponse))); }
/// <summary> /// Retrieves the serialized transaction (bytes). /// </summary> /// <param name="txid">The transaction Id.</param> /// <returns>The byte array for the Transaction.</returns> /// <example> /// <code> /// byte[] serializedTransaction = in3.Btc.GetTransactionBytes("1427c7d1698e61afe061950226f1c149990b8c1e1b157320b0c4acf7d6b5605d"); /// </code> /// </example> public async Task <byte[]> GetTransactionBytes(string txid) { string jsonResponse = await _in3.SendRpc(BtcGetRawTransaction, new object[] { txid, false }); return(DataTypeConverter.HexStringToByteArray(RpcHandler.From <string>(jsonResponse))); }