znn_sdk_dart 5.0.1-dev.1 copy "znn_sdk_dart: ^5.0.1-dev.1" to clipboard
znn_sdk_dart: ^5.0.1-dev.1 copied to clipboard

outdated

Zenon SDK for Dart and Flutter

znn_sdk_dart #

Pub package mirror for znn_sdk_dart: https://testnet.znn.space/#!downloads.md#SDKs

Import the znn_sdk_dart package #

To use the znn_sdk_dart plugin, follow the plugin installation instructions.

Use the package #

Add the following import to your Dart code:

import 'package:znn_sdk_dart/znn_sdk_dart.dart';
// For hexadecimal encoding and decoding
import 'package:hex/hex.dart';
final mnemonic =
    'route become dream access impulse price inform obtain engage ski believe awful absent pig thing vibrant possible exotic flee pepper marble rural fire fancy';

var keyStore = KeyStore.fromMnemonic(mnemonic);
var keyPair = keyStore.getKeyPair(0);
var privateKey = keyPair.getPrivateKey();
var publicKey = await keyPair.getPublicKey();
var address = await keyPair.address;

print('entropy: ${keyStore.entropy}');
print('private key: ${HEX.encode(privateKey!)}');
print('public key: ${HEX.encode(publicKey)}');
print('address: $address');
print('core bytes: ${HEX.encode(address!.core!)}');

Example #

See the example application source for a complete sample app using the znn_sdk_dart package.

Issues and feedback #

Please file issues to send feedback or report a bug. Thank you!