mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2024-12-22 19:49:22 +00:00
add tron support
This commit is contained in:
parent
c126c5ca0e
commit
385b6701d1
2 changed files with 13 additions and 2 deletions
|
@ -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();
|
||||
|
|
|
@ -382,6 +382,7 @@ abstract class DashboardViewModelBase with Store {
|
|||
WalletType.solana,
|
||||
WalletType.nano,
|
||||
WalletType.banano,
|
||||
WalletType.tron,
|
||||
].contains(wallet.type);
|
||||
|
||||
bool get showRepWarning {
|
||||
|
|
Loading…
Reference in a new issue