Esempio n. 1
0
gas_price       = 5000000000
nonce           = 11
token_address   = "0xa74476443119A942dE498590Fe1f2454d7D4aC0d" #EIP-55
to_address      = "0xA6ABB480640d6D27D2FB314196D94463ceDcB31e" #EIP-55
amount          = 5000000000000000

# Nothing changes below here
device = get_transport()
client = TrezorClient(transport=device, ui=ui.ClickUI())

fw = client.features
fw_min = min_version[fw.model]
py_min = (3,6,0)
tl_min = [0,12,0]
if (fw_min > (fw.major_version, fw.minor_version,fw.patch_version) or
    tl_min > [int(i) for i in lib_version.split('.')] or py_min > py_ver):
    m = "Requires at least Python rev {}, trezorlib rev {}, and FW rev {}"
    print(m.format(py_min, tl_min, fw_min))
    exit(1)

w3 = Web3()
address_n = tools.parse_path(address)
from_address = ethereum.get_address(client, address_n)

if token_address: #ERC20 KungFu
    min_abi = [
        {
            "name": "transfer",
            "type": "function",
            "constant": False,
            "inputs": [
Esempio n. 2
0
tx_locktime = 0
sequence = 4294967293

# Code
in1_prev_txn_j = loads(in1_prev_txn_s, parse_float=Decimal)
in1_prev_hash = in1_prev_txn_j['txid']
in1_prev_hash_b = bytes.fromhex(in1_prev_hash)
device = get_transport()
client = TrezorClient(transport=device, ui=ui.ClickUI())

fw = client.features
fw_min = min_version[fw.model]
py_min = (3, 6, 0)
tl_min = [0, 12, 0]
if (fw_min > (fw.major_version, fw.minor_version, fw.patch_version)
        or tl_min > [int(i) for i in lib_version.split('.')]
        or py_min > py_ver):
    m = "Requires at least Python rev {}, trezorlib rev {}, and FW rev {}"
    print(m.format(py_min, tl_min, fw_min))
    exit(1)

signtx = proto.SignTx(version=tx_version, lock_time=tx_locktime)

ins = [
    proto.TxInputType(address_n=tools.parse_path(in1_addr_path),
                      prev_hash=in1_prev_hash_b,
                      prev_index=in1_prev_index,
                      amount=in1_amount,
                      script_type=proto.InputScriptType.SPENDWITNESS,
                      sequence=sequence)
]