BrokerLogin - char* Accounts as input or output?

Posted By: AndrewAMD

BrokerLogin - char* Accounts as input or output? - 10/18/22 16:46

I took a peek at the Bittrex plugin code, and I saw this:
Code
DLLFUNC int BrokerLogin(char* User,char* Pwd,char* Type,char* Account)
{
	if(User) { // login
		memset(&G,0,sizeof(G));
		G.Amount = 0.00001;
		strcpy_s(G.Key,User);
		strcpy_s(G.Secret,Pwd);
		if(!*User || !*Pwd)
			showMsg("Prices only","");
		else if(!BrokerAccount(Account,NULL,NULL,NULL))
			return 0; // invalid credentials
		else 
			showMsg("Bittrex plugin",PLUGIN_VERSION); // all ok
		return 1;
	} else { // logout
		if(G.HttpId) 
			http_free(G.HttpId);
	}
	return 0;
}
As you can see, it is calling BrokerAccount, using Account as an input.

The documentation says that char* Account is an optional output of char[1024]. Is it also an input now? Does it pull from the Accounts.csv file then?
Posted By: jcl

Re: BrokerLogin - char* Accounts as input or output? - 10/18/22 17:40

Yes, it's the account Id from the list. The login function can optionally overwrite it, but if there is only one account for that login, nothing needs be filled.

Updated doc: https://zorro-project.com/manual/en/brokerplugin.htm
Posted By: AndrewAMD

Re: BrokerLogin - char* Accounts as input or output? - 10/18/22 18:38

That was fast, thanks!
© 2024 lite-C Forums