예제 #1
0
		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;
				}
			}
		}
예제 #2
0
		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;
		}