Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add personalSign method #39

Merged
merged 2 commits into from May 10, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 18 additions & 0 deletions lib/src/providers/ethereum_walletconnect_provider.dart
Expand Up @@ -33,6 +33,24 @@ class EthereumWalletConnectProvider extends WalletConnectProvider {
return result;
}

/// Signs method calculates an Ethereum specific signature.
/// [address] - 20B address
/// [message] - message to sign
/// [password] - The password of the account to sign data with
///
/// Returns signature.
Future<String> personalSign(
{required String message,
required String address,
required String password}) async {
final result = await connector.sendCustomRequest(
method: 'personal_sign',
params: [address, message, password],
);

return result;
}

/// Calculates an Ethereum-specific signature.
/// [address] - 20B address
/// [typedData] - message to sign containing type information, a domain separator, and data
Expand Down