Skip to content

Commit 0e6f6cf

Browse files
authored
bump firmware version to 2.8.0 (#224)
* fix(legacy): fix tron dapp sign * feat(legacy): add algorand support * chore(legacy): bump firmware version to 2.8.0
1 parent d5e105a commit 0e6f6cf

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+4095
-33
lines changed
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
syntax = "proto2";
2+
package hw.trezor.messages.algorand;
3+
4+
// Sugar for easier handling in Java
5+
option java_package = "com.satoshilabs.trezor.lib.protobuf";
6+
option java_outer_classname = "TrezorMessageAlgorand";
7+
8+
/**
9+
* Request: Ask device for Algorand address corresponding to address_n path
10+
* @start
11+
* @next AlgorandAddress
12+
* @next Failure
13+
*/
14+
message AlgorandGetAddress {
15+
repeated uint32 address_n = 1; // BIP-32 path to derive the key from master node
16+
optional bool show_display = 3; // Optionally show on display before sending the result
17+
}
18+
19+
/**
20+
* Response: Contains Algorand address derived from device private seed
21+
* @end
22+
*/
23+
message AlgorandAddress {
24+
optional string address = 1; // Algorand address
25+
}
26+
27+
/**
28+
* Request: Ask device to sign Algorand transaction
29+
* @start
30+
* @next AlgorandSignedTx
31+
*/
32+
message AlgorandSignTx {
33+
repeated uint32 address_n = 1; // BIP-32 path to derive the key from master node
34+
required bytes raw_tx = 2; // serialized raw transaction
35+
}
36+
37+
/**
38+
* Response: Contains Algorand transaction signature
39+
* @end
40+
*/
41+
message AlgorandSignedTx {
42+
required bytes signature = 1; // Transaction signature
43+
}

common/protob/messages.proto

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -422,4 +422,10 @@ enum MessageType {
422422
MessageType_NearSignTx = 10703 [(wire_in) = true];
423423
MessageType_NearSignedTx = 10704 [(wire_out) = true];
424424

425+
// Algorand
426+
MessageType_AlgorandGetAddress = 10900 [(wire_in) = true];
427+
MessageType_AlgorandAddress = 10901 [(wire_out) = true];
428+
MessageType_AlgorandSignTx = 10902 [(wire_in) = true];
429+
MessageType_AlgorandSignedTx = 10903 [(wire_out) = true];
430+
425431
}

core/src/trezor/enums/MessageType.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,3 +276,7 @@
276276
NearAddress = 10702
277277
NearSignTx = 10703
278278
NearSignedTx = 10704
279+
AlgorandGetAddress = 10900
280+
AlgorandAddress = 10901
281+
AlgorandSignTx = 10902
282+
AlgorandSignedTx = 10903

core/src/trezor/enums/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,10 @@ class MessageType(IntEnum):
288288
NearAddress = 10702
289289
NearSignTx = 10703
290290
NearSignedTx = 10704
291+
AlgorandGetAddress = 10900
292+
AlgorandAddress = 10901
293+
AlgorandSignTx = 10902
294+
AlgorandSignedTx = 10903
291295

292296
class BinanceOrderType(IntEnum):
293297
OT_UNKNOWN = 0

core/src/trezor/messages.py

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6517,3 +6517,63 @@ def __init__(
65176517
@classmethod
65186518
def is_type_of(cls, msg: protobuf.MessageType) -> TypeGuard["ConfluxSignMessageCIP23"]:
65196519
return isinstance(msg, cls)
6520+
6521+
class AlgorandGetAddress(protobuf.MessageType):
6522+
address_n: "list[int]"
6523+
show_display: "bool | None"
6524+
6525+
def __init__(
6526+
self,
6527+
*,
6528+
address_n: "list[int] | None" = None,
6529+
show_display: "bool | None" = None,
6530+
) -> None:
6531+
pass
6532+
6533+
@classmethod
6534+
def is_type_of(cls, msg: protobuf.MessageType) -> TypeGuard["AlgorandGetAddress"]:
6535+
return isinstance(msg, cls)
6536+
6537+
class AlgorandAddress(protobuf.MessageType):
6538+
address: "str | None"
6539+
6540+
def __init__(
6541+
self,
6542+
*,
6543+
address: "str | None" = None,
6544+
) -> None:
6545+
pass
6546+
6547+
@classmethod
6548+
def is_type_of(cls, msg: protobuf.MessageType) -> TypeGuard["AlgorandAddress"]:
6549+
return isinstance(msg, cls)
6550+
6551+
class AlgorandSignTx(protobuf.MessageType):
6552+
address_n: "list[int]"
6553+
raw_tx: "bytes"
6554+
6555+
def __init__(
6556+
self,
6557+
*,
6558+
raw_tx: "bytes",
6559+
address_n: "list[int] | None" = None,
6560+
) -> None:
6561+
pass
6562+
6563+
@classmethod
6564+
def is_type_of(cls, msg: protobuf.MessageType) -> TypeGuard["AlgorandSignTx"]:
6565+
return isinstance(msg, cls)
6566+
6567+
class AlgorandSignedTx(protobuf.MessageType):
6568+
signature: "bytes"
6569+
6570+
def __init__(
6571+
self,
6572+
*,
6573+
signature: "bytes",
6574+
) -> None:
6575+
pass
6576+
6577+
@classmethod
6578+
def is_type_of(cls, msg: protobuf.MessageType) -> TypeGuard["AlgorandSignedTx"]:
6579+
return isinstance(msg, cls)

0 commit comments

Comments
 (0)