mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-11-22 07:28:10 +00:00
python: return generated files to git
This separates the regeneration step from the build/install step. This is to simplify bootstrapping: trezorlib is needed in several build/test steps, and bound to be needed in more. It should be usable and installable straight from the checkout.
This commit is contained in:
parent
b5b4a2ca5f
commit
cf396e3661
3
python/.gitignore
vendored
3
python/.gitignore
vendored
@ -7,6 +7,3 @@ MANIFEST
|
||||
*.bin
|
||||
*.py.cache
|
||||
/.tox
|
||||
|
||||
/trezorlib/coins.json
|
||||
/trezorlib/messages/*
|
||||
|
@ -7,6 +7,21 @@ EXCLUDE_TARGETS=messages
|
||||
|
||||
all: build
|
||||
|
||||
clean-gen: ## remove generated files
|
||||
rm -f trezorlib/messages/*.py
|
||||
rm -f trezorlib/coins.json
|
||||
|
||||
gen: clean-gen
|
||||
$(PYTHON) ../common/tools/cointool.py dump \
|
||||
--list --support \
|
||||
--include-type=bitcoin \
|
||||
--exclude=icon \
|
||||
-o trezorlib/coins.json
|
||||
$(PYTHON) ../common/protob/pb2py \
|
||||
-o trezorlib/messages \
|
||||
-P ..protobuf \
|
||||
../common/protob/*.proto
|
||||
|
||||
build:
|
||||
$(SETUP) build
|
||||
|
||||
@ -17,11 +32,7 @@ dist: clean
|
||||
$(SETUP) sdist
|
||||
$(SETUP) bdist_wheel
|
||||
|
||||
clean: clean-generated clean-build clean-pyc clean-test ## remove all build, test, coverage and Python artifacts
|
||||
|
||||
clean-generated: ## remove generated files
|
||||
rm -f trezorlib/messages/*.py
|
||||
rm -f trezorlib/coins.json
|
||||
clean: clean-build clean-pyc clean-test ## remove all build, test, coverage and Python artifacts
|
||||
|
||||
clean-build: ## remove build artifacts
|
||||
rm -fr build/
|
||||
@ -55,4 +66,4 @@ style_check:
|
||||
isort --check-only --recursive $(STYLE_TARGETS) --skip-glob "$(EXCLUDE_TARGETS)/*"
|
||||
flake8
|
||||
|
||||
.PHONY: all build install clean style style_check git-clean clean-generated clean-build clean-pyc clean-test
|
||||
.PHONY: all build install clean style style_check git-clean clean-build clean-pyc clean-test
|
||||
|
@ -1,15 +1,9 @@
|
||||
#!/usr/bin/env python3
|
||||
import glob
|
||||
import json
|
||||
import os.path
|
||||
import re
|
||||
import subprocess
|
||||
import sys
|
||||
from distutils.errors import DistutilsError
|
||||
|
||||
from setuptools import Command, find_packages, setup
|
||||
from setuptools.command.build_py import build_py
|
||||
from setuptools.command.develop import develop
|
||||
|
||||
install_requires = [
|
||||
"setuptools>=19.0",
|
||||
@ -24,7 +18,6 @@ install_requires = [
|
||||
]
|
||||
|
||||
CWD = os.path.dirname(os.path.realpath(__file__))
|
||||
TREZOR_COMMON = os.path.join(CWD, "vendor", "trezor-common")
|
||||
|
||||
|
||||
def read(*path):
|
||||
@ -42,24 +35,8 @@ def find_version():
|
||||
raise RuntimeError("Version string not found")
|
||||
|
||||
|
||||
def build_coins_json(dst):
|
||||
TOOLS_PATH = os.path.join(TREZOR_COMMON, "tools")
|
||||
sys.path.insert(0, TOOLS_PATH)
|
||||
import coin_info
|
||||
|
||||
coins = coin_info.coin_info().bitcoin
|
||||
support = coin_info.support_info(coins)
|
||||
for coin in coins:
|
||||
coin["support"] = support[coin["key"]]
|
||||
|
||||
with open(dst, "w") as f:
|
||||
json.dump(coins, f, indent=2, sort_keys=True)
|
||||
|
||||
del sys.path[0]
|
||||
|
||||
|
||||
class PrebuildCommand(Command):
|
||||
description = "update vendored files (coins.json, protobuf messages)"
|
||||
description = "Deprecated. Run 'make gen' instead."
|
||||
user_options = []
|
||||
|
||||
def initialize_options(self):
|
||||
@ -69,51 +46,7 @@ class PrebuildCommand(Command):
|
||||
pass
|
||||
|
||||
def run(self):
|
||||
# check for existence of the submodule directory
|
||||
common_defs = os.path.join(TREZOR_COMMON, "defs")
|
||||
if not os.path.exists(common_defs):
|
||||
raise DistutilsError(
|
||||
"trezor-common submodule seems to be missing.\n"
|
||||
+ "Use 'git submodule update --init' to retrieve it."
|
||||
)
|
||||
|
||||
# generate and copy coins.json to the tree
|
||||
coins_json = os.path.join(CWD, "trezorlib", "coins.json")
|
||||
build_coins_json(coins_json)
|
||||
|
||||
# regenerate messages
|
||||
try:
|
||||
proto_srcs = glob.glob(os.path.join(TREZOR_COMMON, "protob", "*.proto"))
|
||||
subprocess.check_call(
|
||||
[
|
||||
sys.executable,
|
||||
os.path.join(TREZOR_COMMON, "protob", "pb2py"),
|
||||
"-o",
|
||||
os.path.join(CWD, "trezorlib", "messages"),
|
||||
"-P",
|
||||
"..protobuf",
|
||||
]
|
||||
+ proto_srcs
|
||||
)
|
||||
except Exception as e:
|
||||
raise DistutilsError(
|
||||
"Generating protobuf failed. Make sure you have 'protoc' in your PATH."
|
||||
) from e
|
||||
|
||||
|
||||
def _patch_prebuild(cls):
|
||||
"""Patch a setuptools command to depend on `prebuild`"""
|
||||
orig_run = cls.run
|
||||
|
||||
def new_run(self):
|
||||
self.run_command("prebuild")
|
||||
orig_run(self)
|
||||
|
||||
cls.run = new_run
|
||||
|
||||
|
||||
_patch_prebuild(build_py)
|
||||
_patch_prebuild(develop)
|
||||
raise DistutilsError(self.description)
|
||||
|
||||
|
||||
setup(
|
||||
|
1
python/trezorlib/coins.json
Normal file
1
python/trezorlib/coins.json
Normal file
File diff suppressed because one or more lines are too long
@ -24,12 +24,7 @@ COINS_JSON = os.path.join(os.path.dirname(__file__), "coins.json")
|
||||
|
||||
def _load_coins_json():
|
||||
# Load coins.json to local variables
|
||||
# NOTE: coins.json comes from 'vendor/trezor-common/coins.json',
|
||||
# which is a git submodule. If you're trying to run trezorlib directly
|
||||
# from the checkout (or tarball), initialize the submodule with:
|
||||
# $ git submodule update --init
|
||||
# and install coins.json with:
|
||||
# $ python setup.py prebuild
|
||||
# NOTE: coins.json is generated via `make generated` command.
|
||||
with open(COINS_JSON) as coins_json:
|
||||
return json.load(coins_json)
|
||||
|
||||
|
19
python/trezorlib/messages/Address.py
Normal file
19
python/trezorlib/messages/Address.py
Normal file
@ -0,0 +1,19 @@
|
||||
# Automatically generated by pb2py
|
||||
# fmt: off
|
||||
from .. import protobuf as p
|
||||
|
||||
|
||||
class Address(p.MessageType):
|
||||
MESSAGE_WIRE_TYPE = 30
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
address: str = None,
|
||||
) -> None:
|
||||
self.address = address
|
||||
|
||||
@classmethod
|
||||
def get_fields(cls):
|
||||
return {
|
||||
1: ('address', p.UnicodeType, 0), # required
|
||||
}
|
19
python/trezorlib/messages/ApplyFlags.py
Normal file
19
python/trezorlib/messages/ApplyFlags.py
Normal file
@ -0,0 +1,19 @@
|
||||
# Automatically generated by pb2py
|
||||
# fmt: off
|
||||
from .. import protobuf as p
|
||||
|
||||
|
||||
class ApplyFlags(p.MessageType):
|
||||
MESSAGE_WIRE_TYPE = 28
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
flags: int = None,
|
||||
) -> None:
|
||||
self.flags = flags
|
||||
|
||||
@classmethod
|
||||
def get_fields(cls):
|
||||
return {
|
||||
1: ('flags', p.UVarintType, 0),
|
||||
}
|
37
python/trezorlib/messages/ApplySettings.py
Normal file
37
python/trezorlib/messages/ApplySettings.py
Normal file
@ -0,0 +1,37 @@
|
||||
# Automatically generated by pb2py
|
||||
# fmt: off
|
||||
from .. import protobuf as p
|
||||
|
||||
|
||||
class ApplySettings(p.MessageType):
|
||||
MESSAGE_WIRE_TYPE = 25
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
language: str = None,
|
||||
label: str = None,
|
||||
use_passphrase: bool = None,
|
||||
homescreen: bytes = None,
|
||||
passphrase_source: int = None,
|
||||
auto_lock_delay_ms: int = None,
|
||||
display_rotation: int = None,
|
||||
) -> None:
|
||||
self.language = language
|
||||
self.label = label
|
||||
self.use_passphrase = use_passphrase
|
||||
self.homescreen = homescreen
|
||||
self.passphrase_source = passphrase_source
|
||||
self.auto_lock_delay_ms = auto_lock_delay_ms
|
||||
self.display_rotation = display_rotation
|
||||
|
||||
@classmethod
|
||||
def get_fields(cls):
|
||||
return {
|
||||
1: ('language', p.UnicodeType, 0),
|
||||
2: ('label', p.UnicodeType, 0),
|
||||
3: ('use_passphrase', p.BoolType, 0),
|
||||
4: ('homescreen', p.BytesType, 0),
|
||||
5: ('passphrase_source', p.UVarintType, 0),
|
||||
6: ('auto_lock_delay_ms', p.UVarintType, 0),
|
||||
7: ('display_rotation', p.UVarintType, 0),
|
||||
}
|
7
python/trezorlib/messages/BackupDevice.py
Normal file
7
python/trezorlib/messages/BackupDevice.py
Normal file
@ -0,0 +1,7 @@
|
||||
# Automatically generated by pb2py
|
||||
# fmt: off
|
||||
from .. import protobuf as p
|
||||
|
||||
|
||||
class BackupDevice(p.MessageType):
|
||||
MESSAGE_WIRE_TYPE = 34
|
19
python/trezorlib/messages/BinanceAddress.py
Normal file
19
python/trezorlib/messages/BinanceAddress.py
Normal file
@ -0,0 +1,19 @@
|
||||
# Automatically generated by pb2py
|
||||
# fmt: off
|
||||
from .. import protobuf as p
|
||||
|
||||
|
||||
class BinanceAddress(p.MessageType):
|
||||
MESSAGE_WIRE_TYPE = 701
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
address: str = None,
|
||||
) -> None:
|
||||
self.address = address
|
||||
|
||||
@classmethod
|
||||
def get_fields(cls):
|
||||
return {
|
||||
1: ('address', p.UnicodeType, 0),
|
||||
}
|
25
python/trezorlib/messages/BinanceCancelMsg.py
Normal file
25
python/trezorlib/messages/BinanceCancelMsg.py
Normal file
@ -0,0 +1,25 @@
|
||||
# Automatically generated by pb2py
|
||||
# fmt: off
|
||||
from .. import protobuf as p
|
||||
|
||||
|
||||
class BinanceCancelMsg(p.MessageType):
|
||||
MESSAGE_WIRE_TYPE = 708
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
refid: str = None,
|
||||
sender: str = None,
|
||||
symbol: str = None,
|
||||
) -> None:
|
||||
self.refid = refid
|
||||
self.sender = sender
|
||||
self.symbol = symbol
|
||||
|
||||
@classmethod
|
||||
def get_fields(cls):
|
||||
return {
|
||||
1: ('refid', p.UnicodeType, 0),
|
||||
2: ('sender', p.UnicodeType, 0),
|
||||
3: ('symbol', p.UnicodeType, 0),
|
||||
}
|
21
python/trezorlib/messages/BinanceCoin.py
Normal file
21
python/trezorlib/messages/BinanceCoin.py
Normal file
@ -0,0 +1,21 @@
|
||||
# Automatically generated by pb2py
|
||||
# fmt: off
|
||||
from .. import protobuf as p
|
||||
|
||||
|
||||
class BinanceCoin(p.MessageType):
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
amount: int = None,
|
||||
denom: str = None,
|
||||
) -> None:
|
||||
self.amount = amount
|
||||
self.denom = denom
|
||||
|
||||
@classmethod
|
||||
def get_fields(cls):
|
||||
return {
|
||||
1: ('amount', p.SVarintType, 0),
|
||||
2: ('denom', p.UnicodeType, 0),
|
||||
}
|
28
python/trezorlib/messages/BinanceGetAddress.py
Normal file
28
python/trezorlib/messages/BinanceGetAddress.py
Normal file
@ -0,0 +1,28 @@
|
||||
# Automatically generated by pb2py
|
||||
# fmt: off
|
||||
from .. import protobuf as p
|
||||
|
||||
if __debug__:
|
||||
try:
|
||||
from typing import List
|
||||
except ImportError:
|
||||
List = None # type: ignore
|
||||
|
||||
|
||||
class BinanceGetAddress(p.MessageType):
|
||||
MESSAGE_WIRE_TYPE = 700
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
address_n: List[int] = None,
|
||||
show_display: bool = None,
|
||||
) -> None:
|
||||
self.address_n = address_n if address_n is not None else []
|
||||
self.show_display = show_display
|
||||
|
||||
@classmethod
|
||||
def get_fields(cls):
|
||||
return {
|
||||
1: ('address_n', p.UVarintType, p.FLAG_REPEATED),
|
||||
2: ('show_display', p.BoolType, 0),
|
||||
}
|
28
python/trezorlib/messages/BinanceGetPublicKey.py
Normal file
28
python/trezorlib/messages/BinanceGetPublicKey.py
Normal file
@ -0,0 +1,28 @@
|
||||
# Automatically generated by pb2py
|
||||
# fmt: off
|
||||
from .. import protobuf as p
|
||||
|
||||
if __debug__:
|
||||
try:
|
||||
from typing import List
|
||||
except ImportError:
|
||||
List = None # type: ignore
|
||||
|
||||
|
||||
class BinanceGetPublicKey(p.MessageType):
|
||||
MESSAGE_WIRE_TYPE = 702
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
address_n: List[int] = None,
|
||||
show_display: bool = None,
|
||||
) -> None:
|
||||
self.address_n = address_n if address_n is not None else []
|
||||
self.show_display = show_display
|
||||
|
||||
@classmethod
|
||||
def get_fields(cls):
|
||||
return {
|
||||
1: ('address_n', p.UVarintType, p.FLAG_REPEATED),
|
||||
2: ('show_display', p.BoolType, 0),
|
||||
}
|
29
python/trezorlib/messages/BinanceInputOutput.py
Normal file
29
python/trezorlib/messages/BinanceInputOutput.py
Normal file
@ -0,0 +1,29 @@
|
||||
# Automatically generated by pb2py
|
||||
# fmt: off
|
||||
from .. import protobuf as p
|
||||
|
||||
from .BinanceCoin import BinanceCoin
|
||||
|
||||
if __debug__:
|
||||
try:
|
||||
from typing import List
|
||||
except ImportError:
|
||||
List = None # type: ignore
|
||||
|
||||
|
||||
class BinanceInputOutput(p.MessageType):
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
address: str = None,
|
||||
coins: List[BinanceCoin] = None,
|
||||
) -> None:
|
||||
self.address = address
|
||||
self.coins = coins if coins is not None else []
|
||||
|
||||
@classmethod
|
||||
def get_fields(cls):
|
||||
return {
|
||||
1: ('address', p.UnicodeType, 0),
|
||||
2: ('coins', BinanceCoin, p.FLAG_REPEATED),
|
||||
}
|
40
python/trezorlib/messages/BinanceOrderMsg.py
Normal file
40
python/trezorlib/messages/BinanceOrderMsg.py
Normal file
@ -0,0 +1,40 @@
|
||||
# Automatically generated by pb2py
|
||||
# fmt: off
|
||||
from .. import protobuf as p
|
||||
|
||||
|
||||
class BinanceOrderMsg(p.MessageType):
|
||||
MESSAGE_WIRE_TYPE = 707
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
id: str = None,
|
||||
ordertype: int = None,
|
||||
price: int = None,
|
||||
quantity: int = None,
|
||||
sender: str = None,
|
||||
side: int = None,
|
||||
symbol: str = None,
|
||||
timeinforce: int = None,
|
||||
) -> None:
|
||||
self.id = id
|
||||
self.ordertype = ordertype
|
||||
self.price = price
|
||||
self.quantity = quantity
|
||||
self.sender = sender
|
||||
self.side = side
|
||||
self.symbol = symbol
|
||||
self.timeinforce = timeinforce
|
||||
|
||||
@classmethod
|
||||
def get_fields(cls):
|
||||
return {
|
||||
1: ('id', p.UnicodeType, 0),
|
||||
2: ('ordertype', p.UVarintType, 0),
|
||||
3: ('price', p.SVarintType, 0),
|
||||
4: ('quantity', p.SVarintType, 0),
|
||||
5: ('sender', p.UnicodeType, 0),
|
||||
6: ('side', p.UVarintType, 0),
|
||||
7: ('symbol', p.UnicodeType, 0),
|
||||
8: ('timeinforce', p.UVarintType, 0),
|
||||
}
|
5
python/trezorlib/messages/BinanceOrderSide.py
Normal file
5
python/trezorlib/messages/BinanceOrderSide.py
Normal file
@ -0,0 +1,5 @@
|
||||
# Automatically generated by pb2py
|
||||
# fmt: off
|
||||
SIDE_UNKNOWN = 0
|
||||
BUY = 1
|
||||
SELL = 2
|
6
python/trezorlib/messages/BinanceOrderType.py
Normal file
6
python/trezorlib/messages/BinanceOrderType.py
Normal file
@ -0,0 +1,6 @@
|
||||
# Automatically generated by pb2py
|
||||
# fmt: off
|
||||
OT_UNKNOWN = 0
|
||||
MARKET = 1
|
||||
LIMIT = 2
|
||||
OT_RESERVED = 3
|
19
python/trezorlib/messages/BinancePublicKey.py
Normal file
19
python/trezorlib/messages/BinancePublicKey.py
Normal file
@ -0,0 +1,19 @@
|
||||
# Automatically generated by pb2py
|
||||
# fmt: off
|
||||
from .. import protobuf as p
|
||||
|
||||
|
||||
class BinancePublicKey(p.MessageType):
|
||||
MESSAGE_WIRE_TYPE = 703
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
public_key: bytes = None,
|
||||
) -> None:
|
||||
self.public_key = public_key
|
||||
|
||||
@classmethod
|
||||
def get_fields(cls):
|
||||
return {
|
||||
1: ('public_key', p.BytesType, 0),
|
||||
}
|
43
python/trezorlib/messages/BinanceSignTx.py
Normal file
43
python/trezorlib/messages/BinanceSignTx.py
Normal file
@ -0,0 +1,43 @@
|
||||
# Automatically generated by pb2py
|
||||
# fmt: off
|
||||
from .. import protobuf as p
|
||||
|
||||
if __debug__:
|
||||
try:
|
||||
from typing import List
|
||||
except ImportError:
|
||||
List = None # type: ignore
|
||||
|
||||
|
||||
class BinanceSignTx(p.MessageType):
|
||||
MESSAGE_WIRE_TYPE = 704
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
address_n: List[int] = None,
|
||||
msg_count: int = None,
|
||||
account_number: int = None,
|
||||
chain_id: str = None,
|
||||
memo: str = None,
|
||||
sequence: int = None,
|
||||
source: int = None,
|
||||
) -> None:
|
||||
self.address_n = address_n if address_n is not None else []
|
||||
self.msg_count = msg_count
|
||||
self.account_number = account_number
|
||||
self.chain_id = chain_id
|
||||
self.memo = memo
|
||||
self.sequence = sequence
|
||||
self.source = source
|
||||
|
||||
@classmethod
|
||||
def get_fields(cls):
|
||||
return {
|
||||
1: ('address_n', p.UVarintType, p.FLAG_REPEATED),
|
||||
2: ('msg_count', p.UVarintType, 0),
|
||||
3: ('account_number', p.SVarintType, 0),
|
||||
4: ('chain_id', p.UnicodeType, 0),
|
||||
5: ('memo', p.UnicodeType, 0),
|
||||
6: ('sequence', p.SVarintType, 0),
|
||||
7: ('source', p.SVarintType, 0),
|
||||
}
|
25
python/trezorlib/messages/BinanceSignedTx.py
Normal file
25
python/trezorlib/messages/BinanceSignedTx.py
Normal file
@ -0,0 +1,25 @@
|
||||
# Automatically generated by pb2py
|
||||
# fmt: off
|
||||
from .. import protobuf as p
|
||||
|
||||
|
||||
class BinanceSignedTx(p.MessageType):
|
||||
MESSAGE_WIRE_TYPE = 709
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
signature: bytes = None,
|
||||
public_key: bytes = None,
|
||||
json: str = None,
|
||||
) -> None:
|
||||
self.signature = signature
|
||||
self.public_key = public_key
|
||||
self.json = json
|
||||
|
||||
@classmethod
|
||||
def get_fields(cls):
|
||||
return {
|
||||
1: ('signature', p.BytesType, 0),
|
||||
2: ('public_key', p.BytesType, 0),
|
||||
3: ('json', p.UnicodeType, 0),
|
||||
}
|
6
python/trezorlib/messages/BinanceTimeInForce.py
Normal file
6
python/trezorlib/messages/BinanceTimeInForce.py
Normal file
@ -0,0 +1,6 @@
|
||||
# Automatically generated by pb2py
|
||||
# fmt: off
|
||||
TIF_UNKNOWN = 0
|
||||
GTE = 1
|
||||
TIF_RESERVED = 2
|
||||
IOC = 3
|
30
python/trezorlib/messages/BinanceTransferMsg.py
Normal file
30
python/trezorlib/messages/BinanceTransferMsg.py
Normal file
@ -0,0 +1,30 @@
|
||||
# Automatically generated by pb2py
|
||||
# fmt: off
|
||||
from .. import protobuf as p
|
||||
|
||||
from .BinanceInputOutput import BinanceInputOutput
|
||||
|
||||
if __debug__:
|
||||
try:
|
||||
from typing import List
|
||||
except ImportError:
|
||||
List = None # type: ignore
|
||||
|
||||
|
||||
class BinanceTransferMsg(p.MessageType):
|
||||
MESSAGE_WIRE_TYPE = 706
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
inputs: List[BinanceInputOutput] = None,
|
||||
outputs: List[BinanceInputOutput] = None,
|
||||
) -> None:
|
||||
self.inputs = inputs if inputs is not None else []
|
||||
self.outputs = outputs if outputs is not None else []
|
||||
|
||||
@classmethod
|
||||
def get_fields(cls):
|
||||
return {
|
||||
1: ('inputs', BinanceInputOutput, p.FLAG_REPEATED),
|
||||
2: ('outputs', BinanceInputOutput, p.FLAG_REPEATED),
|
||||
}
|
7
python/trezorlib/messages/BinanceTxRequest.py
Normal file
7
python/trezorlib/messages/BinanceTxRequest.py
Normal file
@ -0,0 +1,7 @@
|
||||
# Automatically generated by pb2py
|
||||
# fmt: off
|
||||
from .. import protobuf as p
|
||||
|
||||
|
||||
class BinanceTxRequest(p.MessageType):
|
||||
MESSAGE_WIRE_TYPE = 705
|
7
python/trezorlib/messages/ButtonAck.py
Normal file
7
python/trezorlib/messages/ButtonAck.py
Normal file
@ -0,0 +1,7 @@
|
||||
# Automatically generated by pb2py
|
||||
# fmt: off
|
||||
from .. import protobuf as p
|
||||
|
||||
|
||||
class ButtonAck(p.MessageType):
|
||||
MESSAGE_WIRE_TYPE = 27
|
22
python/trezorlib/messages/ButtonRequest.py
Normal file
22
python/trezorlib/messages/ButtonRequest.py
Normal file
@ -0,0 +1,22 @@
|
||||
# Automatically generated by pb2py
|
||||
# fmt: off
|
||||
from .. import protobuf as p
|
||||
|
||||
|
||||
class ButtonRequest(p.MessageType):
|
||||
MESSAGE_WIRE_TYPE = 26
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
code: int = None,
|
||||
data: str = None,
|
||||
) -> None:
|
||||
self.code = code
|
||||
self.data = data
|
||||
|
||||
@classmethod
|
||||
def get_fields(cls):
|
||||
return {
|
||||
1: ('code', p.UVarintType, 0),
|
||||
2: ('data', p.UnicodeType, 0),
|
||||
}
|
17
python/trezorlib/messages/ButtonRequestType.py
Normal file
17
python/trezorlib/messages/ButtonRequestType.py
Normal file
@ -0,0 +1,17 @@
|
||||
# Automatically generated by pb2py
|
||||
# fmt: off
|
||||
Other = 1
|
||||
FeeOverThreshold = 2
|
||||
ConfirmOutput = 3
|
||||
ResetDevice = 4
|
||||
ConfirmWord = 5
|
||||
WipeDevice = 6
|
||||
ProtectCall = 7
|
||||
SignTx = 8
|
||||
FirmwareCheck = 9
|
||||
Address = 10
|
||||
PublicKey = 11
|
||||
MnemonicWordCount = 12
|
||||
MnemonicInput = 13
|
||||
PassphraseType = 14
|
||||
UnknownDerivationPath = 15
|
7
python/trezorlib/messages/Cancel.py
Normal file
7
python/trezorlib/messages/Cancel.py
Normal file
@ -0,0 +1,7 @@
|
||||
# Automatically generated by pb2py
|
||||
# fmt: off
|
||||
from .. import protobuf as p
|
||||
|
||||
|
||||
class Cancel(p.MessageType):
|
||||
MESSAGE_WIRE_TYPE = 20
|
19
python/trezorlib/messages/CardanoAddress.py
Normal file
19
python/trezorlib/messages/CardanoAddress.py
Normal file
@ -0,0 +1,19 @@
|
||||
# Automatically generated by pb2py
|
||||
# fmt: off
|
||||
from .. import protobuf as p
|
||||
|
||||
|
||||
class CardanoAddress(p.MessageType):
|
||||
MESSAGE_WIRE_TYPE = 308
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
address: str = None,
|
||||
) -> None:
|
||||
self.address = address
|
||||
|
||||
@classmethod
|
||||
def get_fields(cls):
|
||||
return {
|
||||
1: ('address', p.UnicodeType, 0),
|
||||
}
|
28
python/trezorlib/messages/CardanoGetAddress.py
Normal file
28
python/trezorlib/messages/CardanoGetAddress.py
Normal file
@ -0,0 +1,28 @@
|
||||
# Automatically generated by pb2py
|
||||
# fmt: off
|
||||
from .. import protobuf as p
|
||||
|
||||
if __debug__:
|
||||
try:
|
||||
from typing import List
|
||||
except ImportError:
|
||||
List = None # type: ignore
|
||||
|
||||
|
||||
class CardanoGetAddress(p.MessageType):
|
||||
MESSAGE_WIRE_TYPE = 307
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
address_n: List[int] = None,
|
||||
show_display: bool = None,
|
||||
) -> None:
|
||||
self.address_n = address_n if address_n is not None else []
|
||||
self.show_display = show_display
|
||||
|
||||
@classmethod
|
||||
def get_fields(cls):
|
||||
return {
|
||||
1: ('address_n', p.UVarintType, p.FLAG_REPEATED),
|
||||
2: ('show_display', p.BoolType, 0),
|
||||
}
|
28
python/trezorlib/messages/CardanoGetPublicKey.py
Normal file
28
python/trezorlib/messages/CardanoGetPublicKey.py
Normal file
@ -0,0 +1,28 @@
|
||||
# Automatically generated by pb2py
|
||||
# fmt: off
|
||||
from .. import protobuf as p
|
||||
|
||||
if __debug__:
|
||||
try:
|
||||
from typing import List
|
||||
except ImportError:
|
||||
List = None # type: ignore
|
||||
|
||||
|
||||
class CardanoGetPublicKey(p.MessageType):
|
||||
MESSAGE_WIRE_TYPE = 305
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
address_n: List[int] = None,
|
||||
show_display: bool = None,
|
||||
) -> None:
|
||||
self.address_n = address_n if address_n is not None else []
|
||||
self.show_display = show_display
|
||||
|
||||
@classmethod
|
||||
def get_fields(cls):
|
||||
return {
|
||||
1: ('address_n', p.UVarintType, p.FLAG_REPEATED),
|
||||
2: ('show_display', p.BoolType, 0),
|
||||
}
|
24
python/trezorlib/messages/CardanoPublicKey.py
Normal file
24
python/trezorlib/messages/CardanoPublicKey.py
Normal file
@ -0,0 +1,24 @@
|
||||
# Automatically generated by pb2py
|
||||
# fmt: off
|
||||
from .. import protobuf as p
|
||||
|
||||
from .HDNodeType import HDNodeType
|
||||
|
||||
|
||||
class CardanoPublicKey(p.MessageType):
|
||||
MESSAGE_WIRE_TYPE = 306
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
xpub: str = None,
|
||||
node: HDNodeType = None,
|
||||
) -> None:
|
||||
self.xpub = xpub
|
||||
self.node = node
|
||||
|
||||
@classmethod
|
||||
def get_fields(cls):
|
||||
return {
|
||||
1: ('xpub', p.UnicodeType, 0),
|
||||
2: ('node', HDNodeType, 0),
|
||||
}
|
37
python/trezorlib/messages/CardanoSignTx.py
Normal file
37
python/trezorlib/messages/CardanoSignTx.py
Normal file
@ -0,0 +1,37 @@
|
||||
# Automatically generated by pb2py
|
||||
# fmt: off
|
||||
from .. import protobuf as p
|
||||
|
||||
from .CardanoTxInputType import CardanoTxInputType
|
||||
from .CardanoTxOutputType import CardanoTxOutputType
|
||||
|
||||
if __debug__:
|
||||
try:
|
||||
from typing import List
|
||||
except ImportError:
|
||||
List = None # type: ignore
|
||||
|
||||
|
||||
class CardanoSignTx(p.MessageType):
|
||||
MESSAGE_WIRE_TYPE = 303
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
inputs: List[CardanoTxInputType] = None,
|
||||
outputs: List[CardanoTxOutputType] = None,
|
||||
transactions_count: int = None,
|
||||
protocol_magic: int = None,
|
||||
) -> None:
|
||||
self.inputs = inputs if inputs is not None else []
|
||||
self.outputs = outputs if outputs is not None else []
|
||||
self.transactions_count = transactions_count
|
||||
self.protocol_magic = protocol_magic
|
||||
|
||||
@classmethod
|
||||
def get_fields(cls):
|
||||
return {
|
||||
1: ('inputs', CardanoTxInputType, p.FLAG_REPEATED),
|
||||
2: ('outputs', CardanoTxOutputType, p.FLAG_REPEATED),
|
||||
3: ('transactions_count', p.UVarintType, 0),
|
||||
5: ('protocol_magic', p.UVarintType, 0),
|
||||
}
|
22
python/trezorlib/messages/CardanoSignedTx.py
Normal file
22
python/trezorlib/messages/CardanoSignedTx.py
Normal file
@ -0,0 +1,22 @@
|
||||
# Automatically generated by pb2py
|
||||
# fmt: off
|
||||
from .. import protobuf as p
|
||||
|
||||
|
||||
class CardanoSignedTx(p.MessageType):
|
||||
MESSAGE_WIRE_TYPE = 310
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
tx_hash: bytes = None,
|
||||
tx_body: bytes = None,
|
||||
) -> None:
|
||||
self.tx_hash = tx_hash
|
||||
self.tx_body = tx_body
|
||||
|
||||
@classmethod
|
||||
def get_fields(cls):
|
||||
return {
|
||||
1: ('tx_hash', p.BytesType, 0),
|
||||
2: ('tx_body', p.BytesType, 0),
|
||||
}
|
19
python/trezorlib/messages/CardanoTxAck.py
Normal file
19
python/trezorlib/messages/CardanoTxAck.py
Normal file
@ -0,0 +1,19 @@
|
||||
# Automatically generated by pb2py
|
||||
# fmt: off
|
||||
from .. import protobuf as p
|
||||
|
||||
|
||||
class CardanoTxAck(p.MessageType):
|
||||
MESSAGE_WIRE_TYPE = 309
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
transaction: bytes = None,
|
||||
) -> None:
|
||||
self.transaction = transaction
|
||||
|
||||
@classmethod
|
||||
def get_fields(cls):
|
||||
return {
|
||||
1: ('transaction', p.BytesType, 0),
|
||||
}
|
33
python/trezorlib/messages/CardanoTxInputType.py
Normal file
33
python/trezorlib/messages/CardanoTxInputType.py
Normal file
@ -0,0 +1,33 @@
|
||||
# Automatically generated by pb2py
|
||||
# fmt: off
|
||||
from .. import protobuf as p
|
||||
|
||||
if __debug__:
|
||||
try:
|
||||
from typing import List
|
||||
except ImportError:
|
||||
List = None # type: ignore
|
||||
|
||||
|
||||
class CardanoTxInputType(p.MessageType):
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
address_n: List[int] = None,
|
||||
prev_hash: bytes = None,
|
||||
prev_index: int = None,
|
||||
type: int = None,
|
||||
) -> None:
|
||||
self.address_n = address_n if address_n is not None else []
|
||||
self.prev_hash = prev_hash
|
||||
self.prev_index = prev_index
|
||||
self.type = type
|
||||
|
||||
@classmethod
|
||||
def get_fields(cls):
|
||||
return {
|
||||
1: ('address_n', p.UVarintType, p.FLAG_REPEATED),
|
||||
2: ('prev_hash', p.BytesType, 0),
|
||||
3: ('prev_index', p.UVarintType, 0),
|
||||
4: ('type', p.UVarintType, 0),
|
||||
}
|
30
python/trezorlib/messages/CardanoTxOutputType.py
Normal file
30
python/trezorlib/messages/CardanoTxOutputType.py
Normal file
@ -0,0 +1,30 @@
|
||||
# Automatically generated by pb2py
|
||||
# fmt: off
|
||||
from .. import protobuf as p
|
||||
|
||||
if __debug__:
|
||||
try:
|
||||
from typing import List
|
||||
except ImportError:
|
||||
List = None # type: ignore
|
||||
|
||||
|
||||
class CardanoTxOutputType(p.MessageType):
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
address: str = None,
|
||||
address_n: List[int] = None,
|
||||
amount: int = None,
|
||||
) -> None:
|
||||
self.address = address
|
||||
self.address_n = address_n if address_n is not None else []
|
||||
self.amount = amount
|
||||
|
||||
@classmethod
|
||||
def get_fields(cls):
|
||||
return {
|
||||
1: ('address', p.UnicodeType, 0),
|
||||
2: ('address_n', p.UVarintType, p.FLAG_REPEATED),
|
||||
3: ('amount', p.UVarintType, 0),
|
||||
}
|
25
python/trezorlib/messages/CardanoTxRequest.py
Normal file
25
python/trezorlib/messages/CardanoTxRequest.py
Normal file
@ -0,0 +1,25 @@
|
||||
# Automatically generated by pb2py
|
||||
# fmt: off
|
||||
from .. import protobuf as p
|
||||
|
||||
|
||||
class CardanoTxRequest(p.MessageType):
|
||||
MESSAGE_WIRE_TYPE = 304
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
tx_index: int = None,
|
||||
tx_hash: bytes = None,
|
||||
tx_body: bytes = None,
|
||||
) -> None:
|
||||
self.tx_index = tx_index
|
||||
self.tx_hash = tx_hash
|
||||
self.tx_body = tx_body
|
||||
|
||||
@classmethod
|
||||
def get_fields(cls):
|
||||
return {
|
||||
1: ('tx_index', p.UVarintType, 0),
|
||||
2: ('tx_hash', p.BytesType, 0),
|
||||
3: ('tx_body', p.BytesType, 0),
|
||||
}
|
19
python/trezorlib/messages/ChangePin.py
Normal file
19
python/trezorlib/messages/ChangePin.py
Normal file
@ -0,0 +1,19 @@
|
||||
# Automatically generated by pb2py
|
||||
# fmt: off
|
||||
from .. import protobuf as p
|
||||
|
||||
|
||||
class ChangePin(p.MessageType):
|
||||
MESSAGE_WIRE_TYPE = 4
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
remove: bool = None,
|
||||
) -> None:
|
||||
self.remove = remove
|
||||
|
||||
@classmethod
|
||||
def get_fields(cls):
|
||||
return {
|
||||
1: ('remove', p.BoolType, 0),
|
||||
}
|
43
python/trezorlib/messages/CipherKeyValue.py
Normal file
43
python/trezorlib/messages/CipherKeyValue.py
Normal file
@ -0,0 +1,43 @@
|
||||
# Automatically generated by pb2py
|
||||
# fmt: off
|
||||
from .. import protobuf as p
|
||||
|
||||
if __debug__:
|
||||
try:
|
||||
from typing import List
|
||||
except ImportError:
|
||||
List = None # type: ignore
|
||||
|
||||
|
||||
class CipherKeyValue(p.MessageType):
|
||||
MESSAGE_WIRE_TYPE = 23
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
address_n: List[int] = None,
|
||||
key: str = None,
|
||||
value: bytes = None,
|
||||
encrypt: bool = None,
|
||||
ask_on_encrypt: bool = None,
|
||||
ask_on_decrypt: bool = None,
|
||||
iv: bytes = None,
|
||||
) -> None:
|
||||
self.address_n = address_n if address_n is not None else []
|
||||
self.key = key
|
||||
self.value = value
|
||||
self.encrypt = encrypt
|
||||
self.ask_on_encrypt = ask_on_encrypt
|
||||
self.ask_on_decrypt = ask_on_decrypt
|
||||
self.iv = iv
|
||||
|
||||
@classmethod
|
||||
def get_fields(cls):
|
||||
return {
|
||||
1: ('address_n', p.UVarintType, p.FLAG_REPEATED),
|
||||
2: ('key', p.UnicodeType, 0),
|
||||
3: ('value', p.BytesType, 0),
|
||||
4: ('encrypt', p.BoolType, 0),
|
||||
5: ('ask_on_encrypt', p.BoolType, 0),
|
||||
6: ('ask_on_decrypt', p.BoolType, 0),
|
||||
7: ('iv', p.BytesType, 0),
|
||||
}
|
19
python/trezorlib/messages/CipheredKeyValue.py
Normal file
19
python/trezorlib/messages/CipheredKeyValue.py
Normal file
@ -0,0 +1,19 @@
|
||||
# Automatically generated by pb2py
|
||||
# fmt: off
|
||||
from .. import protobuf as p
|
||||
|
||||
|
||||
class CipheredKeyValue(p.MessageType):
|
||||
MESSAGE_WIRE_TYPE = 48
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
value: bytes = None,
|
||||
) -> None:
|
||||
self.value = value
|
||||
|
||||
@classmethod
|
||||
def get_fields(cls):
|
||||
return {
|
||||
1: ('value', p.BytesType, 0),
|
||||
}
|
7
python/trezorlib/messages/ClearSession.py
Normal file
7
python/trezorlib/messages/ClearSession.py
Normal file
@ -0,0 +1,7 @@
|
||||
# Automatically generated by pb2py
|
||||
# fmt: off
|
||||
from .. import protobuf as p
|
||||
|
||||
|
||||
class ClearSession(p.MessageType):
|
||||
MESSAGE_WIRE_TYPE = 24
|
28
python/trezorlib/messages/CosiCommit.py
Normal file
28
python/trezorlib/messages/CosiCommit.py
Normal file
@ -0,0 +1,28 @@
|
||||
# Automatically generated by pb2py
|
||||
# fmt: off
|
||||
from .. import protobuf as p
|
||||
|
||||
if __debug__:
|
||||
try:
|
||||
from typing import List
|
||||
except ImportError:
|
||||
List = None # type: ignore
|
||||
|
||||
|
||||
class CosiCommit(p.MessageType):
|
||||
MESSAGE_WIRE_TYPE = 71
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
address_n: List[int] = None,
|
||||
data: bytes = None,
|
||||
) -> None:
|
||||
self.address_n = address_n if address_n is not None else []
|
||||
self.data = data
|
||||
|
||||
@classmethod
|
||||
def get_fields(cls):
|
||||
return {
|
||||
1: ('address_n', p.UVarintType, p.FLAG_REPEATED),
|
||||
2: ('data', p.BytesType, 0),
|
||||
}
|
22
python/trezorlib/messages/CosiCommitment.py
Normal file
22
python/trezorlib/messages/CosiCommitment.py
Normal file
@ -0,0 +1,22 @@
|
||||
# Automatically generated by pb2py
|
||||
# fmt: off
|
||||
from .. import protobuf as p
|
||||
|
||||
|
||||
class CosiCommitment(p.MessageType):
|
||||
MESSAGE_WIRE_TYPE = 72
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
commitment: bytes = None,
|
||||
pubkey: bytes = None,
|
||||
) -> None:
|
||||
self.commitment = commitment
|
||||
self.pubkey = pubkey
|
||||
|
||||
@classmethod
|
||||
def get_fields(cls):
|
||||
return {
|
||||
1: ('commitment', p.BytesType, 0),
|
||||
2: ('pubkey', p.BytesType, 0),
|
||||
}
|
34
python/trezorlib/messages/CosiSign.py
Normal file
34
python/trezorlib/messages/CosiSign.py
Normal file
@ -0,0 +1,34 @@
|
||||
# Automatically generated by pb2py
|
||||
# fmt: off
|
||||
from .. import protobuf as p
|
||||
|
||||
if __debug__:
|
||||
try:
|
||||
from typing import List
|
||||
except ImportError:
|
||||
List = None # type: ignore
|
||||
|
||||
|
||||
class CosiSign(p.MessageType):
|
||||
MESSAGE_WIRE_TYPE = 73
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
address_n: List[int] = None,
|
||||
data: bytes = None,
|
||||
global_commitment: bytes = None,
|
||||
global_pubkey: bytes = None,
|
||||
) -> None:
|
||||
self.address_n = address_n if address_n is not None else []
|
||||
self.data = data
|
||||
self.global_commitment = global_commitment
|
||||
self.global_pubkey = global_pubkey
|
||||
|
||||
@classmethod
|
||||
def get_fields(cls):
|
||||
return {
|
||||
1: ('address_n', p.UVarintType, p.FLAG_REPEATED),
|
||||
2: ('data', p.BytesType, 0),
|
||||
3: ('global_commitment', p.BytesType, 0),
|
||||
4: ('global_pubkey', p.BytesType, 0),
|
||||
}
|
19
python/trezorlib/messages/CosiSignature.py
Normal file
19
python/trezorlib/messages/CosiSignature.py
Normal file
@ -0,0 +1,19 @@
|
||||
# Automatically generated by pb2py
|
||||
# fmt: off
|
||||
from .. import protobuf as p
|
||||
|
||||
|
||||
class CosiSignature(p.MessageType):
|
||||
MESSAGE_WIRE_TYPE = 74
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
signature: bytes = None,
|
||||
) -> None:
|
||||
self.signature = signature
|
||||
|
||||
@classmethod
|
||||
def get_fields(cls):
|
||||
return {
|
||||
1: ('signature', p.BytesType, 0),
|
||||
}
|
25
python/trezorlib/messages/DebugLinkDecision.py
Normal file
25
python/trezorlib/messages/DebugLinkDecision.py
Normal file
@ -0,0 +1,25 @@
|
||||
# Automatically generated by pb2py
|
||||
# fmt: off
|
||||
from .. import protobuf as p
|
||||
|
||||
|
||||
class DebugLinkDecision(p.MessageType):
|
||||
MESSAGE_WIRE_TYPE = 100
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
yes_no: bool = None,
|
||||
up_down: bool = None,
|
||||
input: str = None,
|
||||
) -> None:
|
||||
self.yes_no = yes_no
|
||||
self.up_down = up_down
|
||||
self.input = input
|
||||
|
||||
@classmethod
|
||||
def get_fields(cls):
|
||||
return {
|
||||
1: ('yes_no', p.BoolType, 0),
|
||||
2: ('up_down', p.BoolType, 0),
|
||||
3: ('input', p.UnicodeType, 0),
|
||||
}
|
19
python/trezorlib/messages/DebugLinkFlashErase.py
Normal file
19
python/trezorlib/messages/DebugLinkFlashErase.py
Normal file
@ -0,0 +1,19 @@
|
||||
# Automatically generated by pb2py
|
||||
# fmt: off
|
||||
from .. import protobuf as p
|
||||
|
||||
|
||||
class DebugLinkFlashErase(p.MessageType):
|
||||
MESSAGE_WIRE_TYPE = 113
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
sector: int = None,
|
||||
) -> None:
|
||||
self.sector = sector
|
||||
|
||||
@classmethod
|
||||
def get_fields(cls):
|
||||
return {
|
||||
1: ('sector', p.UVarintType, 0),
|
||||
}
|
7
python/trezorlib/messages/DebugLinkGetState.py
Normal file
7
python/trezorlib/messages/DebugLinkGetState.py
Normal file
@ -0,0 +1,7 @@
|
||||
# Automatically generated by pb2py
|
||||
# fmt: off
|
||||
from .. import protobuf as p
|
||||
|
||||
|
||||
class DebugLinkGetState(p.MessageType):
|
||||
MESSAGE_WIRE_TYPE = 101
|
25
python/trezorlib/messages/DebugLinkLog.py
Normal file
25
python/trezorlib/messages/DebugLinkLog.py
Normal file
@ -0,0 +1,25 @@
|
||||
# Automatically generated by pb2py
|
||||
# fmt: off
|
||||
from .. import protobuf as p
|
||||
|
||||
|
||||
class DebugLinkLog(p.MessageType):
|
||||
MESSAGE_WIRE_TYPE = 104
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
level: int = None,
|
||||
bucket: str = None,
|
||||
text: str = None,
|
||||
) -> None:
|
||||
self.level = level
|
||||
self.bucket = bucket
|
||||
self.text = text
|
||||
|
||||
@classmethod
|
||||
def get_fields(cls):
|
||||
return {
|
||||
1: ('level', p.UVarintType, 0),
|
||||
2: ('bucket', p.UnicodeType, 0),
|
||||
3: ('text', p.UnicodeType, 0),
|
||||
}
|
19
python/trezorlib/messages/DebugLinkMemory.py
Normal file
19
python/trezorlib/messages/DebugLinkMemory.py
Normal file
@ -0,0 +1,19 @@
|
||||
# Automatically generated by pb2py
|
||||
# fmt: off
|
||||
from .. import protobuf as p
|
||||
|
||||
|
||||
class DebugLinkMemory(p.MessageType):
|
||||
MESSAGE_WIRE_TYPE = 111
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
memory: bytes = None,
|
||||
) -> None:
|
||||
self.memory = memory
|
||||
|
||||
@classmethod
|
||||
def get_fields(cls):
|
||||
return {
|
||||
1: ('memory', p.BytesType, 0),
|
||||
}
|
22
python/trezorlib/messages/DebugLinkMemoryRead.py
Normal file
22
python/trezorlib/messages/DebugLinkMemoryRead.py
Normal file
@ -0,0 +1,22 @@
|
||||
# Automatically generated by pb2py
|
||||
# fmt: off
|
||||
from .. import protobuf as p
|
||||
|
||||
|
||||
class DebugLinkMemoryRead(p.MessageType):
|
||||
MESSAGE_WIRE_TYPE = 110
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
address: int = None,
|
||||
length: int = None,
|
||||
) -> None:
|
||||
self.address = address
|
||||
self.length = length
|
||||
|
||||
@classmethod
|
||||
def get_fields(cls):
|
||||
return {
|
||||
1: ('address', p.UVarintType, 0),
|
||||
2: ('length', p.UVarintType, 0),
|
||||
}
|
25
python/trezorlib/messages/DebugLinkMemoryWrite.py
Normal file
25
python/trezorlib/messages/DebugLinkMemoryWrite.py
Normal file
@ -0,0 +1,25 @@
|
||||
# Automatically generated by pb2py
|
||||
# fmt: off
|
||||
from .. import protobuf as p
|
||||
|
||||
|
||||
class DebugLinkMemoryWrite(p.MessageType):
|
||||
MESSAGE_WIRE_TYPE = 112
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
address: int = None,
|
||||
memory: bytes = None,
|
||||
flash: bool = None,
|
||||
) -> None:
|
||||
self.address = address
|
||||
self.memory = memory
|
||||
self.flash = flash
|
||||
|
||||
@classmethod
|
||||
def get_fields(cls):
|
||||
return {
|
||||
1: ('address', p.UVarintType, 0),
|
||||
2: ('memory', p.BytesType, 0),
|
||||
3: ('flash', p.BoolType, 0),
|
||||
}
|
54
python/trezorlib/messages/DebugLinkState.py
Normal file
54
python/trezorlib/messages/DebugLinkState.py
Normal file
@ -0,0 +1,54 @@
|
||||
# Automatically generated by pb2py
|
||||
# fmt: off
|
||||
from .. import protobuf as p
|
||||
|
||||
from .HDNodeType import HDNodeType
|
||||
|
||||
|
||||
class DebugLinkState(p.MessageType):
|
||||
MESSAGE_WIRE_TYPE = 102
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
layout: bytes = None,
|
||||
pin: str = None,
|
||||
matrix: str = None,
|
||||
mnemonic_secret: bytes = None,
|
||||
node: HDNodeType = None,
|
||||
passphrase_protection: bool = None,
|
||||
reset_word: str = None,
|
||||
reset_entropy: bytes = None,
|
||||
recovery_fake_word: str = None,
|
||||
recovery_word_pos: int = None,
|
||||
reset_word_pos: int = None,
|
||||
mnemonic_type: int = None,
|
||||
) -> None:
|
||||
self.layout = layout
|
||||
self.pin = pin
|
||||
self.matrix = matrix
|
||||
self.mnemonic_secret = mnemonic_secret
|
||||
self.node = node
|
||||
self.passphrase_protection = passphrase_protection
|
||||
self.reset_word = reset_word
|
||||
self.reset_entropy = reset_entropy
|
||||
self.recovery_fake_word = recovery_fake_word
|
||||
self.recovery_word_pos = recovery_word_pos
|
||||
self.reset_word_pos = reset_word_pos
|
||||
self.mnemonic_type = mnemonic_type
|
||||
|
||||
@classmethod
|
||||
def get_fields(cls):
|
||||
return {
|
||||
1: ('layout', p.BytesType, 0),
|
||||
2: ('pin', p.UnicodeType, 0),
|
||||
3: ('matrix', p.UnicodeType, 0),
|
||||
4: ('mnemonic_secret', p.BytesType, 0),
|
||||
5: ('node', HDNodeType, 0),
|
||||
6: ('passphrase_protection', p.BoolType, 0),
|
||||
7: ('reset_word', p.UnicodeType, 0),
|
||||
8: ('reset_entropy', p.BytesType, 0),
|
||||
9: ('recovery_fake_word', p.UnicodeType, 0),
|
||||
10: ('recovery_word_pos', p.UVarintType, 0),
|
||||
11: ('reset_word_pos', p.UVarintType, 0),
|
||||
12: ('mnemonic_type', p.UVarintType, 0),
|
||||
}
|
7
python/trezorlib/messages/DebugLinkStop.py
Normal file
7
python/trezorlib/messages/DebugLinkStop.py
Normal file
@ -0,0 +1,7 @@
|
||||
# Automatically generated by pb2py
|
||||
# fmt: off
|
||||
from .. import protobuf as p
|
||||
|
||||
|
||||
class DebugLinkStop(p.MessageType):
|
||||
MESSAGE_WIRE_TYPE = 103
|
40
python/trezorlib/messages/DebugMoneroDiagAck.py
Normal file
40
python/trezorlib/messages/DebugMoneroDiagAck.py
Normal file
@ -0,0 +1,40 @@
|
||||
# Automatically generated by pb2py
|
||||
# fmt: off
|
||||
from .. import protobuf as p
|
||||
|
||||
if __debug__:
|
||||
try:
|
||||
from typing import List
|
||||
except ImportError:
|
||||
List = None # type: ignore
|
||||
|
||||
|
||||
class DebugMoneroDiagAck(p.MessageType):
|
||||
MESSAGE_WIRE_TYPE = 547
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
ins: int = None,
|
||||
p1: int = None,
|
||||
p2: int = None,
|
||||
pd: List[int] = None,
|
||||
data1: bytes = None,
|
||||
data2: bytes = None,
|
||||
) -> None:
|
||||
self.ins = ins
|
||||
self.p1 = p1
|
||||
self.p2 = p2
|
||||
self.pd = pd if pd is not None else []
|
||||
self.data1 = data1
|
||||
self.data2 = data2
|
||||
|
||||
@classmethod
|
||||
def get_fields(cls):
|
||||
return {
|
||||
1: ('ins', p.UVarintType, 0),
|
||||
2: ('p1', p.UVarintType, 0),
|
||||
3: ('p2', p.UVarintType, 0),
|
||||
4: ('pd', p.UVarintType, p.FLAG_REPEATED),
|
||||
5: ('data1', p.BytesType, 0),
|
||||
6: ('data2', p.BytesType, 0),
|
||||
}
|
40
python/trezorlib/messages/DebugMoneroDiagRequest.py
Normal file
40
python/trezorlib/messages/DebugMoneroDiagRequest.py
Normal file
@ -0,0 +1,40 @@
|
||||
# Automatically generated by pb2py
|
||||
# fmt: off
|
||||
from .. import protobuf as p
|
||||
|
||||
if __debug__:
|
||||
try:
|
||||
from typing import List
|
||||
except ImportError:
|
||||
List = None # type: ignore
|
||||
|
||||
|
||||
class DebugMoneroDiagRequest(p.MessageType):
|
||||
MESSAGE_WIRE_TYPE = 546
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
ins: int = None,
|
||||
p1: int = None,
|
||||
p2: int = None,
|
||||
pd: List[int] = None,
|
||||
data1: bytes = None,
|
||||
data2: bytes = None,
|
||||
) -> None:
|
||||
self.ins = ins
|
||||
self.p1 = p1
|
||||
self.p2 = p2
|
||||
self.pd = pd if pd is not None else []
|
||||
self.data1 = data1
|
||||
self.data2 = data2
|
||||
|
||||
@classmethod
|
||||
def get_fields(cls):
|
||||
return {
|
||||
1: ('ins', p.UVarintType, 0),
|
||||
2: ('p1', p.UVarintType, 0),
|
||||
3: ('p2', p.UVarintType, 0),
|
||||
4: ('pd', p.UVarintType, p.FLAG_REPEATED),
|
||||
5: ('data1', p.BytesType, 0),
|
||||
6: ('data2', p.BytesType, 0),
|
||||
}
|
19
python/trezorlib/messages/ECDHSessionKey.py
Normal file
19
python/trezorlib/messages/ECDHSessionKey.py
Normal file
@ -0,0 +1,19 @@
|
||||
# Automatically generated by pb2py
|
||||
# fmt: off
|
||||
from .. import protobuf as p
|
||||
|
||||
|
||||
class ECDHSessionKey(p.MessageType):
|
||||
MESSAGE_WIRE_TYPE = 62
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
session_key: bytes = None,
|
||||
) -> None:
|
||||
self.session_key = session_key
|
||||
|
||||
@classmethod
|
||||
def get_fields(cls):
|
||||
return {
|
||||
1: ('session_key', p.BytesType, 0),
|
||||
}
|
19
python/trezorlib/messages/Entropy.py
Normal file
19
python/trezorlib/messages/Entropy.py
Normal file
@ -0,0 +1,19 @@
|
||||
# Automatically generated by pb2py
|
||||
# fmt: off
|
||||
from .. import protobuf as p
|
||||
|
||||
|
||||
class Entropy(p.MessageType):
|
||||
MESSAGE_WIRE_TYPE = 10
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
entropy: bytes = None,
|
||||
) -> None:
|
||||
self.entropy = entropy
|
||||
|
||||
@classmethod
|
||||
def get_fields(cls):
|
||||
return {
|
||||
1: ('entropy', p.BytesType, 0), # required
|
||||
}
|
19
python/trezorlib/messages/EntropyAck.py
Normal file
19
python/trezorlib/messages/EntropyAck.py
Normal file
@ -0,0 +1,19 @@
|
||||
# Automatically generated by pb2py
|
||||
# fmt: off
|
||||
from .. import protobuf as p
|
||||
|
||||
|
||||
class EntropyAck(p.MessageType):
|
||||
MESSAGE_WIRE_TYPE = 36
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
entropy: bytes = None,
|
||||
) -> None:
|
||||
self.entropy = entropy
|
||||
|
||||
@classmethod
|
||||
def get_fields(cls):
|
||||
return {
|
||||
1: ('entropy', p.BytesType, 0),
|
||||
}
|
7
python/trezorlib/messages/EntropyRequest.py
Normal file
7
python/trezorlib/messages/EntropyRequest.py
Normal file
@ -0,0 +1,7 @@
|
||||
# Automatically generated by pb2py
|
||||
# fmt: off
|
||||
from .. import protobuf as p
|
||||
|
||||
|
||||
class EntropyRequest(p.MessageType):
|
||||
MESSAGE_WIRE_TYPE = 35
|
26
python/trezorlib/messages/EosActionBuyRam.py
Normal file
26
python/trezorlib/messages/EosActionBuyRam.py
Normal file
@ -0,0 +1,26 @@
|
||||
# Automatically generated by pb2py
|
||||
# fmt: off
|
||||
from .. import protobuf as p
|
||||
|
||||
from .EosAsset import EosAsset
|
||||
|
||||
|
||||
class EosActionBuyRam(p.MessageType):
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
payer: int = None,
|
||||
receiver: int = None,
|
||||
quantity: EosAsset = None,
|
||||
) -> None:
|
||||
self.payer = payer
|
||||
self.receiver = receiver
|
||||
self.quantity = quantity
|
||||
|
||||
@classmethod
|
||||
def get_fields(cls):
|
||||
return {
|
||||
1: ('payer', p.UVarintType, 0),
|
||||
2: ('receiver', p.UVarintType, 0),
|
||||
3: ('quantity', EosAsset, 0),
|
||||
}
|
24
python/trezorlib/messages/EosActionBuyRamBytes.py
Normal file
24
python/trezorlib/messages/EosActionBuyRamBytes.py
Normal file
@ -0,0 +1,24 @@
|
||||
# Automatically generated by pb2py
|
||||
# fmt: off
|
||||
from .. import protobuf as p
|
||||
|
||||
|
||||
class EosActionBuyRamBytes(p.MessageType):
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
payer: int = None,
|
||||
receiver: int = None,
|
||||
bytes: int = None,
|
||||
) -> None:
|
||||
self.payer = payer
|
||||
self.receiver = receiver
|
||||
self.bytes = bytes
|
||||
|
||||
@classmethod
|
||||
def get_fields(cls):
|
||||
return {
|
||||
1: ('payer', p.UVarintType, 0),
|
||||
2: ('receiver', p.UVarintType, 0),
|
||||
3: ('bytes', p.UVarintType, 0),
|
||||
}
|
32
python/trezorlib/messages/EosActionCommon.py
Normal file
32
python/trezorlib/messages/EosActionCommon.py
Normal file
@ -0,0 +1,32 @@
|
||||
# Automatically generated by pb2py
|
||||
# fmt: off
|
||||
from .. import protobuf as p
|
||||
|
||||
from .EosPermissionLevel import EosPermissionLevel
|
||||
|
||||
if __debug__:
|
||||
try:
|
||||
from typing import List
|
||||
except ImportError:
|
||||
List = None # type: ignore
|
||||
|
||||
|
||||
class EosActionCommon(p.MessageType):
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
account: int = None,
|
||||
name: int = None,
|
||||
authorization: List[EosPermissionLevel] = None,
|
||||
) -> None:
|
||||
self.account = account
|
||||
self.name = name
|
||||
self.authorization = authorization if authorization is not None else []
|
||||
|
||||
@classmethod
|
||||
def get_fields(cls):
|
||||
return {
|
||||
1: ('account', p.UVarintType, 0),
|
||||
2: ('name', p.UVarintType, 0),
|
||||
3: ('authorization', EosPermissionLevel, p.FLAG_REPEATED),
|
||||
}
|
32
python/trezorlib/messages/EosActionDelegate.py
Normal file
32
python/trezorlib/messages/EosActionDelegate.py
Normal file
@ -0,0 +1,32 @@
|
||||
# Automatically generated by pb2py
|
||||
# fmt: off
|
||||
from .. import protobuf as p
|
||||
|
||||
from .EosAsset import EosAsset
|
||||
|
||||
|
||||
class EosActionDelegate(p.MessageType):
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
sender: int = None,
|
||||
receiver: int = None,
|
||||
net_quantity: EosAsset = None,
|
||||
cpu_quantity: EosAsset = None,
|
||||
transfer: bool = None,
|
||||
) -> None:
|
||||
self.sender = sender
|
||||
self.receiver = receiver
|
||||
self.net_quantity = net_quantity
|
||||
self.cpu_quantity = cpu_quantity
|
||||
self.transfer = transfer
|
||||
|
||||
@classmethod
|
||||
def get_fields(cls):
|
||||
return {
|
||||
1: ('sender', p.UVarintType, 0),
|
||||
2: ('receiver', p.UVarintType, 0),
|
||||
3: ('net_quantity', EosAsset, 0),
|
||||
4: ('cpu_quantity', EosAsset, 0),
|
||||
5: ('transfer', p.BoolType, 0),
|
||||
}
|
21
python/trezorlib/messages/EosActionDeleteAuth.py
Normal file
21
python/trezorlib/messages/EosActionDeleteAuth.py
Normal file
@ -0,0 +1,21 @@
|
||||
# Automatically generated by pb2py
|
||||
# fmt: off
|
||||
from .. import protobuf as p
|
||||
|
||||
|
||||
class EosActionDeleteAuth(p.MessageType):
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
account: int = None,
|
||||
permission: int = None,
|
||||
) -> None:
|
||||
self.account = account
|
||||
self.permission = permission
|
||||
|
||||
@classmethod
|
||||
def get_fields(cls):
|
||||
return {
|
||||
1: ('account', p.UVarintType, 0),
|
||||
2: ('permission', p.UVarintType, 0),
|
||||
}
|
27
python/trezorlib/messages/EosActionLinkAuth.py
Normal file
27
python/trezorlib/messages/EosActionLinkAuth.py
Normal file
@ -0,0 +1,27 @@
|
||||
# Automatically generated by pb2py
|
||||
# fmt: off
|
||||
from .. import protobuf as p
|
||||
|
||||
|
||||
class EosActionLinkAuth(p.MessageType):
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
account: int = None,
|
||||
code: int = None,
|
||||
type: int = None,
|
||||
requirement: int = None,
|
||||
) -> None:
|
||||
self.account = account
|
||||
self.code = code
|
||||
self.type = type
|
||||
self.requirement = requirement
|
||||
|
||||
@classmethod
|
||||
def get_fields(cls):
|
||||
return {
|
||||
1: ('account', p.UVarintType, 0),
|
||||
2: ('code', p.UVarintType, 0),
|
||||
3: ('type', p.UVarintType, 0),
|
||||
4: ('requirement', p.UVarintType, 0),
|
||||
}
|
29
python/trezorlib/messages/EosActionNewAccount.py
Normal file
29
python/trezorlib/messages/EosActionNewAccount.py
Normal file
@ -0,0 +1,29 @@
|
||||
# Automatically generated by pb2py
|
||||
# fmt: off
|
||||
from .. import protobuf as p
|
||||
|
||||
from .EosAuthorization import EosAuthorization
|
||||
|
||||
|
||||
class EosActionNewAccount(p.MessageType):
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
creator: int = None,
|
||||
name: int = None,
|
||||
owner: EosAuthorization = None,
|
||||
active: EosAuthorization = None,
|
||||
) -> None:
|
||||
self.creator = creator
|
||||
self.name = name
|
||||
self.owner = owner
|
||||
self.active = active
|
||||
|
||||
@classmethod
|
||||
def get_fields(cls):
|
||||
return {
|
||||
1: ('creator', p.UVarintType, 0),
|
||||
2: ('name', p.UVarintType, 0),
|
||||
3: ('owner', EosAuthorization, 0),
|
||||
4: ('active', EosAuthorization, 0),
|
||||
}
|
18
python/trezorlib/messages/EosActionRefund.py
Normal file
18
python/trezorlib/messages/EosActionRefund.py
Normal file
@ -0,0 +1,18 @@
|
||||
# Automatically generated by pb2py
|
||||
# fmt: off
|
||||
from .. import protobuf as p
|
||||
|
||||
|
||||
class EosActionRefund(p.MessageType):
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
owner: int = None,
|
||||
) -> None:
|
||||
self.owner = owner
|
||||
|
||||
@classmethod
|
||||
def get_fields(cls):
|
||||
return {
|
||||
1: ('owner', p.UVarintType, 0),
|
||||
}
|
21
python/trezorlib/messages/EosActionSellRam.py
Normal file
21
python/trezorlib/messages/EosActionSellRam.py
Normal file
@ -0,0 +1,21 @@
|
||||
# Automatically generated by pb2py
|
||||
# fmt: off
|
||||
from .. import protobuf as p
|
||||
|
||||
|
||||
class EosActionSellRam(p.MessageType):
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
account: int = None,
|
||||
bytes: int = None,
|
||||
) -> None:
|
||||
self.account = account
|
||||
self.bytes = bytes
|
||||
|
||||
@classmethod
|
||||
def get_fields(cls):
|
||||
return {
|
||||
1: ('account', p.UVarintType, 0),
|
||||
2: ('bytes', p.UVarintType, 0),
|
||||
}
|
29
python/trezorlib/messages/EosActionTransfer.py
Normal file
29
python/trezorlib/messages/EosActionTransfer.py
Normal file
@ -0,0 +1,29 @@
|
||||
# Automatically generated by pb2py
|
||||
# fmt: off
|
||||
from .. import protobuf as p
|
||||
|
||||
from .EosAsset import EosAsset
|
||||
|
||||
|
||||
class EosActionTransfer(p.MessageType):
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
sender: int = None,
|
||||
receiver: int = None,
|
||||
quantity: EosAsset = None,
|
||||
memo: str = None,
|
||||
) -> None:
|
||||
self.sender = sender
|
||||
self.receiver = receiver
|
||||
self.quantity = quantity
|
||||
self.memo = memo
|
||||
|
||||
@classmethod
|
||||
def get_fields(cls):
|
||||
return {
|
||||
1: ('sender', p.UVarintType, 0),
|
||||
2: ('receiver', p.UVarintType, 0),
|
||||
3: ('quantity', EosAsset, 0),
|
||||
4: ('memo', p.UnicodeType, 0),
|
||||
}
|
29
python/trezorlib/messages/EosActionUndelegate.py
Normal file
29
python/trezorlib/messages/EosActionUndelegate.py
Normal file
@ -0,0 +1,29 @@
|
||||
# Automatically generated by pb2py
|
||||
# fmt: off
|
||||
from .. import protobuf as p
|
||||
|
||||
from .EosAsset import EosAsset
|
||||
|
||||
|
||||
class EosActionUndelegate(p.MessageType):
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
sender: int = None,
|
||||
receiver: int = None,
|
||||
net_quantity: EosAsset = None,
|
||||
cpu_quantity: EosAsset = None,
|
||||
) -> None:
|
||||
self.sender = sender
|
||||
self.receiver = receiver
|
||||
self.net_quantity = net_quantity
|
||||
self.cpu_quantity = cpu_quantity
|
||||
|
||||
@classmethod
|
||||
def get_fields(cls):
|
||||
return {
|
||||
1: ('sender', p.UVarintType, 0),
|
||||
2: ('receiver', p.UVarintType, 0),
|
||||
3: ('net_quantity', EosAsset, 0),
|
||||
4: ('cpu_quantity', EosAsset, 0),
|
||||
}
|
21
python/trezorlib/messages/EosActionUnknown.py
Normal file
21
python/trezorlib/messages/EosActionUnknown.py
Normal file
@ -0,0 +1,21 @@
|
||||
# Automatically generated by pb2py
|
||||
# fmt: off
|
||||
from .. import protobuf as p
|
||||
|
||||
|
||||
class EosActionUnknown(p.MessageType):
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
data_size: int = None,
|
||||
data_chunk: bytes = None,
|
||||
) -> None:
|
||||
self.data_size = data_size
|
||||
self.data_chunk = data_chunk
|
||||
|
||||
@classmethod
|
||||
def get_fields(cls):
|
||||
return {
|
||||
1: ('data_size', p.UVarintType, 0),
|
||||
2: ('data_chunk', p.BytesType, 0),
|
||||
}
|
24
python/trezorlib/messages/EosActionUnlinkAuth.py
Normal file
24
python/trezorlib/messages/EosActionUnlinkAuth.py
Normal file
@ -0,0 +1,24 @@
|
||||
# Automatically generated by pb2py
|
||||
# fmt: off
|
||||
from .. import protobuf as p
|
||||
|
||||
|
||||
class EosActionUnlinkAuth(p.MessageType):
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
account: int = None,
|
||||
code: int = None,
|
||||
type: int = None,
|
||||
) -> None:
|
||||
self.account = account
|
||||
self.code = code
|
||||
self.type = type
|
||||
|
||||
@classmethod
|
||||
def get_fields(cls):
|
||||
return {
|
||||
1: ('account', p.UVarintType, 0),
|
||||
2: ('code', p.UVarintType, 0),
|
||||
3: ('type', p.UVarintType, 0),
|
||||
}
|
29
python/trezorlib/messages/EosActionUpdateAuth.py
Normal file
29
python/trezorlib/messages/EosActionUpdateAuth.py
Normal file
@ -0,0 +1,29 @@
|
||||
# Automatically generated by pb2py
|
||||
# fmt: off
|
||||
from .. import protobuf as p
|
||||
|
||||
from .EosAuthorization import EosAuthorization
|
||||
|
||||
|
||||
class EosActionUpdateAuth(p.MessageType):
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
account: int = None,
|
||||
permission: int = None,
|
||||
parent: int = None,
|
||||
auth: EosAuthorization = None,
|
||||
) -> None:
|
||||
self.account = account
|
||||
self.permission = permission
|
||||
self.parent = parent
|
||||
self.auth = auth
|
||||
|
||||
@classmethod
|
||||
def get_fields(cls):
|
||||
return {
|
||||
1: ('account', p.UVarintType, 0),
|
||||
2: ('permission', p.UVarintType, 0),
|
||||
3: ('parent', p.UVarintType, 0),
|
||||
4: ('auth', EosAuthorization, 0),
|
||||
}
|
30
python/trezorlib/messages/EosActionVoteProducer.py
Normal file
30
python/trezorlib/messages/EosActionVoteProducer.py
Normal file
@ -0,0 +1,30 @@
|
||||
# Automatically generated by pb2py
|
||||
# fmt: off
|
||||
from .. import protobuf as p
|
||||
|
||||
if __debug__:
|
||||
try:
|
||||
from typing import List
|
||||
except ImportError:
|
||||
List = None # type: ignore
|
||||
|
||||
|
||||
class EosActionVoteProducer(p.MessageType):
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
voter: int = None,
|
||||
proxy: int = None,
|
||||
producers: List[int] = None,
|
||||
) -> None:
|
||||
self.voter = voter
|
||||
self.proxy = proxy
|
||||
self.producers = producers if producers is not None else []
|
||||
|
||||
@classmethod
|
||||
def get_fields(cls):
|
||||
return {
|
||||
1: ('voter', p.UVarintType, 0),
|
||||
2: ('proxy', p.UVarintType, 0),
|
||||
3: ('producers', p.UVarintType, p.FLAG_REPEATED),
|
||||
}
|
21
python/trezorlib/messages/EosAsset.py
Normal file
21
python/trezorlib/messages/EosAsset.py
Normal file
@ -0,0 +1,21 @@
|
||||
# Automatically generated by pb2py
|
||||
# fmt: off
|
||||
from .. import protobuf as p
|
||||
|
||||
|
||||
class EosAsset(p.MessageType):
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
amount: int = None,
|
||||
symbol: int = None,
|
||||
) -> None:
|
||||
self.amount = amount
|
||||
self.symbol = symbol
|
||||
|
||||
@classmethod
|
||||
def get_fields(cls):
|
||||
return {
|
||||
1: ('amount', p.SVarintType, 0),
|
||||
2: ('symbol', p.UVarintType, 0),
|
||||
}
|
37
python/trezorlib/messages/EosAuthorization.py
Normal file
37
python/trezorlib/messages/EosAuthorization.py
Normal file
@ -0,0 +1,37 @@
|
||||
# Automatically generated by pb2py
|
||||
# fmt: off
|
||||
from .. import protobuf as p
|
||||
|
||||
from .EosAuthorizationAccount import EosAuthorizationAccount
|
||||
from .EosAuthorizationKey import EosAuthorizationKey
|
||||
from .EosAuthorizationWait import EosAuthorizationWait
|
||||
|
||||
if __debug__:
|
||||
try:
|
||||
from typing import List
|
||||
except ImportError:
|
||||
List = None # type: ignore
|
||||
|
||||
|
||||
class EosAuthorization(p.MessageType):
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
threshold: int = None,
|
||||
keys: List[EosAuthorizationKey] = None,
|
||||
accounts: List[EosAuthorizationAccount] = None,
|
||||
waits: List[EosAuthorizationWait] = None,
|
||||
) -> None:
|
||||
self.threshold = threshold
|
||||
self.keys = keys if keys is not None else []
|
||||
self.accounts = accounts if accounts is not None else []
|
||||
self.waits = waits if waits is not None else []
|
||||
|
||||
@classmethod
|
||||
def get_fields(cls):
|
||||
return {
|
||||
1: ('threshold', p.UVarintType, 0),
|
||||
2: ('keys', EosAuthorizationKey, p.FLAG_REPEATED),
|
||||
3: ('accounts', EosAuthorizationAccount, p.FLAG_REPEATED),
|
||||
4: ('waits', EosAuthorizationWait, p.FLAG_REPEATED),
|
||||
}
|
23
python/trezorlib/messages/EosAuthorizationAccount.py
Normal file
23
python/trezorlib/messages/EosAuthorizationAccount.py
Normal file
@ -0,0 +1,23 @@
|
||||
# Automatically generated by pb2py
|
||||
# fmt: off
|
||||
from .. import protobuf as p
|
||||
|
||||
from .EosPermissionLevel import EosPermissionLevel
|
||||
|
||||
|
||||
class EosAuthorizationAccount(p.MessageType):
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
account: EosPermissionLevel = None,
|
||||
weight: int = None,
|
||||
) -> None:
|
||||
self.account = account
|
||||
self.weight = weight
|
||||
|
||||
@classmethod
|
||||
def get_fields(cls):
|
||||
return {
|
||||
1: ('account', EosPermissionLevel, 0),
|
||||
2: ('weight', p.UVarintType, 0),
|
||||
}
|
33
python/trezorlib/messages/EosAuthorizationKey.py
Normal file
33
python/trezorlib/messages/EosAuthorizationKey.py
Normal file
@ -0,0 +1,33 @@
|
||||
# Automatically generated by pb2py
|
||||
# fmt: off
|
||||
from .. import protobuf as p
|
||||
|
||||
if __debug__:
|
||||
try:
|
||||
from typing import List
|
||||
except ImportError:
|
||||
List = None # type: ignore
|
||||
|
||||
|
||||
class EosAuthorizationKey(p.MessageType):
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
type: int = None,
|
||||
key: bytes = None,
|
||||
address_n: List[int] = None,
|
||||
weight: int = None,
|
||||
) -> None:
|
||||
self.type = type
|
||||
self.key = key
|
||||
self.address_n = address_n if address_n is not None else []
|
||||
self.weight = weight
|
||||
|
||||
@classmethod
|
||||
def get_fields(cls):
|
||||
return {
|
||||
1: ('type', p.UVarintType, 0),
|
||||
2: ('key', p.BytesType, 0),
|
||||
3: ('address_n', p.UVarintType, p.FLAG_REPEATED),
|
||||
4: ('weight', p.UVarintType, 0),
|
||||
}
|
21
python/trezorlib/messages/EosAuthorizationWait.py
Normal file
21
python/trezorlib/messages/EosAuthorizationWait.py
Normal file
@ -0,0 +1,21 @@
|
||||
# Automatically generated by pb2py
|
||||
# fmt: off
|
||||
from .. import protobuf as p
|
||||
|
||||
|
||||
class EosAuthorizationWait(p.MessageType):
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
wait_sec: int = None,
|
||||
weight: int = None,
|
||||
) -> None:
|
||||
self.wait_sec = wait_sec
|
||||
self.weight = weight
|
||||
|
||||
@classmethod
|
||||
def get_fields(cls):
|
||||
return {
|
||||
1: ('wait_sec', p.UVarintType, 0),
|
||||
2: ('weight', p.UVarintType, 0),
|
||||
}
|
28
python/trezorlib/messages/EosGetPublicKey.py
Normal file
28
python/trezorlib/messages/EosGetPublicKey.py
Normal file
@ -0,0 +1,28 @@
|
||||
# Automatically generated by pb2py
|
||||
# fmt: off
|
||||
from .. import protobuf as p
|
||||
|
||||
if __debug__:
|
||||
try:
|
||||
from typing import List
|
||||
except ImportError:
|
||||
List = None # type: ignore
|
||||
|
||||
|
||||
class EosGetPublicKey(p.MessageType):
|
||||
MESSAGE_WIRE_TYPE = 600
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
address_n: List[int] = None,
|
||||
show_display: bool = None,
|
||||
) -> None:
|
||||
self.address_n = address_n if address_n is not None else []
|
||||
self.show_display = show_display
|
||||
|
||||
@classmethod
|
||||
def get_fields(cls):
|
||||
return {
|
||||
1: ('address_n', p.UVarintType, p.FLAG_REPEATED),
|
||||
2: ('show_display', p.BoolType, 0),
|
||||
}
|
21
python/trezorlib/messages/EosPermissionLevel.py
Normal file
21
python/trezorlib/messages/EosPermissionLevel.py
Normal file
@ -0,0 +1,21 @@
|
||||
# Automatically generated by pb2py
|
||||
# fmt: off
|
||||
from .. import protobuf as p
|
||||
|
||||
|
||||
class EosPermissionLevel(p.MessageType):
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
actor: int = None,
|
||||
permission: int = None,
|
||||
) -> None:
|
||||
self.actor = actor
|
||||
self.permission = permission
|
||||
|
||||
@classmethod
|
||||
def get_fields(cls):
|
||||
return {
|
||||
1: ('actor', p.UVarintType, 0),
|
||||
2: ('permission', p.UVarintType, 0),
|
||||
}
|
22
python/trezorlib/messages/EosPublicKey.py
Normal file
22
python/trezorlib/messages/EosPublicKey.py
Normal file
@ -0,0 +1,22 @@
|
||||
# Automatically generated by pb2py
|
||||
# fmt: off
|
||||
from .. import protobuf as p
|
||||
|
||||
|
||||
class EosPublicKey(p.MessageType):
|
||||
MESSAGE_WIRE_TYPE = 601
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
wif_public_key: str = None,
|
||||
raw_public_key: bytes = None,
|
||||
) -> None:
|
||||
self.wif_public_key = wif_public_key
|
||||
self.raw_public_key = raw_public_key
|
||||
|
||||
@classmethod
|
||||
def get_fields(cls):
|
||||
return {
|
||||
1: ('wif_public_key', p.UnicodeType, 0),
|
||||
2: ('raw_public_key', p.BytesType, 0),
|
||||
}
|
36
python/trezorlib/messages/EosSignTx.py
Normal file
36
python/trezorlib/messages/EosSignTx.py
Normal file
@ -0,0 +1,36 @@
|
||||
# Automatically generated by pb2py
|
||||
# fmt: off
|
||||
from .. import protobuf as p
|
||||
|
||||
from .EosTxHeader import EosTxHeader
|
||||
|
||||
if __debug__:
|
||||
try:
|
||||
from typing import List
|
||||
except ImportError:
|
||||
List = None # type: ignore
|
||||
|
||||
|
||||
class EosSignTx(p.MessageType):
|
||||
MESSAGE_WIRE_TYPE = 602
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
address_n: List[int] = None,
|
||||
chain_id: bytes = None,
|
||||
header: EosTxHeader = None,
|
||||
num_actions: int = None,
|
||||
) -> None:
|
||||
self.address_n = address_n if address_n is not None else []
|
||||
self.chain_id = chain_id
|
||||
self.header = header
|
||||
self.num_actions = num_actions
|
||||
|
||||
@classmethod
|
||||
def get_fields(cls):
|
||||
return {
|
||||
1: ('address_n', p.UVarintType, p.FLAG_REPEATED),
|
||||
2: ('chain_id', p.BytesType, 0),
|
||||
3: ('header', EosTxHeader, 0),
|
||||
4: ('num_actions', p.UVarintType, 0),
|
||||
}
|
25
python/trezorlib/messages/EosSignedTx.py
Normal file
25
python/trezorlib/messages/EosSignedTx.py
Normal file
@ -0,0 +1,25 @@
|
||||
# Automatically generated by pb2py
|
||||
# fmt: off
|
||||
from .. import protobuf as p
|
||||
|
||||
|
||||
class EosSignedTx(p.MessageType):
|
||||
MESSAGE_WIRE_TYPE = 605
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
signature_v: int = None,
|
||||
signature_r: bytes = None,
|
||||
signature_s: bytes = None,
|
||||
) -> None:
|
||||
self.signature_v = signature_v
|
||||
self.signature_r = signature_r
|
||||
self.signature_s = signature_s
|
||||
|
||||
@classmethod
|
||||
def get_fields(cls):
|
||||
return {
|
||||
1: ('signature_v', p.UVarintType, 0),
|
||||
2: ('signature_r', p.BytesType, 0),
|
||||
3: ('signature_s', p.BytesType, 0),
|
||||
}
|
77
python/trezorlib/messages/EosTxActionAck.py
Normal file
77
python/trezorlib/messages/EosTxActionAck.py
Normal file
@ -0,0 +1,77 @@
|
||||
# Automatically generated by pb2py
|
||||
# fmt: off
|
||||
from .. import protobuf as p
|
||||
|
||||
from .EosActionBuyRam import EosActionBuyRam
|
||||
from .EosActionBuyRamBytes import EosActionBuyRamBytes
|
||||
from .EosActionCommon import EosActionCommon
|
||||
from .EosActionDelegate import EosActionDelegate
|
||||
from .EosActionDeleteAuth import EosActionDeleteAuth
|
||||
from .EosActionLinkAuth import EosActionLinkAuth
|
||||
from .EosActionNewAccount import EosActionNewAccount
|
||||
from .EosActionRefund import EosActionRefund
|
||||
from .EosActionSellRam import EosActionSellRam
|
||||
from .EosActionTransfer import EosActionTransfer
|
||||
from .EosActionUndelegate import EosActionUndelegate
|
||||
from .EosActionUnknown import EosActionUnknown
|
||||
from .EosActionUnlinkAuth import EosActionUnlinkAuth
|
||||
from .EosActionUpdateAuth import EosActionUpdateAuth
|
||||
from .EosActionVoteProducer import EosActionVoteProducer
|
||||
|
||||
|
||||
class EosTxActionAck(p.MessageType):
|
||||
MESSAGE_WIRE_TYPE = 604
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
common: EosActionCommon = None,
|
||||
transfer: EosActionTransfer = None,
|
||||
delegate: EosActionDelegate = None,
|
||||
undelegate: EosActionUndelegate = None,
|
||||
refund: EosActionRefund = None,
|
||||
buy_ram: EosActionBuyRam = None,
|
||||
buy_ram_bytes: EosActionBuyRamBytes = None,
|
||||
sell_ram: EosActionSellRam = None,
|
||||
vote_producer: EosActionVoteProducer = None,
|
||||
update_auth: EosActionUpdateAuth = None,
|
||||
delete_auth: EosActionDeleteAuth = None,
|
||||
link_auth: EosActionLinkAuth = None,
|
||||
unlink_auth: EosActionUnlinkAuth = None,
|
||||
new_account: EosActionNewAccount = None,
|
||||
unknown: EosActionUnknown = None,
|
||||
) -> None:
|
||||
self.common = common
|
||||
self.transfer = transfer
|
||||
self.delegate = delegate
|
||||
self.undelegate = undelegate
|
||||
self.refund = refund
|
||||
self.buy_ram = buy_ram
|
||||
self.buy_ram_bytes = buy_ram_bytes
|
||||
self.sell_ram = sell_ram
|
||||
self.vote_producer = vote_producer
|
||||
self.update_auth = update_auth
|
||||
self.delete_auth = delete_auth
|
||||
self.link_auth = link_auth
|
||||
self.unlink_auth = unlink_auth
|
||||
self.new_account = new_account
|
||||
self.unknown = unknown
|
||||
|
||||
@classmethod
|
||||
def get_fields(cls):
|
||||
return {
|
||||
1: ('common', EosActionCommon, 0),
|
||||
2: ('transfer', EosActionTransfer, 0),
|
||||
3: ('delegate', EosActionDelegate, 0),
|
||||
4: ('undelegate', EosActionUndelegate, 0),
|
||||
5: ('refund', EosActionRefund, 0),
|
||||
6: ('buy_ram', EosActionBuyRam, 0),
|
||||
7: ('buy_ram_bytes', EosActionBuyRamBytes, 0),
|
||||
8: ('sell_ram', EosActionSellRam, 0),
|
||||
9: ('vote_producer', EosActionVoteProducer, 0),
|
||||
10: ('update_auth', EosActionUpdateAuth, 0),
|
||||
11: ('delete_auth', EosActionDeleteAuth, 0),
|
||||
12: ('link_auth', EosActionLinkAuth, 0),
|
||||
13: ('unlink_auth', EosActionUnlinkAuth, 0),
|
||||
14: ('new_account', EosActionNewAccount, 0),
|
||||
15: ('unknown', EosActionUnknown, 0),
|
||||
}
|
19
python/trezorlib/messages/EosTxActionRequest.py
Normal file
19
python/trezorlib/messages/EosTxActionRequest.py
Normal file
@ -0,0 +1,19 @@
|
||||
# Automatically generated by pb2py
|
||||
# fmt: off
|
||||
from .. import protobuf as p
|
||||
|
||||
|
||||
class EosTxActionRequest(p.MessageType):
|
||||
MESSAGE_WIRE_TYPE = 603
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
data_size: int = None,
|
||||
) -> None:
|
||||
self.data_size = data_size
|
||||
|
||||
@classmethod
|
||||
def get_fields(cls):
|
||||
return {
|
||||
1: ('data_size', p.UVarintType, 0),
|
||||
}
|
33
python/trezorlib/messages/EosTxHeader.py
Normal file
33
python/trezorlib/messages/EosTxHeader.py
Normal file
@ -0,0 +1,33 @@
|
||||
# Automatically generated by pb2py
|
||||
# fmt: off
|
||||
from .. import protobuf as p
|
||||
|
||||
|
||||
class EosTxHeader(p.MessageType):
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
expiration: int = None,
|
||||
ref_block_num: int = None,
|
||||
ref_block_prefix: int = None,
|
||||
max_net_usage_words: int = None,
|
||||
max_cpu_usage_ms: int = None,
|
||||
delay_sec: int = None,
|
||||
) -> None:
|
||||
self.expiration = expiration
|
||||
self.ref_block_num = ref_block_num
|
||||
self.ref_block_prefix = ref_block_prefix
|
||||
self.max_net_usage_words = max_net_usage_words
|
||||
self.max_cpu_usage_ms = max_cpu_usage_ms
|
||||
self.delay_sec = delay_sec
|
||||
|
||||
@classmethod
|
||||
def get_fields(cls):
|
||||
return {
|
||||
1: ('expiration', p.UVarintType, 0), # required
|
||||
2: ('ref_block_num', p.UVarintType, 0), # required
|
||||
3: ('ref_block_prefix', p.UVarintType, 0), # required
|
||||
4: ('max_net_usage_words', p.UVarintType, 0), # required
|
||||
5: ('max_cpu_usage_ms', p.UVarintType, 0), # required
|
||||
6: ('delay_sec', p.UVarintType, 0), # required
|
||||
}
|
22
python/trezorlib/messages/EthereumAddress.py
Normal file
22
python/trezorlib/messages/EthereumAddress.py
Normal file
@ -0,0 +1,22 @@
|
||||
# Automatically generated by pb2py
|
||||
# fmt: off
|
||||
from .. import protobuf as p
|
||||
|
||||
|
||||
class EthereumAddress(p.MessageType):
|
||||
MESSAGE_WIRE_TYPE = 57
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
old_address: bytes = None,
|
||||
address: str = None,
|
||||
) -> None:
|
||||
self.old_address = old_address
|
||||
self.address = address
|
||||
|
||||
@classmethod
|
||||
def get_fields(cls):
|
||||
return {
|
||||
1: ('old_address', p.BytesType, 0),
|
||||
2: ('address', p.UnicodeType, 0),
|
||||
}
|
28
python/trezorlib/messages/EthereumGetAddress.py
Normal file
28
python/trezorlib/messages/EthereumGetAddress.py
Normal file
@ -0,0 +1,28 @@
|
||||
# Automatically generated by pb2py
|
||||
# fmt: off
|
||||
from .. import protobuf as p
|
||||
|
||||
if __debug__:
|
||||
try:
|
||||
from typing import List
|
||||
except ImportError:
|
||||
List = None # type: ignore
|
||||
|
||||
|
||||
class EthereumGetAddress(p.MessageType):
|
||||
MESSAGE_WIRE_TYPE = 56
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
address_n: List[int] = None,
|
||||
show_display: bool = None,
|
||||
) -> None:
|
||||
self.address_n = address_n if address_n is not None else []
|
||||
self.show_display = show_display
|
||||
|
||||
@classmethod
|
||||
def get_fields(cls):
|
||||
return {
|
||||
1: ('address_n', p.UVarintType, p.FLAG_REPEATED),
|
||||
2: ('show_display', p.BoolType, 0),
|
||||
}
|
28
python/trezorlib/messages/EthereumGetPublicKey.py
Normal file
28
python/trezorlib/messages/EthereumGetPublicKey.py
Normal file
@ -0,0 +1,28 @@
|
||||
# Automatically generated by pb2py
|
||||
# fmt: off
|
||||
from .. import protobuf as p
|
||||
|
||||
if __debug__:
|
||||
try:
|
||||
from typing import List
|
||||
except ImportError:
|
||||
List = None # type: ignore
|
||||
|
||||
|
||||
class EthereumGetPublicKey(p.MessageType):
|
||||
MESSAGE_WIRE_TYPE = 450
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
address_n: List[int] = None,
|
||||
show_display: bool = None,
|
||||
) -> None:
|
||||
self.address_n = address_n if address_n is not None else []
|
||||
self.show_display = show_display
|
||||
|
||||
@classmethod
|
||||
def get_fields(cls):
|
||||
return {
|
||||
1: ('address_n', p.UVarintType, p.FLAG_REPEATED),
|
||||
2: ('show_display', p.BoolType, 0),
|
||||
}
|
22
python/trezorlib/messages/EthereumMessageSignature.py
Normal file
22
python/trezorlib/messages/EthereumMessageSignature.py
Normal file
@ -0,0 +1,22 @@
|
||||
# Automatically generated by pb2py
|
||||
# fmt: off
|
||||
from .. import protobuf as p
|
||||
|
||||
|
||||
class EthereumMessageSignature(p.MessageType):
|
||||
MESSAGE_WIRE_TYPE = 66
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
signature: bytes = None,
|
||||
address: str = None,
|
||||
) -> None:
|
||||
self.signature = signature
|
||||
self.address = address
|
||||
|
||||
@classmethod
|
||||
def get_fields(cls):
|
||||
return {
|
||||
2: ('signature', p.BytesType, 0),
|
||||
3: ('address', p.UnicodeType, 0),
|
||||
}
|
24
python/trezorlib/messages/EthereumPublicKey.py
Normal file
24
python/trezorlib/messages/EthereumPublicKey.py
Normal file
@ -0,0 +1,24 @@
|
||||
# Automatically generated by pb2py
|
||||
# fmt: off
|
||||
from .. import protobuf as p
|
||||
|
||||
from .HDNodeType import HDNodeType
|
||||
|
||||
|
||||
class EthereumPublicKey(p.MessageType):
|
||||
MESSAGE_WIRE_TYPE = 451
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
node: HDNodeType = None,
|
||||
xpub: str = None,
|
||||
) -> None:
|
||||
self.node = node
|
||||
self.xpub = xpub
|
||||
|
||||
@classmethod
|
||||
def get_fields(cls):
|
||||
return {
|
||||
1: ('node', HDNodeType, 0),
|
||||
2: ('xpub', p.UnicodeType, 0),
|
||||
}
|
28
python/trezorlib/messages/EthereumSignMessage.py
Normal file
28
python/trezorlib/messages/EthereumSignMessage.py
Normal file
@ -0,0 +1,28 @@
|
||||
# Automatically generated by pb2py
|
||||
# fmt: off
|
||||
from .. import protobuf as p
|
||||
|
||||
if __debug__:
|
||||
try:
|
||||
from typing import List
|
||||
except ImportError:
|
||||
List = None # type: ignore
|
||||
|
||||
|
||||
class EthereumSignMessage(p.MessageType):
|
||||
MESSAGE_WIRE_TYPE = 64
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
address_n: List[int] = None,
|
||||
message: bytes = None,
|
||||
) -> None:
|
||||
self.address_n = address_n if address_n is not None else []
|
||||
self.message = message
|
||||
|
||||
@classmethod
|
||||
def get_fields(cls):
|
||||
return {
|
||||
1: ('address_n', p.UVarintType, p.FLAG_REPEATED),
|
||||
2: ('message', p.BytesType, 0),
|
||||
}
|
52
python/trezorlib/messages/EthereumSignTx.py
Normal file
52
python/trezorlib/messages/EthereumSignTx.py
Normal file
@ -0,0 +1,52 @@
|
||||
# Automatically generated by pb2py
|
||||
# fmt: off
|
||||
from .. import protobuf as p
|
||||
|
||||
if __debug__:
|
||||
try:
|
||||
from typing import List
|
||||
except ImportError:
|
||||
List = None # type: ignore
|
||||
|
||||
|
||||
class EthereumSignTx(p.MessageType):
|
||||
MESSAGE_WIRE_TYPE = 58
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
address_n: List[int] = None,
|
||||
nonce: bytes = None,
|
||||
gas_price: bytes = None,
|
||||
gas_limit: bytes = None,
|
||||
to: str = None,
|
||||
value: bytes = None,
|
||||
data_initial_chunk: bytes = None,
|
||||
data_length: int = None,
|
||||
chain_id: int = None,
|
||||
tx_type: int = None,
|
||||
) -> None:
|
||||
self.address_n = address_n if address_n is not None else []
|
||||
self.nonce = nonce
|
||||
self.gas_price = gas_price
|
||||
self.gas_limit = gas_limit
|
||||
self.to = to
|
||||
self.value = value
|
||||
self.data_initial_chunk = data_initial_chunk
|
||||
self.data_length = data_length
|
||||
self.chain_id = chain_id
|
||||
self.tx_type = tx_type
|
||||
|
||||
@classmethod
|
||||
def get_fields(cls):
|
||||
return {
|
||||
1: ('address_n', p.UVarintType, p.FLAG_REPEATED),
|
||||
2: ('nonce', p.BytesType, 0),
|
||||
3: ('gas_price', p.BytesType, 0),
|
||||
4: ('gas_limit', p.BytesType, 0),
|
||||
11: ('to', p.UnicodeType, 0),
|
||||
6: ('value', p.BytesType, 0),
|
||||
7: ('data_initial_chunk', p.BytesType, 0),
|
||||
8: ('data_length', p.UVarintType, 0),
|
||||
9: ('chain_id', p.UVarintType, 0),
|
||||
10: ('tx_type', p.UVarintType, 0),
|
||||
}
|
19
python/trezorlib/messages/EthereumTxAck.py
Normal file
19
python/trezorlib/messages/EthereumTxAck.py
Normal file
@ -0,0 +1,19 @@
|
||||
# Automatically generated by pb2py
|
||||
# fmt: off
|
||||
from .. import protobuf as p
|
||||
|
||||
|
||||
class EthereumTxAck(p.MessageType):
|
||||
MESSAGE_WIRE_TYPE = 60
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
data_chunk: bytes = None,
|
||||
) -> None:
|
||||
self.data_chunk = data_chunk
|
||||
|
||||
@classmethod
|
||||
def get_fields(cls):
|
||||
return {
|
||||
1: ('data_chunk', p.BytesType, 0),
|
||||
}
|
28
python/trezorlib/messages/EthereumTxRequest.py
Normal file
28
python/trezorlib/messages/EthereumTxRequest.py
Normal file
@ -0,0 +1,28 @@
|
||||
# Automatically generated by pb2py
|
||||
# fmt: off
|
||||
from .. import protobuf as p
|
||||
|
||||
|
||||
class EthereumTxRequest(p.MessageType):
|
||||
MESSAGE_WIRE_TYPE = 59
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
data_length: int = None,
|
||||
signature_v: int = None,
|
||||
signature_r: bytes = None,
|
||||
signature_s: bytes = None,
|
||||
) -> None:
|
||||
self.data_length = data_length
|
||||
self.signature_v = signature_v
|
||||
self.signature_r = signature_r
|
||||
self.signature_s = signature_s
|
||||
|
||||
@classmethod
|
||||
def get_fields(cls):
|
||||
return {
|
||||
1: ('data_length', p.UVarintType, 0),
|
||||
2: ('signature_v', p.UVarintType, 0),
|
||||
3: ('signature_r', p.BytesType, 0),
|
||||
4: ('signature_s', p.BytesType, 0),
|
||||
}
|
25
python/trezorlib/messages/EthereumVerifyMessage.py
Normal file
25
python/trezorlib/messages/EthereumVerifyMessage.py
Normal file
@ -0,0 +1,25 @@
|
||||
# Automatically generated by pb2py
|
||||
# fmt: off
|
||||
from .. import protobuf as p
|
||||
|
||||
|
||||
class EthereumVerifyMessage(p.MessageType):
|
||||
MESSAGE_WIRE_TYPE = 65
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
signature: bytes = None,
|
||||
message: bytes = None,
|
||||
address: str = None,
|
||||
) -> None:
|
||||
self.signature = signature
|
||||
self.message = message
|
||||
self.address = address
|
||||
|
||||
@classmethod
|
||||
def get_fields(cls):
|
||||
return {
|
||||
2: ('signature', p.BytesType, 0),
|
||||
3: ('message', p.BytesType, 0),
|
||||
4: ('address', p.UnicodeType, 0),
|
||||
}
|
22
python/trezorlib/messages/Failure.py
Normal file
22
python/trezorlib/messages/Failure.py
Normal file
@ -0,0 +1,22 @@
|
||||
# Automatically generated by pb2py
|
||||
# fmt: off
|
||||
from .. import protobuf as p
|
||||
|
||||
|
||||
class Failure(p.MessageType):
|
||||
MESSAGE_WIRE_TYPE = 3
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
code: int = None,
|
||||
message: str = None,
|
||||
) -> None:
|
||||
self.code = code
|
||||
self.message = message
|
||||
|
||||
@classmethod
|
||||
def get_fields(cls):
|
||||
return {
|
||||
1: ('code', p.UVarintType, 0),
|
||||
2: ('message', p.UnicodeType, 0),
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user