docs: def broadcast_transaction(hex_tx, blockchain_client):
      """ Dispatch a raw hex transaction to the network.
      """
      if not isinstance(blockchain_client, ChainComClient):
          raise Exception('A ChainComClient object is required')
  
      auth = blockchain_client.auth
      if not auth or len(auth) != 2:
          raise Exception('ChainComClient object must have auth credentials.')
  
      url = CHAIN_API_BASE_URL + '/bitcoin/transactions/send'
      payload = json.dumps({ 'signed_hex': hex_tx })
      r = requests.post(url, data=payload, auth=auth)
  
      try:
          data = r.json()
      except ValueError, e:
          raise Exception('Received non-JSON from chain.com.')
  
      if 'transaction_hash' in data:
          reply = {}
          reply['tx_hash'] = data['transaction_hash']
          reply['success'] = True
          return reply
      else:
          raise Exception('Tx hash missing from chain.com response: ' + str(data) + '\noriginal: ' + str(payload))