mercado_bitcoin 0.3.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f6a463c5141cfcd838dcb6f58639314220f99010
4
- data.tar.gz: 843f340e2d0b8a43053222874bb457693d759447
3
+ metadata.gz: 9341f93059a854f69dc3aa52bc8e4a71ce3760a4
4
+ data.tar.gz: 426ea0f2d98143737c274cbb1ff131de80813cca
5
5
  SHA512:
6
- metadata.gz: b3bc9c8cc54b0e9ba6854859c203b12f6455de2255fb67eaf228d6aa674561719f46b150d8e144d6bfcdd8a532fa13db4f298e3d2863a7a95162841398fc3821
7
- data.tar.gz: fb60a97d933425c725b77e7455aeb7072d2dbc1d945fb08a4a302e43f47536612e89d8b6a8266670b43434fe1586f58b9299f0193b192f595b4863ff1ab8441a
6
+ metadata.gz: f4e36e2c72f15c771ad2d5106a27be748b1811573128d268ff27e82b67fbc6f35b4aa0c8929e908047c53bf39837e772df7cb75a43ae4b38f5a2911855117e05
7
+ data.tar.gz: 314a300b365ad98d79cd5070aded27106be504bb38391bd4d4b09d3e635e4cfa8299a35cc836a43517d24a5c257ac30e7d5f3b831219b26614b1a1fece0e8555
data/.gitignore CHANGED
@@ -36,3 +36,4 @@ Gemfile.lock
36
36
 
37
37
  # unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
38
38
  .rvmrc
39
+ .env
data/.travis.yml CHANGED
@@ -1,4 +1,6 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.2.3
4
- before_install: gem install bundler -v 1.10.6
3
+ - 2.1.10
4
+ - 2.2.5
5
+ - 2.3.1
6
+ before_install: gem install bundler -v 1.12.4
data/Dockerfile ADDED
@@ -0,0 +1,9 @@
1
+ FROM ruby:2.3.1
2
+
3
+ RUN mkdir -p /app
4
+ WORKDIR /app
5
+
6
+ COPY . /app/
7
+ RUN bundle install
8
+
9
+ ENTRYPOINT /bin/bash
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
- # MercadoBitcoin
1
+ # MercadoBitcoin [![Build Status](https://travis-ci.org/marcocarvalho/mercadobitcoin.png?branch=master)](https://travis-ci.org/marcocarvalho/mercadobitcoin)
2
2
 
3
- Thin layer to MercadoBitcoin.com.br public price api layer.
3
+ Thin layer to [MercadoBitcoin.com.br](http://mercadobitcoin.com.br/) public price api layer.
4
4
 
5
5
  ## Installation
6
6
 
@@ -20,10 +20,17 @@ Or install it yourself as:
20
20
 
21
21
  ## Usage
22
22
 
23
- TODO:
23
+ TODO:
24
24
  - write documentation.
25
- - make a CI
25
+ - V3 protocol implementation
26
26
 
27
+ ### Trade Api (v3)
28
+
29
+ ####
30
+ ```
31
+ mb = MercadoBitcoin::TradeApi.new(key: '<key>', code: '<secret>')
32
+ mb.get_account_info
33
+ ```
27
34
  ## Contributing
28
35
 
29
36
  Bug reports and pull requests are welcome on GitHub at https://github.com/marcocarvalho/mercado_bitcoin. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](contributor-covenant.org) code of conduct.
data/bin/mb_console.rb ADDED
@@ -0,0 +1,149 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'bundler'
4
+ require 'json'
5
+ Bundler.setup
6
+
7
+ require 'byebug'
8
+ require 'pry'
9
+ require 'dotenv'
10
+ Dotenv.load
11
+
12
+ require 'mercado_bitcoin'
13
+
14
+
15
+ def options
16
+ @options ||= {
17
+ key: ENV['MB_API_KEY'],
18
+ code: ENV['MB_SECRET_KEY'],
19
+ coin_pair: ENV['MB_COIN_PAIR'] || MercadoBitcoin::TradeApi::BTC,
20
+ pretty_print: true
21
+ }
22
+ end
23
+
24
+ opt_parser = OptionParser.new do |opts|
25
+ opts.banner = <<-USAGE.gsub(/^ /, '')
26
+ Usage: #{File.basename(__FILE__)} [options] command [command_options]
27
+ Pode-se usar variáveis de ambiente ou
28
+ setá-las em um arquivo .env. As variáveis disponíveis são:
29
+ MB_API_KEY
30
+ MB_SECRET_KEY
31
+ MB_COIN_PAIR (padrão: btc)
32
+
33
+ Comandos (mais informações em https://www.mercadobitcoin.com.br/trade-api/):
34
+ list_system_messages - Método para comunicação de eventos do sistema relativos à TAPI
35
+ get_account_info - Retorna dados da conta, como saldos e limites
36
+ get_order ORDER_ID - Retorna os dados da ordem de acordo com o ID informado.
37
+ list_orders - Retorna uma lista de até 200 ordens, de acordo com os filtros informados, ordenadas pela
38
+ data de última atualização. As operações executadas de cada ordem também são retornadas.
39
+ list_orderbook - Retorna informações do livro de negociações (orderbook) do Mercado Bitcoin para o par de
40
+ moedas (coin_pair) informado.
41
+ place_buy_order - Abre uma ordem de compra (buy ou bid) do par de moedas, quantidade de moeda digital e
42
+ preço unitário limite informados.
43
+ place_sell_order - Abre uma ordem de venda (sell ou ask) do par de moedas, quantidade de moeda digital e
44
+ preço unitário limite informados.
45
+ cancel_order ORDER_ID - cancelar orderm de compra/venda
46
+ get_withdrawal WITHDRAWAL_ID - Retorna os dados de uma retirada de moeda digital (BTC, LTC) ou de um saque de Real (BRL).
47
+ withdraw_coin - Executa a retirada de moedas digitais ou saques de Real. Assim, caso o valor de coin seja
48
+ BRL, então realiza um saque para a conta bancária informada. Caso o valor seja BTC ou LTC,
49
+ realiza uma transação para o endereço de moeda digital informado em destiny.
50
+ USAGE
51
+
52
+ opts.on("-k", "--api-key MB_API_KEY", "api key") do |v|
53
+ options[:code] = v
54
+ end
55
+
56
+ opts.on("-s", "--secret-key MB_SECRET_KEY", "secret key") do |v|
57
+ options[:key] = v
58
+ end
59
+
60
+ opts.on("--coin-pair MB_COIN_PAIR", [:brlbtc, :brlltc, :brl], "coin_pair (brlbtc | brlltc | brl), padrão: brlbtc") do |v|
61
+ options[:coin_pair] = v.to_s.to_upper
62
+ end
63
+
64
+ opts.on("--[no-]pretty-print", "Mostra (ou não) o json de saida formatado, saída formatada é a default") do |v|
65
+ options[:pretty_print] = v
66
+ end
67
+
68
+ opts.on("--[no-]debug", "debug info printed") do |v|
69
+ options[:debug] = v
70
+ end
71
+
72
+ opts.on("--order-type [BUY_SELL_OR_CODE]", ['buy', 'sell', '1', '2'], "tipo de ordem, (BUY | SELL | 1 | 2), sem default") do |v|
73
+ options[:order_type] = v
74
+ end
75
+
76
+ opts.on("--status-list [STATUS_LIST]", [:open, :cancelled, :filled, 2, 3, 4], "lista separada por virgulas: (open|2)|(cancelled|3)|(filled|4)") do |v|
77
+ options[:status_list] = v
78
+ end
79
+
80
+ opts.on("--[no-]has-fills", "Filtro para ordens com ou sem execução") do |v|
81
+ options[:has_fills] = v
82
+ end
83
+
84
+ opts.on("--from-id [FROM_ID]", "Filtro para orders a partir do ID informado (inclusive).") do |v|
85
+ options[:from_id] = v
86
+ end
87
+
88
+ opts.on("--to-id [TO_ID]", "Filtro para orders até do ID informado (inclusive).") do |v|
89
+ options[:to_id] = v
90
+ end
91
+
92
+ opts.on("--from-timestamp [FROM_TIMESTAMP]", "Filtro para orders criadas a partir do timestamp informado (inclusive).") do |v|
93
+ options[:from_timestamp] = v
94
+ end
95
+
96
+ opts.on("--to-timestamp [TO_TIMESTAMP]", "Filtro para orders criadas até do timestamp informado (inclusive).") do |v|
97
+ options[:to_timestamp] = v
98
+ end
99
+
100
+ opts.on("--[no-]full", "Indica quantidades de ordens retornadas no livro.") do |v|
101
+ options[:full] = v
102
+ end
103
+
104
+ opts.on("--limit-price [PRICE]", "preço limite para compra ou venda") do |v|
105
+ options[:limit_price] = v
106
+ end
107
+
108
+ opts.on("--quantity [QUANTITY]", "quantidade de moeda digital para compra/venda") do |v|
109
+ options[:quantity] = v
110
+ end
111
+
112
+ opts.on("--destiny [DESTINY]", "Caso o valor de coin seja BRL, informar o ID de uma conta bancária já cadastrada e marcada como confiável. Caso o valor seja BTC ou LTC, informar um endereço marcado como confiável , Bitcoin ou Litecoin, respectivamente.") do |v|
113
+ options[:destiny] = v
114
+ end
115
+
116
+ opts.on("--description [DESCRIPTION]", "Texto livre para auxiliar o usuário a relacionar a retirada/saque com atividades externas.") do |v|
117
+ options[:description] = v
118
+ end
119
+
120
+ opts.on('-h', '--help') do
121
+ puts opts
122
+ exit(0)
123
+ end
124
+ end
125
+
126
+ begin
127
+ opt_parser.parse!
128
+ rescue OptionParser::InvalidArgument => e
129
+ puts e.message
130
+ exit(-3)
131
+ end
132
+
133
+ if(ARGV.count < 1)
134
+ puts opt_parser
135
+ exit(-1)
136
+ end
137
+
138
+ command = ARGV.shift
139
+
140
+ begin
141
+ MercadoBitcoin::Console.new(options).exec(command, ARGV)
142
+ rescue ArgumentError => e
143
+ puts "\n\nFaltando argumentos para o comando #{command}\n\n"
144
+ puts opt_parser
145
+ exit(-2)
146
+ rescue RestClient::ServiceUnavailable => e
147
+ puts "Server returned 503 - Service Unavailable"
148
+ exit(-503)
149
+ end
@@ -0,0 +1,8 @@
1
+ mercadobitcoin:
2
+ build: .
3
+ command: bash
4
+ stdin_open: true
5
+ tty: true
6
+ volumes:
7
+ - .:/app
8
+ - $SSH_AUTH_SOCK:/tmp/agent.sock
@@ -0,0 +1,116 @@
1
+ class MercadoBitcoin::Console
2
+ attr_accessor :options
3
+
4
+ # Laizy way to check parameters :)
5
+ def initialize(key:, code:, coin_pair:, **opts)
6
+ @options = opts || {}
7
+ @options[:key] = key
8
+ @options[:code] = code
9
+ @options[:coin_pair] = coin_pair
10
+ end
11
+
12
+ def exec(command, opts)
13
+ print send(command, *opts)
14
+ end
15
+
16
+ def list_system_messages(*args)
17
+ trade_api.list_system_messages
18
+ end
19
+
20
+ def get_account_info(*args)
21
+ trade_api.get_account_info
22
+ end
23
+
24
+ def get_order(*args)
25
+ raise ArgumentError.new("faltando ORDER_ID") if args.count < 1
26
+ ret = args.map do |id|
27
+ trade_api.get_order(order_id: id)
28
+ end
29
+ if ret.size > 1
30
+ ret
31
+ else
32
+ ret[0]
33
+ end
34
+ end
35
+
36
+ def list_orders(*args)
37
+ trade_api.list_orders(
38
+ coin_pair: options[:coin_pair],
39
+ order_type: options[:order_type],
40
+ status_list: options[:status_list],
41
+ has_fills: options[:has_fills],
42
+ from_id: options[:from_id],
43
+ to_id: options[:to_id],
44
+ from_timestamp: options[:from_timestamp],
45
+ to_timestamp: options[:to_timestamp])
46
+ end
47
+
48
+ def list_orderbook(*args)
49
+ trade_api.list_orderbook(
50
+ coin_pair: options[:coin_pair],
51
+ full: options[:full]
52
+ )
53
+ end
54
+
55
+ def place_buy_order(*args)
56
+ trade_api.place_buy_order(
57
+ coin_pair: options[:coin_pair],
58
+ quantity: options[:quantity],
59
+ limit_price: options[:limit_price]
60
+ )
61
+ end
62
+
63
+ def place_sell_order(*args)
64
+ trade_api.place_sell_order(
65
+ coin_pair: options[:coin_pair],
66
+ quantity: options[:quantity],
67
+ limit_price: options[:limit_price]
68
+ )
69
+ end
70
+
71
+ def cancel_order(*args)
72
+ raise ArgumentError.new("faltando ORDER_ID") if args.count < 1
73
+ ret = args.map do |id|
74
+ trade_api.cancel_order(coin_pair: options[:coin_pair], order_id: id)
75
+ end
76
+ if ret.size > 1
77
+ ret
78
+ else
79
+ ret[0]
80
+ end
81
+ end
82
+
83
+ def get_withdrawal(*args)
84
+ raise ArgumentError.new("faltando withdrawal_id") if args.count < 1
85
+ ret = args.map do |id|
86
+ trade_api.get_withdrawal(coin_pair: params[:coin_pair], withdrawal_id: id)
87
+ end
88
+ if ret.size > 1
89
+ ret
90
+ else
91
+ ret[0]
92
+ end
93
+ end
94
+
95
+ private
96
+
97
+ def print(value)
98
+ if pretty_print?
99
+ Pry::ColorPrinter.pp value
100
+ else
101
+ puts value.to_json
102
+ end
103
+ end
104
+
105
+ def pretty_print?
106
+ @options[:pretty_print]
107
+ end
108
+
109
+ def trade_api
110
+ @trade_api ||= MercadoBitcoin::TradeApi.new(
111
+ key: options[:key],
112
+ code: options[:code],
113
+ debug: options[:debug]
114
+ )
115
+ end
116
+ end
@@ -2,55 +2,105 @@ require 'openssl'
2
2
 
3
3
  module MercadoBitcoin
4
4
  class TradeApi
5
+ BTC = 'BRLBTC'
6
+ LTC = 'BRLLTC'
7
+
5
8
  using QueryStringRefinement
6
9
 
7
- attr_accessor :key, :code, :tonce_correction
10
+ attr_accessor :key, :code
8
11
 
9
- def initialize(key:, code:, tonce_correction: 0)
12
+ def initialize(key:, code:, debug: false)
10
13
  @key = key
11
14
  @code = code
12
- @tonce_correction = tonce_correction
15
+ @debug = debug
16
+ end
17
+
18
+ def get_account_info
19
+ params = base_params('get_account_info')
20
+ post(params)
13
21
  end
14
22
 
15
- def get_info
16
- params = base_params('getInfo')
23
+ def list_system_messages
24
+ params = base_params('list_system_messages')
17
25
  post(params)
18
26
  end
19
27
 
20
- # type: buy, sell
21
- def trade(pair: 'btc_brl', type:, volume:, price:)
22
- params = base_params('Trade')
23
- params[:pair] = pair
24
- params[:type] = type
25
- params[:volume] = volume
26
- params[:price] = price
28
+ def get_order(pair: BTC, order_id:)
29
+ params = base_params('get_order')
30
+ params[:order_id] = order_id
31
+ params[:coin_pair] = pair
27
32
  post(params)
28
33
  end
29
34
 
30
- def cancel_order(pair: 'btc_brl', order_id:)
31
- params = base_params('CancelOrder')
32
- params[:pair] = pair
35
+ def list_orders(
36
+ coin_pair: BTC,
37
+ order_type: nil,
38
+ status_list: nil,
39
+ has_fills: nil, # com ou sem execução
40
+ from_id: nil,
41
+ to_id: nil,
42
+ from_timestamp: nil,
43
+ to_timestamp: nil)
44
+ params = base_params('list_orders')
45
+ params[:coin_pair] = coin_pair
46
+ params[:order_type] = parse_order_type(order_type) if order_type
47
+ params[:status_list] = parse_status_list(status_list) if status_list
48
+ params[:has_fills] = has_fills if has_fills != nil
49
+ params[:from_id] = from_id if from_id
50
+ params[:to_id] = to_id if to_id
51
+ params[:from_timestamp] = from_timestamp if from_timestamp
52
+ params[:to_timestamp] = to_timestamp if to_timestamp
53
+ post(params)
54
+ end
55
+
56
+ def list_orderbook(coin_pair: BTC, full: nil)
57
+ params = base_params('list_orderbook')
58
+ params[:coin_pair] = coin_pair
59
+ params[:full] = full if full != nil
60
+ post(params)
61
+ end
62
+
63
+ def place_buy_order coin_pair: BTC, quantity:, limit_price:
64
+ params = base_params('place_buy_order')
65
+ params[:coin_pair] = coin_pair
66
+ params[:quantity] = quantity
67
+ params[:limit_price] = limit_price
68
+ post(params)
69
+ end
70
+
71
+ def place_sell_order coin_pair: BTC, quantity:, limit_price:
72
+ params = base_params('place_sell_order')
73
+ params[:coin_pair] = coin_pair
74
+ params[:quantity] = quantity
75
+ params[:limit_price] = limit_price
76
+ post(params)
77
+ end
78
+
79
+ def cancel_order(coin_pair: BTC, order_id:)
80
+ params = base_params('cancel_order')
81
+ params[:coin_pair] = coin_pair
33
82
  params[:order_id] = order_id
34
83
  post(params)
35
84
  end
36
85
 
37
- # status: active, canceled, completed
38
- # since and end: in Unix timestamp: Time.new.to_i
39
- def order_list(pair: 'btc_brl', type: nil, status: nil, from_id: nil, end_id: nil, since: nil, _end: nil)
40
- params = base_params('OrderList')
41
- params[:pair] = pair
42
- params[:type] = type if type
43
- params[:status] = status if status
44
- params[:from_id] = from_id if from_id
45
- params[:end_id] = end_id if end_id
46
- params[:since] = since if since
47
- params[:end] = _end if _end
48
- post(params)
86
+ def get_withdrawal(coin_pair: BTC, withdrawal_id:)
87
+ params = base_params('get_withdrawal')
88
+ params[:withdrawal_id] = withdrawal_id
89
+ post(params)
90
+ end
91
+
92
+ def withdraw_coin(coin_pair: BTC, quantity:, destiny:, description: nil)
93
+ params = base_params('withdraw_coin')
94
+ params[:quantity] = quantity
95
+ params[:destiny] = destiny
96
+ params[:description] = description if description
97
+ post(params)
49
98
  end
50
99
 
51
100
  def post(params)
52
- params[:tonce] = Time.new.to_i + env_or_var_tonce
101
+ params[:tapi_nonce] = (Time.new.to_f * 10).to_i
53
102
  signature = sign(params)
103
+ puts params.to_query_string if debug?
54
104
  result = JSON.parse(
55
105
  RestClient.post(
56
106
  base_url,
@@ -58,52 +108,53 @@ module MercadoBitcoin
58
108
  header(signature)
59
109
  )
60
110
  )
61
- raise TonceDesyncError.new('desync') if tonce_error?(result)
62
- result
63
- rescue TonceDesyncError
64
- @tonce_correction = get_tonce_correction(result)
65
- retry
66
111
  end
67
112
 
68
- def tonce_error?(result)
69
- if result['error'].to_s =~ /(\d+) e (\d+), tonce recebido (\d+)+/
70
- $1.to_i - $3.to_i + 10
71
- else
72
- false
73
- end
113
+ def base_path
114
+ @base_path ||= "/tapi/v3/".freeze
74
115
  end
75
- alias_method :get_tonce_correction, :tonce_error?
76
116
 
77
117
  def base_url
78
- @base_url ||= "https://www.mercadobitcoin.net/tapi/".freeze
118
+ @base_url ||= "https://www.mercadobitcoin.net#{base_path}".freeze
79
119
  end
80
120
 
81
121
  def header(signature)
82
122
  {
83
123
  'Content-Type' => 'application/x-www-form-urlencoded',
84
- 'Key' => key,
85
- 'Sign' => signature
124
+ 'TAPI-ID' => key,
125
+ 'TAPI-MAC' => signature
86
126
  }
87
127
  end
88
128
 
89
129
  def base_params(method)
90
130
  {
91
- method: method
131
+ tapi_method: method
92
132
  }
93
133
  end
94
134
 
95
- def env_or_var_tonce
96
- if ENV['TONCE_CORRECTION'].to_s =~ /\d+/
97
- ENV['TONCE_CORRECTION'].to_i
98
- else
99
- tonce_correction
100
- end
101
- end
102
-
103
- def sign(string_or_hash)
104
- string_or_hash = string_or_hash.to_query_string if string_or_hash.is_a?(Hash)
135
+ def sign(string_or_hash, path = nil)
136
+ path ||= base_path
137
+ string_or_hash = path + '?' + string_or_hash.to_query_string if string_or_hash.is_a?(Hash)
105
138
  hmac = OpenSSL::HMAC.new(code, OpenSSL::Digest.new('sha512'))
106
139
  hmac.update(string_or_hash).to_s
107
140
  end
141
+
142
+ private
143
+
144
+ def debug?
145
+ @debug
146
+ end
147
+
148
+ def parse_status_list(list)
149
+ list
150
+ .gsub(/(cancelled|open|filled)/i, { 'cancelled' => 3, 'open' => 2, 'filled' => 4 })
151
+ .split(',')
152
+ .to_json
153
+ end
154
+
155
+ def parse_order_type(type)
156
+ type
157
+ .gsub(/(buy|sell)/i, { 'buy' => 1, 'sell' => 2 })
158
+ end
108
159
  end
109
- end
160
+ end
@@ -1,3 +1,3 @@
1
1
  module MercadoBitcoin
2
- VERSION = "0.3.0"
2
+ VERSION = "0.4.0"
3
3
  end
@@ -6,6 +6,7 @@ require 'json'
6
6
 
7
7
  module MercadoBitcoin
8
8
  require 'mercado_bitcoin/errors'
9
+ autoload :Console, 'mercado_bitcoin/console'
9
10
  autoload :Api, 'mercado_bitcoin/api'
10
11
  autoload :TradeApi, 'mercado_bitcoin/trade_api'
11
12
  autoload :QueryStringRefinement, 'mercado_bitcoin/query_string_refinement'
@@ -18,9 +18,11 @@ Gem::Specification.new do |spec|
18
18
  spec.require_paths = ["lib"]
19
19
 
20
20
  spec.add_dependency 'virtus', '~> 1.0'
21
- spec.add_dependency 'rest-client', '~> 1.8'
21
+ spec.add_dependency 'rest-client', '~> 2.0'
22
+ spec.add_dependency 'dotenv', '~> 2.1'
22
23
  spec.add_development_dependency "bundler", "~> 1.10"
23
- spec.add_development_dependency "byebug", "~> 8.2"
24
- spec.add_development_dependency "rake", "~> 10.0"
24
+ spec.add_development_dependency "pry", "~> 0.10"
25
+ spec.add_development_dependency "byebug", "~> 9.0"
26
+ spec.add_development_dependency "rake", "~> 11.2"
25
27
  spec.add_development_dependency "rspec", "~> 3.4"
26
28
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mercado_bitcoin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marco Carvalho
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-01-12 00:00:00.000000000 Z
11
+ date: 2016-07-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: virtus
@@ -30,14 +30,28 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '1.8'
33
+ version: '2.0'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '1.8'
40
+ version: '2.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: dotenv
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '2.1'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '2.1'
41
55
  - !ruby/object:Gem::Dependency
42
56
  name: bundler
43
57
  requirement: !ruby/object:Gem::Requirement
@@ -52,34 +66,48 @@ dependencies:
52
66
  - - "~>"
53
67
  - !ruby/object:Gem::Version
54
68
  version: '1.10'
69
+ - !ruby/object:Gem::Dependency
70
+ name: pry
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '0.10'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '0.10'
55
83
  - !ruby/object:Gem::Dependency
56
84
  name: byebug
57
85
  requirement: !ruby/object:Gem::Requirement
58
86
  requirements:
59
87
  - - "~>"
60
88
  - !ruby/object:Gem::Version
61
- version: '8.2'
89
+ version: '9.0'
62
90
  type: :development
63
91
  prerelease: false
64
92
  version_requirements: !ruby/object:Gem::Requirement
65
93
  requirements:
66
94
  - - "~>"
67
95
  - !ruby/object:Gem::Version
68
- version: '8.2'
96
+ version: '9.0'
69
97
  - !ruby/object:Gem::Dependency
70
98
  name: rake
71
99
  requirement: !ruby/object:Gem::Requirement
72
100
  requirements:
73
101
  - - "~>"
74
102
  - !ruby/object:Gem::Version
75
- version: '10.0'
103
+ version: '11.2'
76
104
  type: :development
77
105
  prerelease: false
78
106
  version_requirements: !ruby/object:Gem::Requirement
79
107
  requirements:
80
108
  - - "~>"
81
109
  - !ruby/object:Gem::Version
82
- version: '10.0'
110
+ version: '11.2'
83
111
  - !ruby/object:Gem::Dependency
84
112
  name: rspec
85
113
  requirement: !ruby/object:Gem::Requirement
@@ -106,12 +134,13 @@ files:
106
134
  - ".rspec"
107
135
  - ".travis.yml"
108
136
  - CODE_OF_CONDUCT.md
137
+ - Dockerfile
109
138
  - Gemfile
110
139
  - LICENSE.txt
111
140
  - README.md
112
141
  - Rakefile
113
- - bin/console
114
- - bin/setup
142
+ - bin/mb_console.rb
143
+ - docker-compose.yml
115
144
  - lib/mercado_bitcoin.rb
116
145
  - lib/mercado_bitcoin/api.rb
117
146
  - lib/mercado_bitcoin/api/data.rb
@@ -121,6 +150,7 @@ files:
121
150
  - lib/mercado_bitcoin/api/data/ticker.rb
122
151
  - lib/mercado_bitcoin/api/data/trade.rb
123
152
  - lib/mercado_bitcoin/base_api_call.rb
153
+ - lib/mercado_bitcoin/console.rb
124
154
  - lib/mercado_bitcoin/errors.rb
125
155
  - lib/mercado_bitcoin/order_book.rb
126
156
  - lib/mercado_bitcoin/query_string_refinement.rb
@@ -150,7 +180,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
150
180
  version: '0'
151
181
  requirements: []
152
182
  rubyforge_project:
153
- rubygems_version: 2.4.8
183
+ rubygems_version: 2.6.6
154
184
  signing_key:
155
185
  specification_version: 4
156
186
  summary: Thin layer over public price api of MercadoBitcoin.com.br
data/bin/console DELETED
@@ -1,14 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require "bundler/setup"
4
- require "mercado_bitcoin"
5
-
6
- # You can add fixtures and/or initialization code here to make experimenting
7
- # with your gem easier. You can also use a different console, if you like.
8
-
9
- # (If you use this, don't forget to add pry to your Gemfile!)
10
- # require "pry"
11
- # Pry.start
12
-
13
- require "irb"
14
- IRB.start
data/bin/setup DELETED
@@ -1,7 +0,0 @@
1
- #!/bin/bash
2
- set -euo pipefail
3
- IFS=$'\n\t'
4
-
5
- bundle install
6
-
7
- # Do any other automated setup that you need to do here