feat(common): let's work with Trezor Suite instead of the web wallet

pull/1466/head
Pavol Rusnak 3 years ago
parent 6676352070
commit cc9dd66729
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D

@ -134,8 +134,8 @@ External contributors should not touch this file unless asked to.
We keep track of support status of each coin over our devices. That is
`trezor1` for Trezor One, `trezor2` for Trezor T, `connect` for [Connect](https://github.com/trezor/connect)
and `webwallet` for [Trezor Wallet](https://wallet.trezor.io/). In further description, the word "device"
applies to Connect and webwallet as well.
and `suite` for [Trezor Suite](https://suite.trezor.io/). In further description, the word "device"
applies to Connect and Suite as well.
This information is stored in [`support.json`](support.json).
External contributors should not touch this file unless asked to.
@ -144,10 +144,10 @@ Each coin on each device can be in one of four support states:
* **supported** explicitly: coin's key is listed in the device's `supported`
dictionary. If it's a Trezor device, it contains the firmware version from which
it is supported. For connect and webwallet, the value is simply `true`.
it is supported. For connect and suite, the value is simply `true`.
* **unsupported** explicitly: coin's key is listed in the device's `unsupported`
dictionary. The value is a string with reason for not supporting.
For connect and webwallet, if the key is not listed at all, it is also considered unsupported.
For connect and suite, if the key is not listed at all, it is also considered unsupported.
ERC20 tokens detected as duplicates are also considered unsupported.
* **soon**: coin's key is listed in the device's `supported` dictionary, with
the value `"soon"`.

File diff suppressed because it is too large Load Diff

@ -5,10 +5,6 @@
"erc20:eth:LINK (Chainlink)": {
"name": "Chainlink"
},
"erc20:eth:YUPIE": {
"hidden": 1,
"notes": "Replaced by YUP"
},
"eth:CLO": {
"coinmarketcap_alias": "callisto-network"
},

@ -4523,7 +4523,7 @@
"eth:ATH:43110": "duplicate key"
}
},
"webwallet": {
"suite": {
"supported": {
"bitcoin:ACM": true,
"bitcoin:BCH": true,

@ -113,14 +113,14 @@ misc:ONT - Ontology (ONT)
* connect : NO
* trezor1 : support info missing
* trezor2 : support info missing
* webwallet : NO
* suite : NO
$ ./support.py set misc:ONT trezor1=no -r "not planned on T1" trezor2=soon
misc:ONT - Ontology (ONT)
* connect : NO
* trezor1 : NO (reason: not planned on T1)
* trezor2 : SOON
* webwallet : NO
* suite : NO
```
Afterwards, review and commit changes to `defs/support.json`, and update the `trezor-common`

@ -327,7 +327,7 @@ def _load_fido_apps():
# ====== support info ======
RELEASES_URL = "https://data.trezor.io/firmware/{}/releases.json"
MISSING_SUPPORT_MEANS_NO = ("connect", "webwallet")
MISSING_SUPPORT_MEANS_NO = ("connect", "suite")
VERSIONED_SUPPORT_INFO = ("trezor1", "trezor2")
@ -362,7 +362,7 @@ def support_info_single(support_data, coin):
* if the coin is a duplicate ERC20 token, all support values are `None`
* if the coin has an entry in `unsupported`, its support is `None`
* if the coin has an entry in `supported` its support is that entry
(usually a version string, or `True` for connect/webwallet)
(usually a version string, or `True` for connect/suite)
* otherwise support is presumed "soon"
"""
support_info = {}
@ -393,7 +393,7 @@ def support_info(coins):
Takes a collection of coins and generates a support-info entry for each.
The support-info is a dict with keys based on `support.json` keys.
These are usually: "trezor1", "trezor2", "connect" and "webwallet".
These are usually: "trezor1", "trezor2", "connect" and "suite".
The `coins` argument can be a `CoinsInfo` object, a list or a dict of
coin items.

@ -21,8 +21,7 @@ OVERRIDES = coin_info.load_json("coins_details.override.json")
VERSIONS = coin_info.latest_releases()
# automatic wallet entries
WALLET_TREZOR = {"Trezor Wallet": "https://wallet.trezor.io"}
WALLET_ETH_TREZOR = {"Trezor Suite": "https://suite.trezor.io"}
WALLET_SUITE = {"Trezor Suite": "https://suite.trezor.io"}
WALLET_NEM = {
"Nano Wallet": "https://nem.io/downloads/",
"Magnum": "https://magnumwallet.co",
@ -96,14 +95,14 @@ def _is_supported(support, trezor_version):
return nominal
def _webwallet_support(coin, support):
"""Check the "webwallet" support property.
def _suite_support(coin, support):
"""Check the "suite" support property.
If set, check that at least one of the backends run on trezor.io.
If yes, assume we support the coin in our wallet.
Otherwise it's probably working with a custom backend, which means don't
link to our wallet.
"""
if not support.get("webwallet"):
if not support.get("suite"):
return False
return any(".trezor.io" in url for url in coin["blockbook"])
@ -150,7 +149,7 @@ def update_bitcoin(coins, support_info):
details = dict(
name=coin["coin_label"],
links=dict(Homepage=coin["website"], Github=coin["github"]),
wallet=WALLET_TREZOR if _webwallet_support(coin, support) else {},
wallet=WALLET_SUITE if _suite_support(coin, support) else {},
)
dict_merge(res[key], details)
@ -172,8 +171,8 @@ def update_erc20(coins, networks, support_info):
if "deprecation" in coin:
hidden = True
if network_support.get(chain, {}).get("webwallet"):
wallets = WALLET_ETH_TREZOR
if network_support.get(chain, {}).get("suite"):
wallets = WALLET_SUITE
else:
wallets = WALLETS_ETH_3RDPARTY
@ -200,8 +199,8 @@ def update_ethereum_networks(coins, support_info):
res = update_simple(coins, support_info, "coin")
for coin in coins:
key = coin["key"]
if support_info[key].get("webwallet"):
wallets = WALLET_ETH_TREZOR
if support_info[key].get("suite"):
wallets = WALLET_SUITE
else:
wallets = WALLETS_ETH_3RDPARTY
details = dict(links=dict(Homepage=coin.get("url")), wallet=wallets)

@ -464,7 +464,7 @@ def set_support_value(key, entries, reason):
"""Set a support info variable.
Examples:
support.py set coin:BTC trezor1=soon trezor2=2.0.7 webwallet=yes connect=no
support.py set coin:BTC trezor1=soon trezor2=2.0.7 suite=yes connect=no
support.py set coin:LTC trezor1=yes connect=
Setting a variable to "yes", "true" or "1" sets support to true.

Loading…
Cancel
Save