require "SimBot/version" require 'thor' require 'pusher-client' require_relative 'apicontroller/barong' require_relative 'apicontroller/peatio' require_relative 'deamons/wash_trade' module SimBot # CLI for controlling the SimBot class CLI < Thor require 'utils' desc 'start', 'Start simulation bot parsing in base-url and auth token.' method_option :email, type: :string, default: 'admin@ovex.io', required: true, desc: 'Your OVEX email address' method_option :password, type: :string, default: '7P1CMgrr', required: true, desc: 'Your OVEX password' method_option :peatio_base_url, type: :string, default: 'https://api.review.ovex.io/api/v2', desc: 'Peatio API base URL' method_option :barong_base_url, type: :string, default: 'https://auth.review.ovex.io/api/v1', desc: 'Barong API base URL' method_option :app_id, type: :string, default: 'ceca08fbc83c2fb4eb53bb026489', desc: 'Peatio applicaiton id from Barong' method_option :market, type: :string, default: 'bchbtc', required: false, desc: 'OVEX market for SimBot to interact with' method_option :freq, type: :numeric, default: 1, desc: 'Frequency for trades to be added' def start jwt = ApiController::Barong.new(options[:barong_base_url], options[:app_id]).log_in(options[:email], options[:password]) api = ApiController::Peatio.new(options[:peatio_base_url], jwt) Deamons::WashTrade.new(api, options[:market], options[:freq]) end desc 'list', 'Return list of running processes' def list puts Dir['*.pid'] end desc 'stop pid', 'stop a running process with the given pid' def stop(pid) Utils.kill_process(pid) end desc 'test_ws', 'connect to web socket and test it is working correctly' def test_ws Barong::API.log_in("hi there","my man") end desc 'quote market', 'get the quote for the given market e.g. btc/eth' def quote(market) puts "#{market}: #{Utils.quote(market)}" end desc 'cmc_data outfile', 'export coin market cap data to spread sheet' def cmc_data(outfile) data = Utils.cmc_data Utils.write_to_spreadsheet(data, outfile) end end end