sendTransaction method

Future<BlockchainResponse> sendTransaction(
  1. String txhex
)

Implementation

Future<BlockchainResponse> sendTransaction(String txhex) async {
  final res = await networkClient.postHTTP(
      BitcoinBlockChainNetworkUrls.listOfUrls.first + '/txs/push',
      {'tx': txhex});
  print(res.data);
  if (res.data['error'] != null || res.data == null) {
    return BlockchainResponse(
      data: res.data['error'],
      status: BlockchainResponses.error,
    );
  }
  return BlockchainResponse(
    data: {"data": res.data},
    status: BlockchainResponses.success,
  );
}