/// <summary> /// Gets whether or not a pairwise record exists in the provided wallet for the specified DID . /// </summary> /// <param name="wallet">The wallet to check for a pairwise record.</param> /// <param name="theirDid">The DID to check.</param> /// <returns>An asynchronous <see cref="Task{T}"/> that resolves to true if a pairwise exists for the /// DID, otherwise false.</returns> public static Task <bool> IsExistsAsync(Wallet wallet, string theirDid) { var taskCompletionSource = new TaskCompletionSource <bool>(); var commandHandle = PendingCommands.Add(taskCompletionSource); int result = IndyNativeMethods.indy_is_pairwise_exists( commandHandle, wallet.Handle, theirDid, _isPairwiseExistsCallback); CallbackHelper.CheckResult(result); return(taskCompletionSource.Task); }