diff --git a/python/docs/EXAMPLES.rst b/python/docs/EXAMPLES.rst index 86a4ed756..90c1e4075 100644 --- a/python/docs/EXAMPLES.rst +++ b/python/docs/EXAMPLES.rst @@ -66,7 +66,7 @@ A provided script can be used to sign transactions interactively. You will need 5) Amount to send in satoshis - ``91305`` in the example below (multiply BTC amount 0.00091305 by 100,000,000). 6) Expected fee (``0.00019695`` BTC in example below). Note: the miner receives all satoshis left unspent from a transaction. If you want to receive some change, you need to send it to an address you own (otherwise it will go to miner). Fee is not needed below, we just want it as a sanity check. -There are many ways to retrieve the info above: from a watch-only wallet in Bitcoin Core, https://coinb.in (`screenshot `_) etc. The easiest way is using the Trezor online wallet: https://beta-wallet.trezor.io +There are many ways to retrieve the info above: from a watch-only wallet in Bitcoin Core, https://coinb.in (`screenshot `_) etc. The easiest way is using the Trezor Suite: https://suite.trezor.io After authenticating, open the "Send" tab, fill-out all details, then open the "Show transaction details" menu to see the info needed above (`screenshot `_). Once you have the required details, you can then perform the transaction signing using ``trezorctl`` as shown in the example below: @@ -96,7 +96,7 @@ After authenticating, open the "Send" tab, fill-out all details, then open the " Signed Transaction: 02000000014ee601d273df3fe31f4bd79ad483d89973fe2d626faff316(...) -The signed transaction text can then be inspected in Electrum (`screenshot `_), `coinb.in `_ or another tool. If all info is correct, you can then broadcast the tx to the Bitcoin network via the URL provided by ``trezorctl`` or Electrum (Tools → Load transaction → From text. Here is a `screenshot `_). TIP: Electrum will only show the transaction fee if you previously imported the spending address (eg ``16ijWp48xn8hj6deD5ZHSJcgNjtYbpiki8`` from example tx above). Also, the final tx size (and therefore satoshis / byte) might be slightly different than the estimate shown on beta-wallet.trezor.io +The signed transaction text can then be inspected in Electrum (`screenshot `_), `coinb.in `_ or another tool. If all info is correct, you can then broadcast the tx to the Bitcoin network via the URL provided by ``trezorctl`` or Electrum (Tools → Load transaction → From text. Here is a `screenshot `_). TIP: Electrum will only show the transaction fee if you previously imported the spending address (eg ``16ijWp48xn8hj6deD5ZHSJcgNjtYbpiki8`` from example tx above). Also, the final tx size (and therefore satoshis / byte) might be slightly different than the estimate shown on suite.trezor.io The final broadcast and mined transaction can be seen here: https://blockchain.info/tx/270684c14be85efec9adafa50339fd120658381ed2300b9207d0a0df2a5f0bf9 diff --git a/python/helper-scripts/bump-required-fw-versions.py b/python/helper-scripts/bump-required-fw-versions.py index f968f1a53..69096614d 100755 --- a/python/helper-scripts/bump-required-fw-versions.py +++ b/python/helper-scripts/bump-required-fw-versions.py @@ -2,7 +2,7 @@ import os import requests -RELEASES_URL = "https://beta-wallet.trezor.io/data/firmware/{}/releases.json" +RELEASES_URL = "https://data.trezor.io/firmware/{}/releases.json" MODELS = ("1", "T") FILENAME = os.path.join(os.path.dirname(__file__), "..", "trezorlib", "__init__.py") diff --git a/python/src/trezorlib/cli/firmware.py b/python/src/trezorlib/cli/firmware.py index e23e9105d..1c7f87d12 100644 --- a/python/src/trezorlib/cli/firmware.py +++ b/python/src/trezorlib/cli/firmware.py @@ -84,16 +84,24 @@ def validate_firmware(version, fw, expected_fingerprint=None): def find_best_firmware_version( bootloader_version, requested_version=None, beta=False, bitcoin_only=False ): - if beta: - url = "https://beta-wallet.trezor.io/data/firmware/{}/releases.json" - else: - url = "https://wallet.trezor.io/data/firmware/{}/releases.json" + url = "https://data.trezor.io/firmware/{}/releases.json" releases = requests.get(url.format(bootloader_version[0])).json() if not releases: raise click.ClickException("Failed to get list of releases") if bitcoin_only: releases = [r for r in releases if "url_bitcoinonly" in r] + + # filter releases according to channel field + releases_stable = [ + r for r in releases if "channel" not in r or r["channel"] == "stable" + ] + releases_beta = [r for r in releases if "channel" in r and r["channel"] == "beta"] + if beta: + releases = releases_stable + releases_beta + else: + releases = releases_stable + releases.sort(key=lambda r: r["version"], reverse=True) def version_str(version): @@ -158,10 +166,10 @@ def find_best_firmware_version( else: url = release["url"] fingerprint = release["fingerprint"] - if beta: - url = "https://beta-wallet.trezor.io/" + url - else: - url = "https://wallet.trezor.io/" + url + if not url.startswith("data/"): + click.echo("Unsupported URL found: {}".format(url)) + sys.exit(1) + url = "https://data.trezor.io/" + url[5:] return url, fingerprint