diff --git a/trezorctl b/trezorctl index ded9ea8a7d..e7275ed8fb 100755 --- a/trezorctl +++ b/trezorctl @@ -552,7 +552,7 @@ def sign_tx(connect, coin): click.echo(binascii.hexlify(serialized_tx)) click.echo() click.echo('Use the following form to broadcast it to the network:') - click.echo(txapi.url.replace('/api/', '/tx/send')) + click.echo(txapi.pushtx_url) # diff --git a/trezorlib/tx_api.py b/trezorlib/tx_api.py index 3974503c59..147246cb2e 100644 --- a/trezorlib/tx_api.py +++ b/trezorlib/tx_api.py @@ -31,6 +31,7 @@ class TxApi(object): def __init__(self, network, url): self.network = network self.url = url + self.pushtx_url = url def get_url(self, resource, resourceid): url = '%s%s/%s' % (self.url, resource, resourceid) @@ -68,6 +69,7 @@ class TxApiInsight(TxApi): def __init__(self, network, url, zcash=None): super(TxApiInsight, self).__init__(network, url) self.zcash = zcash + self.pushtx_url = url.replace('/api/', '/tx/send') def get_tx(self, txhash): @@ -149,6 +151,10 @@ class TxApiSmartbit(TxApi): class TxApiBlockCypher(TxApi): + def __init__(self, network, url, zcash=None): + super(TxApiBlockCypher, self).__init__(network, url) + self.pushtx_url = url.replace('//api.', '//live.').replace('/v1/', '/').replace('/main/', '/pushtx/') + def get_tx(self, txhash): data = self.fetch_json('txs', txhash)