Open BlockchainDeveloper009 opened 2 years ago
hi @BlockchainDeveloper009 the getAccounts()
function you provided doesn't look to be returning anything but a Task
. Also looks like you aren't printing the results from accounts. Here is some of your code modified:
public class Program
{
public static async Task<IEnumerable<Services.Accounts.Models.Account>> getAccounts()
{
var apiKey = "";
var apiSecret = "";
var passphrase = "";
try
{
var authenticator = new Authenticator(apiKey, apiSecret, passphrase);
//create the CoinbasePro client
var coinbaseProClient = new CoinbaseProClient(authenticator);
//use one of the services
return await coinbaseProClient.AccountsService.GetAllAccountsAsync();
}
catch (Exception e)
{
Console.WriteLine(e.Message);
throw;
}
}
public static async Task Main(string[] args)
{
var accounts = await getAccounts();
foreach (var account in accounts)
{
Console.WriteLine(account.Id);
}
Console.ReadKey();
}
}
hope this helps!
Hello,
I am trying to use your project. Please find below code for your reference.
calling main Program:
static void Main(string[] args) { getAccounts(); console.ReadKey(); // }
What am i doing wrong????