|
|
|
@ -1,6 +1,7 @@
|
|
|
|
|
# generated from tokens.py.mako
|
|
|
|
|
# do not edit manually!
|
|
|
|
|
|
|
|
|
|
# flake8: noqa
|
|
|
|
|
# fmt: off
|
|
|
|
|
<%
|
|
|
|
|
from collections import defaultdict
|
|
|
|
|
|
|
|
|
@ -9,7 +10,7 @@ def group_tokens(tokens):
|
|
|
|
|
for t in sorted(tokens, key=lambda t: t.chain_id):
|
|
|
|
|
r[t.chain_id].append(t)
|
|
|
|
|
return r
|
|
|
|
|
%>
|
|
|
|
|
%>\
|
|
|
|
|
|
|
|
|
|
UNKNOWN_TOKEN = (None, None, None, None)
|
|
|
|
|
|
|
|
|
@ -17,7 +18,6 @@ UNKNOWN_TOKEN = (None, None, None, None)
|
|
|
|
|
def token_by_chain_address(chain_id, address):
|
|
|
|
|
if False:
|
|
|
|
|
pass
|
|
|
|
|
# fmt: off
|
|
|
|
|
% for token_chain_id, tokens in group_tokens(supported_on("trezor2", erc20)).items():
|
|
|
|
|
elif chain_id == ${token_chain_id}:
|
|
|
|
|
if False:
|
|
|
|
@ -27,5 +27,4 @@ def token_by_chain_address(chain_id, address):
|
|
|
|
|
return (chain_id, address, ${black_repr(t.symbol)}, ${t.decimals}) # ${t.chain} / ${t.name.strip()}
|
|
|
|
|
% endfor
|
|
|
|
|
% endfor
|
|
|
|
|
# fmt: on
|
|
|
|
|
return UNKNOWN_TOKEN
|
|
|
|
|