Esempio n. 1
0
 public async Task <IgResponse <AccountDetailsResponse> > AccountBalance()
 {
     return(await IgRestService.RestfulService <AccountDetailsResponse>(_uri + "accounts", HttpMethod.Get, "1", _conversationContext));
 }
Esempio n. 2
0
        //private async Task<string> SecurePassword(string rawPassword)
        //{
        //    var encryptedPassword = rawPassword;


        //    //Try encrypting password. If we can encrypt it, do so...
        //    var secureResponse = await fetchEncryptionKey();

        //    ekr = new EncryptionKeyResponse();
        //    ekr = secureResponse.Response;

        //    if (ekr != null)
        //    {
        //        byte[] encryptedBytes;

        //        // get a public key to ENCRYPT...
        //        Rsa rsa = new Rsa(Convert.FromBase64String(ekr.encryptionKey), true);

        //        encryptedBytes = rsa.RsaEncrypt(string.Format("{0}|{1}", rawPassword, ekr.timeStamp));
        //        encryptedPassword = Convert.ToBase64String(encryptedBytes);
        //    }
        //    return encryptedPassword;
        //}

        ///<Summary>
        ///Creates a trading session, obtaining session tokens for subsequent API access.
        ///<p>
        ///   Please note that region-specific <a href=/loginrestrictions>login restrictions</a> may apply.
        ///</p>
        ///@param authenticationRequest Client login credentials
        ///@return Client summary account information
        ///</Summary>

        public async Task <IgResponse <dto.endpoint.auth.session.v2.AuthenticationResponse> > authenticate(dto.endpoint.auth.session.v2.AuthenticationRequest authenticationRequest)
        {
            return(await _igRestService.RestfulService <dto.endpoint.auth.session.v2.AuthenticationResponse>("/gateway/deal/session", HttpMethod.Post, "2", _conversationContext, authenticationRequest));
        }