Skip to content

Commit 35e28ce

Browse files
authored
bump firmware version to 2.8.0 (#223)
* fix(legacy): fix tron dapp sign * feat(legacy): add algorand support * chore(legacy): bump firmware version to 2.8.0
1 parent f4df95c commit 35e28ce

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
@@ -427,6 +427,12 @@ enum MessageType {
427427
MessageType_NearSignTx = 10703 [(wire_in) = true];
428428
MessageType_NearSignedTx = 10704 [(wire_out) = true];
429429

430+
// Algorand
431+
MessageType_AlgorandGetAddress = 10900 [(wire_in) = true];
432+
MessageType_AlgorandAddress = 10901 [(wire_out) = true];
433+
MessageType_AlgorandSignTx = 10902 [(wire_in) = true];
434+
MessageType_AlgorandSignedTx = 10903 [(wire_out) = true];
435+
430436
//onekey
431437
MessageType_DeviceInfoSettings = 10001 [(wire_in) = true];
432438
MessageType_GetDeviceInfo = 10002 [(wire_in) = true];

core/src/trezor/enums/MessageType.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,10 @@
276276
NearAddress = 10702
277277
NearSignTx = 10703
278278
NearSignedTx = 10704
279+
AlgorandGetAddress = 10900
280+
AlgorandAddress = 10901
281+
AlgorandSignTx = 10902
282+
AlgorandSignedTx = 10903
279283
DeviceInfoSettings = 10001
280284
GetDeviceInfo = 10002
281285
DeviceInfo = 10003

core/src/trezor/enums/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,10 @@ class MessageType(IntEnum):
292292
NearAddress = 10702
293293
NearSignTx = 10703
294294
NearSignedTx = 10704
295+
AlgorandGetAddress = 10900
296+
AlgorandAddress = 10901
297+
AlgorandSignTx = 10902
298+
AlgorandSignedTx = 10903
295299
DeviceInfoSettings = 10001
296300
GetDeviceInfo = 10002
297301
DeviceInfo = 10003

core/src/trezor/messages.py

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6746,3 +6746,63 @@ def __init__(
67466746
@classmethod
67476747
def is_type_of(cls, msg: protobuf.MessageType) -> TypeGuard["ConfluxSignMessageCIP23"]:
67486748
return isinstance(msg, cls)
6749+
6750+
class AlgorandGetAddress(protobuf.MessageType):
6751+
address_n: "list[int]"
6752+
show_display: "bool | None"
6753+
6754+
def __init__(
6755+
self,
6756+
*,
6757+
address_n: "list[int] | None" = None,
6758+
show_display: "bool | None" = None,
6759+
) -> None:
6760+
pass
6761+
6762+
@classmethod
6763+
def is_type_of(cls, msg: protobuf.MessageType) -> TypeGuard["AlgorandGetAddress"]:
6764+
return isinstance(msg, cls)
6765+
6766+
class AlgorandAddress(protobuf.MessageType):
6767+
address: "str | None"
6768+
6769+
def __init__(
6770+
self,
6771+
*,
6772+
address: "str | None" = None,
6773+
) -> None:
6774+
pass
6775+
6776+
@classmethod
6777+
def is_type_of(cls, msg: protobuf.MessageType) -> TypeGuard["AlgorandAddress"]:
6778+
return isinstance(msg, cls)
6779+
6780+
class AlgorandSignTx(protobuf.MessageType):
6781+
address_n: "list[int]"
6782+
raw_tx: "bytes"
6783+
6784+
def __init__(
6785+
self,
6786+
*,
6787+
raw_tx: "bytes",
6788+
address_n: "list[int] | None" = None,
6789+
) -> None:
6790+
pass
6791+
6792+
@classmethod
6793+
def is_type_of(cls, msg: protobuf.MessageType) -> TypeGuard["AlgorandSignTx"]:
6794+
return isinstance(msg, cls)
6795+
6796+
class AlgorandSignedTx(protobuf.MessageType):
6797+
signature: "bytes"
6798+
6799+
def __init__(
6800+
self,
6801+
*,
6802+
signature: "bytes",
6803+
) -> None:
6804+
pass
6805+
6806+
@classmethod
6807+
def is_type_of(cls, msg: protobuf.MessageType) -> TypeGuard["AlgorandSignedTx"]:
6808+
return isinstance(msg, cls)

0 commit comments

Comments
 (0)