mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-11-26 09:28:13 +00:00
update coins
This commit is contained in:
parent
3440ead4c9
commit
fa2f5fb33f
@ -6,37 +6,38 @@ coins = json.load(open('../vendor/trezor-common/coins.json', 'r'))
|
||||
fields = []
|
||||
|
||||
for c in coins:
|
||||
fields.append([
|
||||
'true' if c['coin_name'] is not None else 'false',
|
||||
'"%s"' % c['coin_name'] if c['coin_name'] is not None else 'NULL',
|
||||
if c['firmware']:
|
||||
fields.append([
|
||||
'true' if c['coin_name'] is not None else 'false',
|
||||
'"%s"' % c['coin_name'] if c['coin_name'] is not None else 'NULL',
|
||||
|
||||
'true' if c['coin_shortcut'] is not None else 'false',
|
||||
'" %s"' % c['coin_shortcut'] if c['coin_shortcut'] is not None else 'NULL',
|
||||
'true' if c['coin_shortcut'] is not None else 'false',
|
||||
'" %s"' % c['coin_shortcut'] if c['coin_shortcut'] is not None else 'NULL',
|
||||
|
||||
'true' if c['address_type'] is not None else 'false',
|
||||
'%d' % c['address_type'] if c['address_type'] is not None else '0',
|
||||
'true' if c['address_type'] is not None else 'false',
|
||||
'%d' % c['address_type'] if c['address_type'] is not None else '0',
|
||||
|
||||
'true' if c['maxfee_kb'] is not None else 'false',
|
||||
'%d' % c['maxfee_kb'] if c['maxfee_kb'] is not None else '0',
|
||||
'true' if c['maxfee_kb'] is not None else 'false',
|
||||
'%d' % c['maxfee_kb'] if c['maxfee_kb'] is not None else '0',
|
||||
|
||||
'true' if c['address_type_p2sh'] is not None else 'false',
|
||||
'%d' % c['address_type_p2sh'] if c['address_type_p2sh'] is not None else '0',
|
||||
'true' if c['address_type_p2sh'] is not None else 'false',
|
||||
'%d' % c['address_type_p2sh'] if c['address_type_p2sh'] is not None else '0',
|
||||
|
||||
'true' if c['signed_message_header'] is not None else 'false',
|
||||
'"\\x%02x" "%s"' % (len(c['signed_message_header']), c['signed_message_header'].replace('\n', '\\n')) if c['signed_message_header'] is not None else 'NULL',
|
||||
'true' if c['signed_message_header'] is not None else 'false',
|
||||
'"\\x%02x" "%s"' % (len(c['signed_message_header']), c['signed_message_header'].replace('\n', '\\n')) if c['signed_message_header'] is not None else 'NULL',
|
||||
|
||||
'true' if c['xpub_magic'] is not None else 'false',
|
||||
'0x%s' % c['xpub_magic'] if c['xpub_magic'] is not None else '00000000',
|
||||
'true' if c['xpub_magic'] is not None else 'false',
|
||||
'0x%s' % c['xpub_magic'] if c['xpub_magic'] is not None else '00000000',
|
||||
|
||||
'true' if c['xprv_magic'] is not None else 'false',
|
||||
'0x%s' % c['xprv_magic'] if c['xprv_magic'] is not None else '00000000',
|
||||
'true' if c['xprv_magic'] is not None else 'false',
|
||||
'0x%s' % c['xprv_magic'] if c['xprv_magic'] is not None else '00000000',
|
||||
|
||||
'true' if c['segwit'] is not None else 'false',
|
||||
'true' if c['segwit'] else 'false',
|
||||
'true' if c['segwit'] is not None else 'false',
|
||||
'true' if c['segwit'] else 'false',
|
||||
|
||||
'true' if c['forkid'] is not None else 'false',
|
||||
'%d' % c['forkid'] if c['forkid'] else '0'
|
||||
])
|
||||
'true' if c['forkid'] is not None else 'false',
|
||||
'%d' % c['forkid'] if c['forkid'] else '0'
|
||||
])
|
||||
|
||||
for j in range(len(fields[0])):
|
||||
l = max([len(x[j]) for x in fields]) + 1
|
||||
|
@ -28,8 +28,7 @@
|
||||
const CoinType coins[COINS_COUNT] = {
|
||||
{true, "Bitcoin", true, " BTC", true, 0, true, 500000, true, 5, true, "\x18" "Bitcoin Signed Message:\n", true, 0x0488b21e, true, 0x0488ade4, true, true, false, 0, },
|
||||
{true, "Testnet", true, " TEST", true, 111, true, 10000000, true, 196, true, "\x18" "Bitcoin Signed Message:\n", true, 0x043587cf, true, 0x04358394, true, true, false, 0, },
|
||||
{true, "Bitcoin Cash", true, " BCH", true, 0, true, 500000, true, 5, true, "\x18" "Bitcoin Signed Message:\n", true, 0x0488b21e, true, 0x0488ade4, true, false, true, 0, },
|
||||
{true, "Testnet Cash", true, " TBCH", true, 111, true, 10000000, true, 196, true, "\x18" "Bitcoin Signed Message:\n", true, 0x043587cf, true, 0x04358394, true, false, true, 0, },
|
||||
{true, "Bcash", true, " BCH", true, 0, true, 500000, true, 5, true, "\x18" "Bitcoin Signed Message:\n", true, 0x0488b21e, true, 0x0488ade4, true, false, true, 0, },
|
||||
{true, "Namecoin", true, " NMC", true, 52, true, 10000000, true, 5, true, "\x19" "Namecoin Signed Message:\n", true, 0x019da462, true, 0x019d9cfe, true, false, false, 0, },
|
||||
{true, "Litecoin", true, " LTC", true, 48, true, 40000000, true, 50, true, "\x19" "Litecoin Signed Message:\n", true, 0x019da462, true, 0x019d9cfe, true, true, false, 0, },
|
||||
{true, "Dogecoin", true, " DOGE", true, 30, true, 1000000000, true, 22, true, "\x19" "Dogecoin Signed Message:\n", true, 0x02facafd, true, 0x02fac398, true, false, false, 0, },
|
||||
|
@ -22,7 +22,7 @@
|
||||
|
||||
#include "types.pb.h"
|
||||
|
||||
#define COINS_COUNT 10
|
||||
#define COINS_COUNT 9
|
||||
|
||||
extern const CoinType coins[COINS_COUNT];
|
||||
|
||||
|
@ -2,7 +2,7 @@ Features.vendor max_size:33
|
||||
Features.device_id max_size:25
|
||||
Features.language max_size:17
|
||||
Features.label max_size:33
|
||||
Features.coins max_count:10
|
||||
Features.coins max_count:9
|
||||
Features.revision max_size:20
|
||||
Features.bootloader_hash max_size:32
|
||||
|
||||
@ -26,12 +26,12 @@ Entropy.entropy max_size:1024
|
||||
|
||||
GetPublicKey.address_n max_count:8
|
||||
GetPublicKey.ecdsa_curve_name max_size:32
|
||||
GetPublicKey.coin_name max_size:17
|
||||
GetPublicKey.coin_name max_size:21
|
||||
|
||||
PublicKey.xpub max_size:113
|
||||
|
||||
GetAddress.address_n max_count:8
|
||||
GetAddress.coin_name max_size:17
|
||||
GetAddress.coin_name max_size:21
|
||||
|
||||
Address.address max_size:60
|
||||
|
||||
@ -55,12 +55,12 @@ WordAck.word max_size:12
|
||||
|
||||
SignMessage.address_n max_count:8
|
||||
SignMessage.message max_size:1024
|
||||
SignMessage.coin_name max_size:17
|
||||
SignMessage.coin_name max_size:21
|
||||
|
||||
VerifyMessage.address max_size:60
|
||||
VerifyMessage.signature max_size:65
|
||||
VerifyMessage.message max_size:1024
|
||||
VerifyMessage.coin_name max_size:17
|
||||
VerifyMessage.coin_name max_size:21
|
||||
|
||||
MessageSignature.address max_size:60
|
||||
MessageSignature.signature max_size:65
|
||||
@ -80,7 +80,7 @@ EncryptMessage skip_message:true
|
||||
# EncryptMessage.pubkey max_size:33
|
||||
# EncryptMessage.message max_size:1024
|
||||
# EncryptMessage.address_n max_count:8
|
||||
# EncryptMessage.coin_name max_size:17
|
||||
# EncryptMessage.coin_name max_size:21
|
||||
|
||||
# deprecated
|
||||
EncryptedMessage skip_message:true
|
||||
@ -109,12 +109,12 @@ CipheredKeyValue.value max_size:1024
|
||||
|
||||
# deprecated
|
||||
EstimateTxSize skip_message:true
|
||||
# EstimateTxSize.coin_name max_size:17
|
||||
# EstimateTxSize.coin_name max_size:21
|
||||
|
||||
# deprecated
|
||||
TxSize skip_message:true
|
||||
|
||||
SignTx.coin_name max_size:17
|
||||
SignTx.coin_name max_size:21
|
||||
|
||||
EthereumSignTx.address_n max_count:8
|
||||
EthereumSignTx.nonce max_size:32
|
||||
|
@ -3,17 +3,17 @@
|
||||
|
||||
#include "messages.pb.h"
|
||||
|
||||
const char GetPublicKey_coin_name_default[17] = "Bitcoin";
|
||||
const char GetAddress_coin_name_default[17] = "Bitcoin";
|
||||
const char GetPublicKey_coin_name_default[21] = "Bitcoin";
|
||||
const char GetAddress_coin_name_default[21] = "Bitcoin";
|
||||
const InputScriptType GetAddress_script_type_default = InputScriptType_SPENDADDRESS;
|
||||
const char LoadDevice_language_default[17] = "english";
|
||||
const uint32_t ResetDevice_strength_default = 256u;
|
||||
const char ResetDevice_language_default[17] = "english";
|
||||
const char RecoveryDevice_language_default[17] = "english";
|
||||
const char SignMessage_coin_name_default[17] = "Bitcoin";
|
||||
const char SignMessage_coin_name_default[21] = "Bitcoin";
|
||||
const InputScriptType SignMessage_script_type_default = InputScriptType_SPENDADDRESS;
|
||||
const char VerifyMessage_coin_name_default[17] = "Bitcoin";
|
||||
const char SignTx_coin_name_default[17] = "Bitcoin";
|
||||
const char VerifyMessage_coin_name_default[21] = "Bitcoin";
|
||||
const char SignTx_coin_name_default[21] = "Bitcoin";
|
||||
const uint32_t SignTx_version_default = 1u;
|
||||
const uint32_t SignTx_lock_time_default = 0u;
|
||||
|
||||
|
@ -506,7 +506,7 @@ typedef struct _Features {
|
||||
bool has_label;
|
||||
char label[33];
|
||||
size_t coins_count;
|
||||
CoinType coins[10];
|
||||
CoinType coins[9];
|
||||
bool has_initialized;
|
||||
bool initialized;
|
||||
bool has_revision;
|
||||
@ -531,7 +531,7 @@ typedef struct _GetAddress {
|
||||
size_t address_n_count;
|
||||
uint32_t address_n[8];
|
||||
bool has_coin_name;
|
||||
char coin_name[17];
|
||||
char coin_name[21];
|
||||
bool has_show_display;
|
||||
bool show_display;
|
||||
bool has_multisig;
|
||||
@ -566,7 +566,7 @@ typedef struct _GetPublicKey {
|
||||
bool has_show_display;
|
||||
bool show_display;
|
||||
bool has_coin_name;
|
||||
char coin_name[17];
|
||||
char coin_name[21];
|
||||
} GetPublicKey;
|
||||
|
||||
typedef struct _LoadDevice {
|
||||
@ -701,7 +701,7 @@ typedef struct _SignMessage {
|
||||
uint32_t address_n[8];
|
||||
SignMessage_message_t message;
|
||||
bool has_coin_name;
|
||||
char coin_name[17];
|
||||
char coin_name[21];
|
||||
bool has_script_type;
|
||||
InputScriptType script_type;
|
||||
} SignMessage;
|
||||
@ -710,7 +710,7 @@ typedef struct _SignTx {
|
||||
uint32_t outputs_count;
|
||||
uint32_t inputs_count;
|
||||
bool has_coin_name;
|
||||
char coin_name[17];
|
||||
char coin_name[21];
|
||||
bool has_version;
|
||||
uint32_t version;
|
||||
bool has_lock_time;
|
||||
@ -773,7 +773,7 @@ typedef struct _VerifyMessage {
|
||||
bool has_message;
|
||||
VerifyMessage_message_t message;
|
||||
bool has_coin_name;
|
||||
char coin_name[17];
|
||||
char coin_name[21];
|
||||
} VerifyMessage;
|
||||
|
||||
typedef struct _WordAck {
|
||||
@ -786,24 +786,24 @@ typedef struct _WordRequest {
|
||||
} WordRequest;
|
||||
|
||||
/* Default values for struct fields */
|
||||
extern const char GetPublicKey_coin_name_default[17];
|
||||
extern const char GetAddress_coin_name_default[17];
|
||||
extern const char GetPublicKey_coin_name_default[21];
|
||||
extern const char GetAddress_coin_name_default[21];
|
||||
extern const InputScriptType GetAddress_script_type_default;
|
||||
extern const char LoadDevice_language_default[17];
|
||||
extern const uint32_t ResetDevice_strength_default;
|
||||
extern const char ResetDevice_language_default[17];
|
||||
extern const char RecoveryDevice_language_default[17];
|
||||
extern const char SignMessage_coin_name_default[17];
|
||||
extern const char SignMessage_coin_name_default[21];
|
||||
extern const InputScriptType SignMessage_script_type_default;
|
||||
extern const char VerifyMessage_coin_name_default[17];
|
||||
extern const char SignTx_coin_name_default[17];
|
||||
extern const char VerifyMessage_coin_name_default[21];
|
||||
extern const char SignTx_coin_name_default[21];
|
||||
extern const uint32_t SignTx_version_default;
|
||||
extern const uint32_t SignTx_lock_time_default;
|
||||
|
||||
/* Initializer values for message structs */
|
||||
#define Initialize_init_default {0}
|
||||
#define GetFeatures_init_default {0}
|
||||
#define Features_init_default {false, "", false, 0, false, 0, false, 0, false, 0, false, "", false, 0, false, 0, false, "", false, "", 0, {CoinType_init_default, CoinType_init_default, CoinType_init_default, CoinType_init_default, CoinType_init_default, CoinType_init_default, CoinType_init_default, CoinType_init_default, CoinType_init_default, CoinType_init_default}, false, 0, false, {0, {0}}, false, {0, {0}}, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0}
|
||||
#define Features_init_default {false, "", false, 0, false, 0, false, 0, false, 0, false, "", false, 0, false, 0, false, "", false, "", 0, {CoinType_init_default, CoinType_init_default, CoinType_init_default, CoinType_init_default, CoinType_init_default, CoinType_init_default, CoinType_init_default, CoinType_init_default, CoinType_init_default}, false, 0, false, {0, {0}}, false, {0, {0}}, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0}
|
||||
#define ClearSession_init_default {0}
|
||||
#define ApplySettings_init_default {false, "", false, "", false, 0, false, {0, {0}}}
|
||||
#define ApplyFlags_init_default {false, 0}
|
||||
@ -865,7 +865,7 @@ extern const uint32_t SignTx_lock_time_default;
|
||||
#define DebugLinkFlashErase_init_default {false, 0}
|
||||
#define Initialize_init_zero {0}
|
||||
#define GetFeatures_init_zero {0}
|
||||
#define Features_init_zero {false, "", false, 0, false, 0, false, 0, false, 0, false, "", false, 0, false, 0, false, "", false, "", 0, {CoinType_init_zero, CoinType_init_zero, CoinType_init_zero, CoinType_init_zero, CoinType_init_zero, CoinType_init_zero, CoinType_init_zero, CoinType_init_zero, CoinType_init_zero, CoinType_init_zero}, false, 0, false, {0, {0}}, false, {0, {0}}, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0}
|
||||
#define Features_init_zero {false, "", false, 0, false, 0, false, 0, false, 0, false, "", false, 0, false, 0, false, "", false, "", 0, {CoinType_init_zero, CoinType_init_zero, CoinType_init_zero, CoinType_init_zero, CoinType_init_zero, CoinType_init_zero, CoinType_init_zero, CoinType_init_zero, CoinType_init_zero}, false, 0, false, {0, {0}}, false, {0, {0}}, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0}
|
||||
#define ClearSession_init_zero {0}
|
||||
#define ApplySettings_init_zero {false, "", false, "", false, 0, false, {0, {0}}}
|
||||
#define ApplyFlags_init_zero {false, 0}
|
||||
@ -1159,7 +1159,7 @@ extern const pb_field_t DebugLinkFlashErase_fields[2];
|
||||
/* Maximum encoded size of messages (where known) */
|
||||
#define Initialize_size 0
|
||||
#define GetFeatures_size 0
|
||||
#define Features_size (279 + 10*CoinType_size)
|
||||
#define Features_size (273 + 9*CoinType_size)
|
||||
#define ClearSession_size 0
|
||||
#define ApplySettings_size 1083
|
||||
#define ApplyFlags_size 6
|
||||
@ -1176,9 +1176,9 @@ extern const pb_field_t DebugLinkFlashErase_fields[2];
|
||||
#define PassphraseAck_size 53
|
||||
#define GetEntropy_size 6
|
||||
#define Entropy_size 1027
|
||||
#define GetPublicKey_size 103
|
||||
#define GetPublicKey_size 107
|
||||
#define PublicKey_size (121 + HDNodeType_size)
|
||||
#define GetAddress_size (81 + MultisigRedeemScriptType_size)
|
||||
#define GetAddress_size (85 + MultisigRedeemScriptType_size)
|
||||
#define EthereumGetAddress_size 50
|
||||
#define Address_size 62
|
||||
#define EthereumAddress_size 22
|
||||
@ -1191,12 +1191,12 @@ extern const pb_field_t DebugLinkFlashErase_fields[2];
|
||||
#define RecoveryDevice_size 80
|
||||
#define WordRequest_size 6
|
||||
#define WordAck_size 14
|
||||
#define SignMessage_size 1100
|
||||
#define VerifyMessage_size 1175
|
||||
#define SignMessage_size 1104
|
||||
#define VerifyMessage_size 1179
|
||||
#define MessageSignature_size 129
|
||||
#define CipherKeyValue_size 1358
|
||||
#define CipheredKeyValue_size 1027
|
||||
#define SignTx_size 43
|
||||
#define SignTx_size 47
|
||||
#define TxRequest_size (18 + TxRequestDetailsType_size + TxRequestSerializedType_size)
|
||||
#define TxAck_size (6 + TransactionType_size)
|
||||
#define EthereumSignTx_size 1245
|
||||
|
2
vendor/trezor-common
vendored
2
vendor/trezor-common
vendored
@ -1 +1 @@
|
||||
Subproject commit dc1ed85c96e3766f9e99dc4c8af12ecf6de22f1e
|
||||
Subproject commit e7832b2beb2085ea02130db8ad090eaacdf8b2ff
|
Loading…
Reference in New Issue
Block a user