1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-24 15:28:10 +00:00

refactor(python): rework trezorlib protobuf codec

API-compatibility with the original one is retained.

Now that we don't need to keep code parity with core, we could do some
changes that make life easier.

All generated classes are now in one file. This makes github diffs more
readable, at the cost of somewhat complicating inspecting individual
classes; however, that is something we shouldn't be doing anyway.

Enums are now implemented as enum.IntEnum.

The original class-level FIELDS member was restored.

Each field is now defined via protobuf.Field, which is easier to work
with in the codec, AND we're not stuffing defaults and flags into the
same field.
This commit is contained in:
matejcik 2021-06-01 11:29:20 +02:00 committed by matejcik
parent 729414e606
commit a58823cc0c
343 changed files with 7014 additions and 11826 deletions

View File

@ -0,0 +1 @@
Refactor protobuf codec for better clarity

View File

@ -0,0 +1,63 @@
# Automatically generated by pb2py
# fmt: off
# isort:skip_file
from enum import IntEnum
from typing import List, Optional
from . import protobuf
% for enum in enums:
class ${enum.name}(IntEnum):
% for value in enum.value:
${value.name} = ${value.number}
% endfor
% endfor
% for message in messages:
<%
required_fields = [f for f in message.fields if f.required]
repeated_fields = [f for f in message.fields if f.repeated]
optional_fields = [f for f in message.fields if f.optional]
def type_name(field):
if field.type_object is not None:
return field.type_name
else:
return '"' + field.type_name + '"'
%>\
class ${message.name}(protobuf.MessageType):
MESSAGE_WIRE_TYPE = ${message.wire_type}
% if message.fields:
FIELDS = {
% for field in message.fields:
${field.number}: protobuf.Field("${field.name}", ${type_name(field)}, repeated=${field.repeated}, required=${field.required}),
% endfor
}
def __init__(
self,
*,
% for field in required_fields:
${field.name}: ${field.python_type},
% endfor
% for field in repeated_fields:
${field.name}: Optional[List[${field.python_type}]] = None,
% endfor
% for field in optional_fields:
${field.name}: Optional[${field.python_type}] = ${field.default_value_repr},
% endfor
) -> None:
% for field in repeated_fields:
self.${field.name} = ${field.name} if ${field.name} is not None else []
% endfor
% for field in required_fields + optional_fields:
self.${field.name} = ${field.name}
% endfor
% endif
% endfor

View File

@ -18,6 +18,7 @@ import logging
import textwrap
from collections import namedtuple
from copy import deepcopy
from enum import IntEnum
from mnemonic import Mnemonic
@ -285,11 +286,11 @@ class MessageFilter:
@classmethod
def from_message(cls, message):
fields = {}
for fname, _, _ in message.get_fields().values():
value = getattr(message, fname)
if value in (None, [], protobuf.FLAG_REQUIRED):
for field in message.FIELDS.values():
value = getattr(message, field.name)
if value in (None, [], protobuf.REQUIRED_FIELD_PLACEHOLDER):
continue
fields[fname] = value
fields[field.name] = value
return cls(type(message), **fields)
def match(self, message):
@ -308,12 +309,12 @@ class MessageFilter:
def format(self, maxwidth=80):
fields = []
for fname, ftype, _ in self.message_type.get_fields().values():
if fname not in self.fields:
for field in self.message_type.FIELDS.values():
if field.name not in self.fields:
continue
value = self.fields[fname]
if isinstance(ftype, protobuf.EnumType) and isinstance(value, int):
field_str = ftype.to_str(value)
value = self.fields[field.name]
if isinstance(value, IntEnum):
field_str = value.name
elif isinstance(value, MessageFilter):
field_str = value.format(maxwidth - 4)
elif isinstance(value, protobuf.MessageType):
@ -321,7 +322,7 @@ class MessageFilter:
else:
field_str = repr(value)
field_str = textwrap.indent(field_str, " ").lstrip()
fields.append((fname, field_str))
fields.append((field.name, field_str))
pairs = ["{}={}".format(k, v) for k, v in fields]
oneline_str = ", ".join(pairs)

View File

@ -24,24 +24,16 @@ map_class_to_type = {}
def build_map():
for msg_name in dir(messages.MessageType):
if msg_name.startswith("__"):
continue
if msg_name == "Literal":
# TODO: remove this when we have a good implementation of enums
continue
try:
msg_class = getattr(messages, msg_name)
except AttributeError:
for entry in messages.MessageType:
msg_class = getattr(messages, entry.name, None)
if msg_class is None:
raise ValueError(
"Implementation of protobuf message '%s' is missing" % msg_name
f"Implementation of protobuf message '{entry.name}' is missing"
)
if msg_class.MESSAGE_WIRE_TYPE != getattr(messages.MessageType, msg_name):
if msg_class.MESSAGE_WIRE_TYPE != entry.value:
raise ValueError(
"Inconsistent wire type and MessageType record for '%s'" % msg_class
f"Inconsistent wire type and MessageType record for '{entry.name}'"
)
register_message(msg_class)

File diff suppressed because it is too large Load Diff

View File

@ -1,28 +0,0 @@
# Automatically generated by pb2py
# fmt: off
# isort:skip_file
from .. import protobuf as p
if __debug__:
try:
from typing import Dict, List, Optional # noqa: F401
from typing_extensions import Literal # noqa: F401
except ImportError:
pass
class Address(p.MessageType):
MESSAGE_WIRE_TYPE = 30
def __init__(
self,
*,
address: str,
) -> None:
self.address = address
@classmethod
def get_fields(cls) -> Dict:
return {
1: ('address', p.UnicodeType, p.FLAG_REQUIRED),
}

View File

@ -1,13 +0,0 @@
# Automatically generated by pb2py
# fmt: off
# isort:skip_file
if __debug__:
try:
from typing_extensions import Literal # noqa: F401
except ImportError:
pass
BITCOIN: Literal[0] = 0
MILLIBITCOIN: Literal[1] = 1
MICROBITCOIN: Literal[2] = 2
SATOSHI: Literal[3] = 3

View File

@ -1,28 +0,0 @@
# Automatically generated by pb2py
# fmt: off
# isort:skip_file
from .. import protobuf as p
if __debug__:
try:
from typing import Dict, List, Optional # noqa: F401
from typing_extensions import Literal # noqa: F401
except ImportError:
pass
class ApplyFlags(p.MessageType):
MESSAGE_WIRE_TYPE = 28
def __init__(
self,
*,
flags: Optional[int] = None,
) -> None:
self.flags = flags
@classmethod
def get_fields(cls) -> Dict:
return {
1: ('flags', p.UVarintType, None),
}

View File

@ -1,53 +0,0 @@
# Automatically generated by pb2py
# fmt: off
# isort:skip_file
from .. import protobuf as p
if __debug__:
try:
from typing import Dict, List, Optional # noqa: F401
from typing_extensions import Literal # noqa: F401
EnumTypeSafetyCheckLevel = Literal[0, 1, 2]
except ImportError:
pass
class ApplySettings(p.MessageType):
MESSAGE_WIRE_TYPE = 25
def __init__(
self,
*,
language: Optional[str] = None,
label: Optional[str] = None,
use_passphrase: Optional[bool] = None,
homescreen: Optional[bytes] = None,
auto_lock_delay_ms: Optional[int] = None,
display_rotation: Optional[int] = None,
passphrase_always_on_device: Optional[bool] = None,
safety_checks: Optional[EnumTypeSafetyCheckLevel] = None,
experimental_features: Optional[bool] = None,
) -> None:
self.language = language
self.label = label
self.use_passphrase = use_passphrase
self.homescreen = homescreen
self.auto_lock_delay_ms = auto_lock_delay_ms
self.display_rotation = display_rotation
self.passphrase_always_on_device = passphrase_always_on_device
self.safety_checks = safety_checks
self.experimental_features = experimental_features
@classmethod
def get_fields(cls) -> Dict:
return {
1: ('language', p.UnicodeType, None),
2: ('label', p.UnicodeType, None),
3: ('use_passphrase', p.BoolType, None),
4: ('homescreen', p.BytesType, None),
6: ('auto_lock_delay_ms', p.UVarintType, None),
7: ('display_rotation', p.UVarintType, None),
8: ('passphrase_always_on_device', p.BoolType, None),
9: ('safety_checks', p.EnumType("SafetyCheckLevel", (0, 1, 2,)), None),
10: ('experimental_features', p.BoolType, None),
}

View File

@ -1,49 +0,0 @@
# Automatically generated by pb2py
# fmt: off
# isort:skip_file
from .. import protobuf as p
if __debug__:
try:
from typing import Dict, List, Optional # noqa: F401
from typing_extensions import Literal # noqa: F401
EnumTypeInputScriptType = Literal[0, 1, 2, 3, 4]
EnumTypeAmountUnit = Literal[0, 1, 2, 3]
except ImportError:
pass
class AuthorizeCoinJoin(p.MessageType):
MESSAGE_WIRE_TYPE = 51
UNSTABLE = True
def __init__(
self,
*,
coordinator: str,
max_total_fee: int,
address_n: Optional[List[int]] = None,
fee_per_anonymity: int = 0,
coin_name: str = "Bitcoin",
script_type: EnumTypeInputScriptType = 0,
amount_unit: EnumTypeAmountUnit = 0,
) -> None:
self.address_n = address_n if address_n is not None else []
self.coordinator = coordinator
self.max_total_fee = max_total_fee
self.fee_per_anonymity = fee_per_anonymity
self.coin_name = coin_name
self.script_type = script_type
self.amount_unit = amount_unit
@classmethod
def get_fields(cls) -> Dict:
return {
1: ('coordinator', p.UnicodeType, p.FLAG_REQUIRED),
2: ('max_total_fee', p.UVarintType, p.FLAG_REQUIRED),
3: ('fee_per_anonymity', p.UVarintType, 0), # default=0
4: ('address_n', p.UVarintType, p.FLAG_REPEATED),
5: ('coin_name', p.UnicodeType, "Bitcoin"), # default=Bitcoin
6: ('script_type', p.EnumType("InputScriptType", (0, 1, 2, 3, 4,)), 0), # default=SPENDADDRESS
11: ('amount_unit', p.EnumType("AmountUnit", (0, 1, 2, 3,)), 0), # default=BITCOIN
}

View File

@ -1,15 +0,0 @@
# Automatically generated by pb2py
# fmt: off
# isort:skip_file
from .. import protobuf as p
if __debug__:
try:
from typing import Dict, List, Optional # noqa: F401
from typing_extensions import Literal # noqa: F401
except ImportError:
pass
class BackupDevice(p.MessageType):
MESSAGE_WIRE_TYPE = 34

View File

@ -1,12 +0,0 @@
# Automatically generated by pb2py
# fmt: off
# isort:skip_file
if __debug__:
try:
from typing_extensions import Literal # noqa: F401
except ImportError:
pass
Bip39: Literal[0] = 0
Slip39_Basic: Literal[1] = 1
Slip39_Advanced: Literal[2] = 2

View File

@ -1,28 +0,0 @@
# Automatically generated by pb2py
# fmt: off
# isort:skip_file
from .. import protobuf as p
if __debug__:
try:
from typing import Dict, List, Optional # noqa: F401
from typing_extensions import Literal # noqa: F401
except ImportError:
pass
class BinanceAddress(p.MessageType):
MESSAGE_WIRE_TYPE = 701
def __init__(
self,
*,
address: str,
) -> None:
self.address = address
@classmethod
def get_fields(cls) -> Dict:
return {
1: ('address', p.UnicodeType, p.FLAG_REQUIRED),
}

View File

@ -1,34 +0,0 @@
# Automatically generated by pb2py
# fmt: off
# isort:skip_file
from .. import protobuf as p
if __debug__:
try:
from typing import Dict, List, Optional # noqa: F401
from typing_extensions import Literal # noqa: F401
except ImportError:
pass
class BinanceCancelMsg(p.MessageType):
MESSAGE_WIRE_TYPE = 708
def __init__(
self,
*,
refid: Optional[str] = None,
sender: Optional[str] = None,
symbol: Optional[str] = None,
) -> None:
self.refid = refid
self.sender = sender
self.symbol = symbol
@classmethod
def get_fields(cls) -> Dict:
return {
1: ('refid', p.UnicodeType, None),
2: ('sender', p.UnicodeType, None),
3: ('symbol', p.UnicodeType, None),
}

View File

@ -1,30 +0,0 @@
# Automatically generated by pb2py
# fmt: off
# isort:skip_file
from .. import protobuf as p
if __debug__:
try:
from typing import Dict, List, Optional # noqa: F401
from typing_extensions import Literal # noqa: F401
except ImportError:
pass
class BinanceCoin(p.MessageType):
def __init__(
self,
*,
amount: Optional[int] = None,
denom: Optional[str] = None,
) -> None:
self.amount = amount
self.denom = denom
@classmethod
def get_fields(cls) -> Dict:
return {
1: ('amount', p.SVarintType, None),
2: ('denom', p.UnicodeType, None),
}

View File

@ -1,31 +0,0 @@
# Automatically generated by pb2py
# fmt: off
# isort:skip_file
from .. import protobuf as p
if __debug__:
try:
from typing import Dict, List, Optional # noqa: F401
from typing_extensions import Literal # noqa: F401
except ImportError:
pass
class BinanceGetAddress(p.MessageType):
MESSAGE_WIRE_TYPE = 700
def __init__(
self,
*,
address_n: Optional[List[int]] = None,
show_display: Optional[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) -> Dict:
return {
1: ('address_n', p.UVarintType, p.FLAG_REPEATED),
2: ('show_display', p.BoolType, None),
}

View File

@ -1,31 +0,0 @@
# Automatically generated by pb2py
# fmt: off
# isort:skip_file
from .. import protobuf as p
if __debug__:
try:
from typing import Dict, List, Optional # noqa: F401
from typing_extensions import Literal # noqa: F401
except ImportError:
pass
class BinanceGetPublicKey(p.MessageType):
MESSAGE_WIRE_TYPE = 702
def __init__(
self,
*,
address_n: Optional[List[int]] = None,
show_display: Optional[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) -> Dict:
return {
1: ('address_n', p.UVarintType, p.FLAG_REPEATED),
2: ('show_display', p.BoolType, None),
}

View File

@ -1,32 +0,0 @@
# Automatically generated by pb2py
# fmt: off
# isort:skip_file
from .. import protobuf as p
from .BinanceCoin import BinanceCoin
if __debug__:
try:
from typing import Dict, List, Optional # noqa: F401
from typing_extensions import Literal # noqa: F401
except ImportError:
pass
class BinanceInputOutput(p.MessageType):
def __init__(
self,
*,
coins: Optional[List[BinanceCoin]] = None,
address: Optional[str] = None,
) -> None:
self.coins = coins if coins is not None else []
self.address = address
@classmethod
def get_fields(cls) -> Dict:
return {
1: ('address', p.UnicodeType, None),
2: ('coins', BinanceCoin, p.FLAG_REPEATED),
}

View File

@ -1,52 +0,0 @@
# Automatically generated by pb2py
# fmt: off
# isort:skip_file
from .. import protobuf as p
if __debug__:
try:
from typing import Dict, List, Optional # noqa: F401
from typing_extensions import Literal # noqa: F401
EnumTypeBinanceOrderType = Literal[0, 1, 2, 3]
EnumTypeBinanceOrderSide = Literal[0, 1, 2]
EnumTypeBinanceTimeInForce = Literal[0, 1, 2, 3]
except ImportError:
pass
class BinanceOrderMsg(p.MessageType):
MESSAGE_WIRE_TYPE = 707
def __init__(
self,
*,
id: Optional[str] = None,
ordertype: Optional[EnumTypeBinanceOrderType] = None,
price: Optional[int] = None,
quantity: Optional[int] = None,
sender: Optional[str] = None,
side: Optional[EnumTypeBinanceOrderSide] = None,
symbol: Optional[str] = None,
timeinforce: Optional[EnumTypeBinanceTimeInForce] = 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) -> Dict:
return {
1: ('id', p.UnicodeType, None),
2: ('ordertype', p.EnumType("BinanceOrderType", (0, 1, 2, 3,)), None),
3: ('price', p.SVarintType, None),
4: ('quantity', p.SVarintType, None),
5: ('sender', p.UnicodeType, None),
6: ('side', p.EnumType("BinanceOrderSide", (0, 1, 2,)), None),
7: ('symbol', p.UnicodeType, None),
8: ('timeinforce', p.EnumType("BinanceTimeInForce", (0, 1, 2, 3,)), None),
}

View File

@ -1,12 +0,0 @@
# Automatically generated by pb2py
# fmt: off
# isort:skip_file
if __debug__:
try:
from typing_extensions import Literal # noqa: F401
except ImportError:
pass
SIDE_UNKNOWN: Literal[0] = 0
BUY: Literal[1] = 1
SELL: Literal[2] = 2

View File

@ -1,13 +0,0 @@
# Automatically generated by pb2py
# fmt: off
# isort:skip_file
if __debug__:
try:
from typing_extensions import Literal # noqa: F401
except ImportError:
pass
OT_UNKNOWN: Literal[0] = 0
MARKET: Literal[1] = 1
LIMIT: Literal[2] = 2
OT_RESERVED: Literal[3] = 3

View File

@ -1,28 +0,0 @@
# Automatically generated by pb2py
# fmt: off
# isort:skip_file
from .. import protobuf as p
if __debug__:
try:
from typing import Dict, List, Optional # noqa: F401
from typing_extensions import Literal # noqa: F401
except ImportError:
pass
class BinancePublicKey(p.MessageType):
MESSAGE_WIRE_TYPE = 703
def __init__(
self,
*,
public_key: bytes,
) -> None:
self.public_key = public_key
@classmethod
def get_fields(cls) -> Dict:
return {
1: ('public_key', p.BytesType, p.FLAG_REQUIRED),
}

View File

@ -1,46 +0,0 @@
# Automatically generated by pb2py
# fmt: off
# isort:skip_file
from .. import protobuf as p
if __debug__:
try:
from typing import Dict, List, Optional # noqa: F401
from typing_extensions import Literal # noqa: F401
except ImportError:
pass
class BinanceSignTx(p.MessageType):
MESSAGE_WIRE_TYPE = 704
def __init__(
self,
*,
address_n: Optional[List[int]] = None,
msg_count: Optional[int] = None,
account_number: Optional[int] = None,
chain_id: Optional[str] = None,
memo: Optional[str] = None,
sequence: Optional[int] = None,
source: Optional[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) -> Dict:
return {
1: ('address_n', p.UVarintType, p.FLAG_REPEATED),
2: ('msg_count', p.UVarintType, None),
3: ('account_number', p.SVarintType, None),
4: ('chain_id', p.UnicodeType, None),
5: ('memo', p.UnicodeType, None),
6: ('sequence', p.SVarintType, None),
7: ('source', p.SVarintType, None),
}

View File

@ -1,31 +0,0 @@
# Automatically generated by pb2py
# fmt: off
# isort:skip_file
from .. import protobuf as p
if __debug__:
try:
from typing import Dict, List, Optional # noqa: F401
from typing_extensions import Literal # noqa: F401
except ImportError:
pass
class BinanceSignedTx(p.MessageType):
MESSAGE_WIRE_TYPE = 709
def __init__(
self,
*,
signature: bytes,
public_key: bytes,
) -> None:
self.signature = signature
self.public_key = public_key
@classmethod
def get_fields(cls) -> Dict:
return {
1: ('signature', p.BytesType, p.FLAG_REQUIRED),
2: ('public_key', p.BytesType, p.FLAG_REQUIRED),
}

View File

@ -1,13 +0,0 @@
# Automatically generated by pb2py
# fmt: off
# isort:skip_file
if __debug__:
try:
from typing_extensions import Literal # noqa: F401
except ImportError:
pass
TIF_UNKNOWN: Literal[0] = 0
GTE: Literal[1] = 1
TIF_RESERVED: Literal[2] = 2
IOC: Literal[3] = 3

View File

@ -1,33 +0,0 @@
# Automatically generated by pb2py
# fmt: off
# isort:skip_file
from .. import protobuf as p
from .BinanceInputOutput import BinanceInputOutput
if __debug__:
try:
from typing import Dict, List, Optional # noqa: F401
from typing_extensions import Literal # noqa: F401
except ImportError:
pass
class BinanceTransferMsg(p.MessageType):
MESSAGE_WIRE_TYPE = 706
def __init__(
self,
*,
inputs: Optional[List[BinanceInputOutput]] = None,
outputs: Optional[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) -> Dict:
return {
1: ('inputs', BinanceInputOutput, p.FLAG_REPEATED),
2: ('outputs', BinanceInputOutput, p.FLAG_REPEATED),
}

View File

@ -1,15 +0,0 @@
# Automatically generated by pb2py
# fmt: off
# isort:skip_file
from .. import protobuf as p
if __debug__:
try:
from typing import Dict, List, Optional # noqa: F401
from typing_extensions import Literal # noqa: F401
except ImportError:
pass
class BinanceTxRequest(p.MessageType):
MESSAGE_WIRE_TYPE = 705

View File

@ -1,15 +0,0 @@
# Automatically generated by pb2py
# fmt: off
# isort:skip_file
from .. import protobuf as p
if __debug__:
try:
from typing import Dict, List, Optional # noqa: F401
from typing_extensions import Literal # noqa: F401
except ImportError:
pass
class ButtonAck(p.MessageType):
MESSAGE_WIRE_TYPE = 27

View File

@ -1,29 +0,0 @@
# Automatically generated by pb2py
# fmt: off
# isort:skip_file
from .. import protobuf as p
if __debug__:
try:
from typing import Dict, List, Optional # noqa: F401
from typing_extensions import Literal # noqa: F401
EnumTypeButtonRequestType = Literal[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20]
except ImportError:
pass
class ButtonRequest(p.MessageType):
MESSAGE_WIRE_TYPE = 26
def __init__(
self,
*,
code: Optional[EnumTypeButtonRequestType] = None,
) -> None:
self.code = code
@classmethod
def get_fields(cls) -> Dict:
return {
1: ('code', p.EnumType("ButtonRequestType", (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,)), None),
}

View File

@ -1,29 +0,0 @@
# Automatically generated by pb2py
# fmt: off
# isort:skip_file
if __debug__:
try:
from typing_extensions import Literal # noqa: F401
except ImportError:
pass
Other: Literal[1] = 1
FeeOverThreshold: Literal[2] = 2
ConfirmOutput: Literal[3] = 3
ResetDevice: Literal[4] = 4
ConfirmWord: Literal[5] = 5
WipeDevice: Literal[6] = 6
ProtectCall: Literal[7] = 7
SignTx: Literal[8] = 8
FirmwareCheck: Literal[9] = 9
Address: Literal[10] = 10
PublicKey: Literal[11] = 11
MnemonicWordCount: Literal[12] = 12
MnemonicInput: Literal[13] = 13
_Deprecated_ButtonRequest_PassphraseType: Literal[14] = 14
UnknownDerivationPath: Literal[15] = 15
RecoveryHomepage: Literal[16] = 16
Success: Literal[17] = 17
Warning: Literal[18] = 18
PassphraseEntry: Literal[19] = 19
PinEntry: Literal[20] = 20

View File

@ -1,15 +0,0 @@
# Automatically generated by pb2py
# fmt: off
# isort:skip_file
from .. import protobuf as p
if __debug__:
try:
from typing import Dict, List, Optional # noqa: F401
from typing_extensions import Literal # noqa: F401
except ImportError:
pass
class Cancel(p.MessageType):
MESSAGE_WIRE_TYPE = 20

View File

@ -1,15 +0,0 @@
# Automatically generated by pb2py
# fmt: off
# isort:skip_file
from .. import protobuf as p
if __debug__:
try:
from typing import Dict, List, Optional # noqa: F401
from typing_extensions import Literal # noqa: F401
except ImportError:
pass
class CancelAuthorization(p.MessageType):
MESSAGE_WIRE_TYPE = 86

View File

@ -1,26 +0,0 @@
# Automatically generated by pb2py
# fmt: off
# isort:skip_file
if __debug__:
try:
from typing_extensions import Literal # noqa: F401
except ImportError:
pass
Bitcoin: Literal[1] = 1
Bitcoin_like: Literal[2] = 2
Binance: Literal[3] = 3
Cardano: Literal[4] = 4
Crypto: Literal[5] = 5
EOS: Literal[6] = 6
Ethereum: Literal[7] = 7
Lisk: Literal[8] = 8
Monero: Literal[9] = 9
NEM: Literal[10] = 10
Ripple: Literal[11] = 11
Stellar: Literal[12] = 12
Tezos: Literal[13] = 13
U2F: Literal[14] = 14
Shamir: Literal[15] = 15
ShamirGroups: Literal[16] = 16
PassphraseEntry: Literal[17] = 17

View File

@ -1,28 +0,0 @@
# Automatically generated by pb2py
# fmt: off
# isort:skip_file
from .. import protobuf as p
if __debug__:
try:
from typing import Dict, List, Optional # noqa: F401
from typing_extensions import Literal # noqa: F401
except ImportError:
pass
class CardanoAddress(p.MessageType):
MESSAGE_WIRE_TYPE = 308
def __init__(
self,
*,
address: str,
) -> None:
self.address = address
@classmethod
def get_fields(cls) -> Dict:
return {
1: ('address', p.UnicodeType, p.FLAG_REQUIRED),
}

View File

@ -1,42 +0,0 @@
# Automatically generated by pb2py
# fmt: off
# isort:skip_file
from .. import protobuf as p
from .CardanoBlockchainPointerType import CardanoBlockchainPointerType
if __debug__:
try:
from typing import Dict, List, Optional # noqa: F401
from typing_extensions import Literal # noqa: F401
EnumTypeCardanoAddressType = Literal[0, 1, 2, 3, 4, 5, 6, 7, 8, 14, 15]
except ImportError:
pass
class CardanoAddressParametersType(p.MessageType):
def __init__(
self,
*,
address_type: EnumTypeCardanoAddressType,
address_n: Optional[List[int]] = None,
address_n_staking: Optional[List[int]] = None,
staking_key_hash: Optional[bytes] = None,
certificate_pointer: Optional[CardanoBlockchainPointerType] = None,
) -> None:
self.address_n = address_n if address_n is not None else []
self.address_n_staking = address_n_staking if address_n_staking is not None else []
self.address_type = address_type
self.staking_key_hash = staking_key_hash
self.certificate_pointer = certificate_pointer
@classmethod
def get_fields(cls) -> Dict:
return {
1: ('address_type', p.EnumType("CardanoAddressType", (0, 1, 2, 3, 4, 5, 6, 7, 8, 14, 15,)), p.FLAG_REQUIRED),
2: ('address_n', p.UVarintType, p.FLAG_REPEATED),
3: ('address_n_staking', p.UVarintType, p.FLAG_REPEATED),
4: ('staking_key_hash', p.BytesType, None),
5: ('certificate_pointer', CardanoBlockchainPointerType, None),
}

View File

@ -1,20 +0,0 @@
# Automatically generated by pb2py
# fmt: off
# isort:skip_file
if __debug__:
try:
from typing_extensions import Literal # noqa: F401
except ImportError:
pass
BASE: Literal[0] = 0
BASE_SCRIPT_KEY: Literal[1] = 1
BASE_KEY_SCRIPT: Literal[2] = 2
BASE_SCRIPT_SCRIPT: Literal[3] = 3
POINTER: Literal[4] = 4
POINTER_SCRIPT: Literal[5] = 5
ENTERPRISE: Literal[6] = 6
ENTERPRISE_SCRIPT: Literal[7] = 7
BYRON: Literal[8] = 8
REWARD: Literal[14] = 14
REWARD_SCRIPT: Literal[15] = 15

View File

@ -1,32 +0,0 @@
# Automatically generated by pb2py
# fmt: off
# isort:skip_file
from .. import protobuf as p
from .CardanoTokenType import CardanoTokenType
if __debug__:
try:
from typing import Dict, List, Optional # noqa: F401
from typing_extensions import Literal # noqa: F401
except ImportError:
pass
class CardanoAssetGroupType(p.MessageType):
def __init__(
self,
*,
policy_id: bytes,
tokens: Optional[List[CardanoTokenType]] = None,
) -> None:
self.tokens = tokens if tokens is not None else []
self.policy_id = policy_id
@classmethod
def get_fields(cls) -> Dict:
return {
1: ('policy_id', p.BytesType, p.FLAG_REQUIRED),
2: ('tokens', CardanoTokenType, p.FLAG_REPEATED),
}

View File

@ -1,33 +0,0 @@
# Automatically generated by pb2py
# fmt: off
# isort:skip_file
from .. import protobuf as p
if __debug__:
try:
from typing import Dict, List, Optional # noqa: F401
from typing_extensions import Literal # noqa: F401
except ImportError:
pass
class CardanoBlockchainPointerType(p.MessageType):
def __init__(
self,
*,
block_index: int,
tx_index: int,
certificate_index: int,
) -> None:
self.block_index = block_index
self.tx_index = tx_index
self.certificate_index = certificate_index
@classmethod
def get_fields(cls) -> Dict:
return {
1: ('block_index', p.UVarintType, p.FLAG_REQUIRED),
2: ('tx_index', p.UVarintType, p.FLAG_REQUIRED),
3: ('certificate_index', p.UVarintType, p.FLAG_REQUIRED),
}

View File

@ -1,38 +0,0 @@
# Automatically generated by pb2py
# fmt: off
# isort:skip_file
from .. import protobuf as p
from .CardanoAddressParametersType import CardanoAddressParametersType
if __debug__:
try:
from typing import Dict, List, Optional # noqa: F401
from typing_extensions import Literal # noqa: F401
except ImportError:
pass
class CardanoCatalystRegistrationParametersType(p.MessageType):
def __init__(
self,
*,
voting_public_key: bytes,
reward_address_parameters: CardanoAddressParametersType,
nonce: int,
staking_path: Optional[List[int]] = None,
) -> None:
self.staking_path = staking_path if staking_path is not None else []
self.voting_public_key = voting_public_key
self.reward_address_parameters = reward_address_parameters
self.nonce = nonce
@classmethod
def get_fields(cls) -> Dict:
return {
1: ('voting_public_key', p.BytesType, p.FLAG_REQUIRED),
2: ('staking_path', p.UVarintType, p.FLAG_REPEATED),
3: ('reward_address_parameters', CardanoAddressParametersType, p.FLAG_REQUIRED),
4: ('nonce', p.UVarintType, p.FLAG_REQUIRED),
}

View File

@ -1,13 +0,0 @@
# Automatically generated by pb2py
# fmt: off
# isort:skip_file
if __debug__:
try:
from typing_extensions import Literal # noqa: F401
except ImportError:
pass
STAKE_REGISTRATION: Literal[0] = 0
STAKE_DEREGISTRATION: Literal[1] = 1
STAKE_DELEGATION: Literal[2] = 2
STAKE_POOL_REGISTRATION: Literal[3] = 3

View File

@ -1,39 +0,0 @@
# Automatically generated by pb2py
# fmt: off
# isort:skip_file
from .. import protobuf as p
from .CardanoAddressParametersType import CardanoAddressParametersType
if __debug__:
try:
from typing import Dict, List, Optional # noqa: F401
from typing_extensions import Literal # noqa: F401
except ImportError:
pass
class CardanoGetAddress(p.MessageType):
MESSAGE_WIRE_TYPE = 307
def __init__(
self,
*,
protocol_magic: int,
network_id: int,
address_parameters: CardanoAddressParametersType,
show_display: bool = False,
) -> None:
self.protocol_magic = protocol_magic
self.network_id = network_id
self.address_parameters = address_parameters
self.show_display = show_display
@classmethod
def get_fields(cls) -> Dict:
return {
2: ('show_display', p.BoolType, False), # default=false
3: ('protocol_magic', p.UVarintType, p.FLAG_REQUIRED),
4: ('network_id', p.UVarintType, p.FLAG_REQUIRED),
5: ('address_parameters', CardanoAddressParametersType, p.FLAG_REQUIRED),
}

View File

@ -1,31 +0,0 @@
# Automatically generated by pb2py
# fmt: off
# isort:skip_file
from .. import protobuf as p
if __debug__:
try:
from typing import Dict, List, Optional # noqa: F401
from typing_extensions import Literal # noqa: F401
except ImportError:
pass
class CardanoGetPublicKey(p.MessageType):
MESSAGE_WIRE_TYPE = 305
def __init__(
self,
*,
address_n: Optional[List[int]] = None,
show_display: Optional[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) -> Dict:
return {
1: ('address_n', p.UVarintType, p.FLAG_REPEATED),
2: ('show_display', p.BoolType, None),
}

View File

@ -1,30 +0,0 @@
# Automatically generated by pb2py
# fmt: off
# isort:skip_file
from .. import protobuf as p
if __debug__:
try:
from typing import Dict, List, Optional # noqa: F401
from typing_extensions import Literal # noqa: F401
except ImportError:
pass
class CardanoPoolMetadataType(p.MessageType):
def __init__(
self,
*,
url: str,
hash: bytes,
) -> None:
self.url = url
self.hash = hash
@classmethod
def get_fields(cls) -> Dict:
return {
1: ('url', p.UnicodeType, p.FLAG_REQUIRED),
2: ('hash', p.BytesType, p.FLAG_REQUIRED),
}

View File

@ -1,30 +0,0 @@
# Automatically generated by pb2py
# fmt: off
# isort:skip_file
from .. import protobuf as p
if __debug__:
try:
from typing import Dict, List, Optional # noqa: F401
from typing_extensions import Literal # noqa: F401
except ImportError:
pass
class CardanoPoolOwnerType(p.MessageType):
def __init__(
self,
*,
staking_key_path: Optional[List[int]] = None,
staking_key_hash: Optional[bytes] = None,
) -> None:
self.staking_key_path = staking_key_path if staking_key_path is not None else []
self.staking_key_hash = staking_key_hash
@classmethod
def get_fields(cls) -> Dict:
return {
1: ('staking_key_path', p.UVarintType, p.FLAG_REPEATED),
2: ('staking_key_hash', p.BytesType, None),
}

View File

@ -1,58 +0,0 @@
# Automatically generated by pb2py
# fmt: off
# isort:skip_file
from .. import protobuf as p
from .CardanoPoolMetadataType import CardanoPoolMetadataType
from .CardanoPoolOwnerType import CardanoPoolOwnerType
from .CardanoPoolRelayParametersType import CardanoPoolRelayParametersType
if __debug__:
try:
from typing import Dict, List, Optional # noqa: F401
from typing_extensions import Literal # noqa: F401
except ImportError:
pass
class CardanoPoolParametersType(p.MessageType):
def __init__(
self,
*,
pool_id: bytes,
vrf_key_hash: bytes,
pledge: int,
cost: int,
margin_numerator: int,
margin_denominator: int,
reward_account: str,
owners: Optional[List[CardanoPoolOwnerType]] = None,
relays: Optional[List[CardanoPoolRelayParametersType]] = None,
metadata: Optional[CardanoPoolMetadataType] = None,
) -> None:
self.owners = owners if owners is not None else []
self.relays = relays if relays is not None else []
self.pool_id = pool_id
self.vrf_key_hash = vrf_key_hash
self.pledge = pledge
self.cost = cost
self.margin_numerator = margin_numerator
self.margin_denominator = margin_denominator
self.reward_account = reward_account
self.metadata = metadata
@classmethod
def get_fields(cls) -> Dict:
return {
1: ('pool_id', p.BytesType, p.FLAG_REQUIRED),
2: ('vrf_key_hash', p.BytesType, p.FLAG_REQUIRED),
3: ('pledge', p.UVarintType, p.FLAG_REQUIRED),
4: ('cost', p.UVarintType, p.FLAG_REQUIRED),
5: ('margin_numerator', p.UVarintType, p.FLAG_REQUIRED),
6: ('margin_denominator', p.UVarintType, p.FLAG_REQUIRED),
7: ('reward_account', p.UnicodeType, p.FLAG_REQUIRED),
8: ('owners', CardanoPoolOwnerType, p.FLAG_REPEATED),
9: ('relays', CardanoPoolRelayParametersType, p.FLAG_REPEATED),
10: ('metadata', CardanoPoolMetadataType, None),
}

View File

@ -1,40 +0,0 @@
# Automatically generated by pb2py
# fmt: off
# isort:skip_file
from .. import protobuf as p
if __debug__:
try:
from typing import Dict, List, Optional # noqa: F401
from typing_extensions import Literal # noqa: F401
EnumTypeCardanoPoolRelayType = Literal[0, 1, 2]
except ImportError:
pass
class CardanoPoolRelayParametersType(p.MessageType):
def __init__(
self,
*,
type: EnumTypeCardanoPoolRelayType,
ipv4_address: Optional[bytes] = None,
ipv6_address: Optional[bytes] = None,
host_name: Optional[str] = None,
port: Optional[int] = None,
) -> None:
self.type = type
self.ipv4_address = ipv4_address
self.ipv6_address = ipv6_address
self.host_name = host_name
self.port = port
@classmethod
def get_fields(cls) -> Dict:
return {
1: ('type', p.EnumType("CardanoPoolRelayType", (0, 1, 2,)), p.FLAG_REQUIRED),
2: ('ipv4_address', p.BytesType, None),
3: ('ipv6_address', p.BytesType, None),
4: ('host_name', p.UnicodeType, None),
5: ('port', p.UVarintType, None),
}

View File

@ -1,12 +0,0 @@
# Automatically generated by pb2py
# fmt: off
# isort:skip_file
if __debug__:
try:
from typing_extensions import Literal # noqa: F401
except ImportError:
pass
SINGLE_HOST_IP: Literal[0] = 0
SINGLE_HOST_NAME: Literal[1] = 1
MULTIPLE_HOST_NAME: Literal[2] = 2

View File

@ -1,33 +0,0 @@
# Automatically generated by pb2py
# fmt: off
# isort:skip_file
from .. import protobuf as p
from .HDNodeType import HDNodeType
if __debug__:
try:
from typing import Dict, List, Optional # noqa: F401
from typing_extensions import Literal # noqa: F401
except ImportError:
pass
class CardanoPublicKey(p.MessageType):
MESSAGE_WIRE_TYPE = 306
def __init__(
self,
*,
xpub: str,
node: HDNodeType,
) -> None:
self.xpub = xpub
self.node = node
@classmethod
def get_fields(cls) -> Dict:
return {
1: ('xpub', p.UnicodeType, p.FLAG_REQUIRED),
2: ('node', HDNodeType, p.FLAG_REQUIRED),
}

View File

@ -1,61 +0,0 @@
# Automatically generated by pb2py
# fmt: off
# isort:skip_file
from .. import protobuf as p
from .CardanoTxAuxiliaryDataType import CardanoTxAuxiliaryDataType
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,
validity_interval_start: Optional[int] = None,
auxiliary_data: Optional[CardanoTxAuxiliaryDataType] = 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.validity_interval_start = validity_interval_start
self.auxiliary_data = auxiliary_data
@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),
12: ('validity_interval_start', p.UVarintType, None),
13: ('auxiliary_data', CardanoTxAuxiliaryDataType, None),
}

View File

@ -1,31 +0,0 @@
# Automatically generated by pb2py
# fmt: off
# isort:skip_file
from .. import protobuf as p
if __debug__:
try:
from typing import Dict, List, Optional # noqa: F401
from typing_extensions import Literal # noqa: F401
except ImportError:
pass
class CardanoSignedTx(p.MessageType):
MESSAGE_WIRE_TYPE = 310
def __init__(
self,
*,
tx_hash: bytes,
serialized_tx: Optional[bytes] = None,
) -> None:
self.tx_hash = tx_hash
self.serialized_tx = serialized_tx
@classmethod
def get_fields(cls) -> Dict:
return {
1: ('tx_hash', p.BytesType, p.FLAG_REQUIRED),
2: ('serialized_tx', p.BytesType, None),
}

View File

@ -1,28 +0,0 @@
# Automatically generated by pb2py
# fmt: off
# isort:skip_file
from .. import protobuf as p
if __debug__:
try:
from typing import Dict, List, Optional # noqa: F401
from typing_extensions import Literal # noqa: F401
except ImportError:
pass
class CardanoSignedTxChunk(p.MessageType):
MESSAGE_WIRE_TYPE = 311
def __init__(
self,
*,
signed_tx_chunk: bytes,
) -> None:
self.signed_tx_chunk = signed_tx_chunk
@classmethod
def get_fields(cls) -> Dict:
return {
1: ('signed_tx_chunk', p.BytesType, p.FLAG_REQUIRED),
}

View File

@ -1,15 +0,0 @@
# Automatically generated by pb2py
# fmt: off
# isort:skip_file
from .. import protobuf as p
if __debug__:
try:
from typing import Dict, List, Optional # noqa: F401
from typing_extensions import Literal # noqa: F401
except ImportError:
pass
class CardanoSignedTxChunkAck(p.MessageType):
MESSAGE_WIRE_TYPE = 312

View File

@ -1,30 +0,0 @@
# Automatically generated by pb2py
# fmt: off
# isort:skip_file
from .. import protobuf as p
if __debug__:
try:
from typing import Dict, List, Optional # noqa: F401
from typing_extensions import Literal # noqa: F401
except ImportError:
pass
class CardanoTokenType(p.MessageType):
def __init__(
self,
*,
asset_name_bytes: bytes,
amount: int,
) -> None:
self.asset_name_bytes = asset_name_bytes
self.amount = amount
@classmethod
def get_fields(cls) -> Dict:
return {
1: ('asset_name_bytes', p.BytesType, p.FLAG_REQUIRED),
2: ('amount', p.UVarintType, p.FLAG_REQUIRED),
}

View File

@ -1,32 +0,0 @@
# Automatically generated by pb2py
# fmt: off
# isort:skip_file
from .. import protobuf as p
from .CardanoCatalystRegistrationParametersType import CardanoCatalystRegistrationParametersType
if __debug__:
try:
from typing import Dict, List, Optional # noqa: F401
from typing_extensions import Literal # noqa: F401
except ImportError:
pass
class CardanoTxAuxiliaryDataType(p.MessageType):
def __init__(
self,
*,
blob: Optional[bytes] = None,
catalyst_registration_parameters: Optional[CardanoCatalystRegistrationParametersType] = None,
) -> None:
self.blob = blob
self.catalyst_registration_parameters = catalyst_registration_parameters
@classmethod
def get_fields(cls) -> Dict:
return {
1: ('blob', p.BytesType, None),
2: ('catalyst_registration_parameters', CardanoCatalystRegistrationParametersType, None),
}

View File

@ -1,39 +0,0 @@
# Automatically generated by pb2py
# fmt: off
# isort:skip_file
from .. import protobuf as p
from .CardanoPoolParametersType import CardanoPoolParametersType
if __debug__:
try:
from typing import Dict, List, Optional # noqa: F401
from typing_extensions import Literal # noqa: F401
EnumTypeCardanoCertificateType = Literal[0, 1, 2, 3]
except ImportError:
pass
class CardanoTxCertificateType(p.MessageType):
def __init__(
self,
*,
type: EnumTypeCardanoCertificateType,
path: Optional[List[int]] = None,
pool: Optional[bytes] = None,
pool_parameters: Optional[CardanoPoolParametersType] = None,
) -> None:
self.path = path if path is not None else []
self.type = type
self.pool = pool
self.pool_parameters = pool_parameters
@classmethod
def get_fields(cls) -> Dict:
return {
1: ('type', p.EnumType("CardanoCertificateType", (0, 1, 2, 3,)), p.FLAG_REQUIRED),
2: ('path', p.UVarintType, p.FLAG_REPEATED),
3: ('pool', p.BytesType, None),
4: ('pool_parameters', CardanoPoolParametersType, None),
}

View File

@ -1,33 +0,0 @@
# Automatically generated by pb2py
# fmt: off
# isort:skip_file
from .. import protobuf as p
if __debug__:
try:
from typing import Dict, List, Optional # noqa: F401
from typing_extensions import Literal # noqa: F401
except ImportError:
pass
class CardanoTxInputType(p.MessageType):
def __init__(
self,
*,
prev_hash: bytes,
prev_index: int,
address_n: Optional[List[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
@classmethod
def get_fields(cls) -> Dict:
return {
1: ('address_n', p.UVarintType, p.FLAG_REPEATED),
2: ('prev_hash', p.BytesType, p.FLAG_REQUIRED),
3: ('prev_index', p.UVarintType, p.FLAG_REQUIRED),
}

View File

@ -1,39 +0,0 @@
# Automatically generated by pb2py
# fmt: off
# isort:skip_file
from .. import protobuf as p
from .CardanoAddressParametersType import CardanoAddressParametersType
from .CardanoAssetGroupType import CardanoAssetGroupType
if __debug__:
try:
from typing import Dict, List, Optional # noqa: F401
from typing_extensions import Literal # noqa: F401
except ImportError:
pass
class CardanoTxOutputType(p.MessageType):
def __init__(
self,
*,
amount: int,
token_bundle: Optional[List[CardanoAssetGroupType]] = None,
address: Optional[str] = None,
address_parameters: Optional[CardanoAddressParametersType] = None,
) -> None:
self.token_bundle = token_bundle if token_bundle is not None else []
self.amount = amount
self.address = address
self.address_parameters = address_parameters
@classmethod
def get_fields(cls) -> Dict:
return {
1: ('address', p.UnicodeType, None),
3: ('amount', p.UVarintType, p.FLAG_REQUIRED),
4: ('address_parameters', CardanoAddressParametersType, None),
5: ('token_bundle', CardanoAssetGroupType, p.FLAG_REPEATED),
}

View File

@ -1,30 +0,0 @@
# Automatically generated by pb2py
# fmt: off
# isort:skip_file
from .. import protobuf as p
if __debug__:
try:
from typing import Dict, List, Optional # noqa: F401
from typing_extensions import Literal # noqa: F401
except ImportError:
pass
class CardanoTxWithdrawalType(p.MessageType):
def __init__(
self,
*,
amount: int,
path: Optional[List[int]] = None,
) -> None:
self.path = path if path is not None else []
self.amount = amount
@classmethod
def get_fields(cls) -> Dict:
return {
1: ('path', p.UVarintType, p.FLAG_REPEATED),
2: ('amount', p.UVarintType, p.FLAG_REQUIRED),
}

View File

@ -1,28 +0,0 @@
# Automatically generated by pb2py
# fmt: off
# isort:skip_file
from .. import protobuf as p
if __debug__:
try:
from typing import Dict, List, Optional # noqa: F401
from typing_extensions import Literal # noqa: F401
except ImportError:
pass
class ChangePin(p.MessageType):
MESSAGE_WIRE_TYPE = 4
def __init__(
self,
*,
remove: Optional[bool] = None,
) -> None:
self.remove = remove
@classmethod
def get_fields(cls) -> Dict:
return {
1: ('remove', p.BoolType, None),
}

View File

@ -1,28 +0,0 @@
# Automatically generated by pb2py
# fmt: off
# isort:skip_file
from .. import protobuf as p
if __debug__:
try:
from typing import Dict, List, Optional # noqa: F401
from typing_extensions import Literal # noqa: F401
except ImportError:
pass
class ChangeWipeCode(p.MessageType):
MESSAGE_WIRE_TYPE = 82
def __init__(
self,
*,
remove: Optional[bool] = None,
) -> None:
self.remove = remove
@classmethod
def get_fields(cls) -> Dict:
return {
1: ('remove', p.BoolType, None),
}

View File

@ -1,46 +0,0 @@
# Automatically generated by pb2py
# fmt: off
# isort:skip_file
from .. import protobuf as p
if __debug__:
try:
from typing import Dict, List, Optional # noqa: F401
from typing_extensions import Literal # noqa: F401
except ImportError:
pass
class CipherKeyValue(p.MessageType):
MESSAGE_WIRE_TYPE = 23
def __init__(
self,
*,
key: str,
value: bytes,
address_n: Optional[List[int]] = None,
encrypt: Optional[bool] = None,
ask_on_encrypt: Optional[bool] = None,
ask_on_decrypt: Optional[bool] = None,
iv: Optional[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) -> Dict:
return {
1: ('address_n', p.UVarintType, p.FLAG_REPEATED),
2: ('key', p.UnicodeType, p.FLAG_REQUIRED),
3: ('value', p.BytesType, p.FLAG_REQUIRED),
4: ('encrypt', p.BoolType, None),
5: ('ask_on_encrypt', p.BoolType, None),
6: ('ask_on_decrypt', p.BoolType, None),
7: ('iv', p.BytesType, None),
}

View File

@ -1,28 +0,0 @@
# Automatically generated by pb2py
# fmt: off
# isort:skip_file
from .. import protobuf as p
if __debug__:
try:
from typing import Dict, List, Optional # noqa: F401
from typing_extensions import Literal # noqa: F401
except ImportError:
pass
class CipheredKeyValue(p.MessageType):
MESSAGE_WIRE_TYPE = 48
def __init__(
self,
*,
value: bytes,
) -> None:
self.value = value
@classmethod
def get_fields(cls) -> Dict:
return {
1: ('value', p.BytesType, p.FLAG_REQUIRED),
}

View File

@ -1,31 +0,0 @@
# Automatically generated by pb2py
# fmt: off
# isort:skip_file
from .. import protobuf as p
if __debug__:
try:
from typing import Dict, List, Optional # noqa: F401
from typing_extensions import Literal # noqa: F401
except ImportError:
pass
class CosiCommit(p.MessageType):
MESSAGE_WIRE_TYPE = 71
def __init__(
self,
*,
address_n: Optional[List[int]] = None,
data: Optional[bytes] = None,
) -> None:
self.address_n = address_n if address_n is not None else []
self.data = data
@classmethod
def get_fields(cls) -> Dict:
return {
1: ('address_n', p.UVarintType, p.FLAG_REPEATED),
2: ('data', p.BytesType, None),
}

View File

@ -1,31 +0,0 @@
# Automatically generated by pb2py
# fmt: off
# isort:skip_file
from .. import protobuf as p
if __debug__:
try:
from typing import Dict, List, Optional # noqa: F401
from typing_extensions import Literal # noqa: F401
except ImportError:
pass
class CosiCommitment(p.MessageType):
MESSAGE_WIRE_TYPE = 72
def __init__(
self,
*,
commitment: Optional[bytes] = None,
pubkey: Optional[bytes] = None,
) -> None:
self.commitment = commitment
self.pubkey = pubkey
@classmethod
def get_fields(cls) -> Dict:
return {
1: ('commitment', p.BytesType, None),
2: ('pubkey', p.BytesType, None),
}

View File

@ -1,37 +0,0 @@
# Automatically generated by pb2py
# fmt: off
# isort:skip_file
from .. import protobuf as p
if __debug__:
try:
from typing import Dict, List, Optional # noqa: F401
from typing_extensions import Literal # noqa: F401
except ImportError:
pass
class CosiSign(p.MessageType):
MESSAGE_WIRE_TYPE = 73
def __init__(
self,
*,
address_n: Optional[List[int]] = None,
data: Optional[bytes] = None,
global_commitment: Optional[bytes] = None,
global_pubkey: Optional[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) -> Dict:
return {
1: ('address_n', p.UVarintType, p.FLAG_REPEATED),
2: ('data', p.BytesType, None),
3: ('global_commitment', p.BytesType, None),
4: ('global_pubkey', p.BytesType, None),
}

View File

@ -1,28 +0,0 @@
# Automatically generated by pb2py
# fmt: off
# isort:skip_file
from .. import protobuf as p
if __debug__:
try:
from typing import Dict, List, Optional # noqa: F401
from typing_extensions import Literal # noqa: F401
except ImportError:
pass
class CosiSignature(p.MessageType):
MESSAGE_WIRE_TYPE = 74
def __init__(
self,
*,
signature: bytes,
) -> None:
self.signature = signature
@classmethod
def get_fields(cls) -> Dict:
return {
1: ('signature', p.BytesType, p.FLAG_REQUIRED),
}

View File

@ -1,47 +0,0 @@
# Automatically generated by pb2py
# fmt: off
# isort:skip_file
from .. import protobuf as p
if __debug__:
try:
from typing import Dict, List, Optional # noqa: F401
from typing_extensions import Literal # noqa: F401
EnumTypeDebugSwipeDirection = Literal[0, 1, 2, 3]
except ImportError:
pass
class DebugLinkDecision(p.MessageType):
MESSAGE_WIRE_TYPE = 100
def __init__(
self,
*,
yes_no: Optional[bool] = None,
swipe: Optional[EnumTypeDebugSwipeDirection] = None,
input: Optional[str] = None,
x: Optional[int] = None,
y: Optional[int] = None,
wait: Optional[bool] = None,
hold_ms: Optional[int] = None,
) -> None:
self.yes_no = yes_no
self.swipe = swipe
self.input = input
self.x = x
self.y = y
self.wait = wait
self.hold_ms = hold_ms
@classmethod
def get_fields(cls) -> Dict:
return {
1: ('yes_no', p.BoolType, None),
2: ('swipe', p.EnumType("DebugSwipeDirection", (0, 1, 2, 3,)), None),
3: ('input', p.UnicodeType, None),
4: ('x', p.UVarintType, None),
5: ('y', p.UVarintType, None),
6: ('wait', p.BoolType, None),
7: ('hold_ms', p.UVarintType, None),
}

View File

@ -1,28 +0,0 @@
# Automatically generated by pb2py
# fmt: off
# isort:skip_file
from .. import protobuf as p
if __debug__:
try:
from typing import Dict, List, Optional # noqa: F401
from typing_extensions import Literal # noqa: F401
except ImportError:
pass
class DebugLinkEraseSdCard(p.MessageType):
MESSAGE_WIRE_TYPE = 9005
def __init__(
self,
*,
format: Optional[bool] = None,
) -> None:
self.format = format
@classmethod
def get_fields(cls) -> Dict:
return {
1: ('format', p.BoolType, None),
}

View File

@ -1,28 +0,0 @@
# Automatically generated by pb2py
# fmt: off
# isort:skip_file
from .. import protobuf as p
if __debug__:
try:
from typing import Dict, List, Optional # noqa: F401
from typing_extensions import Literal # noqa: F401
except ImportError:
pass
class DebugLinkFlashErase(p.MessageType):
MESSAGE_WIRE_TYPE = 113
def __init__(
self,
*,
sector: Optional[int] = None,
) -> None:
self.sector = sector
@classmethod
def get_fields(cls) -> Dict:
return {
1: ('sector', p.UVarintType, None),
}

View File

@ -1,34 +0,0 @@
# Automatically generated by pb2py
# fmt: off
# isort:skip_file
from .. import protobuf as p
if __debug__:
try:
from typing import Dict, List, Optional # noqa: F401
from typing_extensions import Literal # noqa: F401
except ImportError:
pass
class DebugLinkGetState(p.MessageType):
MESSAGE_WIRE_TYPE = 101
def __init__(
self,
*,
wait_word_list: Optional[bool] = None,
wait_word_pos: Optional[bool] = None,
wait_layout: Optional[bool] = None,
) -> None:
self.wait_word_list = wait_word_list
self.wait_word_pos = wait_word_pos
self.wait_layout = wait_layout
@classmethod
def get_fields(cls) -> Dict:
return {
1: ('wait_word_list', p.BoolType, None),
2: ('wait_word_pos', p.BoolType, None),
3: ('wait_layout', p.BoolType, None),
}

View File

@ -1,28 +0,0 @@
# Automatically generated by pb2py
# fmt: off
# isort:skip_file
from .. import protobuf as p
if __debug__:
try:
from typing import Dict, List, Optional # noqa: F401
from typing_extensions import Literal # noqa: F401
except ImportError:
pass
class DebugLinkLayout(p.MessageType):
MESSAGE_WIRE_TYPE = 9001
def __init__(
self,
*,
lines: Optional[List[str]] = None,
) -> None:
self.lines = lines if lines is not None else []
@classmethod
def get_fields(cls) -> Dict:
return {
1: ('lines', p.UnicodeType, p.FLAG_REPEATED),
}

View File

@ -1,34 +0,0 @@
# Automatically generated by pb2py
# fmt: off
# isort:skip_file
from .. import protobuf as p
if __debug__:
try:
from typing import Dict, List, Optional # noqa: F401
from typing_extensions import Literal # noqa: F401
except ImportError:
pass
class DebugLinkLog(p.MessageType):
MESSAGE_WIRE_TYPE = 104
def __init__(
self,
*,
level: Optional[int] = None,
bucket: Optional[str] = None,
text: Optional[str] = None,
) -> None:
self.level = level
self.bucket = bucket
self.text = text
@classmethod
def get_fields(cls) -> Dict:
return {
1: ('level', p.UVarintType, None),
2: ('bucket', p.UnicodeType, None),
3: ('text', p.UnicodeType, None),
}

View File

@ -1,28 +0,0 @@
# Automatically generated by pb2py
# fmt: off
# isort:skip_file
from .. import protobuf as p
if __debug__:
try:
from typing import Dict, List, Optional # noqa: F401
from typing_extensions import Literal # noqa: F401
except ImportError:
pass
class DebugLinkMemory(p.MessageType):
MESSAGE_WIRE_TYPE = 111
def __init__(
self,
*,
memory: Optional[bytes] = None,
) -> None:
self.memory = memory
@classmethod
def get_fields(cls) -> Dict:
return {
1: ('memory', p.BytesType, None),
}

View File

@ -1,31 +0,0 @@
# Automatically generated by pb2py
# fmt: off
# isort:skip_file
from .. import protobuf as p
if __debug__:
try:
from typing import Dict, List, Optional # noqa: F401
from typing_extensions import Literal # noqa: F401
except ImportError:
pass
class DebugLinkMemoryRead(p.MessageType):
MESSAGE_WIRE_TYPE = 110
def __init__(
self,
*,
address: Optional[int] = None,
length: Optional[int] = None,
) -> None:
self.address = address
self.length = length
@classmethod
def get_fields(cls) -> Dict:
return {
1: ('address', p.UVarintType, None),
2: ('length', p.UVarintType, None),
}

View File

@ -1,34 +0,0 @@
# Automatically generated by pb2py
# fmt: off
# isort:skip_file
from .. import protobuf as p
if __debug__:
try:
from typing import Dict, List, Optional # noqa: F401
from typing_extensions import Literal # noqa: F401
except ImportError:
pass
class DebugLinkMemoryWrite(p.MessageType):
MESSAGE_WIRE_TYPE = 112
def __init__(
self,
*,
address: Optional[int] = None,
memory: Optional[bytes] = None,
flash: Optional[bool] = None,
) -> None:
self.address = address
self.memory = memory
self.flash = flash
@classmethod
def get_fields(cls) -> Dict:
return {
1: ('address', p.UVarintType, None),
2: ('memory', p.BytesType, None),
3: ('flash', p.BoolType, None),
}

View File

@ -1,28 +0,0 @@
# Automatically generated by pb2py
# fmt: off
# isort:skip_file
from .. import protobuf as p
if __debug__:
try:
from typing import Dict, List, Optional # noqa: F401
from typing_extensions import Literal # noqa: F401
except ImportError:
pass
class DebugLinkRecordScreen(p.MessageType):
MESSAGE_WIRE_TYPE = 9003
def __init__(
self,
*,
target_directory: Optional[str] = None,
) -> None:
self.target_directory = target_directory
@classmethod
def get_fields(cls) -> Dict:
return {
1: ('target_directory', p.UnicodeType, None),
}

View File

@ -1,28 +0,0 @@
# Automatically generated by pb2py
# fmt: off
# isort:skip_file
from .. import protobuf as p
if __debug__:
try:
from typing import Dict, List, Optional # noqa: F401
from typing_extensions import Literal # noqa: F401
except ImportError:
pass
class DebugLinkReseedRandom(p.MessageType):
MESSAGE_WIRE_TYPE = 9002
def __init__(
self,
*,
value: Optional[int] = None,
) -> None:
self.value = value
@classmethod
def get_fields(cls) -> Dict:
return {
1: ('value', p.UVarintType, None),
}

View File

@ -1,66 +0,0 @@
# Automatically generated by pb2py
# fmt: off
# isort:skip_file
from .. import protobuf as p
from .HDNodeType import HDNodeType
if __debug__:
try:
from typing import Dict, List, Optional # noqa: F401
from typing_extensions import Literal # noqa: F401
except ImportError:
pass
class DebugLinkState(p.MessageType):
MESSAGE_WIRE_TYPE = 102
def __init__(
self,
*,
layout_lines: Optional[List[str]] = None,
layout: Optional[bytes] = None,
pin: Optional[str] = None,
matrix: Optional[str] = None,
mnemonic_secret: Optional[bytes] = None,
node: Optional[HDNodeType] = None,
passphrase_protection: Optional[bool] = None,
reset_word: Optional[str] = None,
reset_entropy: Optional[bytes] = None,
recovery_fake_word: Optional[str] = None,
recovery_word_pos: Optional[int] = None,
reset_word_pos: Optional[int] = None,
mnemonic_type: Optional[int] = None,
) -> None:
self.layout_lines = layout_lines if layout_lines is not None else []
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) -> Dict:
return {
1: ('layout', p.BytesType, None),
2: ('pin', p.UnicodeType, None),
3: ('matrix', p.UnicodeType, None),
4: ('mnemonic_secret', p.BytesType, None),
5: ('node', HDNodeType, None),
6: ('passphrase_protection', p.BoolType, None),
7: ('reset_word', p.UnicodeType, None),
8: ('reset_entropy', p.BytesType, None),
9: ('recovery_fake_word', p.UnicodeType, None),
10: ('recovery_word_pos', p.UVarintType, None),
11: ('reset_word_pos', p.UVarintType, None),
12: ('mnemonic_type', p.UVarintType, None),
13: ('layout_lines', p.UnicodeType, p.FLAG_REPEATED),
}

View File

@ -1,15 +0,0 @@
# Automatically generated by pb2py
# fmt: off
# isort:skip_file
from .. import protobuf as p
if __debug__:
try:
from typing import Dict, List, Optional # noqa: F401
from typing_extensions import Literal # noqa: F401
except ImportError:
pass
class DebugLinkStop(p.MessageType):
MESSAGE_WIRE_TYPE = 103

View File

@ -1,28 +0,0 @@
# Automatically generated by pb2py
# fmt: off
# isort:skip_file
from .. import protobuf as p
if __debug__:
try:
from typing import Dict, List, Optional # noqa: F401
from typing_extensions import Literal # noqa: F401
except ImportError:
pass
class DebugLinkWatchLayout(p.MessageType):
MESSAGE_WIRE_TYPE = 9006
def __init__(
self,
*,
watch: Optional[bool] = None,
) -> None:
self.watch = watch
@classmethod
def get_fields(cls) -> Dict:
return {
1: ('watch', p.BoolType, None),
}

View File

@ -1,43 +0,0 @@
# Automatically generated by pb2py
# fmt: off
# isort:skip_file
from .. import protobuf as p
if __debug__:
try:
from typing import Dict, List, Optional # noqa: F401
from typing_extensions import Literal # noqa: F401
except ImportError:
pass
class DebugMoneroDiagAck(p.MessageType):
MESSAGE_WIRE_TYPE = 547
def __init__(
self,
*,
pd: Optional[List[int]] = None,
ins: Optional[int] = None,
p1: Optional[int] = None,
p2: Optional[int] = None,
data1: Optional[bytes] = None,
data2: Optional[bytes] = None,
) -> None:
self.pd = pd if pd is not None else []
self.ins = ins
self.p1 = p1
self.p2 = p2
self.data1 = data1
self.data2 = data2
@classmethod
def get_fields(cls) -> Dict:
return {
1: ('ins', p.UVarintType, None),
2: ('p1', p.UVarintType, None),
3: ('p2', p.UVarintType, None),
4: ('pd', p.UVarintType, p.FLAG_REPEATED),
5: ('data1', p.BytesType, None),
6: ('data2', p.BytesType, None),
}

View File

@ -1,43 +0,0 @@
# Automatically generated by pb2py
# fmt: off
# isort:skip_file
from .. import protobuf as p
if __debug__:
try:
from typing import Dict, List, Optional # noqa: F401
from typing_extensions import Literal # noqa: F401
except ImportError:
pass
class DebugMoneroDiagRequest(p.MessageType):
MESSAGE_WIRE_TYPE = 546
def __init__(
self,
*,
pd: Optional[List[int]] = None,
ins: Optional[int] = None,
p1: Optional[int] = None,
p2: Optional[int] = None,
data1: Optional[bytes] = None,
data2: Optional[bytes] = None,
) -> None:
self.pd = pd if pd is not None else []
self.ins = ins
self.p1 = p1
self.p2 = p2
self.data1 = data1
self.data2 = data2
@classmethod
def get_fields(cls) -> Dict:
return {
1: ('ins', p.UVarintType, None),
2: ('p1', p.UVarintType, None),
3: ('p2', p.UVarintType, None),
4: ('pd', p.UVarintType, p.FLAG_REPEATED),
5: ('data1', p.BytesType, None),
6: ('data2', p.BytesType, None),
}

View File

@ -1,13 +0,0 @@
# Automatically generated by pb2py
# fmt: off
# isort:skip_file
if __debug__:
try:
from typing_extensions import Literal # noqa: F401
except ImportError:
pass
UP: Literal[0] = 0
DOWN: Literal[1] = 1
LEFT: Literal[2] = 2
RIGHT: Literal[3] = 3

View File

@ -1,11 +0,0 @@
# Automatically generated by pb2py
# fmt: off
# isort:skip_file
if __debug__:
try:
from typing_extensions import Literal # noqa: F401
except ImportError:
pass
SSGen: Literal[0] = 0
SSRTX: Literal[1] = 1

View File

@ -1,15 +0,0 @@
# Automatically generated by pb2py
# fmt: off
# isort:skip_file
from .. import protobuf as p
if __debug__:
try:
from typing import Dict, List, Optional # noqa: F401
from typing_extensions import Literal # noqa: F401
except ImportError:
pass
class Deprecated_PassphraseStateAck(p.MessageType):
MESSAGE_WIRE_TYPE = 78

View File

@ -1,28 +0,0 @@
# Automatically generated by pb2py
# fmt: off
# isort:skip_file
from .. import protobuf as p
if __debug__:
try:
from typing import Dict, List, Optional # noqa: F401
from typing_extensions import Literal # noqa: F401
except ImportError:
pass
class Deprecated_PassphraseStateRequest(p.MessageType):
MESSAGE_WIRE_TYPE = 77
def __init__(
self,
*,
state: Optional[bytes] = None,
) -> None:
self.state = state
@classmethod
def get_fields(cls) -> Dict:
return {
1: ('state', p.BytesType, None),
}

View File

@ -1,15 +0,0 @@
# Automatically generated by pb2py
# fmt: off
# isort:skip_file
from .. import protobuf as p
if __debug__:
try:
from typing import Dict, List, Optional # noqa: F401
from typing_extensions import Literal # noqa: F401
except ImportError:
pass
class DoPreauthorized(p.MessageType):
MESSAGE_WIRE_TYPE = 84

View File

@ -1,31 +0,0 @@
# Automatically generated by pb2py
# fmt: off
# isort:skip_file
from .. import protobuf as p
if __debug__:
try:
from typing import Dict, List, Optional # noqa: F401
from typing_extensions import Literal # noqa: F401
except ImportError:
pass
class ECDHSessionKey(p.MessageType):
MESSAGE_WIRE_TYPE = 62
def __init__(
self,
*,
session_key: bytes,
public_key: Optional[bytes] = None,
) -> None:
self.session_key = session_key
self.public_key = public_key
@classmethod
def get_fields(cls) -> Dict:
return {
1: ('session_key', p.BytesType, p.FLAG_REQUIRED),
2: ('public_key', p.BytesType, None),
}

View File

@ -1,15 +0,0 @@
# Automatically generated by pb2py
# fmt: off
# isort:skip_file
from .. import protobuf as p
if __debug__:
try:
from typing import Dict, List, Optional # noqa: F401
from typing_extensions import Literal # noqa: F401
except ImportError:
pass
class EndSession(p.MessageType):
MESSAGE_WIRE_TYPE = 83

View File

@ -1,28 +0,0 @@
# Automatically generated by pb2py
# fmt: off
# isort:skip_file
from .. import protobuf as p
if __debug__:
try:
from typing import Dict, List, Optional # noqa: F401
from typing_extensions import Literal # noqa: F401
except ImportError:
pass
class Entropy(p.MessageType):
MESSAGE_WIRE_TYPE = 10
def __init__(
self,
*,
entropy: bytes,
) -> None:
self.entropy = entropy
@classmethod
def get_fields(cls) -> Dict:
return {
1: ('entropy', p.BytesType, p.FLAG_REQUIRED),
}

View File

@ -1,28 +0,0 @@
# Automatically generated by pb2py
# fmt: off
# isort:skip_file
from .. import protobuf as p
if __debug__:
try:
from typing import Dict, List, Optional # noqa: F401
from typing_extensions import Literal # noqa: F401
except ImportError:
pass
class EntropyAck(p.MessageType):
MESSAGE_WIRE_TYPE = 36
def __init__(
self,
*,
entropy: Optional[bytes] = None,
) -> None:
self.entropy = entropy
@classmethod
def get_fields(cls) -> Dict:
return {
1: ('entropy', p.BytesType, None),
}

View File

@ -1,15 +0,0 @@
# Automatically generated by pb2py
# fmt: off
# isort:skip_file
from .. import protobuf as p
if __debug__:
try:
from typing import Dict, List, Optional # noqa: F401
from typing_extensions import Literal # noqa: F401
except ImportError:
pass
class EntropyRequest(p.MessageType):
MESSAGE_WIRE_TYPE = 35

View File

@ -1,35 +0,0 @@
# Automatically generated by pb2py
# fmt: off
# isort:skip_file
from .. import protobuf as p
from .EosAsset import EosAsset
if __debug__:
try:
from typing import Dict, List, Optional # noqa: F401
from typing_extensions import Literal # noqa: F401
except ImportError:
pass
class EosActionBuyRam(p.MessageType):
def __init__(
self,
*,
payer: Optional[int] = None,
receiver: Optional[int] = None,
quantity: Optional[EosAsset] = None,
) -> None:
self.payer = payer
self.receiver = receiver
self.quantity = quantity
@classmethod
def get_fields(cls) -> Dict:
return {
1: ('payer', p.UVarintType, None),
2: ('receiver', p.UVarintType, None),
3: ('quantity', EosAsset, None),
}

View File

@ -1,33 +0,0 @@
# Automatically generated by pb2py
# fmt: off
# isort:skip_file
from .. import protobuf as p
if __debug__:
try:
from typing import Dict, List, Optional # noqa: F401
from typing_extensions import Literal # noqa: F401
except ImportError:
pass
class EosActionBuyRamBytes(p.MessageType):
def __init__(
self,
*,
payer: Optional[int] = None,
receiver: Optional[int] = None,
bytes: Optional[int] = None,
) -> None:
self.payer = payer
self.receiver = receiver
self.bytes = bytes
@classmethod
def get_fields(cls) -> Dict:
return {
1: ('payer', p.UVarintType, None),
2: ('receiver', p.UVarintType, None),
3: ('bytes', p.UVarintType, None),
}

View File

@ -1,35 +0,0 @@
# Automatically generated by pb2py
# fmt: off
# isort:skip_file
from .. import protobuf as p
from .EosPermissionLevel import EosPermissionLevel
if __debug__:
try:
from typing import Dict, List, Optional # noqa: F401
from typing_extensions import Literal # noqa: F401
except ImportError:
pass
class EosActionCommon(p.MessageType):
def __init__(
self,
*,
authorization: Optional[List[EosPermissionLevel]] = None,
account: Optional[int] = None,
name: Optional[int] = None,
) -> None:
self.authorization = authorization if authorization is not None else []
self.account = account
self.name = name
@classmethod
def get_fields(cls) -> Dict:
return {
1: ('account', p.UVarintType, None),
2: ('name', p.UVarintType, None),
3: ('authorization', EosPermissionLevel, p.FLAG_REPEATED),
}

View File

@ -1,41 +0,0 @@
# Automatically generated by pb2py
# fmt: off
# isort:skip_file
from .. import protobuf as p
from .EosAsset import EosAsset
if __debug__:
try:
from typing import Dict, List, Optional # noqa: F401
from typing_extensions import Literal # noqa: F401
except ImportError:
pass
class EosActionDelegate(p.MessageType):
def __init__(
self,
*,
sender: Optional[int] = None,
receiver: Optional[int] = None,
net_quantity: Optional[EosAsset] = None,
cpu_quantity: Optional[EosAsset] = None,
transfer: Optional[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) -> Dict:
return {
1: ('sender', p.UVarintType, None),
2: ('receiver', p.UVarintType, None),
3: ('net_quantity', EosAsset, None),
4: ('cpu_quantity', EosAsset, None),
5: ('transfer', p.BoolType, None),
}

View File

@ -1,30 +0,0 @@
# Automatically generated by pb2py
# fmt: off
# isort:skip_file
from .. import protobuf as p
if __debug__:
try:
from typing import Dict, List, Optional # noqa: F401
from typing_extensions import Literal # noqa: F401
except ImportError:
pass
class EosActionDeleteAuth(p.MessageType):
def __init__(
self,
*,
account: Optional[int] = None,
permission: Optional[int] = None,
) -> None:
self.account = account
self.permission = permission
@classmethod
def get_fields(cls) -> Dict:
return {
1: ('account', p.UVarintType, None),
2: ('permission', p.UVarintType, None),
}

View File

@ -1,36 +0,0 @@
# Automatically generated by pb2py
# fmt: off
# isort:skip_file
from .. import protobuf as p
if __debug__:
try:
from typing import Dict, List, Optional # noqa: F401
from typing_extensions import Literal # noqa: F401
except ImportError:
pass
class EosActionLinkAuth(p.MessageType):
def __init__(
self,
*,
account: Optional[int] = None,
code: Optional[int] = None,
type: Optional[int] = None,
requirement: Optional[int] = None,
) -> None:
self.account = account
self.code = code
self.type = type
self.requirement = requirement
@classmethod
def get_fields(cls) -> Dict:
return {
1: ('account', p.UVarintType, None),
2: ('code', p.UVarintType, None),
3: ('type', p.UVarintType, None),
4: ('requirement', p.UVarintType, None),
}

View File

@ -1,38 +0,0 @@
# Automatically generated by pb2py
# fmt: off
# isort:skip_file
from .. import protobuf as p
from .EosAuthorization import EosAuthorization
if __debug__:
try:
from typing import Dict, List, Optional # noqa: F401
from typing_extensions import Literal # noqa: F401
except ImportError:
pass
class EosActionNewAccount(p.MessageType):
def __init__(
self,
*,
creator: Optional[int] = None,
name: Optional[int] = None,
owner: Optional[EosAuthorization] = None,
active: Optional[EosAuthorization] = None,
) -> None:
self.creator = creator
self.name = name
self.owner = owner
self.active = active
@classmethod
def get_fields(cls) -> Dict:
return {
1: ('creator', p.UVarintType, None),
2: ('name', p.UVarintType, None),
3: ('owner', EosAuthorization, None),
4: ('active', EosAuthorization, None),
}

View File

@ -1,27 +0,0 @@
# Automatically generated by pb2py
# fmt: off
# isort:skip_file
from .. import protobuf as p
if __debug__:
try:
from typing import Dict, List, Optional # noqa: F401
from typing_extensions import Literal # noqa: F401
except ImportError:
pass
class EosActionRefund(p.MessageType):
def __init__(
self,
*,
owner: Optional[int] = None,
) -> None:
self.owner = owner
@classmethod
def get_fields(cls) -> Dict:
return {
1: ('owner', p.UVarintType, None),
}

Some files were not shown because too many files have changed in this diff Show More