Beispiel #1
0
def bci_pushtx(tx):
    if not re.match('^[0-9a-fA-F]*$', tx):
        tx = tx.encode('hex')
    return make_request(
        'https://blockchain.info/pushtx', 
        from_string_to_bytes('tx='+tx)
    )
Beispiel #2
0
def bci_pushtx(tx, network):
    if isinstance(tx, bytes) or not re.match('^[0-9a-fA-F]*$', tx):
        tx = tx.hex()
    url = 'https://blockchain.info/pushtx' if network == 'btc' else 'https://{}.blockchain.info/pushtx'.format(
        network)
    return make_request(url, from_string_to_bytes('tx=' + tx))