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

common+python: remove TRX

This commit is contained in:
Pavol Rusnak 2019-05-25 12:15:52 +02:00
parent 8a179437b1
commit 03feb21b09
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D
30 changed files with 1 additions and 788 deletions

View File

@ -149,19 +149,6 @@
"wallet": {},
"blockchain_link": {}
},
{
"name": "Tron",
"shortcut": "TRX",
"slip44": 195,
"curve": "secp256k1",
"decimals": 6,
"links": {
"Homepage": "https://tron.network",
"Github": "https://github.com/tronprotocol/java-tron"
},
"wallet": {},
"blockchain_link": {}
},
{
"name": "Omni",
"shortcut": "OMNI",

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.7 KiB

View File

@ -1428,7 +1428,6 @@
"misc:BNB": "not implemented",
"misc:EOS": "not implemented",
"misc:ONT": "not implemented",
"misc:TRX": "not implemented",
"misc:XMR": "not implemented",
"misc:XRP": "not implemented",
"misc:XTZ": "not implemented",

View File

@ -1,4 +1,4 @@
check: messages.pb messages-binance.pb messages-bitcoin.pb messages-bootloader.pb messages-cardano.pb messages-common.pb messages-crypto.pb messages-debug.pb messages-ethereum.pb messages-lisk.pb messages-management.pb messages-monero.pb messages-nem.pb messages-ripple.pb messages-stellar.pb messages-tezos.pb messages-tron.pb messages-eos.pb
check: messages.pb messages-binance.pb messages-bitcoin.pb messages-bootloader.pb messages-cardano.pb messages-common.pb messages-crypto.pb messages-debug.pb messages-ethereum.pb messages-lisk.pb messages-management.pb messages-monero.pb messages-nem.pb messages-ripple.pb messages-stellar.pb messages-tezos.pb messages-eos.pb
%.pb: %.proto
protoc -I/usr/include -I. $< -o $@

View File

@ -1,162 +0,0 @@
syntax = "proto2";
// Sugar for easier handling in Java
option java_package = "com.satoshilabs.trezor.lib.protobuf";
option java_outer_classname = "TrezorMessageTron";
/**
* Request: Ask device for Tron address corresponding to address_n path
* @start
* @next TronAddress
* @next Failure
*/
message TronGetAddress {
repeated uint32 address_n = 1; // BIP-32 path to derive the key from master node
optional bool show_display = 2; // Optionally show on display before sending the result
}
/**
* Response: Contains Tron address derived from device private seed
* @end
*/
message TronAddress {
optional string address = 1; // Tron address (base58)
}
/**
* Request: Ask device to sign Tron transaction
* @start
* @next TronSignedTx
*/
message TronSignTx {
repeated uint32 address_n = 1; // BIP-32 path to derive the key from master node
// Common part of transaction
optional bytes ref_block_bytes = 2; // Reference block number
optional bytes ref_block_hash = 3; // Reference block hash
optional uint64 expiration = 4; // Transaction expiration
optional string data = 5; // Extra transaction info
optional TronContract contract = 6; // Contract messages
optional uint64 timestamp = 7; // UTC timestamp
/***
* Tron Contracts Messages
*
*/
message TronContract {
// Update account name
message TronAccountUpdateContract {
optional string account_name = 1; // Account name is not unique
}
// Transfer TRX
message TronTransferContract {
optional bytes to_address = 1; // To address - decoded base 58
optional uint64 amount = 2; // TRX amount in sun (10^-6)
}
// Transfer asset
message TronTransferAssetContract {
optional string asset_name = 1; // Asset name
optional bytes to_address = 2; // To address - decoded base 58
optional uint64 amount = 3; // Amount to transfer
}
// Vote witness
message TronVoteWitnessContract {
message TronVote {
optional bytes vote_address = 1; // Candidate Address - decoded base 58
optional uint64 vote_count = 2; // Amount of votes
}
repeated TronVote votes = 1; // votes
}
// Upgrade account to witness
message TronWitnessCreateContract {
optional string url = 1; // Witness URL
}
// Update witness URL
message TronWitnessUpdateContract {
optional string update_url = 2; // Witness URL
}
// Issue Asset
message TronAssetIssueContract {
message TronFrozenSupply {
optional uint64 frozen_amount = 1; // Amount frozen
optional uint64 frozen_days = 2; // Days from issue date
}
optional string name = 2; // Asset name
optional string abbr = 3; // Asset abbreviation
optional uint64 total_supply = 4; // Total supply including frozen
repeated TronFrozenSupply frozen_supply = 5; // Frozen supply
optional uint32 trx_num = 6; // Amount of TRX (exchange ratio)
optional uint32 num = 7; // Amount of tokens (exchange ratio)
optional uint64 start_time = 8; // Negotiation start date and time
optional uint64 end_time = 9; // Negotiation end date and time
optional string description = 10; // Asset description
optional string url = 11; // Asset URL
}
// Participate in an asset
message TronParticipateAssetIssueContract {
optional bytes to_address = 1; // Asset issuer address - decoded base 58
optional string asset_name = 2; // The name of target asset
optional uint64 amount = 3; // TRX amount in sun
}
// Freeze TRX balance
message TronFreezeBalanceContract {
optional uint64 frozen_balance = 1; // Amount to freeze
optional uint64 frozen_duration = 2; // Freeze minimal duration in days
}
// Unfreeze TRX Balance
message TronUnfreezeBalanceContract {
}
// Unfreeze Asset Balance
message TronUnfreezeAssetContract {
}
// Withdraw witness balance
message TronWithdrawBalanceContract {
}
// Update Asset
message TronUpdateAssetContract {
optional string description = 1; // New description
optional string url = 2; // New URL
}
// Network proposal contract
message TronProposalCreateContract {
message TronProposalParameters {
optional uint64 key = 1; // Parameter key
optional uint64 value = 2; // Parameter value
}
repeated TronProposalParameters parameters = 1; // Parameter to be changed
}
// Approval contract
message TronProposalApproveContract {
optional uint64 proposal_id = 1; // Proposal ID
optional bool is_add_approval = 2; // Add or remove approval
}
// Delete proposal
message TronProposalDeleteContract {
optional uint64 proposal_id = 1; // Proposal ID
}
optional TronTransferContract transfer_contract = 1;
optional TronTransferAssetContract transfer_asset_contract = 2;
optional TronVoteWitnessContract vote_witness_contract = 4;
optional TronWitnessCreateContract witness_create_contract = 5;
optional TronAssetIssueContract asset_issue_contract = 6;
optional TronWitnessUpdateContract witness_update_contract = 8;
optional TronParticipateAssetIssueContract participate_asset_issue_contract = 9;
optional TronAccountUpdateContract account_update_contract = 10;
optional TronFreezeBalanceContract freeze_balance_contract = 11;
optional TronUnfreezeBalanceContract unfreeze_balance_contract = 12;
optional TronWithdrawBalanceContract withdraw_balance_contract = 13;
optional TronUnfreezeAssetContract unfreeze_asset_contract = 14;
optional TronUpdateAssetContract update_asset_contract = 15;
optional TronProposalCreateContract proposal_create_contract = 16;
optional TronProposalApproveContract proposal_approve_contract = 17;
optional TronProposalDeleteContract proposal_delete_contract = 18;
}
}
/**
* Response: Contains Tron transaction signature
* @end
*/
message TronSignedTx {
optional bytes signature = 1; // Transaction signature
optional bytes serialized_tx = 2; // Serialized transaction
}

View File

@ -1,18 +0,0 @@
# Automatically generated by pb2py
# fmt: off
from .. import protobuf as p
class TronAccountUpdateContract(p.MessageType):
def __init__(
self,
account_name: str = None,
) -> None:
self.account_name = account_name
@classmethod
def get_fields(cls):
return {
1: ('account_name', p.UnicodeType, 0),
}

View File

@ -1,19 +0,0 @@
# Automatically generated by pb2py
# fmt: off
from .. import protobuf as p
class TronAddress(p.MessageType):
MESSAGE_WIRE_TYPE = 251
def __init__(
self,
address: str = None,
) -> None:
self.address = address
@classmethod
def get_fields(cls):
return {
1: ('address', p.UnicodeType, 0),
}

View File

@ -1,53 +0,0 @@
# Automatically generated by pb2py
# fmt: off
from .. import protobuf as p
from .TronFrozenSupply import TronFrozenSupply
if __debug__:
try:
from typing import List
except ImportError:
List = None # type: ignore
class TronAssetIssueContract(p.MessageType):
def __init__(
self,
name: str = None,
abbr: str = None,
total_supply: int = None,
frozen_supply: List[TronFrozenSupply] = None,
trx_num: int = None,
num: int = None,
start_time: int = None,
end_time: int = None,
description: str = None,
url: str = None,
) -> None:
self.name = name
self.abbr = abbr
self.total_supply = total_supply
self.frozen_supply = frozen_supply if frozen_supply is not None else []
self.trx_num = trx_num
self.num = num
self.start_time = start_time
self.end_time = end_time
self.description = description
self.url = url
@classmethod
def get_fields(cls):
return {
2: ('name', p.UnicodeType, 0),
3: ('abbr', p.UnicodeType, 0),
4: ('total_supply', p.UVarintType, 0),
5: ('frozen_supply', TronFrozenSupply, p.FLAG_REPEATED),
6: ('trx_num', p.UVarintType, 0),
7: ('num', p.UVarintType, 0),
8: ('start_time', p.UVarintType, 0),
9: ('end_time', p.UVarintType, 0),
10: ('description', p.UnicodeType, 0),
11: ('url', p.UnicodeType, 0),
}

View File

@ -1,80 +0,0 @@
# Automatically generated by pb2py
# fmt: off
from .. import protobuf as p
from .TronAccountUpdateContract import TronAccountUpdateContract
from .TronAssetIssueContract import TronAssetIssueContract
from .TronFreezeBalanceContract import TronFreezeBalanceContract
from .TronParticipateAssetIssueContract import TronParticipateAssetIssueContract
from .TronProposalApproveContract import TronProposalApproveContract
from .TronProposalCreateContract import TronProposalCreateContract
from .TronProposalDeleteContract import TronProposalDeleteContract
from .TronTransferAssetContract import TronTransferAssetContract
from .TronTransferContract import TronTransferContract
from .TronUnfreezeAssetContract import TronUnfreezeAssetContract
from .TronUnfreezeBalanceContract import TronUnfreezeBalanceContract
from .TronUpdateAssetContract import TronUpdateAssetContract
from .TronVoteWitnessContract import TronVoteWitnessContract
from .TronWithdrawBalanceContract import TronWithdrawBalanceContract
from .TronWitnessCreateContract import TronWitnessCreateContract
from .TronWitnessUpdateContract import TronWitnessUpdateContract
class TronContract(p.MessageType):
def __init__(
self,
transfer_contract: TronTransferContract = None,
transfer_asset_contract: TronTransferAssetContract = None,
vote_witness_contract: TronVoteWitnessContract = None,
witness_create_contract: TronWitnessCreateContract = None,
asset_issue_contract: TronAssetIssueContract = None,
witness_update_contract: TronWitnessUpdateContract = None,
participate_asset_issue_contract: TronParticipateAssetIssueContract = None,
account_update_contract: TronAccountUpdateContract = None,
freeze_balance_contract: TronFreezeBalanceContract = None,
unfreeze_balance_contract: TronUnfreezeBalanceContract = None,
withdraw_balance_contract: TronWithdrawBalanceContract = None,
unfreeze_asset_contract: TronUnfreezeAssetContract = None,
update_asset_contract: TronUpdateAssetContract = None,
proposal_create_contract: TronProposalCreateContract = None,
proposal_approve_contract: TronProposalApproveContract = None,
proposal_delete_contract: TronProposalDeleteContract = None,
) -> None:
self.transfer_contract = transfer_contract
self.transfer_asset_contract = transfer_asset_contract
self.vote_witness_contract = vote_witness_contract
self.witness_create_contract = witness_create_contract
self.asset_issue_contract = asset_issue_contract
self.witness_update_contract = witness_update_contract
self.participate_asset_issue_contract = participate_asset_issue_contract
self.account_update_contract = account_update_contract
self.freeze_balance_contract = freeze_balance_contract
self.unfreeze_balance_contract = unfreeze_balance_contract
self.withdraw_balance_contract = withdraw_balance_contract
self.unfreeze_asset_contract = unfreeze_asset_contract
self.update_asset_contract = update_asset_contract
self.proposal_create_contract = proposal_create_contract
self.proposal_approve_contract = proposal_approve_contract
self.proposal_delete_contract = proposal_delete_contract
@classmethod
def get_fields(cls):
return {
1: ('transfer_contract', TronTransferContract, 0),
2: ('transfer_asset_contract', TronTransferAssetContract, 0),
4: ('vote_witness_contract', TronVoteWitnessContract, 0),
5: ('witness_create_contract', TronWitnessCreateContract, 0),
6: ('asset_issue_contract', TronAssetIssueContract, 0),
8: ('witness_update_contract', TronWitnessUpdateContract, 0),
9: ('participate_asset_issue_contract', TronParticipateAssetIssueContract, 0),
10: ('account_update_contract', TronAccountUpdateContract, 0),
11: ('freeze_balance_contract', TronFreezeBalanceContract, 0),
12: ('unfreeze_balance_contract', TronUnfreezeBalanceContract, 0),
13: ('withdraw_balance_contract', TronWithdrawBalanceContract, 0),
14: ('unfreeze_asset_contract', TronUnfreezeAssetContract, 0),
15: ('update_asset_contract', TronUpdateAssetContract, 0),
16: ('proposal_create_contract', TronProposalCreateContract, 0),
17: ('proposal_approve_contract', TronProposalApproveContract, 0),
18: ('proposal_delete_contract', TronProposalDeleteContract, 0),
}

View File

@ -1,21 +0,0 @@
# Automatically generated by pb2py
# fmt: off
from .. import protobuf as p
class TronFreezeBalanceContract(p.MessageType):
def __init__(
self,
frozen_balance: int = None,
frozen_duration: int = None,
) -> None:
self.frozen_balance = frozen_balance
self.frozen_duration = frozen_duration
@classmethod
def get_fields(cls):
return {
1: ('frozen_balance', p.UVarintType, 0),
2: ('frozen_duration', p.UVarintType, 0),
}

View File

@ -1,21 +0,0 @@
# Automatically generated by pb2py
# fmt: off
from .. import protobuf as p
class TronFrozenSupply(p.MessageType):
def __init__(
self,
frozen_amount: int = None,
frozen_days: int = None,
) -> None:
self.frozen_amount = frozen_amount
self.frozen_days = frozen_days
@classmethod
def get_fields(cls):
return {
1: ('frozen_amount', p.UVarintType, 0),
2: ('frozen_days', p.UVarintType, 0),
}

View File

@ -1,28 +0,0 @@
# Automatically generated by pb2py
# fmt: off
from .. import protobuf as p
if __debug__:
try:
from typing import List
except ImportError:
List = None # type: ignore
class TronGetAddress(p.MessageType):
MESSAGE_WIRE_TYPE = 250
def __init__(
self,
address_n: List[int] = None,
show_display: 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):
return {
1: ('address_n', p.UVarintType, p.FLAG_REPEATED),
2: ('show_display', p.BoolType, 0),
}

View File

@ -1,24 +0,0 @@
# Automatically generated by pb2py
# fmt: off
from .. import protobuf as p
class TronParticipateAssetIssueContract(p.MessageType):
def __init__(
self,
to_address: bytes = None,
asset_name: str = None,
amount: int = None,
) -> None:
self.to_address = to_address
self.asset_name = asset_name
self.amount = amount
@classmethod
def get_fields(cls):
return {
1: ('to_address', p.BytesType, 0),
2: ('asset_name', p.UnicodeType, 0),
3: ('amount', p.UVarintType, 0),
}

View File

@ -1,21 +0,0 @@
# Automatically generated by pb2py
# fmt: off
from .. import protobuf as p
class TronProposalApproveContract(p.MessageType):
def __init__(
self,
proposal_id: int = None,
is_add_approval: bool = None,
) -> None:
self.proposal_id = proposal_id
self.is_add_approval = is_add_approval
@classmethod
def get_fields(cls):
return {
1: ('proposal_id', p.UVarintType, 0),
2: ('is_add_approval', p.BoolType, 0),
}

View File

@ -1,26 +0,0 @@
# Automatically generated by pb2py
# fmt: off
from .. import protobuf as p
from .TronProposalParameters import TronProposalParameters
if __debug__:
try:
from typing import List
except ImportError:
List = None # type: ignore
class TronProposalCreateContract(p.MessageType):
def __init__(
self,
parameters: List[TronProposalParameters] = None,
) -> None:
self.parameters = parameters if parameters is not None else []
@classmethod
def get_fields(cls):
return {
1: ('parameters', TronProposalParameters, p.FLAG_REPEATED),
}

View File

@ -1,18 +0,0 @@
# Automatically generated by pb2py
# fmt: off
from .. import protobuf as p
class TronProposalDeleteContract(p.MessageType):
def __init__(
self,
proposal_id: int = None,
) -> None:
self.proposal_id = proposal_id
@classmethod
def get_fields(cls):
return {
1: ('proposal_id', p.UVarintType, 0),
}

View File

@ -1,21 +0,0 @@
# Automatically generated by pb2py
# fmt: off
from .. import protobuf as p
class TronProposalParameters(p.MessageType):
def __init__(
self,
key: int = None,
value: int = None,
) -> None:
self.key = key
self.value = value
@classmethod
def get_fields(cls):
return {
1: ('key', p.UVarintType, 0),
2: ('value', p.UVarintType, 0),
}

View File

@ -1,45 +0,0 @@
# Automatically generated by pb2py
# fmt: off
from .. import protobuf as p
from .TronContract import TronContract
if __debug__:
try:
from typing import List
except ImportError:
List = None # type: ignore
class TronSignTx(p.MessageType):
MESSAGE_WIRE_TYPE = 252
def __init__(
self,
address_n: List[int] = None,
ref_block_bytes: bytes = None,
ref_block_hash: bytes = None,
expiration: int = None,
data: str = None,
contract: TronContract = None,
timestamp: int = None,
) -> None:
self.address_n = address_n if address_n is not None else []
self.ref_block_bytes = ref_block_bytes
self.ref_block_hash = ref_block_hash
self.expiration = expiration
self.data = data
self.contract = contract
self.timestamp = timestamp
@classmethod
def get_fields(cls):
return {
1: ('address_n', p.UVarintType, p.FLAG_REPEATED),
2: ('ref_block_bytes', p.BytesType, 0),
3: ('ref_block_hash', p.BytesType, 0),
4: ('expiration', p.UVarintType, 0),
5: ('data', p.UnicodeType, 0),
6: ('contract', TronContract, 0),
7: ('timestamp', p.UVarintType, 0),
}

View File

@ -1,22 +0,0 @@
# Automatically generated by pb2py
# fmt: off
from .. import protobuf as p
class TronSignedTx(p.MessageType):
MESSAGE_WIRE_TYPE = 253
def __init__(
self,
signature: bytes = None,
serialized_tx: bytes = None,
) -> None:
self.signature = signature
self.serialized_tx = serialized_tx
@classmethod
def get_fields(cls):
return {
1: ('signature', p.BytesType, 0),
2: ('serialized_tx', p.BytesType, 0),
}

View File

@ -1,24 +0,0 @@
# Automatically generated by pb2py
# fmt: off
from .. import protobuf as p
class TronTransferAssetContract(p.MessageType):
def __init__(
self,
asset_name: str = None,
to_address: bytes = None,
amount: int = None,
) -> None:
self.asset_name = asset_name
self.to_address = to_address
self.amount = amount
@classmethod
def get_fields(cls):
return {
1: ('asset_name', p.UnicodeType, 0),
2: ('to_address', p.BytesType, 0),
3: ('amount', p.UVarintType, 0),
}

View File

@ -1,21 +0,0 @@
# Automatically generated by pb2py
# fmt: off
from .. import protobuf as p
class TronTransferContract(p.MessageType):
def __init__(
self,
to_address: bytes = None,
amount: int = None,
) -> None:
self.to_address = to_address
self.amount = amount
@classmethod
def get_fields(cls):
return {
1: ('to_address', p.BytesType, 0),
2: ('amount', p.UVarintType, 0),
}

View File

@ -1,7 +0,0 @@
# Automatically generated by pb2py
# fmt: off
from .. import protobuf as p
class TronUnfreezeAssetContract(p.MessageType):
pass

View File

@ -1,7 +0,0 @@
# Automatically generated by pb2py
# fmt: off
from .. import protobuf as p
class TronUnfreezeBalanceContract(p.MessageType):
pass

View File

@ -1,21 +0,0 @@
# Automatically generated by pb2py
# fmt: off
from .. import protobuf as p
class TronUpdateAssetContract(p.MessageType):
def __init__(
self,
description: str = None,
url: str = None,
) -> None:
self.description = description
self.url = url
@classmethod
def get_fields(cls):
return {
1: ('description', p.UnicodeType, 0),
2: ('url', p.UnicodeType, 0),
}

View File

@ -1,21 +0,0 @@
# Automatically generated by pb2py
# fmt: off
from .. import protobuf as p
class TronVote(p.MessageType):
def __init__(
self,
vote_address: bytes = None,
vote_count: int = None,
) -> None:
self.vote_address = vote_address
self.vote_count = vote_count
@classmethod
def get_fields(cls):
return {
1: ('vote_address', p.BytesType, 0),
2: ('vote_count', p.UVarintType, 0),
}

View File

@ -1,26 +0,0 @@
# Automatically generated by pb2py
# fmt: off
from .. import protobuf as p
from .TronVote import TronVote
if __debug__:
try:
from typing import List
except ImportError:
List = None # type: ignore
class TronVoteWitnessContract(p.MessageType):
def __init__(
self,
votes: List[TronVote] = None,
) -> None:
self.votes = votes if votes is not None else []
@classmethod
def get_fields(cls):
return {
1: ('votes', TronVote, p.FLAG_REPEATED),
}

View File

@ -1,7 +0,0 @@
# Automatically generated by pb2py
# fmt: off
from .. import protobuf as p
class TronWithdrawBalanceContract(p.MessageType):
pass

View File

@ -1,18 +0,0 @@
# Automatically generated by pb2py
# fmt: off
from .. import protobuf as p
class TronWitnessCreateContract(p.MessageType):
def __init__(
self,
url: str = None,
) -> None:
self.url = url
@classmethod
def get_fields(cls):
return {
1: ('url', p.UnicodeType, 0),
}

View File

@ -1,18 +0,0 @@
# Automatically generated by pb2py
# fmt: off
from .. import protobuf as p
class TronWitnessUpdateContract(p.MessageType):
def __init__(
self,
update_url: str = None,
) -> None:
self.update_url = update_url
@classmethod
def get_fields(cls):
return {
2: ('update_url', p.UnicodeType, 0),
}

View File

@ -239,30 +239,6 @@ from .TezosSignTx import TezosSignTx
from .TezosSignedTx import TezosSignedTx
from .TezosTransactionOp import TezosTransactionOp
from .TransactionType import TransactionType
from .TronAccountUpdateContract import TronAccountUpdateContract
from .TronAddress import TronAddress
from .TronAssetIssueContract import TronAssetIssueContract
from .TronContract import TronContract
from .TronFreezeBalanceContract import TronFreezeBalanceContract
from .TronFrozenSupply import TronFrozenSupply
from .TronGetAddress import TronGetAddress
from .TronParticipateAssetIssueContract import TronParticipateAssetIssueContract
from .TronProposalApproveContract import TronProposalApproveContract
from .TronProposalCreateContract import TronProposalCreateContract
from .TronProposalDeleteContract import TronProposalDeleteContract
from .TronProposalParameters import TronProposalParameters
from .TronSignTx import TronSignTx
from .TronSignedTx import TronSignedTx
from .TronTransferAssetContract import TronTransferAssetContract
from .TronTransferContract import TronTransferContract
from .TronUnfreezeAssetContract import TronUnfreezeAssetContract
from .TronUnfreezeBalanceContract import TronUnfreezeBalanceContract
from .TronUpdateAssetContract import TronUpdateAssetContract
from .TronVote import TronVote
from .TronVoteWitnessContract import TronVoteWitnessContract
from .TronWithdrawBalanceContract import TronWithdrawBalanceContract
from .TronWitnessCreateContract import TronWitnessCreateContract
from .TronWitnessUpdateContract import TronWitnessUpdateContract
from .TxAck import TxAck
from .TxInputType import TxInputType
from .TxOutputBinType import TxOutputBinType