File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
client/src/ledger_app_clients/ethereum Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -83,6 +83,7 @@ class ParamType(IntEnum):
83
83
ENUM = 0x07
84
84
TRUSTED_NAME = 0x08
85
85
CALLDATA = 0x09
86
+ TOKEN = 0x0a
86
87
87
88
88
89
class TypeFamily (IntEnum ):
@@ -452,6 +453,26 @@ def serialize(self) -> bytes:
452
453
return payload
453
454
454
455
456
+ class ParamToken (TlvSerializable ):
457
+ version : int
458
+ addr : Value
459
+ native_currency : Optional [list [bytes ]]
460
+
461
+ def __init__ (self , version , addr : Value , native_currency : Optional [list [bytes ]] = None ):
462
+ self .version = version
463
+ self .addr = addr
464
+ self .native_currency = native_currency
465
+
466
+ def serialize (self ) -> bytes :
467
+ payload = bytearray ()
468
+ payload += self .serialize_field (0x00 , self .version )
469
+ payload += self .serialize_field (0x01 , self .addr .serialize ())
470
+ if self .native_currency is not None :
471
+ for nat_cur in self .native_currency :
472
+ payload += self .serialize_field (0x02 , nat_cur )
473
+ return payload
474
+
475
+
455
476
class Field (TlvSerializable ):
456
477
version : int
457
478
name : str
You can’t perform that action at this time.
0 commit comments