public async static Task<Wallet> LoadAsync(FileInfo fileInfo) { using(var stream = FileStream.Create(fileInfo, FileMode.Open)) { using(var reader = new StreamReader(stream)) { var wallet = new Wallet(fileInfo); await wallet.ReadAsync(reader); return wallet; } } }
public static async Task<Wallet> CreateAsync(byte[] passphrase, FileInfo file = null, PrivateKeyCollection keys = null, AddressCollection publicAddresses = null, AddressCollection watchAddresses = null) { var wallet = new Wallet(file, keys, publicAddresses, watchAddresses); await wallet.LockAsync(passphrase); await wallet.UnlockAsync(passphrase); return wallet; }