Signer is a dart client created to sign and verify raw data using mnemonic or seed.
Dart >= 3.2.0
This is a simple example to sign and verify data using mnemonic.
// Add your mnemonic
final mnemonic = 'your-mnemonic';
// Create Instance of signer
final signer = Signer();
// Initialize signer from mnemonic
await signer.fromMnemonic(mnemonic);
// Add your data
final data = "anydata123";
// Sign data with mnemonic
final signatureFromMnemonic = await signer.sign(data);
// Verify signed data with your mnemonic
final res = await signer.verify(signatureFromMnemonic, data);
This is a simple example to sign and verify data using hex seed.
// Create Instance of signer
final signer = Signer();
// Add your hex seed
final seed = '0x.....';
// Initialize signer from your seed
await signer.fromHexSeed(seed);
// Add your data
final data = "anydata123";
// Sign data with your seed
final signatureFromSeed = await signer.sign(data);
// Verify signed data with your mnemonic
final res = await signer.verify(signatureFromSeed, data);
To initialize workspace and get all packages, run the following command.
dart pub get
To run the tests, run the following command
dart test .
To generate coverage signer package, run the following command
make coverage
Check results from result.txt
with the following command
cat coverage/result.txt