예제 #1
0
        private async Task <JArray> getCredentialsArray(string walletQuery)
        {
            try
            {
                var creds = await AnonCreds.ProverSearchCredentialsAsync(
                    d_openWallet, walletQuery);

                int count = creds.TotalCount;
                // return "0" if there are no records for the type and query
                // if (count == 0)
                //     return "0";

                // get count schema's
                string res = await AnonCreds.ProverFetchCredentialsAsync(
                    creds, count);

                // make response human readable
                JArray a = JArray.Parse(res);

                return(a);
            }
            catch (Exception e)
            {
                Console.WriteLine($"Error: {e.Message}");
                return(new JArray());;
            }
        }