Skip to content

Overview

One of the most important aspects of working with blockchain is the ability of signing transactions. The Polkadart Keyring package provide a convenient way to manage key pairs and sign transactions.

Installation

Add the following to your pubspec.yaml file:

pubspec.yaml
dependencies:
polkadart_keyring: ^0.4.4

Get the dependencies by running:

Terminal window
dart pub get

Sample usage

demo.dart
import 'package:polkadart_keyring/polkadart_keyring.dart';
Future<void> main(List<String> arguments) async {
final keyring = Keyring();
final keyPair = await keyring.fromUri('//Alice');
print('Alice address: ${keyPair.address}');
}

You will get the following output:

Alice address: 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY

The keyring is a very powerful tool and we will show you what you can do with it in the following sections.