UNPKG

metaapi.cloud-sdk

Version:

SDK for MetaApi, a professional cloud forex API which includes MetaTrader REST API and MetaTrader websocket API. Supports both MetaTrader 5 (MT5) and MetaTrader 4 (MT4). CopyFactory copy trading API included. (https://metaapi.cloud)

43 lines (42 loc) 1.25 kB
import DomainClient from './domain.client'; import HttpClient from './httpClient'; /** * metaapi.cloud MetaTrader API client */ export default class MetaApiClient { protected _httpClient: any; protected _domainClient: any; protected _host: string; protected _token: any; /** * Constructs MetaTrader API client instance * @param {HttpClient} httpClient HTTP client * @param {DomainClient} domainClient domain client */ constructor(httpClient: HttpClient, domainClient: DomainClient); /** * Returns type of current token * @returns {string} Type of current token * @protected */ get _tokenType(): "" | "api" | "account"; /** * Checks that current token is not api token * @returns {boolean} Indicator of absence api token * @protected */ _isNotJwtToken(): boolean; /** * Checks that current token is not account token * @returns {boolean} Indicator of absence account token * @protected */ _isNotAccountToken(): boolean; /** * Handles no accessing to the method * @param {string} methodName Name of method * @protected * @throws */ _handleNoAccessError(methodName: any): Promise<never>; }