{"size": 803, "ext": "js", "max_stars_repo_path": "bfx-hf-server/lib/platform.js", "max_stars_repo_name": "nomad-cr/bfx-hf-node", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "bfx-hf-server/lib/platform.js", "max_issues_repo_name": "nomad-cr/bfx-hf-node", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "bfx-hf-server/lib/platform.js", "max_forks_repo_name": "nomad-cr/bfx-hf-node", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 29.7407407407, "max_line_length": 118, "alphanum_fraction": 0.5330012453}
'use strict'

const debug = require('debug')('bfx:hf:platfomr')

module.exports = (platform) => {
    debug('determining platform from %s', platform)
    switch (platform) {
        case 'ETHFINEX':
            debug('platform ETHFINEX')
            return {
                WS_URL: 'wss://api.ethfinex.com/ws/2',
                REST_URL: 'https://api.ethfinex.com'
            }
        case 'BITFINEX':
        case null:
        case undefined:
            debug('platform BITFINEX')
            return {
                WS_URL: 'wss://api.bitfinex.com/ws/2',
                REST_URL: 'https://api.bitfinex.com'
            }
        default:
            debug('invalid or unspecified PLATFORM, should be ETHFINEX, BITFINEX or unspecified for default BITFINEX')
            process.exit(1)
    }
}
