|
Monero
|
Functions | |
| crayon (color, string, bold=False, dim=False) | |
| print_log (level, *args, **kwargs) | |
| c_str_filter (b) | |
| black_repr_filter (val) | |
| ascii_filter (s) | |
| make_support_filter (support_info) | |
| render_file (src, dst, coins, support_info) | |
| mark_unsupported (support_info, coins) | |
| highlight_key (coin, color) | |
| find_collisions (coins, field) | |
| check_eth (coins) | |
| check_btc (coins) | |
| check_dups (buckets, print_at_level=logging.WARNING) | |
| check_backends (coins) | |
| check_icons (coins) | |
| check_key_uniformity (coins) | |
| check_segwit (coins) | |
| check_fido (apps) | |
| convert_icon (icon) | |
| coindef_from_dict (coin) | |
| serialize_coindef (proto, icon) | |
| sign (data) | |
| cli (colors) | |
| check (backend, icons, show_duplicates) | |
| dump (outfile, support, pretty, flat_list, include, exclude, include_type, exclude_type, filter, filter_exclude, exclude_tokens, device) | |
| coindefs (outfile) | |
| render (paths, outfile, verbose, bitcoin_only) | |
Variables | |
| termcolor = None | |
| bool | CAN_RENDER = True |
| requests = None | |
| bool | CAN_BUILD_DEFS = True |
| bool | USE_COLORS = False |
| dict | MAKO_FILTERS |
| IGNORE_NONUNIFORM_KEYS = frozenset(("unsupported", "duplicate")) | |
| FIDO_KNOWN_KEYS | |
| cointool.ascii_filter | ( | s | ) |
| cointool.black_repr_filter | ( | val | ) |
| cointool.c_str_filter | ( | b | ) |
| cointool.check | ( | backend, | |
| icons, | |||
| show_duplicates ) |
Validate coin definitions. Checks that every btc-like coin is properly filled out, reports duplicate symbols, missing or invalid icons, backend responses, and uniform key information -- i.e., that all coins of the same type have the same fields in their JSON data. Uniformity check ignores NEM mosaics and ERC20 tokens, where non-uniformity is expected. The `--show-duplicates` option can be set to: - all: all shortcut collisions are shown, including colliding ERC20 tokens - nontoken: only collisions that affect non-ERC20 coins are shown - errors: only collisions between non-ERC20 tokens are shown. This is the default, as a collision between two or more non-ERC20 tokens is an error. In the output, duplicate ERC tokens will be shown in cyan; duplicate non-tokens in red. An asterisk (*) next to symbol name means that even though it was detected as duplicate, it is still included in results. The collision detection checks that SLIP44 numbers don't collide between different mainnets (testnet collisions are allowed), that `address_prefix` doesn't collide with Bitcoin (other collisions are reported as warnings). `address_prefix_p2sh` is also checked but we have a bunch of collisions there and can't do much about them, so it's not an error. In the collision checks, Bitcoin is shown in red, other mainnets in blue, testnets in green and unsupported networks in gray, marked with `(X)` for non-colored output.
| cointool.check_backends | ( | coins | ) |
| cointool.check_btc | ( | coins | ) |
| cointool.check_dups | ( | buckets, | |
| print_at_level = logging.WARNING ) |
Analyze and pretty-print results of `coin_info.mark_duplicate_shortcuts`. `print_at_level` can be one of logging levels. The results are buckets of colliding symbols. If the collision is only between ERC20 tokens, it's DEBUG. If the collision includes one non-token, it's INFO. If the collision includes more than one non-token, it's ERROR and printed always.
| cointool.check_eth | ( | coins | ) |
| cointool.check_fido | ( | apps | ) |
| cointool.check_icons | ( | coins | ) |
| cointool.check_key_uniformity | ( | coins | ) |
| cointool.check_segwit | ( | coins | ) |
| cointool.cli | ( | colors | ) |
| cointool.coindef_from_dict | ( | coin | ) |
| cointool.coindefs | ( | outfile | ) |
Generate signed coin definitions for python-trezor and others This is currently unused but should enable us to add new coins without having to update firmware.
| cointool.convert_icon | ( | icon | ) |
Convert PIL icon to TOIF format
| cointool.crayon | ( | color, | |
| string, | |||
| bold = False, | |||
| dim = False ) |
| cointool.dump | ( | outfile, | |
| support, | |||
| pretty, | |||
| flat_list, | |||
| include, | |||
| exclude, | |||
| include_type, | |||
| exclude_type, | |||
| filter, | |||
| filter_exclude, | |||
| exclude_tokens, | |||
| device ) |
Dump coin data in JSON format. This file is structured the same as the internal data. That is, top-level object is a dict with keys: 'bitcoin', 'eth', 'erc20', 'nem' and 'misc'. Value for each key is a list of dicts, each describing a known coin. If '--list' is specified, the top-level object is instead a flat list of coins. \b Fields are category-specific, except for four common ones: - 'name' - human-readable name - 'shortcut' - currency symbol - 'key' - unique identifier, e.g., 'bitcoin:BTC' - 'support' - a dict with entries per known device To control the size and properties of the resulting file, you can specify whether or not you want pretty-printing and whether or not to include support data with each coin. You can specify which categories and which fields will be included or excluded. You cannot specify both include and exclude at the same time. Include is "stronger" than exclude, in that _only_ the specified fields are included. You can also specify filters, in the form '-f field=value' (or '-F' for inverse filter). Filter values are case-insensitive and support shell-style wildcards, so '-f name=bit*' finds all coins whose names start with "bit" or "Bit".
| cointool.find_collisions | ( | coins, | |
| field ) |
Detects collisions in a given field. Returns buckets of colliding coins.
| cointool.highlight_key | ( | coin, | |
| color ) |
Return a colorful string where the SYMBOL part is bold.
| cointool.make_support_filter | ( | support_info | ) |
| cointool.mark_unsupported | ( | support_info, | |
| coins ) |
| cointool.print_log | ( | level, | |
| * | args, | ||
| ** | kwargs ) |
| cointool.render | ( | paths, | |
| outfile, | |||
| verbose, | |||
| bitcoin_only ) |
Generate source code from Mako templates. For every "foo.bar.mako" filename passed, runs the template and saves the result as "foo.bar". For every directory name passed, processes all ".mako" files found in that directory. If `-o` is specified, renders a single file into the specified outfile. If no arguments are given, processes the current directory.
| cointool.render_file | ( | src, | |
| dst, | |||
| coins, | |||
| support_info ) |
Renders `src` template into `dst`. `src` is a filename, `dst` is an open file object.
| cointool.serialize_coindef | ( | proto, | |
| icon ) |
| cointool.sign | ( | data | ) |
| bool cointool.CAN_BUILD_DEFS = True |
| bool cointool.CAN_RENDER = True |
| cointool.FIDO_KNOWN_KEYS |
| cointool.IGNORE_NONUNIFORM_KEYS = frozenset(("unsupported", "duplicate")) |
| dict cointool.MAKO_FILTERS |
| cointool.requests = None |
| cointool.termcolor = None |
| bool cointool.USE_COLORS = False |