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)

52 lines (51 loc) 1.39 kB
import HttpClient from './httpClient'; /** * Connection URL managing client */ export default class DomainClient { private _httpClient; private _domain; private _token; private _urlCache; private _retryIntervalInSeconds; private _logger; /** * Constructs domain client instance * @param {HttpClient} httpClient HTTP client * @param {String} token authorization token * @param {String} domain domain to connect to, default is agiliumtrade.agiliumtrade.ai */ constructor(httpClient: HttpClient, token: string, domain?: string); /** * Returns domain client domain * @returns {String} client domain */ get domain(): string; /** * Returns domain client token * @returns {String} client token */ get token(): string; /** * Returns the API URL * @param {String} host REST API host * @param {String} region host region * @returns {String} API URL */ getUrl(host: string, region: string): Promise<string>; /** * Returns domain settings * @returns {DomainSettings} domain settings */ getSettings(): Promise<DomainSettings>; private _updateDomain; } /** * Domain settings */ export declare type DomainSettings = { /** client api host name */ hostname: string; /** client api domain for regions */ domain: string; };