private string  GetAuthMsg(ref bool bIsValid)
        {
            try
            {
                long   authNonce   = BitfinexAuthentication.CreateAuthNonce();
                string authPayload = BitfinexAuthentication.CreateAuthPayload(authNonce);
                string authSig     = BitfinexAuthentication.CreateSignature(authPayload, _apiSecret);

                RequestAuth reqAuth = new RequestAuth
                {
                    ApiKey      = _apiKey,
                    AuthNonce   = authNonce,
                    AuthSig     = authSig,
                    AuthPayload = authPayload
                };

                bIsValid = true;

                return(CBitfinexJsonSerializer.SerializeObject(reqAuth));
            }
            catch (Exception e)
            {
                Error("Unable gen AuthMsg");
                return("");
            }
        }
        private long GenUniqueId(int botId)
        {
            //After Bitfinex's modification of 2018-01-08
            //uid type was changed to int45 (truncated)
            //so 1000 was changed to 1
            //2018-10-01 changed  CreateAuthNonce => CreateAuthNonceShort
            long uid = /*1000*/ 1 * BitfinexAuthentication.CreateAuthNonceShort() + botId;

            return(uid);
        }