public ImportPrivateKeyAsync ( global request, CallOptions options ) : AsyncUnaryCall |
||
request | global | |
options | CallOptions | |
return | AsyncUnaryCall |
public AsyncUnaryCall<global::Walletrpc.ImportPrivateKeyResponse> ImportPrivateKeyAsync(global::Walletrpc.ImportPrivateKeyRequest request, CallOptions options)
{
var call = CreateCall(__Method_ImportPrivateKey, options);
return Calls.AsyncUnaryCall(call, request);
}
public global::Walletrpc.FundTransactionResponse FundTransaction(global::Walletrpc.FundTransactionRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
WalletService.WalletServiceClient::ImportPrivateKeyAsync ( global request, Metadata headers = null, DateTime deadline = null, CancellationToken cancellationToken = default(CancellationToken) ) : AsyncUnaryCall |
public async Task ImportPrivateKeyAsync(Account account, string privateKeyWif, bool rescan, string passphrase) { if (privateKeyWif == null) throw new ArgumentNullException(nameof(privateKeyWif)); if (passphrase == null) throw new ArgumentNullException(nameof(passphrase)); var client = new WalletService.WalletServiceClient(_channel); var request = new ImportPrivateKeyRequest { Account = account.AccountNumber, PrivateKeyWif = privateKeyWif, Rescan = rescan, Passphrase = ByteString.CopyFromUtf8(passphrase), // Poorly named: this outputs UTF8 from a UTF16 System.String }; await client.ImportPrivateKeyAsync(request, cancellationToken: _tokenSource.Token); }