Skip to content

ajuna-network/Ajuna.NetWallet

Repository files navigation

Ajuna.NetWallet (NETStandard2.0)

ajuna-Header-1080p_with_logo

What is Ajuna.NetWallet ?

Build Nuget GitHub issues license contributors

Ajuna.NetWallet implements the basic functionality to create an account, and encrypt it on a device based filesystem.

It also:

  • Supports mnemonic, AES, SR25519 and ED25519 encryption.
  • Encodes and decodes substrate-based address formats in ss58.

Ajuna.NetWallet ideally extends Ajuna.NetApi which is the basic framework for accessing and handling JSON-RPC connections and handling all standard RPC calls exposed by the rpc.methods() of every substrate node.

Usage Examples

Check wallet Name and Password validity

// Check name validity
var wallet = new Wallet();
wallet.IsValidWalletName("1234");     // false
wallet.IsValidWalletName("wal_let"); // true

// Check password validity
wallet.IsValidPassword("1BCDefg");   // false
wallet.IsValidPassword("ABCDefg1"); // true

Create wallet with name, password and mnemonic

// Declare name, password and mnemonic
var walletName = "mnemonic_wallet";
var walletPassword = "aA1234dd"
var walletMnemonic = "tornado glad segment lift squirrel top ball soldier joy sudden edit advice";

var wallet = new Wallet();

// KeyType.Sr25519 and KeyType.Ed25519 can be both used. 
wallet.Create(walletPassword, , KeyType.Sr25519, Mnemonic.BIP39Wordlist.English , walletName);

// Confirm that wallet was successfully created
var isCreated = wallet.IsCreated;

Load wallet from device based filesystem and unlock it

// We will load the wallet that we created in the example above

var walletToUnlock = new Wallet();

// Load wallet
walletToUnlock.Load("mnemonic_wallet");

// Unlock wallet with password
walletToUnlock.Unlock("aA1234dd");

// Confirm that wallet is unlocked
var isUnlocked = walletToUnlock.IsUnlocked;

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages