|
Monero
|
Classes | |
| class | CoinsInfo |
Functions | |
| def | load_json (path) |
| def | check_type (val, types, nullable=False, empty=False, regex=None, choice=None) |
| def | check_key (key, types, optional=False, kwargs) |
| def | validate_btc (coin) |
| def | _load_btc_coins () |
| def | _load_ethereum_networks () |
| def | _load_erc20_tokens () |
| def | _load_nem_mosaics () |
| def | _load_misc () |
| def | _load_fido_apps () |
| def | get_support_data () |
| def | latest_releases () |
| def | is_token (coin) |
| def | support_info_single (support_data, coin) |
| def | support_info (coins) |
| def | _ensure_mandatory_values (coins) |
| def | symbol_from_shortcut (shortcut) |
| def | mark_duplicate_shortcuts (coins) |
| def | deduplicate_erc20 (buckets, networks) |
| def | deduplicate_keys (all_coins) |
| def | _btc_sort_key (coin) |
| def | collect_coin_info () |
| def | sort_coin_infos (all_coins) |
| def | coin_info_with_duplicates () |
| def | coin_info () |
| def | fido_info () |
| def | search (coins, keyword) |
Variables | |
| requests = None | |
| log = logging.getLogger(__name__) | |
| DEFS_DIR | |
| list | BTC_CHECKS |
| string | RELEASES_URL = "https://beta-wallet.trezor.io/data/firmware/{}/releases.json" |
| tuple | MISSING_SUPPORT_MEANS_NO = ("connect", "webwallet") |
| tuple | VERSIONED_SUPPORT_INFO = ("trezor1", "trezor2") |
|
private |
|
private |
Checks that every coin has the mandatory fields: name, shortcut, key
|
private |
Load btc-like coins from `bitcoin/*.json`
|
private |
Load ERC20 tokens from `ethereum/tokens` submodule.
|
private |
Load ethereum networks from `ethereum/networks.json`
|
private |
Load FIDO apps from `fido/*.json`
|
private |
Loads miscellaneous networks from `misc/misc.json`
|
private |
Loads NEM mosaics from `nem/nem_mosaics.json`
| def coin_info.check_key | ( | key, | |
| types, | |||
optional = False, |
|||
| kwargs | |||
| ) |
| def coin_info.check_type | ( | val, | |
| types, | |||
nullable = False, |
|||
empty = False, |
|||
regex = None, |
|||
choice = None |
|||
| ) |
| def coin_info.coin_info | ( | ) |
Collects coin info, fills out support info and returns the result. Does not auto-delete duplicates. This should now be based on support info.
| def coin_info.coin_info_with_duplicates | ( | ) |
Collects coin info, detects duplicates but does not remove them. Returns the CoinsInfo object and duplicate buckets.
| def coin_info.collect_coin_info | ( | ) |
Returns all definition as dict organized by coin type. `coins` for btc-like coins, `eth` for ethereum networks, `erc20` for ERC20 tokens, `nem` for NEM mosaics, `misc` for other networks.
| def coin_info.deduplicate_erc20 | ( | buckets, | |
| networks | |||
| ) |
Apply further processing to ERC20 duplicate buckets. This function works on results of `mark_duplicate_shortcuts`. Buckets that contain at least one non-token are ignored - symbol collisions with non-tokens always apply. Otherwise the following rules are applied: 1. If _all tokens_ in the bucket have shortcuts with distinct suffixes, e.g., `CAT (BitClave)` and `CAT (Blockcat)`, the bucket is cleared - all are considered non-duplicate. (If even one token in the bucket _does not_ have a distinct suffix, e.g., `MIT` and `MIT (Mychatcoin)`, this rule does not apply and ALL tokens in the bucket are still considered duplicate.) 2. If there is only one "main" token in the bucket, the bucket is cleared. That means that all other tokens must either be on testnets, or they must be marked as deprecated, with a deprecation pointing to the "main" token.
| def coin_info.deduplicate_keys | ( | all_coins | ) |
| def coin_info.fido_info | ( | ) |
Returns info about known FIDO/U2F apps.
| def coin_info.get_support_data | ( | ) |
Get raw support data from `support.json`.
| def coin_info.is_token | ( | coin | ) |
| def coin_info.latest_releases | ( | ) |
Get latest released firmware versions for Trezor 1 and 2
| def coin_info.load_json | ( | path | ) |
Convenience function to load a JSON file from DEFS_DIR.
| def coin_info.mark_duplicate_shortcuts | ( | coins | ) |
Finds coins with identical symbols and sets their `duplicate` field. "Symbol" here means the first part of `shortcut` (separated by space), so, e.g., "BTL (Battle)" and "BTL (Bitlle)" have the same symbol "BTL". The result of this function is a dictionary of _buckets_, each of which is indexed by the duplicated symbol, or `_override`. The `_override` bucket will contain all coins that are set to `true` in `duplicity_overrides.json`. Each coin in every bucket will have its "duplicate" property set to True, unless it's explicitly marked as `false` in `duplicity_overrides.json`.
| def coin_info.search | ( | coins, | |
| keyword | |||
| ) |
| def coin_info.sort_coin_infos | ( | all_coins | ) |
| def coin_info.support_info | ( | coins | ) |
Generate Trezor support information. 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". The `coins` argument can be a `CoinsInfo` object, a list or a dict of coin items. Support information is taken from `support.json`.
| def coin_info.support_info_single | ( | support_data, | |
| coin | |||
| ) |
Extract a support dict from `support.json` data. Returns a dict of support values for each "device", i.e., `support.json` top-level key. The support value for each device is determined in order of priority: * 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) * otherwise support is presumed "soon"
| def coin_info.symbol_from_shortcut | ( | shortcut | ) |
| def coin_info.validate_btc | ( | coin | ) |
| list coin_info.BTC_CHECKS |
| coin_info.DEFS_DIR |
| coin_info.log = logging.getLogger(__name__) |
| tuple coin_info.MISSING_SUPPORT_MEANS_NO = ("connect", "webwallet") |
| string coin_info.RELEASES_URL = "https://beta-wallet.trezor.io/data/firmware/{}/releases.json" |
| coin_info.requests = None |
| tuple coin_info.VERSIONED_SUPPORT_INFO = ("trezor1", "trezor2") |
1.8.14