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/CardanoSignTx.py

60 lines
2.2 KiB

# Automatically generated by pb2py
# fmt: off
import protobuf as p
from .CardanoTxCertificateType import CardanoTxCertificateType
from .CardanoTxInputType import CardanoTxInputType
from .CardanoTxOutputType import CardanoTxOutputType
from .CardanoTxWithdrawalType import CardanoTxWithdrawalType
if __debug__:
try:
from typing import Dict, List, Optional # noqa: F401
from typing_extensions import Literal # noqa: F401
except ImportError:
pass
class CardanoSignTx(p.MessageType):
MESSAGE_WIRE_TYPE = 303
def __init__(
self,
*,
protocol_magic: int,
fee: int,
network_id: int,
inputs: Optional[List[CardanoTxInputType]] = None,
outputs: Optional[List[CardanoTxOutputType]] = None,
certificates: Optional[List[CardanoTxCertificateType]] = None,
withdrawals: Optional[List[CardanoTxWithdrawalType]] = None,
ttl: Optional[int] = None,
metadata: Optional[bytes] = None,
validity_interval_start: Optional[int] = None,
) -> None:
self.inputs = inputs if inputs is not None else []
self.outputs = outputs if outputs is not None else []
self.certificates = certificates if certificates is not None else []
self.withdrawals = withdrawals if withdrawals is not None else []
self.protocol_magic = protocol_magic
self.fee = fee
self.network_id = network_id
self.ttl = ttl
self.metadata = metadata
self.validity_interval_start = validity_interval_start
@classmethod
def get_fields(cls) -> Dict:
return {
1: ('inputs', CardanoTxInputType, p.FLAG_REPEATED),
2: ('outputs', CardanoTxOutputType, p.FLAG_REPEATED),
5: ('protocol_magic', p.UVarintType, p.FLAG_REQUIRED),
6: ('fee', p.UVarintType, p.FLAG_REQUIRED),
7: ('ttl', p.UVarintType, None),
8: ('network_id', p.UVarintType, p.FLAG_REQUIRED),
9: ('certificates', CardanoTxCertificateType, p.FLAG_REPEATED),
10: ('withdrawals', CardanoTxWithdrawalType, p.FLAG_REPEATED),
11: ('metadata', p.BytesType, None),
12: ('validity_interval_start', p.UVarintType, None),
}