mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-12-16 19:38:09 +00:00
commit
7bafad494d
@ -1,6 +1,4 @@
|
|||||||
[pytest]
|
[pytest]
|
||||||
addopts = --pyargs trezorlib.tests.device_tests
|
addopts = --pyargs trezorlib.tests.device_tests
|
||||||
xfail_strict = true
|
xfail_strict = true
|
||||||
|
run_xfail = lisk
|
||||||
# List of markers that run as if not xfailed. See docs/testing.md for details
|
|
||||||
# run_xfail = stellar lisk nem
|
|
||||||
|
24
src/apps/lisk/__init__.py
Normal file
24
src/apps/lisk/__init__.py
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
from trezor.wire import register, protobuf_workflow
|
||||||
|
from trezor.messages.wire_types import \
|
||||||
|
LiskGetAddress, LiskSignTx, LiskGetPublicKey
|
||||||
|
|
||||||
|
|
||||||
|
def dispatch_LiskGetAddress(*args, **kwargs):
|
||||||
|
from .get_address import layout_lisk_get_address
|
||||||
|
return layout_lisk_get_address(*args, **kwargs)
|
||||||
|
|
||||||
|
|
||||||
|
def dispatch_LiskGetPublicKey(*args, **kwargs):
|
||||||
|
from .get_public_key import lisk_get_public_key
|
||||||
|
return lisk_get_public_key(*args, **kwargs)
|
||||||
|
|
||||||
|
|
||||||
|
def dispatch_LiskSignTx(*args, **kwargs):
|
||||||
|
from .sign_tx import lisk_sign_tx
|
||||||
|
return lisk_sign_tx(*args, **kwargs)
|
||||||
|
|
||||||
|
|
||||||
|
def boot():
|
||||||
|
register(LiskGetPublicKey, protobuf_workflow, dispatch_LiskGetPublicKey)
|
||||||
|
register(LiskGetAddress, protobuf_workflow, dispatch_LiskGetAddress)
|
||||||
|
register(LiskSignTx, protobuf_workflow, dispatch_LiskSignTx)
|
23
src/apps/lisk/get_address.py
Normal file
23
src/apps/lisk/get_address.py
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
from apps.common import seed
|
||||||
|
from apps.wallet.get_address import _show_address, _show_qr
|
||||||
|
from trezor.messages.LiskAddress import LiskAddress
|
||||||
|
|
||||||
|
from .helpers import LISK_CURVE, get_address_from_public_key
|
||||||
|
|
||||||
|
|
||||||
|
async def layout_lisk_get_address(ctx, msg):
|
||||||
|
address_n = msg.address_n or ()
|
||||||
|
|
||||||
|
node = await seed.derive_node(ctx, address_n, LISK_CURVE)
|
||||||
|
pubkey = node.public_key()
|
||||||
|
pubkey = pubkey[1:] # skip ed25519 pubkey marker
|
||||||
|
address = get_address_from_public_key(pubkey)
|
||||||
|
|
||||||
|
if msg.show_display:
|
||||||
|
while True:
|
||||||
|
if await _show_address(ctx, address):
|
||||||
|
break
|
||||||
|
if await _show_qr(ctx, address):
|
||||||
|
break
|
||||||
|
|
||||||
|
return LiskAddress(address=address)
|
18
src/apps/lisk/get_public_key.py
Normal file
18
src/apps/lisk/get_public_key.py
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
from apps.common import seed
|
||||||
|
from apps.wallet.get_public_key import _show_pubkey
|
||||||
|
from trezor.messages.LiskPublicKey import LiskPublicKey
|
||||||
|
|
||||||
|
from .helpers import LISK_CURVE
|
||||||
|
|
||||||
|
|
||||||
|
async def lisk_get_public_key(ctx, msg):
|
||||||
|
address_n = msg.address_n or ()
|
||||||
|
|
||||||
|
node = await seed.derive_node(ctx, address_n, LISK_CURVE)
|
||||||
|
pubkey = node.public_key()
|
||||||
|
pubkey = pubkey[1:] # skip ed25519 pubkey marker
|
||||||
|
|
||||||
|
if msg.show_display:
|
||||||
|
await _show_pubkey(ctx, pubkey)
|
||||||
|
|
||||||
|
return LiskPublicKey(public_key=pubkey)
|
33
src/apps/lisk/helpers.py
Normal file
33
src/apps/lisk/helpers.py
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
from trezor.crypto.hashlib import sha256
|
||||||
|
|
||||||
|
LISK_CURVE = 'ed25519'
|
||||||
|
|
||||||
|
|
||||||
|
def get_address_from_public_key(pubkey):
|
||||||
|
pubkeyhash = sha256(pubkey).digest()
|
||||||
|
address = int.from_bytes(pubkeyhash[:8], 'little')
|
||||||
|
return str(address) + 'L'
|
||||||
|
|
||||||
|
|
||||||
|
def get_votes_count(votes):
|
||||||
|
plus, minus = 0, 0
|
||||||
|
for vote in votes:
|
||||||
|
if vote.startswith('+'):
|
||||||
|
plus += 1
|
||||||
|
else:
|
||||||
|
minus += 1
|
||||||
|
return plus, minus
|
||||||
|
|
||||||
|
|
||||||
|
def get_vote_tx_text(votes):
|
||||||
|
plus, minus = get_votes_count(votes)
|
||||||
|
text = []
|
||||||
|
if plus > 0:
|
||||||
|
text.append(_text_with_plural('Add', plus))
|
||||||
|
if minus > 0:
|
||||||
|
text.append(_text_with_plural('Remove', minus))
|
||||||
|
return text
|
||||||
|
|
||||||
|
|
||||||
|
def _text_with_plural(txt, value):
|
||||||
|
return '%s %s %s' % (txt, value, ('votes' if value != 1 else 'vote'))
|
63
src/apps/lisk/layout.py
Normal file
63
src/apps/lisk/layout.py
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
from apps.common.confirm import require_confirm, require_hold_to_confirm
|
||||||
|
from apps.wallet.get_public_key import _show_pubkey
|
||||||
|
from trezor import ui
|
||||||
|
from trezor.messages import ButtonRequestType
|
||||||
|
from trezor.ui.text import Text
|
||||||
|
from trezor.utils import chunks
|
||||||
|
|
||||||
|
from .helpers import get_vote_tx_text
|
||||||
|
|
||||||
|
|
||||||
|
async def require_confirm_tx(ctx, to, value):
|
||||||
|
content = Text('Confirm sending', ui.ICON_SEND,
|
||||||
|
ui.BOLD, format_amount(value),
|
||||||
|
ui.NORMAL, 'to',
|
||||||
|
ui.MONO, *split_address(to),
|
||||||
|
icon_color=ui.GREEN)
|
||||||
|
return await require_confirm(ctx, content, ButtonRequestType.SignTx)
|
||||||
|
|
||||||
|
|
||||||
|
async def require_confirm_delegate_registration(ctx, delegate_name):
|
||||||
|
content = Text('Confirm transaction', ui.ICON_SEND,
|
||||||
|
'Do you really want to',
|
||||||
|
'register a delegate?',
|
||||||
|
ui.BOLD, *chunks(delegate_name, 20),
|
||||||
|
icon_color=ui.GREEN)
|
||||||
|
return await require_confirm(ctx, content, ButtonRequestType.SignTx)
|
||||||
|
|
||||||
|
|
||||||
|
async def require_confirm_vote_tx(ctx, votes):
|
||||||
|
content = Text('Confirm transaction', ui.ICON_SEND,
|
||||||
|
*get_vote_tx_text(votes),
|
||||||
|
icon_color=ui.GREEN)
|
||||||
|
return await require_confirm(ctx, content, ButtonRequestType.SignTx)
|
||||||
|
|
||||||
|
|
||||||
|
async def require_confirm_public_key(ctx, public_key):
|
||||||
|
return await _show_pubkey(ctx, public_key)
|
||||||
|
|
||||||
|
|
||||||
|
async def require_confirm_multisig(ctx, multisignature):
|
||||||
|
content = Text('Confirm transaction', ui.ICON_SEND,
|
||||||
|
('Keys group length: %s' % len(multisignature.keys_group)),
|
||||||
|
('Life time: %s' % multisignature.life_time),
|
||||||
|
('Min: %s' % multisignature.min),
|
||||||
|
icon_color=ui.GREEN)
|
||||||
|
return await require_confirm(ctx, content, ButtonRequestType.SignTx)
|
||||||
|
|
||||||
|
|
||||||
|
async def require_confirm_fee(ctx, value, fee):
|
||||||
|
content = Text('Confirm transaction', ui.ICON_SEND,
|
||||||
|
ui.BOLD, format_amount(value),
|
||||||
|
ui.NORMAL, 'fee:',
|
||||||
|
ui.BOLD, format_amount(fee),
|
||||||
|
icon_color=ui.GREEN)
|
||||||
|
await require_hold_to_confirm(ctx, content, ButtonRequestType.ConfirmOutput)
|
||||||
|
|
||||||
|
|
||||||
|
def format_amount(value):
|
||||||
|
return '%s LSK' % (int(value) / 100000000)
|
||||||
|
|
||||||
|
|
||||||
|
def split_address(address):
|
||||||
|
return chunks(address, 16)
|
131
src/apps/lisk/sign_tx.py
Normal file
131
src/apps/lisk/sign_tx.py
Normal file
@ -0,0 +1,131 @@
|
|||||||
|
import ustruct
|
||||||
|
from apps.common import seed
|
||||||
|
from trezor import wire
|
||||||
|
from trezor.crypto.curve import ed25519
|
||||||
|
from trezor.crypto.hashlib import sha256
|
||||||
|
from trezor.messages import LiskTransactionType
|
||||||
|
from trezor.messages.LiskSignedTx import LiskSignedTx
|
||||||
|
from trezor.utils import HashWriter
|
||||||
|
|
||||||
|
from . import layout
|
||||||
|
from .helpers import LISK_CURVE, get_address_from_public_key
|
||||||
|
|
||||||
|
|
||||||
|
async def lisk_sign_tx(ctx, msg):
|
||||||
|
pubkey, seckey = await _get_keys(ctx, msg)
|
||||||
|
transaction = _update_raw_tx(msg.transaction, pubkey)
|
||||||
|
|
||||||
|
try:
|
||||||
|
await _require_confirm_by_type(ctx, transaction)
|
||||||
|
except AttributeError:
|
||||||
|
raise wire.DataError('The transaction has invalid asset data field')
|
||||||
|
|
||||||
|
await layout.require_confirm_fee(ctx, transaction.amount, transaction.fee)
|
||||||
|
|
||||||
|
txbytes = _get_transaction_bytes(transaction)
|
||||||
|
txhash = HashWriter(sha256)
|
||||||
|
for field in txbytes:
|
||||||
|
txhash.extend(field)
|
||||||
|
digest = txhash.get_digest()
|
||||||
|
|
||||||
|
signature = ed25519.sign(seckey, digest)
|
||||||
|
|
||||||
|
return LiskSignedTx(signature=signature)
|
||||||
|
|
||||||
|
|
||||||
|
async def _get_keys(ctx, msg):
|
||||||
|
address_n = msg.address_n or ()
|
||||||
|
node = await seed.derive_node(ctx, address_n, LISK_CURVE)
|
||||||
|
|
||||||
|
seckey = node.private_key()
|
||||||
|
pubkey = node.public_key()
|
||||||
|
pubkey = pubkey[1:] # skip ed25519 pubkey marker
|
||||||
|
|
||||||
|
return pubkey, seckey
|
||||||
|
|
||||||
|
|
||||||
|
def _update_raw_tx(transaction, pubkey):
|
||||||
|
transaction.sender_public_key = pubkey
|
||||||
|
|
||||||
|
# For CastVotes transactions, recipientId should be equal to transaction
|
||||||
|
# creator address.
|
||||||
|
if transaction.type == LiskTransactionType.CastVotes:
|
||||||
|
transaction.recipient_id = get_address_from_public_key(pubkey)
|
||||||
|
|
||||||
|
return transaction
|
||||||
|
|
||||||
|
|
||||||
|
async def _require_confirm_by_type(ctx, transaction):
|
||||||
|
|
||||||
|
if transaction.type == LiskTransactionType.Transfer:
|
||||||
|
return await layout.require_confirm_tx(
|
||||||
|
ctx, transaction.recipient_id, transaction.amount)
|
||||||
|
|
||||||
|
if transaction.type == LiskTransactionType.RegisterDelegate:
|
||||||
|
return await layout.require_confirm_delegate_registration(
|
||||||
|
ctx, transaction.asset.delegate.username)
|
||||||
|
|
||||||
|
if transaction.type == LiskTransactionType.CastVotes:
|
||||||
|
return await layout.require_confirm_vote_tx(
|
||||||
|
ctx, transaction.asset.votes)
|
||||||
|
|
||||||
|
if transaction.type == LiskTransactionType.RegisterSecondPassphrase:
|
||||||
|
return await layout.require_confirm_public_key(
|
||||||
|
ctx, transaction.asset.signature.public_key)
|
||||||
|
|
||||||
|
if transaction.type == LiskTransactionType.RegisterMultisignatureAccount:
|
||||||
|
return await layout.require_confirm_multisig(
|
||||||
|
ctx, transaction.asset.multisignature)
|
||||||
|
|
||||||
|
raise wire.DataError('Invalid transaction type')
|
||||||
|
|
||||||
|
|
||||||
|
def _get_transaction_bytes(tx):
|
||||||
|
|
||||||
|
# Required transaction parameters
|
||||||
|
t_type = ustruct.pack('<b', tx.type)
|
||||||
|
t_timestamp = ustruct.pack('<i', tx.timestamp)
|
||||||
|
t_sender_public_key = tx.sender_public_key
|
||||||
|
t_requester_public_key = tx.requester_public_key or b''
|
||||||
|
|
||||||
|
if not tx.recipient_id:
|
||||||
|
# Value can be empty string
|
||||||
|
t_recipient_id = ustruct.pack('>Q', 0)
|
||||||
|
else:
|
||||||
|
# Lisk uses big-endian for recipient_id, string -> int -> bytes
|
||||||
|
t_recipient_id = ustruct.pack('>Q', int(tx.recipient_id[:-1]))
|
||||||
|
|
||||||
|
t_amount = ustruct.pack('<Q', tx.amount)
|
||||||
|
t_asset = _get_asset_data_bytes(tx)
|
||||||
|
t_signature = tx.signature or b''
|
||||||
|
|
||||||
|
return (t_type, t_timestamp, t_sender_public_key, t_requester_public_key,
|
||||||
|
t_recipient_id, t_amount, t_asset, t_signature)
|
||||||
|
|
||||||
|
|
||||||
|
def _get_asset_data_bytes(msg):
|
||||||
|
|
||||||
|
if msg.type == LiskTransactionType.Transfer:
|
||||||
|
# Transfer transaction have optional data field
|
||||||
|
if msg.asset.data is not None:
|
||||||
|
return bytes(msg.asset.data, 'utf8')
|
||||||
|
else:
|
||||||
|
return b''
|
||||||
|
|
||||||
|
if msg.type == LiskTransactionType.RegisterDelegate:
|
||||||
|
return bytes(msg.asset.delegate.username, 'utf8')
|
||||||
|
|
||||||
|
if msg.type == LiskTransactionType.CastVotes:
|
||||||
|
return bytes(''.join(msg.asset.votes), 'utf8')
|
||||||
|
|
||||||
|
if msg.type == LiskTransactionType.RegisterSecondPassphrase:
|
||||||
|
return msg.asset.signature.public_key
|
||||||
|
|
||||||
|
if msg.type == LiskTransactionType.RegisterMultisignatureAccount:
|
||||||
|
data = b''
|
||||||
|
data += ustruct.pack('<b', msg.asset.multisignature.min)
|
||||||
|
data += ustruct.pack('<b', msg.asset.multisignature.life_time)
|
||||||
|
data += bytes(''.join(msg.asset.multisignature.keys_group), 'utf8')
|
||||||
|
return data
|
||||||
|
|
||||||
|
raise wire.DataError('Invalid transaction type')
|
@ -11,6 +11,7 @@ import apps.homescreen
|
|||||||
import apps.management
|
import apps.management
|
||||||
import apps.wallet
|
import apps.wallet
|
||||||
import apps.ethereum
|
import apps.ethereum
|
||||||
|
import apps.lisk
|
||||||
if __debug__:
|
if __debug__:
|
||||||
import apps.debug
|
import apps.debug
|
||||||
else:
|
else:
|
||||||
@ -21,6 +22,7 @@ apps.homescreen.boot()
|
|||||||
apps.management.boot()
|
apps.management.boot()
|
||||||
apps.wallet.boot()
|
apps.wallet.boot()
|
||||||
apps.ethereum.boot()
|
apps.ethereum.boot()
|
||||||
|
apps.lisk.boot()
|
||||||
if __debug__:
|
if __debug__:
|
||||||
apps.debug.boot()
|
apps.debug.boot()
|
||||||
else:
|
else:
|
||||||
|
@ -9,6 +9,7 @@ class ApplySettings(p.MessageType):
|
|||||||
3: ('use_passphrase', p.BoolType, 0),
|
3: ('use_passphrase', p.BoolType, 0),
|
||||||
4: ('homescreen', p.BytesType, 0),
|
4: ('homescreen', p.BytesType, 0),
|
||||||
5: ('passphrase_source', p.UVarintType, 0),
|
5: ('passphrase_source', p.UVarintType, 0),
|
||||||
|
6: ('auto_lock_delay_ms', p.UVarintType, 0),
|
||||||
}
|
}
|
||||||
MESSAGE_WIRE_TYPE = 25
|
MESSAGE_WIRE_TYPE = 25
|
||||||
|
|
||||||
@ -19,6 +20,7 @@ class ApplySettings(p.MessageType):
|
|||||||
use_passphrase: bool = None,
|
use_passphrase: bool = None,
|
||||||
homescreen: bytes = None,
|
homescreen: bytes = None,
|
||||||
passphrase_source: int = None,
|
passphrase_source: int = None,
|
||||||
|
auto_lock_delay_ms: int = None,
|
||||||
**kwargs,
|
**kwargs,
|
||||||
):
|
):
|
||||||
self.language = language
|
self.language = language
|
||||||
@ -26,4 +28,5 @@ class ApplySettings(p.MessageType):
|
|||||||
self.use_passphrase = use_passphrase
|
self.use_passphrase = use_passphrase
|
||||||
self.homescreen = homescreen
|
self.homescreen = homescreen
|
||||||
self.passphrase_source = passphrase_source
|
self.passphrase_source = passphrase_source
|
||||||
|
self.auto_lock_delay_ms = auto_lock_delay_ms
|
||||||
p.MessageType.__init__(self, **kwargs)
|
p.MessageType.__init__(self, **kwargs)
|
||||||
|
17
src/trezor/messages/LiskAddress.py
Normal file
17
src/trezor/messages/LiskAddress.py
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
# Automatically generated by pb2py
|
||||||
|
import protobuf as p
|
||||||
|
|
||||||
|
|
||||||
|
class LiskAddress(p.MessageType):
|
||||||
|
FIELDS = {
|
||||||
|
1: ('address', p.UnicodeType, 0),
|
||||||
|
}
|
||||||
|
MESSAGE_WIRE_TYPE = 115
|
||||||
|
|
||||||
|
def __init__(
|
||||||
|
self,
|
||||||
|
address: str = None,
|
||||||
|
**kwargs,
|
||||||
|
):
|
||||||
|
self.address = address
|
||||||
|
p.MessageType.__init__(self, **kwargs)
|
16
src/trezor/messages/LiskDelegateType.py
Normal file
16
src/trezor/messages/LiskDelegateType.py
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
# Automatically generated by pb2py
|
||||||
|
import protobuf as p
|
||||||
|
|
||||||
|
|
||||||
|
class LiskDelegateType(p.MessageType):
|
||||||
|
FIELDS = {
|
||||||
|
1: ('username', p.UnicodeType, 0),
|
||||||
|
}
|
||||||
|
|
||||||
|
def __init__(
|
||||||
|
self,
|
||||||
|
username: str = None,
|
||||||
|
**kwargs,
|
||||||
|
):
|
||||||
|
self.username = username
|
||||||
|
p.MessageType.__init__(self, **kwargs)
|
20
src/trezor/messages/LiskGetAddress.py
Normal file
20
src/trezor/messages/LiskGetAddress.py
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
# Automatically generated by pb2py
|
||||||
|
import protobuf as p
|
||||||
|
|
||||||
|
|
||||||
|
class LiskGetAddress(p.MessageType):
|
||||||
|
FIELDS = {
|
||||||
|
1: ('address_n', p.UVarintType, p.FLAG_REPEATED),
|
||||||
|
2: ('show_display', p.BoolType, 0),
|
||||||
|
}
|
||||||
|
MESSAGE_WIRE_TYPE = 114
|
||||||
|
|
||||||
|
def __init__(
|
||||||
|
self,
|
||||||
|
address_n: list = None,
|
||||||
|
show_display: bool = None,
|
||||||
|
**kwargs,
|
||||||
|
):
|
||||||
|
self.address_n = [] if address_n is None else address_n
|
||||||
|
self.show_display = show_display
|
||||||
|
p.MessageType.__init__(self, **kwargs)
|
20
src/trezor/messages/LiskGetPublicKey.py
Normal file
20
src/trezor/messages/LiskGetPublicKey.py
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
# Automatically generated by pb2py
|
||||||
|
import protobuf as p
|
||||||
|
|
||||||
|
|
||||||
|
class LiskGetPublicKey(p.MessageType):
|
||||||
|
FIELDS = {
|
||||||
|
1: ('address_n', p.UVarintType, p.FLAG_REPEATED),
|
||||||
|
2: ('show_display', p.BoolType, 0),
|
||||||
|
}
|
||||||
|
MESSAGE_WIRE_TYPE = 121
|
||||||
|
|
||||||
|
def __init__(
|
||||||
|
self,
|
||||||
|
address_n: list = None,
|
||||||
|
show_display: bool = None,
|
||||||
|
**kwargs,
|
||||||
|
):
|
||||||
|
self.address_n = [] if address_n is None else address_n
|
||||||
|
self.show_display = show_display
|
||||||
|
p.MessageType.__init__(self, **kwargs)
|
20
src/trezor/messages/LiskMessageSignature.py
Normal file
20
src/trezor/messages/LiskMessageSignature.py
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
# Automatically generated by pb2py
|
||||||
|
import protobuf as p
|
||||||
|
|
||||||
|
|
||||||
|
class LiskMessageSignature(p.MessageType):
|
||||||
|
FIELDS = {
|
||||||
|
1: ('address', p.UnicodeType, 0),
|
||||||
|
2: ('signature', p.BytesType, 0),
|
||||||
|
}
|
||||||
|
MESSAGE_WIRE_TYPE = 119
|
||||||
|
|
||||||
|
def __init__(
|
||||||
|
self,
|
||||||
|
address: str = None,
|
||||||
|
signature: bytes = None,
|
||||||
|
**kwargs,
|
||||||
|
):
|
||||||
|
self.address = address
|
||||||
|
self.signature = signature
|
||||||
|
p.MessageType.__init__(self, **kwargs)
|
22
src/trezor/messages/LiskMultisignatureType.py
Normal file
22
src/trezor/messages/LiskMultisignatureType.py
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
# Automatically generated by pb2py
|
||||||
|
import protobuf as p
|
||||||
|
|
||||||
|
|
||||||
|
class LiskMultisignatureType(p.MessageType):
|
||||||
|
FIELDS = {
|
||||||
|
1: ('min', p.UVarintType, 0),
|
||||||
|
2: ('life_time', p.UVarintType, 0),
|
||||||
|
3: ('keys_group', p.UnicodeType, p.FLAG_REPEATED),
|
||||||
|
}
|
||||||
|
|
||||||
|
def __init__(
|
||||||
|
self,
|
||||||
|
min: int = None,
|
||||||
|
life_time: int = None,
|
||||||
|
keys_group: list = None,
|
||||||
|
**kwargs,
|
||||||
|
):
|
||||||
|
self.min = min
|
||||||
|
self.life_time = life_time
|
||||||
|
self.keys_group = [] if keys_group is None else keys_group
|
||||||
|
p.MessageType.__init__(self, **kwargs)
|
17
src/trezor/messages/LiskPublicKey.py
Normal file
17
src/trezor/messages/LiskPublicKey.py
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
# Automatically generated by pb2py
|
||||||
|
import protobuf as p
|
||||||
|
|
||||||
|
|
||||||
|
class LiskPublicKey(p.MessageType):
|
||||||
|
FIELDS = {
|
||||||
|
1: ('public_key', p.BytesType, 0),
|
||||||
|
}
|
||||||
|
MESSAGE_WIRE_TYPE = 122
|
||||||
|
|
||||||
|
def __init__(
|
||||||
|
self,
|
||||||
|
public_key: bytes = None,
|
||||||
|
**kwargs,
|
||||||
|
):
|
||||||
|
self.public_key = public_key
|
||||||
|
p.MessageType.__init__(self, **kwargs)
|
20
src/trezor/messages/LiskSignMessage.py
Normal file
20
src/trezor/messages/LiskSignMessage.py
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
# Automatically generated by pb2py
|
||||||
|
import protobuf as p
|
||||||
|
|
||||||
|
|
||||||
|
class LiskSignMessage(p.MessageType):
|
||||||
|
FIELDS = {
|
||||||
|
1: ('address_n', p.UVarintType, p.FLAG_REPEATED),
|
||||||
|
2: ('message', p.BytesType, 0),
|
||||||
|
}
|
||||||
|
MESSAGE_WIRE_TYPE = 118
|
||||||
|
|
||||||
|
def __init__(
|
||||||
|
self,
|
||||||
|
address_n: list = None,
|
||||||
|
message: bytes = None,
|
||||||
|
**kwargs,
|
||||||
|
):
|
||||||
|
self.address_n = [] if address_n is None else address_n
|
||||||
|
self.message = message
|
||||||
|
p.MessageType.__init__(self, **kwargs)
|
21
src/trezor/messages/LiskSignTx.py
Normal file
21
src/trezor/messages/LiskSignTx.py
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
# Automatically generated by pb2py
|
||||||
|
import protobuf as p
|
||||||
|
from .LiskTransactionCommon import LiskTransactionCommon
|
||||||
|
|
||||||
|
|
||||||
|
class LiskSignTx(p.MessageType):
|
||||||
|
FIELDS = {
|
||||||
|
1: ('address_n', p.UVarintType, p.FLAG_REPEATED),
|
||||||
|
2: ('transaction', LiskTransactionCommon, 0),
|
||||||
|
}
|
||||||
|
MESSAGE_WIRE_TYPE = 116
|
||||||
|
|
||||||
|
def __init__(
|
||||||
|
self,
|
||||||
|
address_n: list = None,
|
||||||
|
transaction: LiskTransactionCommon = None,
|
||||||
|
**kwargs,
|
||||||
|
):
|
||||||
|
self.address_n = [] if address_n is None else address_n
|
||||||
|
self.transaction = transaction
|
||||||
|
p.MessageType.__init__(self, **kwargs)
|
16
src/trezor/messages/LiskSignatureType.py
Normal file
16
src/trezor/messages/LiskSignatureType.py
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
# Automatically generated by pb2py
|
||||||
|
import protobuf as p
|
||||||
|
|
||||||
|
|
||||||
|
class LiskSignatureType(p.MessageType):
|
||||||
|
FIELDS = {
|
||||||
|
1: ('public_key', p.BytesType, 0),
|
||||||
|
}
|
||||||
|
|
||||||
|
def __init__(
|
||||||
|
self,
|
||||||
|
public_key: bytes = None,
|
||||||
|
**kwargs,
|
||||||
|
):
|
||||||
|
self.public_key = public_key
|
||||||
|
p.MessageType.__init__(self, **kwargs)
|
17
src/trezor/messages/LiskSignedTx.py
Normal file
17
src/trezor/messages/LiskSignedTx.py
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
# Automatically generated by pb2py
|
||||||
|
import protobuf as p
|
||||||
|
|
||||||
|
|
||||||
|
class LiskSignedTx(p.MessageType):
|
||||||
|
FIELDS = {
|
||||||
|
1: ('signature', p.BytesType, 0),
|
||||||
|
}
|
||||||
|
MESSAGE_WIRE_TYPE = 117
|
||||||
|
|
||||||
|
def __init__(
|
||||||
|
self,
|
||||||
|
signature: bytes = None,
|
||||||
|
**kwargs,
|
||||||
|
):
|
||||||
|
self.signature = signature
|
||||||
|
p.MessageType.__init__(self, **kwargs)
|
31
src/trezor/messages/LiskTransactionAsset.py
Normal file
31
src/trezor/messages/LiskTransactionAsset.py
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
# Automatically generated by pb2py
|
||||||
|
import protobuf as p
|
||||||
|
from .LiskDelegateType import LiskDelegateType
|
||||||
|
from .LiskMultisignatureType import LiskMultisignatureType
|
||||||
|
from .LiskSignatureType import LiskSignatureType
|
||||||
|
|
||||||
|
|
||||||
|
class LiskTransactionAsset(p.MessageType):
|
||||||
|
FIELDS = {
|
||||||
|
1: ('signature', LiskSignatureType, 0),
|
||||||
|
2: ('delegate', LiskDelegateType, 0),
|
||||||
|
3: ('votes', p.UnicodeType, p.FLAG_REPEATED),
|
||||||
|
4: ('multisignature', LiskMultisignatureType, 0),
|
||||||
|
5: ('data', p.UnicodeType, 0),
|
||||||
|
}
|
||||||
|
|
||||||
|
def __init__(
|
||||||
|
self,
|
||||||
|
signature: LiskSignatureType = None,
|
||||||
|
delegate: LiskDelegateType = None,
|
||||||
|
votes: list = None,
|
||||||
|
multisignature: LiskMultisignatureType = None,
|
||||||
|
data: str = None,
|
||||||
|
**kwargs,
|
||||||
|
):
|
||||||
|
self.signature = signature
|
||||||
|
self.delegate = delegate
|
||||||
|
self.votes = [] if votes is None else votes
|
||||||
|
self.multisignature = multisignature
|
||||||
|
self.data = data
|
||||||
|
p.MessageType.__init__(self, **kwargs)
|
41
src/trezor/messages/LiskTransactionCommon.py
Normal file
41
src/trezor/messages/LiskTransactionCommon.py
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
# Automatically generated by pb2py
|
||||||
|
import protobuf as p
|
||||||
|
from .LiskTransactionAsset import LiskTransactionAsset
|
||||||
|
|
||||||
|
|
||||||
|
class LiskTransactionCommon(p.MessageType):
|
||||||
|
FIELDS = {
|
||||||
|
1: ('type', p.UVarintType, 0),
|
||||||
|
2: ('amount', p.UVarintType, 0), # default=0
|
||||||
|
3: ('fee', p.UVarintType, 0),
|
||||||
|
4: ('recipient_id', p.UnicodeType, 0),
|
||||||
|
5: ('sender_public_key', p.BytesType, 0),
|
||||||
|
6: ('requester_public_key', p.BytesType, 0),
|
||||||
|
7: ('signature', p.BytesType, 0),
|
||||||
|
8: ('timestamp', p.UVarintType, 0),
|
||||||
|
9: ('asset', LiskTransactionAsset, 0),
|
||||||
|
}
|
||||||
|
|
||||||
|
def __init__(
|
||||||
|
self,
|
||||||
|
type: int = None,
|
||||||
|
amount: int = None,
|
||||||
|
fee: int = None,
|
||||||
|
recipient_id: str = None,
|
||||||
|
sender_public_key: bytes = None,
|
||||||
|
requester_public_key: bytes = None,
|
||||||
|
signature: bytes = None,
|
||||||
|
timestamp: int = None,
|
||||||
|
asset: LiskTransactionAsset = None,
|
||||||
|
**kwargs,
|
||||||
|
):
|
||||||
|
self.type = type
|
||||||
|
self.amount = amount
|
||||||
|
self.fee = fee
|
||||||
|
self.recipient_id = recipient_id
|
||||||
|
self.sender_public_key = sender_public_key
|
||||||
|
self.requester_public_key = requester_public_key
|
||||||
|
self.signature = signature
|
||||||
|
self.timestamp = timestamp
|
||||||
|
self.asset = asset
|
||||||
|
p.MessageType.__init__(self, **kwargs)
|
11
src/trezor/messages/LiskTransactionType.py
Normal file
11
src/trezor/messages/LiskTransactionType.py
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
# Automatically generated by pb2py
|
||||||
|
from micropython import const
|
||||||
|
|
||||||
|
Transfer = const(0)
|
||||||
|
RegisterSecondPassphrase = const(1)
|
||||||
|
RegisterDelegate = const(2)
|
||||||
|
CastVotes = const(3)
|
||||||
|
RegisterMultisignatureAccount = const(4)
|
||||||
|
CreateDapp = const(5)
|
||||||
|
TransferIntoDapp = const(6)
|
||||||
|
TransferOutOfDapp = const(7)
|
23
src/trezor/messages/LiskVerifyMessage.py
Normal file
23
src/trezor/messages/LiskVerifyMessage.py
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
# Automatically generated by pb2py
|
||||||
|
import protobuf as p
|
||||||
|
|
||||||
|
|
||||||
|
class LiskVerifyMessage(p.MessageType):
|
||||||
|
FIELDS = {
|
||||||
|
1: ('signature', p.BytesType, 0),
|
||||||
|
2: ('public_key', p.BytesType, 0),
|
||||||
|
3: ('message', p.BytesType, 0),
|
||||||
|
}
|
||||||
|
MESSAGE_WIRE_TYPE = 120
|
||||||
|
|
||||||
|
def __init__(
|
||||||
|
self,
|
||||||
|
signature: bytes = None,
|
||||||
|
public_key: bytes = None,
|
||||||
|
message: bytes = None,
|
||||||
|
**kwargs,
|
||||||
|
):
|
||||||
|
self.signature = signature
|
||||||
|
self.public_key = public_key
|
||||||
|
self.message = message
|
||||||
|
p.MessageType.__init__(self, **kwargs)
|
@ -86,3 +86,31 @@ DebugLinkMemoryRead = const(110)
|
|||||||
DebugLinkMemory = const(111)
|
DebugLinkMemory = const(111)
|
||||||
DebugLinkMemoryWrite = const(112)
|
DebugLinkMemoryWrite = const(112)
|
||||||
DebugLinkFlashErase = const(113)
|
DebugLinkFlashErase = const(113)
|
||||||
|
LiskGetAddress = const(114)
|
||||||
|
LiskAddress = const(115)
|
||||||
|
LiskSignTx = const(116)
|
||||||
|
LiskSignedTx = const(117)
|
||||||
|
LiskSignMessage = const(118)
|
||||||
|
LiskMessageSignature = const(119)
|
||||||
|
LiskVerifyMessage = const(120)
|
||||||
|
LiskGetPublicKey = const(121)
|
||||||
|
LiskPublicKey = const(122)
|
||||||
|
StellarGetPublicKey = const(200)
|
||||||
|
StellarPublicKey = const(201)
|
||||||
|
StellarSignTx = const(202)
|
||||||
|
StellarTxOpRequest = const(203)
|
||||||
|
StellarSignMessage = const(204)
|
||||||
|
StellarMessageSignature = const(205)
|
||||||
|
StellarVerifyMessage = const(206)
|
||||||
|
StellarCreateAccountOp = const(210)
|
||||||
|
StellarPaymentOp = const(211)
|
||||||
|
StellarPathPaymentOp = const(212)
|
||||||
|
StellarManageOfferOp = const(213)
|
||||||
|
StellarCreatePassiveOfferOp = const(214)
|
||||||
|
StellarSetOptionsOp = const(215)
|
||||||
|
StellarChangeTrustOp = const(216)
|
||||||
|
StellarAllowTrustOp = const(217)
|
||||||
|
StellarAccountMergeOp = const(218)
|
||||||
|
StellarManageDataOp = const(220)
|
||||||
|
StellarBumpSequenceOp = const(221)
|
||||||
|
StellarSignedTx = const(230)
|
||||||
|
20
src/trezor/messages/StellarAccountMergeOp.py
Normal file
20
src/trezor/messages/StellarAccountMergeOp.py
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
# Automatically generated by pb2py
|
||||||
|
import protobuf as p
|
||||||
|
|
||||||
|
|
||||||
|
class StellarAccountMergeOp(p.MessageType):
|
||||||
|
FIELDS = {
|
||||||
|
1: ('source_account', p.BytesType, 0),
|
||||||
|
2: ('destination_account', p.BytesType, 0),
|
||||||
|
}
|
||||||
|
MESSAGE_WIRE_TYPE = 218
|
||||||
|
|
||||||
|
def __init__(
|
||||||
|
self,
|
||||||
|
source_account: bytes = None,
|
||||||
|
destination_account: bytes = None,
|
||||||
|
**kwargs,
|
||||||
|
):
|
||||||
|
self.source_account = source_account
|
||||||
|
self.destination_account = destination_account
|
||||||
|
p.MessageType.__init__(self, **kwargs)
|
29
src/trezor/messages/StellarAllowTrustOp.py
Normal file
29
src/trezor/messages/StellarAllowTrustOp.py
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
# Automatically generated by pb2py
|
||||||
|
import protobuf as p
|
||||||
|
|
||||||
|
|
||||||
|
class StellarAllowTrustOp(p.MessageType):
|
||||||
|
FIELDS = {
|
||||||
|
1: ('source_account', p.BytesType, 0),
|
||||||
|
2: ('trusted_account', p.BytesType, 0),
|
||||||
|
3: ('asset_type', p.UVarintType, 0),
|
||||||
|
4: ('asset_code', p.UnicodeType, 0),
|
||||||
|
5: ('is_authorized', p.UVarintType, 0),
|
||||||
|
}
|
||||||
|
MESSAGE_WIRE_TYPE = 217
|
||||||
|
|
||||||
|
def __init__(
|
||||||
|
self,
|
||||||
|
source_account: bytes = None,
|
||||||
|
trusted_account: bytes = None,
|
||||||
|
asset_type: int = None,
|
||||||
|
asset_code: str = None,
|
||||||
|
is_authorized: int = None,
|
||||||
|
**kwargs,
|
||||||
|
):
|
||||||
|
self.source_account = source_account
|
||||||
|
self.trusted_account = trusted_account
|
||||||
|
self.asset_type = asset_type
|
||||||
|
self.asset_code = asset_code
|
||||||
|
self.is_authorized = is_authorized
|
||||||
|
p.MessageType.__init__(self, **kwargs)
|
22
src/trezor/messages/StellarAssetType.py
Normal file
22
src/trezor/messages/StellarAssetType.py
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
# Automatically generated by pb2py
|
||||||
|
import protobuf as p
|
||||||
|
|
||||||
|
|
||||||
|
class StellarAssetType(p.MessageType):
|
||||||
|
FIELDS = {
|
||||||
|
1: ('type', p.UVarintType, 0),
|
||||||
|
2: ('code', p.UnicodeType, 0),
|
||||||
|
3: ('issuer', p.BytesType, 0),
|
||||||
|
}
|
||||||
|
|
||||||
|
def __init__(
|
||||||
|
self,
|
||||||
|
type: int = None,
|
||||||
|
code: str = None,
|
||||||
|
issuer: bytes = None,
|
||||||
|
**kwargs,
|
||||||
|
):
|
||||||
|
self.type = type
|
||||||
|
self.code = code
|
||||||
|
self.issuer = issuer
|
||||||
|
p.MessageType.__init__(self, **kwargs)
|
20
src/trezor/messages/StellarBumpSequenceOp.py
Normal file
20
src/trezor/messages/StellarBumpSequenceOp.py
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
# Automatically generated by pb2py
|
||||||
|
import protobuf as p
|
||||||
|
|
||||||
|
|
||||||
|
class StellarBumpSequenceOp(p.MessageType):
|
||||||
|
FIELDS = {
|
||||||
|
1: ('source_account', p.BytesType, 0),
|
||||||
|
2: ('bump_to', p.UVarintType, 0),
|
||||||
|
}
|
||||||
|
MESSAGE_WIRE_TYPE = 221
|
||||||
|
|
||||||
|
def __init__(
|
||||||
|
self,
|
||||||
|
source_account: bytes = None,
|
||||||
|
bump_to: int = None,
|
||||||
|
**kwargs,
|
||||||
|
):
|
||||||
|
self.source_account = source_account
|
||||||
|
self.bump_to = bump_to
|
||||||
|
p.MessageType.__init__(self, **kwargs)
|
24
src/trezor/messages/StellarChangeTrustOp.py
Normal file
24
src/trezor/messages/StellarChangeTrustOp.py
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
# Automatically generated by pb2py
|
||||||
|
import protobuf as p
|
||||||
|
from .StellarAssetType import StellarAssetType
|
||||||
|
|
||||||
|
|
||||||
|
class StellarChangeTrustOp(p.MessageType):
|
||||||
|
FIELDS = {
|
||||||
|
1: ('source_account', p.BytesType, 0),
|
||||||
|
2: ('asset', StellarAssetType, 0),
|
||||||
|
3: ('limit', p.UVarintType, 0),
|
||||||
|
}
|
||||||
|
MESSAGE_WIRE_TYPE = 216
|
||||||
|
|
||||||
|
def __init__(
|
||||||
|
self,
|
||||||
|
source_account: bytes = None,
|
||||||
|
asset: StellarAssetType = None,
|
||||||
|
limit: int = None,
|
||||||
|
**kwargs,
|
||||||
|
):
|
||||||
|
self.source_account = source_account
|
||||||
|
self.asset = asset
|
||||||
|
self.limit = limit
|
||||||
|
p.MessageType.__init__(self, **kwargs)
|
23
src/trezor/messages/StellarCreateAccountOp.py
Normal file
23
src/trezor/messages/StellarCreateAccountOp.py
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
# Automatically generated by pb2py
|
||||||
|
import protobuf as p
|
||||||
|
|
||||||
|
|
||||||
|
class StellarCreateAccountOp(p.MessageType):
|
||||||
|
FIELDS = {
|
||||||
|
1: ('source_account', p.BytesType, 0),
|
||||||
|
2: ('new_account', p.BytesType, 0),
|
||||||
|
3: ('starting_balance', p.Sint64Type, 0),
|
||||||
|
}
|
||||||
|
MESSAGE_WIRE_TYPE = 210
|
||||||
|
|
||||||
|
def __init__(
|
||||||
|
self,
|
||||||
|
source_account: bytes = None,
|
||||||
|
new_account: bytes = None,
|
||||||
|
starting_balance: int = None,
|
||||||
|
**kwargs,
|
||||||
|
):
|
||||||
|
self.source_account = source_account
|
||||||
|
self.new_account = new_account
|
||||||
|
self.starting_balance = starting_balance
|
||||||
|
p.MessageType.__init__(self, **kwargs)
|
33
src/trezor/messages/StellarCreatePassiveOfferOp.py
Normal file
33
src/trezor/messages/StellarCreatePassiveOfferOp.py
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
# Automatically generated by pb2py
|
||||||
|
import protobuf as p
|
||||||
|
from .StellarAssetType import StellarAssetType
|
||||||
|
|
||||||
|
|
||||||
|
class StellarCreatePassiveOfferOp(p.MessageType):
|
||||||
|
FIELDS = {
|
||||||
|
1: ('source_account', p.BytesType, 0),
|
||||||
|
2: ('selling_asset', StellarAssetType, 0),
|
||||||
|
3: ('buying_asset', StellarAssetType, 0),
|
||||||
|
4: ('amount', p.Sint64Type, 0),
|
||||||
|
5: ('price_n', p.UVarintType, 0),
|
||||||
|
6: ('price_d', p.UVarintType, 0),
|
||||||
|
}
|
||||||
|
MESSAGE_WIRE_TYPE = 214
|
||||||
|
|
||||||
|
def __init__(
|
||||||
|
self,
|
||||||
|
source_account: bytes = None,
|
||||||
|
selling_asset: StellarAssetType = None,
|
||||||
|
buying_asset: StellarAssetType = None,
|
||||||
|
amount: int = None,
|
||||||
|
price_n: int = None,
|
||||||
|
price_d: int = None,
|
||||||
|
**kwargs,
|
||||||
|
):
|
||||||
|
self.source_account = source_account
|
||||||
|
self.selling_asset = selling_asset
|
||||||
|
self.buying_asset = buying_asset
|
||||||
|
self.amount = amount
|
||||||
|
self.price_n = price_n
|
||||||
|
self.price_d = price_d
|
||||||
|
p.MessageType.__init__(self, **kwargs)
|
17
src/trezor/messages/StellarGetPublicKey.py
Normal file
17
src/trezor/messages/StellarGetPublicKey.py
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
# Automatically generated by pb2py
|
||||||
|
import protobuf as p
|
||||||
|
|
||||||
|
|
||||||
|
class StellarGetPublicKey(p.MessageType):
|
||||||
|
FIELDS = {
|
||||||
|
1: ('address_n', p.UVarintType, p.FLAG_REPEATED),
|
||||||
|
}
|
||||||
|
MESSAGE_WIRE_TYPE = 200
|
||||||
|
|
||||||
|
def __init__(
|
||||||
|
self,
|
||||||
|
address_n: list = None,
|
||||||
|
**kwargs,
|
||||||
|
):
|
||||||
|
self.address_n = [] if address_n is None else address_n
|
||||||
|
p.MessageType.__init__(self, **kwargs)
|
23
src/trezor/messages/StellarManageDataOp.py
Normal file
23
src/trezor/messages/StellarManageDataOp.py
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
# Automatically generated by pb2py
|
||||||
|
import protobuf as p
|
||||||
|
|
||||||
|
|
||||||
|
class StellarManageDataOp(p.MessageType):
|
||||||
|
FIELDS = {
|
||||||
|
1: ('source_account', p.BytesType, 0),
|
||||||
|
2: ('key', p.UnicodeType, 0),
|
||||||
|
3: ('value', p.BytesType, 0),
|
||||||
|
}
|
||||||
|
MESSAGE_WIRE_TYPE = 220
|
||||||
|
|
||||||
|
def __init__(
|
||||||
|
self,
|
||||||
|
source_account: bytes = None,
|
||||||
|
key: str = None,
|
||||||
|
value: bytes = None,
|
||||||
|
**kwargs,
|
||||||
|
):
|
||||||
|
self.source_account = source_account
|
||||||
|
self.key = key
|
||||||
|
self.value = value
|
||||||
|
p.MessageType.__init__(self, **kwargs)
|
36
src/trezor/messages/StellarManageOfferOp.py
Normal file
36
src/trezor/messages/StellarManageOfferOp.py
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
# Automatically generated by pb2py
|
||||||
|
import protobuf as p
|
||||||
|
from .StellarAssetType import StellarAssetType
|
||||||
|
|
||||||
|
|
||||||
|
class StellarManageOfferOp(p.MessageType):
|
||||||
|
FIELDS = {
|
||||||
|
1: ('source_account', p.BytesType, 0),
|
||||||
|
2: ('selling_asset', StellarAssetType, 0),
|
||||||
|
3: ('buying_asset', StellarAssetType, 0),
|
||||||
|
4: ('amount', p.Sint64Type, 0),
|
||||||
|
5: ('price_n', p.UVarintType, 0),
|
||||||
|
6: ('price_d', p.UVarintType, 0),
|
||||||
|
7: ('offer_id', p.UVarintType, 0),
|
||||||
|
}
|
||||||
|
MESSAGE_WIRE_TYPE = 213
|
||||||
|
|
||||||
|
def __init__(
|
||||||
|
self,
|
||||||
|
source_account: bytes = None,
|
||||||
|
selling_asset: StellarAssetType = None,
|
||||||
|
buying_asset: StellarAssetType = None,
|
||||||
|
amount: int = None,
|
||||||
|
price_n: int = None,
|
||||||
|
price_d: int = None,
|
||||||
|
offer_id: int = None,
|
||||||
|
**kwargs,
|
||||||
|
):
|
||||||
|
self.source_account = source_account
|
||||||
|
self.selling_asset = selling_asset
|
||||||
|
self.buying_asset = buying_asset
|
||||||
|
self.amount = amount
|
||||||
|
self.price_n = price_n
|
||||||
|
self.price_d = price_d
|
||||||
|
self.offer_id = offer_id
|
||||||
|
p.MessageType.__init__(self, **kwargs)
|
20
src/trezor/messages/StellarMessageSignature.py
Normal file
20
src/trezor/messages/StellarMessageSignature.py
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
# Automatically generated by pb2py
|
||||||
|
import protobuf as p
|
||||||
|
|
||||||
|
|
||||||
|
class StellarMessageSignature(p.MessageType):
|
||||||
|
FIELDS = {
|
||||||
|
1: ('public_key', p.BytesType, 0),
|
||||||
|
2: ('signature', p.BytesType, 0),
|
||||||
|
}
|
||||||
|
MESSAGE_WIRE_TYPE = 205
|
||||||
|
|
||||||
|
def __init__(
|
||||||
|
self,
|
||||||
|
public_key: bytes = None,
|
||||||
|
signature: bytes = None,
|
||||||
|
**kwargs,
|
||||||
|
):
|
||||||
|
self.public_key = public_key
|
||||||
|
self.signature = signature
|
||||||
|
p.MessageType.__init__(self, **kwargs)
|
36
src/trezor/messages/StellarPathPaymentOp.py
Normal file
36
src/trezor/messages/StellarPathPaymentOp.py
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
# Automatically generated by pb2py
|
||||||
|
import protobuf as p
|
||||||
|
from .StellarAssetType import StellarAssetType
|
||||||
|
|
||||||
|
|
||||||
|
class StellarPathPaymentOp(p.MessageType):
|
||||||
|
FIELDS = {
|
||||||
|
1: ('source_account', p.BytesType, 0),
|
||||||
|
2: ('send_asset', StellarAssetType, 0),
|
||||||
|
3: ('send_max', p.Sint64Type, 0),
|
||||||
|
4: ('destination_account', p.BytesType, 0),
|
||||||
|
5: ('destination_asset', StellarAssetType, 0),
|
||||||
|
6: ('destination_amount', p.Sint64Type, 0),
|
||||||
|
7: ('paths', StellarAssetType, p.FLAG_REPEATED),
|
||||||
|
}
|
||||||
|
MESSAGE_WIRE_TYPE = 212
|
||||||
|
|
||||||
|
def __init__(
|
||||||
|
self,
|
||||||
|
source_account: bytes = None,
|
||||||
|
send_asset: StellarAssetType = None,
|
||||||
|
send_max: int = None,
|
||||||
|
destination_account: bytes = None,
|
||||||
|
destination_asset: StellarAssetType = None,
|
||||||
|
destination_amount: int = None,
|
||||||
|
paths: list = None,
|
||||||
|
**kwargs,
|
||||||
|
):
|
||||||
|
self.source_account = source_account
|
||||||
|
self.send_asset = send_asset
|
||||||
|
self.send_max = send_max
|
||||||
|
self.destination_account = destination_account
|
||||||
|
self.destination_asset = destination_asset
|
||||||
|
self.destination_amount = destination_amount
|
||||||
|
self.paths = [] if paths is None else paths
|
||||||
|
p.MessageType.__init__(self, **kwargs)
|
27
src/trezor/messages/StellarPaymentOp.py
Normal file
27
src/trezor/messages/StellarPaymentOp.py
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
# Automatically generated by pb2py
|
||||||
|
import protobuf as p
|
||||||
|
from .StellarAssetType import StellarAssetType
|
||||||
|
|
||||||
|
|
||||||
|
class StellarPaymentOp(p.MessageType):
|
||||||
|
FIELDS = {
|
||||||
|
1: ('source_account', p.BytesType, 0),
|
||||||
|
2: ('destination_account', p.BytesType, 0),
|
||||||
|
3: ('asset', StellarAssetType, 0),
|
||||||
|
4: ('amount', p.Sint64Type, 0),
|
||||||
|
}
|
||||||
|
MESSAGE_WIRE_TYPE = 211
|
||||||
|
|
||||||
|
def __init__(
|
||||||
|
self,
|
||||||
|
source_account: bytes = None,
|
||||||
|
destination_account: bytes = None,
|
||||||
|
asset: StellarAssetType = None,
|
||||||
|
amount: int = None,
|
||||||
|
**kwargs,
|
||||||
|
):
|
||||||
|
self.source_account = source_account
|
||||||
|
self.destination_account = destination_account
|
||||||
|
self.asset = asset
|
||||||
|
self.amount = amount
|
||||||
|
p.MessageType.__init__(self, **kwargs)
|
17
src/trezor/messages/StellarPublicKey.py
Normal file
17
src/trezor/messages/StellarPublicKey.py
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
# Automatically generated by pb2py
|
||||||
|
import protobuf as p
|
||||||
|
|
||||||
|
|
||||||
|
class StellarPublicKey(p.MessageType):
|
||||||
|
FIELDS = {
|
||||||
|
1: ('public_key', p.BytesType, 0),
|
||||||
|
}
|
||||||
|
MESSAGE_WIRE_TYPE = 201
|
||||||
|
|
||||||
|
def __init__(
|
||||||
|
self,
|
||||||
|
public_key: bytes = None,
|
||||||
|
**kwargs,
|
||||||
|
):
|
||||||
|
self.public_key = public_key
|
||||||
|
p.MessageType.__init__(self, **kwargs)
|
50
src/trezor/messages/StellarSetOptionsOp.py
Normal file
50
src/trezor/messages/StellarSetOptionsOp.py
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
# Automatically generated by pb2py
|
||||||
|
import protobuf as p
|
||||||
|
|
||||||
|
|
||||||
|
class StellarSetOptionsOp(p.MessageType):
|
||||||
|
FIELDS = {
|
||||||
|
1: ('source_account', p.BytesType, 0),
|
||||||
|
2: ('inflation_destination_account', p.BytesType, 0),
|
||||||
|
3: ('clear_flags', p.UVarintType, 0),
|
||||||
|
4: ('set_flags', p.UVarintType, 0),
|
||||||
|
5: ('master_weight', p.UVarintType, 0),
|
||||||
|
6: ('low_threshold', p.UVarintType, 0),
|
||||||
|
7: ('medium_threshold', p.UVarintType, 0),
|
||||||
|
8: ('high_threshold', p.UVarintType, 0),
|
||||||
|
9: ('home_domain', p.UnicodeType, 0),
|
||||||
|
10: ('signer_type', p.UVarintType, 0),
|
||||||
|
11: ('signer_key', p.BytesType, 0),
|
||||||
|
12: ('signer_weight', p.UVarintType, 0),
|
||||||
|
}
|
||||||
|
MESSAGE_WIRE_TYPE = 215
|
||||||
|
|
||||||
|
def __init__(
|
||||||
|
self,
|
||||||
|
source_account: bytes = None,
|
||||||
|
inflation_destination_account: bytes = None,
|
||||||
|
clear_flags: int = None,
|
||||||
|
set_flags: int = None,
|
||||||
|
master_weight: int = None,
|
||||||
|
low_threshold: int = None,
|
||||||
|
medium_threshold: int = None,
|
||||||
|
high_threshold: int = None,
|
||||||
|
home_domain: str = None,
|
||||||
|
signer_type: int = None,
|
||||||
|
signer_key: bytes = None,
|
||||||
|
signer_weight: int = None,
|
||||||
|
**kwargs,
|
||||||
|
):
|
||||||
|
self.source_account = source_account
|
||||||
|
self.inflation_destination_account = inflation_destination_account
|
||||||
|
self.clear_flags = clear_flags
|
||||||
|
self.set_flags = set_flags
|
||||||
|
self.master_weight = master_weight
|
||||||
|
self.low_threshold = low_threshold
|
||||||
|
self.medium_threshold = medium_threshold
|
||||||
|
self.high_threshold = high_threshold
|
||||||
|
self.home_domain = home_domain
|
||||||
|
self.signer_type = signer_type
|
||||||
|
self.signer_key = signer_key
|
||||||
|
self.signer_weight = signer_weight
|
||||||
|
p.MessageType.__init__(self, **kwargs)
|
20
src/trezor/messages/StellarSignMessage.py
Normal file
20
src/trezor/messages/StellarSignMessage.py
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
# Automatically generated by pb2py
|
||||||
|
import protobuf as p
|
||||||
|
|
||||||
|
|
||||||
|
class StellarSignMessage(p.MessageType):
|
||||||
|
FIELDS = {
|
||||||
|
1: ('address_n', p.UVarintType, p.FLAG_REPEATED),
|
||||||
|
2: ('message', p.UnicodeType, 0),
|
||||||
|
}
|
||||||
|
MESSAGE_WIRE_TYPE = 204
|
||||||
|
|
||||||
|
def __init__(
|
||||||
|
self,
|
||||||
|
address_n: list = None,
|
||||||
|
message: str = None,
|
||||||
|
**kwargs,
|
||||||
|
):
|
||||||
|
self.address_n = [] if address_n is None else address_n
|
||||||
|
self.message = message
|
||||||
|
p.MessageType.__init__(self, **kwargs)
|
53
src/trezor/messages/StellarSignTx.py
Normal file
53
src/trezor/messages/StellarSignTx.py
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
# Automatically generated by pb2py
|
||||||
|
import protobuf as p
|
||||||
|
|
||||||
|
|
||||||
|
class StellarSignTx(p.MessageType):
|
||||||
|
FIELDS = {
|
||||||
|
1: ('protocol_version', p.UVarintType, 0),
|
||||||
|
2: ('address_n', p.UVarintType, p.FLAG_REPEATED),
|
||||||
|
3: ('network_passphrase', p.UnicodeType, 0),
|
||||||
|
4: ('source_account', p.BytesType, 0),
|
||||||
|
5: ('fee', p.UVarintType, 0),
|
||||||
|
6: ('sequence_number', p.UVarintType, 0),
|
||||||
|
8: ('timebounds_start', p.UVarintType, 0),
|
||||||
|
9: ('timebounds_end', p.UVarintType, 0),
|
||||||
|
10: ('memo_type', p.UVarintType, 0),
|
||||||
|
11: ('memo_text', p.UnicodeType, 0),
|
||||||
|
12: ('memo_id', p.UVarintType, 0),
|
||||||
|
13: ('memo_hash', p.BytesType, 0),
|
||||||
|
14: ('num_operations', p.UVarintType, 0),
|
||||||
|
}
|
||||||
|
MESSAGE_WIRE_TYPE = 202
|
||||||
|
|
||||||
|
def __init__(
|
||||||
|
self,
|
||||||
|
protocol_version: int = None,
|
||||||
|
address_n: list = None,
|
||||||
|
network_passphrase: str = None,
|
||||||
|
source_account: bytes = None,
|
||||||
|
fee: int = None,
|
||||||
|
sequence_number: int = None,
|
||||||
|
timebounds_start: int = None,
|
||||||
|
timebounds_end: int = None,
|
||||||
|
memo_type: int = None,
|
||||||
|
memo_text: str = None,
|
||||||
|
memo_id: int = None,
|
||||||
|
memo_hash: bytes = None,
|
||||||
|
num_operations: int = None,
|
||||||
|
**kwargs,
|
||||||
|
):
|
||||||
|
self.protocol_version = protocol_version
|
||||||
|
self.address_n = [] if address_n is None else address_n
|
||||||
|
self.network_passphrase = network_passphrase
|
||||||
|
self.source_account = source_account
|
||||||
|
self.fee = fee
|
||||||
|
self.sequence_number = sequence_number
|
||||||
|
self.timebounds_start = timebounds_start
|
||||||
|
self.timebounds_end = timebounds_end
|
||||||
|
self.memo_type = memo_type
|
||||||
|
self.memo_text = memo_text
|
||||||
|
self.memo_id = memo_id
|
||||||
|
self.memo_hash = memo_hash
|
||||||
|
self.num_operations = num_operations
|
||||||
|
p.MessageType.__init__(self, **kwargs)
|
20
src/trezor/messages/StellarSignedTx.py
Normal file
20
src/trezor/messages/StellarSignedTx.py
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
# Automatically generated by pb2py
|
||||||
|
import protobuf as p
|
||||||
|
|
||||||
|
|
||||||
|
class StellarSignedTx(p.MessageType):
|
||||||
|
FIELDS = {
|
||||||
|
1: ('public_key', p.BytesType, 0),
|
||||||
|
2: ('signature', p.BytesType, 0),
|
||||||
|
}
|
||||||
|
MESSAGE_WIRE_TYPE = 230
|
||||||
|
|
||||||
|
def __init__(
|
||||||
|
self,
|
||||||
|
public_key: bytes = None,
|
||||||
|
signature: bytes = None,
|
||||||
|
**kwargs,
|
||||||
|
):
|
||||||
|
self.public_key = public_key
|
||||||
|
self.signature = signature
|
||||||
|
p.MessageType.__init__(self, **kwargs)
|
12
src/trezor/messages/StellarTxOpRequest.py
Normal file
12
src/trezor/messages/StellarTxOpRequest.py
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
# Automatically generated by pb2py
|
||||||
|
import protobuf as p
|
||||||
|
|
||||||
|
|
||||||
|
class StellarTxOpRequest(p.MessageType):
|
||||||
|
MESSAGE_WIRE_TYPE = 203
|
||||||
|
|
||||||
|
def __init__(
|
||||||
|
self,
|
||||||
|
**kwargs,
|
||||||
|
):
|
||||||
|
p.MessageType.__init__(self, **kwargs)
|
23
src/trezor/messages/StellarVerifyMessage.py
Normal file
23
src/trezor/messages/StellarVerifyMessage.py
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
# Automatically generated by pb2py
|
||||||
|
import protobuf as p
|
||||||
|
|
||||||
|
|
||||||
|
class StellarVerifyMessage(p.MessageType):
|
||||||
|
FIELDS = {
|
||||||
|
1: ('public_key', p.BytesType, 0),
|
||||||
|
2: ('message', p.BytesType, 0),
|
||||||
|
3: ('signature', p.BytesType, 0),
|
||||||
|
}
|
||||||
|
MESSAGE_WIRE_TYPE = 206
|
||||||
|
|
||||||
|
def __init__(
|
||||||
|
self,
|
||||||
|
public_key: bytes = None,
|
||||||
|
message: bytes = None,
|
||||||
|
signature: bytes = None,
|
||||||
|
**kwargs,
|
||||||
|
):
|
||||||
|
self.public_key = public_key
|
||||||
|
self.message = message
|
||||||
|
self.signature = signature
|
||||||
|
p.MessageType.__init__(self, **kwargs)
|
@ -53,6 +53,15 @@ GetEntropy = const(9)
|
|||||||
GetFeatures = const(55)
|
GetFeatures = const(55)
|
||||||
GetPublicKey = const(11)
|
GetPublicKey = const(11)
|
||||||
Initialize = const(0)
|
Initialize = const(0)
|
||||||
|
LiskAddress = const(115)
|
||||||
|
LiskGetAddress = const(114)
|
||||||
|
LiskGetPublicKey = const(121)
|
||||||
|
LiskMessageSignature = const(119)
|
||||||
|
LiskPublicKey = const(122)
|
||||||
|
LiskSignMessage = const(118)
|
||||||
|
LiskSignTx = const(116)
|
||||||
|
LiskSignedTx = const(117)
|
||||||
|
LiskVerifyMessage = const(120)
|
||||||
LoadDevice = const(13)
|
LoadDevice = const(13)
|
||||||
MessageSignature = const(40)
|
MessageSignature = const(40)
|
||||||
NEMAddress = const(68)
|
NEMAddress = const(68)
|
||||||
@ -78,6 +87,25 @@ SignMessage = const(38)
|
|||||||
SignTx = const(15)
|
SignTx = const(15)
|
||||||
SignedIdentity = const(54)
|
SignedIdentity = const(54)
|
||||||
SimpleSignTx = const(16)
|
SimpleSignTx = const(16)
|
||||||
|
StellarAccountMergeOp = const(218)
|
||||||
|
StellarAllowTrustOp = const(217)
|
||||||
|
StellarBumpSequenceOp = const(221)
|
||||||
|
StellarChangeTrustOp = const(216)
|
||||||
|
StellarCreateAccountOp = const(210)
|
||||||
|
StellarCreatePassiveOfferOp = const(214)
|
||||||
|
StellarGetPublicKey = const(200)
|
||||||
|
StellarManageDataOp = const(220)
|
||||||
|
StellarManageOfferOp = const(213)
|
||||||
|
StellarMessageSignature = const(205)
|
||||||
|
StellarPathPaymentOp = const(212)
|
||||||
|
StellarPaymentOp = const(211)
|
||||||
|
StellarPublicKey = const(201)
|
||||||
|
StellarSetOptionsOp = const(215)
|
||||||
|
StellarSignMessage = const(204)
|
||||||
|
StellarSignTx = const(202)
|
||||||
|
StellarSignedTx = const(230)
|
||||||
|
StellarTxOpRequest = const(203)
|
||||||
|
StellarVerifyMessage = const(206)
|
||||||
Success = const(2)
|
Success = const(2)
|
||||||
TxAck = const(22)
|
TxAck = const(22)
|
||||||
TxRequest = const(21)
|
TxRequest = const(21)
|
||||||
|
2
vendor/trezor-common
vendored
2
vendor/trezor-common
vendored
@ -1 +1 @@
|
|||||||
Subproject commit 66a85673ed303f2cf48bdb3d027adbc7e8464364
|
Subproject commit 9abe3a7c69000cc7ee3cda2ec940193fa9d62e6c
|
Loading…
Reference in New Issue
Block a user