You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to use your project. Please find below code for your reference.
public static async Task getAccounts()
{
var apiKey = "";
var apiSecret = "";
var passphrase = "";
try
{
//create an authenticator with your apiKey, apiSecret and passphrase
var authenticator = new Authenticator(apiKey, apiSecret, passphrase);
//create the CoinbasePro client
var coinbaseProClient = new CoinbasePro.CoinbaseProClient(authenticator);
//use one of the services
var allAccounts = await coinbaseProClient.AccountsService.GetAllAccountsAsync(); // once this line executed, this method quits to main program.
console.Write("I would like to print results."); //this line is not executed.
}
catch (Exception e)
{
Console.WriteLine(e.Message);
throw;
}
}
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:
publicclassProgram{publicstaticasyncTask<IEnumerable<Services.Accounts.Models.Account>>getAccounts(){varapiKey="";varapiSecret="";varpassphrase="";try{varauthenticator=newAuthenticator(apiKey,apiSecret,passphrase);//create the CoinbasePro clientvarcoinbaseProClient=newCoinbaseProClient(authenticator);//use one of the services returnawaitcoinbaseProClient.AccountsService.GetAllAccountsAsync();}catch(Exceptione){Console.WriteLine(e.Message);throw;}}publicstaticasyncTaskMain(string[]args){varaccounts=awaitgetAccounts();foreach(varaccountinaccounts){Console.WriteLine(account.Id);}Console.ReadKey();}}
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????
The text was updated successfully, but these errors were encountered: