Exemple #1
0
		public BtceClient(SecureString key, SecureString secret)
		{
			//if (key == null)
			//	throw new ArgumentNullException("key");

			//if (secret == null)
			//	throw new ArgumentNullException("secret");

			_key = key.To<SecureString>();
			_hasher = new HMACSHA512(Encoding.ASCII.GetBytes(secret.To<string>() ?? string.Empty));

			// до 2038 года работать будет
			//_nonce = ( int )(DateTime.UtcNow - new DateTime( 1970, 1, 1 )).TotalSeconds;

			// по умолчанию к одному серверу обращается .DefaultPersistentConnectionLimit(2) запроса
			// остальные ставятся в очередь
			// мы можем одновременно запросить и стаканы и сделки и отменить заявку и т.д и т.п.
			// если никто не менял, то установим в наше значение
			//if (ServicePointManager.DefaultConnectionLimit == ServicePointManager.DefaultPersistentConnectionLimit)
			//	ServicePointManager.DefaultConnectionLimit = 7;

			_nonce = (int)(DateTime.UtcNow - TimeHelper.GregorianStart).TotalSeconds;
		}