add tron support

This commit is contained in:
Matthew Fosse 2024-05-06 11:13:02 -07:00
parent c126c5ca0e
commit 385b6701d1
2 changed files with 13 additions and 2 deletions

View file

@ -551,8 +551,18 @@ abstract class TronWalletBase
}
@override
Future<String> signMessage(String message, {String? address}) async =>
_tronPrivateKey.signPersonalMessage(ascii.encode(message));
Future<String> signMessage(String message, {String? address}) async {
return _tronPrivateKey.signPersonalMessage(ascii.encode(message));
}
@override
Future<bool> verifyMessage(String message, String signature, {String? address}) async {
if (address == null) {
return false;
}
TronPublicKey pubKey = TronPublicKey.fromPersonalSignature(ascii.encode(message), signature)!;
return pubKey.toAddress().toString() == address;
}
String getTronBase58AddressFromHex(String hexAddress) {
return TronAddress(hexAddress).toAddress();

View file

@ -382,6 +382,7 @@ abstract class DashboardViewModelBase with Store {
WalletType.solana,
WalletType.nano,
WalletType.banano,
WalletType.tron,
].contains(wallet.type);
bool get showRepWarning {