/// <summary> /// Initializes a new instance of the <see cref="Kraken"/> class. /// </summary> /// <param name="key">The API key.</param> /// <param name="secret">The API secret.</param> /// <param name="rateLimitMilliseconds">The rate limit in milliseconds.</param> public KrakenApi(KrakenSymbolMapper symbolMapper, string key, string secret, int rateLimitMilliseconds = 5000) : base("Kraken Brokerage") { _restApi = new KrakenRestApi(key, secret, rateLimitMilliseconds); this.SymbolMapper = symbolMapper; // symbolMapper.UpdateSymbols(_restApi); }
/// <summary> /// Initializes a new instance of the <see cref="KrakenBrokerage"/> class. /// </summary> /// <param name="key">The Kraken access token (can be the user's personal access token or the access token obtained with OAuth by QC on behalf of the user)</param> /// <param name="secret">The account identifier.</param> public KrakenBrokerage(string key, string secret) : base("Kraken Brokerage") { _symbolMapper = new KrakenSymbolMapper(); _api = new KrakenApi(_symbolMapper, key, secret); // forward events received from API _api.OrderStatusChanged += (sender, orderEvent) => OnOrderEvent(orderEvent); _api.AccountChanged += (sender, accountEvent) => OnAccountChanged(accountEvent); _api.Message += (sender, messageEvent) => OnMessage(messageEvent); }