Skip to content

Program exits abruptly after the call to async method #300

Open
@BlockchainDeveloper009

Description

@BlockchainDeveloper009

Hello,

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;
            }

        }

calling main Program:

static void Main(string[] args)
{
getAccounts();
console.ReadKey(); //
}

What am i doing wrong????

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions