mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-07-15 19:18:11 +00:00
42 lines
1.1 KiB
Python
42 lines
1.1 KiB
Python
# Automatically generated by pb2py
|
|
# fmt: off
|
|
from .. import protobuf as p
|
|
|
|
if __debug__:
|
|
try:
|
|
from typing import Dict, List # noqa: F401
|
|
from typing_extensions import Literal # noqa: F401
|
|
except ImportError:
|
|
pass
|
|
|
|
|
|
class HDNodeType(p.MessageType):
|
|
|
|
def __init__(
|
|
self,
|
|
*,
|
|
depth: int,
|
|
fingerprint: int,
|
|
child_num: int,
|
|
chain_code: bytes,
|
|
public_key: bytes,
|
|
private_key: bytes = None,
|
|
) -> None:
|
|
self.depth = depth
|
|
self.fingerprint = fingerprint
|
|
self.child_num = child_num
|
|
self.chain_code = chain_code
|
|
self.public_key = public_key
|
|
self.private_key = private_key
|
|
|
|
@classmethod
|
|
def get_fields(cls) -> Dict:
|
|
return {
|
|
1: ('depth', p.UVarintType, p.FLAG_REQUIRED),
|
|
2: ('fingerprint', p.UVarintType, p.FLAG_REQUIRED),
|
|
3: ('child_num', p.UVarintType, p.FLAG_REQUIRED),
|
|
4: ('chain_code', p.BytesType, p.FLAG_REQUIRED),
|
|
5: ('private_key', p.BytesType, None),
|
|
6: ('public_key', p.BytesType, p.FLAG_REQUIRED),
|
|
}
|