You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
trezor-firmware/core/src/trezor/messages/SignTx.py

56 lines
1.8 KiB

# Automatically generated by pb2py
# fmt: off
import protobuf as p
if __debug__:
try:
from typing import Dict, List # noqa: F401
from typing_extensions import Literal # noqa: F401
EnumTypeAmountUnit = Literal[0, 1, 2, 3]
except ImportError:
pass
class SignTx(p.MessageType):
MESSAGE_WIRE_TYPE = 15
def __init__(
self,
*,
outputs_count: int,
inputs_count: int,
coin_name: str = "Bitcoin",
version: int = 1,
lock_time: int = 0,
expiry: int = None,
version_group_id: int = None,
timestamp: int = None,
branch_id: int = None,
amount_unit: EnumTypeAmountUnit = 0,
) -> None:
self.outputs_count = outputs_count
self.inputs_count = inputs_count
self.coin_name = coin_name
self.version = version
self.lock_time = lock_time
self.expiry = expiry
self.version_group_id = version_group_id
self.timestamp = timestamp
self.branch_id = branch_id
self.amount_unit = amount_unit
@classmethod
def get_fields(cls) -> Dict:
return {
1: ('outputs_count', p.UVarintType, p.FLAG_REQUIRED),
2: ('inputs_count', p.UVarintType, p.FLAG_REQUIRED),
3: ('coin_name', p.UnicodeType, "Bitcoin"), # default=Bitcoin
4: ('version', p.UVarintType, 1), # default=1
5: ('lock_time', p.UVarintType, 0), # default=0
6: ('expiry', p.UVarintType, None),
8: ('version_group_id', p.UVarintType, None),
9: ('timestamp', p.UVarintType, None),
10: ('branch_id', p.UVarintType, None),
11: ('amount_unit', p.EnumType("AmountUnit", (0, 1, 2, 3)), 0), # default=BITCOIN
}