public override async Task <string> GetTransactionHex(string transactionId) { var settings = SettingsProvider.GetSettings(); string transactionHex = string.Empty; try { QBitNinja.Client.QBitNinjaClient client = new QBitNinja.Client.QBitNinjaClient(settings.QBitNinjaBaseUrl, settings.Network); var qbitNinjaResponse = await client.GetTransaction(new uint256(transactionId)); transactionHex = qbitNinjaResponse.Transaction.ToHex(); } catch (Exception exp) { throw exp; } return(transactionHex); }
public async Task <GetTransactionHexResult> GetTransactionHex(Settings settings, string transactionId) { string transactionHex = string.Empty; bool errorOccured = false; string errorMessage = string.Empty; try { QBitNinja.Client.QBitNinjaClient client = new QBitNinja.Client.QBitNinjaClient(settings.QBitNinjaUrl, settings.Network); var qbitNinjaResponse = await client.GetTransaction(new uint256(transactionId)); transactionHex = qbitNinjaResponse.Transaction.ToHex(); } catch (Exception exp) { errorOccured = true; errorMessage = exp.ToString(); } return(new GetTransactionHexResult { HasErrorOccurred = errorOccured, TransactionHex = transactionHex, Error = errorMessage }); }