diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 39b52e6..0000000 --- a/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "bitstamp"] - path = bitstamp - url = https://github.com/kojnapp/bitstamp.git diff --git a/.travis.yml b/.travis.yml index 9ce7196..e730602 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,13 +1,13 @@ language: ruby rvm: -- 2.1.0 +- 2.1.1 - 2.0.0 - 1.9.3 - ruby-head matrix: allow_failures: - - rvm: 2.1.0 + - rvm: 2.1.1 - rvm: ruby-head env: global: diff --git a/Gemfile b/Gemfile index e26eb16..e5dae47 100644 --- a/Gemfile +++ b/Gemfile @@ -1,6 +1,5 @@ source 'https://rubygems.org' -# Specify your gem's dependencies in rbtc_arbitrage.gemspec gemspec group :development do gem 'rspec' @@ -8,7 +7,6 @@ group :development do gem "activesupport", ">= 3.1" gem 'guard' gem 'ruby_gntp' - # gem 'awesome_print' gem 'guard-rspec' gem 'simplecov' gem 'coveralls', require: false @@ -17,5 +15,4 @@ group :development do gem 'codeclimate-test-reporter' gem 'hashie' gem 'sinatra' -end -gem 'bitstamp', path: './bitstamp' \ No newline at end of file +end \ No newline at end of file diff --git a/Gemfile.lock b/Gemfile.lock index bf4fa9a..7ffe1b0 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,12 +1,13 @@ PATH remote: . specs: - rbtc_arbitrage (2.3.0) + rbtc_arbitrage (2.4.1) activemodel (>= 3.1) activesupport (>= 3.1) + bitstamp-rbtc-arbitrage btce (= 0.2.4) bundler (~> 1.3) - coinbase (= 1.3.0) + coinbase (= 2.1.0) faraday (= 0.8.8) pony rake (= 10.1.1) @@ -14,15 +15,6 @@ PATH tco (= 0.1.0) thor -PATH - remote: ./bitstamp - specs: - bitstamp (0.4.0) - activemodel (>= 3.1) - activesupport (>= 3.1) - curb (> 0.8.1) - ruby-hmac (= 0.4.0) - GEM remote: https://rubygems.org/ specs: @@ -37,6 +29,13 @@ GEM tzinfo (~> 0.3.37) addressable (2.3.5) atomic (1.1.16) + bitstamp-rbtc-arbitrage (0.4.0) + activemodel (>= 3.1) + activesupport + curb (> 0.8.1) + i18n (= 0.6.9) + ruby-hmac (= 0.4.0) + tzinfo btce (0.2.4) monkey-patch builder (3.1.4) @@ -45,11 +44,13 @@ GEM codeclimate-test-reporter (0.2.0) simplecov (>= 0.7.1, < 1.0.0) coderay (1.1.0) - coinbase (1.3.0) + coinbase (2.1.0) hashie (>= 1.2.0) httparty (>= 0.8.3) - money (= 5.1.1) + monetize (~> 0.3.0) + money (~> 6.0) multi_json (>= 1.3.4) + oauth2 (~> 0.9) coveralls (0.7.0) multi_json (~> 1.3) rest-client @@ -58,7 +59,7 @@ GEM thor crack (0.4.1) safe_yaml (~> 0.9.0) - curb (0.8.5) + curb (0.8.6) diff-lcs (1.2.5) docile (1.1.1) faraday (0.8.8) @@ -80,27 +81,33 @@ GEM multi_xml (>= 0.5.2) i18n (0.6.9) json (1.8.1) + jwt (1.0.0) listen (2.4.0) celluloid (>= 0.15.2) rb-fsevent (>= 0.9.3) rb-inotify (>= 0.9) lumberjack (1.0.4) - mail (2.2.7) - activesupport (>= 2.3.6) - mime-types - treetop (>= 1.4.5) + mail (2.6.1) + mime-types (>= 1.16, < 3) method_source (0.8.2) mime-types (2.0) minitest (4.7.5) - money (5.1.1) - i18n (~> 0.6.0) + monetize (0.3.0) + money (~> 6.1.0.beta1) + money (6.1.1) + i18n (~> 0.6.4) monkey-patch (0.0.16) activesupport multi_json (1.9.2) multi_xml (0.5.5) multipart-post (1.2.0) - polyglot (0.3.4) - pony (1.8) + oauth2 (0.9.4) + faraday (>= 0.8, < 0.10) + jwt (~> 1.0) + multi_json (~> 1.3) + multi_xml (~> 0.5) + rack (~> 1.2) + pony (1.10) mail (>= 2.0) pry (0.9.12.4) coderay (~> 1.0) @@ -150,8 +157,6 @@ GEM tilt (1.4.1) timers (1.1.0) tins (0.13.1) - treetop (1.5.3) - polyglot (~> 0.3) tzinfo (0.3.39) vcr (2.8.0) webmock (1.16.1) @@ -164,7 +169,6 @@ PLATFORMS DEPENDENCIES activemodel (>= 3.1) activesupport (>= 3.1) - bitstamp! codeclimate-test-reporter coveralls guard diff --git a/bitstamp b/bitstamp deleted file mode 160000 index aa6d572..0000000 --- a/bitstamp +++ /dev/null @@ -1 +0,0 @@ -Subproject commit aa6d572d1796a9fdae49220304c5cad9c4d058ee diff --git a/lib/rbtc_arbitrage/trader/notifier.rb b/lib/rbtc_arbitrage/trader/notifier.rb index 2b6bdeb..9a0dd1b 100644 --- a/lib/rbtc_arbitrage/trader/notifier.rb +++ b/lib/rbtc_arbitrage/trader/notifier.rb @@ -15,10 +15,10 @@ def notify end if (stathat_api_key = ENV['STATHAT_API_KEY']).present? - options[:logger].info "Notifying #{ stathat_api_key } via stathat" + options[:logger].info "Notifying #{ stathat_api_key } via stathat" - StatHat::SyncAPI.ez_post_value("#{@buy_client.exchange}_to_#{@sell_client.exchange}_percent", stathat_api_key, @percent) - StatHat::SyncAPI.ez_post_value("#{@buy_client.exchange}_to_#{@sell_client.exchange}_profit", stathat_api_key, @received - @paid) + StatHat::SyncAPI.ez_post_value("#{@buy_client.exchange}_to_#{@sell_client.exchange}_percent", stathat_api_key, @percent) + StatHat::SyncAPI.ez_post_value("#{@buy_client.exchange}_to_#{@sell_client.exchange}_profit", stathat_api_key, @received - @paid) end end diff --git a/lib/rbtc_arbitrage/version.rb b/lib/rbtc_arbitrage/version.rb index 7eefe4f..9090d14 100644 --- a/lib/rbtc_arbitrage/version.rb +++ b/lib/rbtc_arbitrage/version.rb @@ -1,3 +1,3 @@ module RbtcArbitrage - VERSION = "2.3.0" + VERSION = "2.4.1" end diff --git a/rbtc_arbitrage.gemspec b/rbtc_arbitrage.gemspec index 5d641b6..c8f1719 100644 --- a/rbtc_arbitrage.gemspec +++ b/rbtc_arbitrage.gemspec @@ -14,25 +14,6 @@ Gem::Specification.new do |spec| spec.license = "MIT" spec.files = `git ls-files`.split($/) - # get an array of submodule dirs by executing 'pwd' inside each submodule - `git submodule --quiet foreach pwd`.split($\).each do |submodule_path| - # for each submodule, change working directory to that submodule - Dir.chdir(submodule_path) do - # issue git ls-files in submodule's directory - submodule_files = `git ls-files`.split($\) - # prepend the submodule path to create absolute file paths - submodule_files_fullpaths = submodule_files.map do |filename| - "#{submodule_path}/#{filename}" - end - # remove leading path parts to get paths relative to the gem's root dir - # (this assumes, that the gemspec resides in the gem's root dir) - submodule_files_paths = submodule_files_fullpaths.map do |filename| - filename.gsub "#{File.dirname(__FILE__)}/", "" - end - # add relative paths to gem.files - spec.files += submodule_files_paths - end - end spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) } spec.test_files = spec.files.grep(%r{^(test|spec|features)/}) @@ -47,8 +28,9 @@ Gem::Specification.new do |spec| spec.add_dependency "activesupport", ">= 3.1" spec.add_dependency "thor" spec.add_dependency "btce", '0.2.4' - spec.add_dependency "coinbase", '1.3.0' spec.add_dependency "stathat" + spec.add_dependency "coinbase", '2.1.0' spec.add_dependency "pony" spec.add_dependency "tco", "0.1.0" + spec.add_dependency "bitstamp-rbtc-arbitrage" end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index e4758b5..0f6c6d3 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -24,6 +24,7 @@ c.ignore_request do |request| # true end + c.filter_sensitive_data("") { ENV['COINBASE_KEY'] } c.configure_rspec_metadata! end diff --git a/spec/support/cassettes/RbtcArbitrage_Clients_CoinbaseClient/_balance/fetches_the_balance_correctly.yml b/spec/support/cassettes/RbtcArbitrage_Clients_CoinbaseClient/_balance/fetches_the_balance_correctly.yml deleted file mode 100644 index 00b525b..0000000 --- a/spec/support/cassettes/RbtcArbitrage_Clients_CoinbaseClient/_balance/fetches_the_balance_correctly.yml +++ /dev/null @@ -1,109 +0,0 @@ ---- -http_interactions: -- request: - method: get - uri: https://coinbase.com/api/v1/account/balance - headers: {} - response: - status: - code: 200 - message: OK - headers: - Server: - - cloudflare-nginx - Date: - - Mon, 23 Dec 2013 01:42:04 GMT - Content-Type: - - application/json; charset=utf-8 - Transfer-Encoding: - - chunked - Connection: - - keep-alive - Set-Cookie: - - __cfduid=d9faf92bd27e293c2b04658e27fc1eea11387762924181; expires=Mon, 23-Dec-2019 - 23:50:00 GMT; path=/; domain=.coinbase.com; HttpOnly - - request_method=GET; path=/; secure - Status: - - 200 OK - Strict-Transport-Security: - - max-age=31536000 - - max-age=31536000 - X-Ua-Compatible: - - IE=Edge,chrome=1 - Etag: - - '"0aaa6e856f86a20a74cd625cd583960f"' - Cache-Control: - - max-age=0, private, must-revalidate - X-Request-Id: - - 612f6dd78e2ed682b0cf33c4cb32a384 - X-Runtime: - - '0.024974' - X-Frame-Options: - - SAMEORIGIN - X-Content-Type-Options: - - nosniff - X-Rack-Cache: - - miss - Vary: - - Accept-Encoding - Cf-Ray: - - e115a63abe30295 - body: - encoding: UTF-8 - string: '{"amount":"0.39332963","currency":"BTC"}' - http_version: - recorded_at: Mon, 23 Dec 2013 01:42:03 GMT -- request: - method: get - uri: https://coinbase.com/api/v1/account/balance - headers: {} - response: - status: - code: 200 - message: OK - headers: - Server: - - cloudflare-nginx - Date: - - Mon, 23 Dec 2013 01:42:05 GMT - Content-Type: - - application/json; charset=utf-8 - Transfer-Encoding: - - chunked - Connection: - - keep-alive - Set-Cookie: - - __cfduid=d1af7669c762757c89c6a8863c9952e661387762924925; expires=Mon, 23-Dec-2019 - 23:50:00 GMT; path=/; domain=.coinbase.com; HttpOnly - - request_method=GET; path=/; secure - Status: - - 200 OK - Strict-Transport-Security: - - max-age=31536000 - - max-age=31536000 - X-Ua-Compatible: - - IE=Edge,chrome=1 - Etag: - - '"0aaa6e856f86a20a74cd625cd583960f"' - Cache-Control: - - max-age=0, private, must-revalidate - X-Request-Id: - - d35d32621cf9f8464b0bfa22dfed087d - X-Runtime: - - '0.022264' - X-Frame-Options: - - SAMEORIGIN - X-Content-Type-Options: - - nosniff - X-Rack-Cache: - - miss - Vary: - - Accept-Encoding - Cf-Ray: - - e115a685bf50295 - body: - encoding: UTF-8 - string: '{"amount":"0.39332963","currency":"BTC"}' - http_version: - recorded_at: Mon, 23 Dec 2013 01:42:04 GMT -recorded_with: VCR 2.8.0 diff --git a/spec/support/cassettes/RbtcArbitrage_Clients_CoinbaseClient/_price/calls_coinbase.yml b/spec/support/cassettes/RbtcArbitrage_Clients_CoinbaseClient/_price/calls_coinbase.yml index 90beef3..0fcadbe 100644 --- a/spec/support/cassettes/RbtcArbitrage_Clients_CoinbaseClient/_price/calls_coinbase.yml +++ b/spec/support/cassettes/RbtcArbitrage_Clients_CoinbaseClient/_price/calls_coinbase.yml @@ -2,8 +2,19 @@ http_interactions: - request: method: get - uri: https://coinbase.com/api/v1/prices/buy - headers: {} + uri: https://coinbase.com/api/v1/prices/buy?qty=1 + body: + encoding: US-ASCII + string: '' + headers: + Access-Key: + - + Access-Signature: + - 5ea031c544bc6321482ae1bd6551c79806cd4bb79cc3d74f34ce6380ddb738c4 + Access-Nonce: + - '1406308782570980' + Content-Type: + - application/json response: status: code: 200 @@ -12,51 +23,59 @@ http_interactions: Server: - cloudflare-nginx Date: - - Mon, 23 Dec 2013 01:50:02 GMT + - Fri, 25 Jul 2014 17:19:43 GMT Content-Type: - application/json; charset=utf-8 Transfer-Encoding: - chunked Connection: - keep-alive - Set-Cookie: - - __cfduid=ddaa6e4bf7ecb198302cf54b54705b1131387763401454; expires=Mon, 23-Dec-2019 - 23:50:00 GMT; path=/; domain=.coinbase.com; HttpOnly - - request_method=GET; path=/; secure + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Expires: + - '-1' + Pragma: + - no-cache Status: - 200 OK Strict-Transport-Security: - max-age=31536000 - - max-age=31536000 - X-Ua-Compatible: - - IE=Edge,chrome=1 - Etag: - - '"21c3685567c83fb6123bfaa4d9ea14f5"' - Cache-Control: - - max-age=0, private, must-revalidate - X-Request-Id: - - 6f5e05003d57c4f27106b08346d40e92 - X-Runtime: - - '0.231970' - X-Frame-Options: - - SAMEORIGIN + Vary: + - Accept-Encoding X-Content-Type-Options: - nosniff + X-Frame-Options: + - SAMEORIGIN X-Rack-Cache: - miss - Vary: - - Accept-Encoding + X-Request-Id: + - e4db8662-2753-4b12-8248-641eb7693b8d + X-Runtime: + - '0.519928' + X-Ua-Compatible: + - IE=Edge,chrome=1 Cf-Ray: - - e11660a84d90296 + - 14fa06239411051a-SEA body: encoding: UTF-8 - string: '{"subtotal":{"amount":"634.03","currency":"USD"},"fees":[{"coinbase":{"amount":"6.34","currency":"USD"}},{"bank":{"amount":"0.15","currency":"USD"}}],"total":{"amount":"640.52","currency":"USD"},"amount":"640.52","currency":"USD"}' - http_version: - recorded_at: Mon, 23 Dec 2013 01:50:01 GMT + string: '{"subtotal":{"amount":"602.93","currency":"USD"},"fees":[{"coinbase":{"amount":"6.03","currency":"USD"}},{"bank":{"amount":"0.15","currency":"USD"}}],"total":{"amount":"609.11","currency":"USD"},"amount":"609.11","currency":"USD"}' + http_version: + recorded_at: Fri, 25 Jul 2014 17:19:43 GMT - request: method: get - uri: https://coinbase.com/api/v1/prices/buy - headers: {} + uri: https://coinbase.com/api/v1/prices/buy?qty=1 + body: + encoding: US-ASCII + string: '' + headers: + Access-Key: + - + Access-Signature: + - 5e429c3ac24c7db7e606969f48cc393fb39c591a45f46d48364007bbc415984f + Access-Nonce: + - '1406308783565567' + Content-Type: + - application/json response: status: code: 200 @@ -65,51 +84,59 @@ http_interactions: Server: - cloudflare-nginx Date: - - Mon, 23 Dec 2013 01:50:03 GMT + - Fri, 25 Jul 2014 17:19:44 GMT Content-Type: - application/json; charset=utf-8 Transfer-Encoding: - chunked Connection: - keep-alive - Set-Cookie: - - __cfduid=d599c599d9a0afa96ebc108372a7338501387763402504; expires=Mon, 23-Dec-2019 - 23:50:00 GMT; path=/; domain=.coinbase.com; HttpOnly - - request_method=GET; path=/; secure + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Expires: + - '-1' + Pragma: + - no-cache Status: - 200 OK Strict-Transport-Security: - max-age=31536000 - - max-age=31536000 - X-Ua-Compatible: - - IE=Edge,chrome=1 - Etag: - - '"21c3685567c83fb6123bfaa4d9ea14f5"' - Cache-Control: - - max-age=0, private, must-revalidate - X-Request-Id: - - 8f1a06fc780cb3eff298c0e95b5b725b - X-Runtime: - - '0.458310' - X-Frame-Options: - - SAMEORIGIN + Vary: + - Accept-Encoding X-Content-Type-Options: - nosniff + X-Frame-Options: + - SAMEORIGIN X-Rack-Cache: - miss - Vary: - - Accept-Encoding + X-Request-Id: + - f628fdf9-5d1b-4bfa-a346-874f6ee42ed6 + X-Runtime: + - '0.502370' + X-Ua-Compatible: + - IE=Edge,chrome=1 Cf-Ray: - - e11661132770296 + - 14fa0629bf33051a-SEA body: encoding: UTF-8 - string: '{"subtotal":{"amount":"634.03","currency":"USD"},"fees":[{"coinbase":{"amount":"6.34","currency":"USD"}},{"bank":{"amount":"0.15","currency":"USD"}}],"total":{"amount":"640.52","currency":"USD"},"amount":"640.52","currency":"USD"}' - http_version: - recorded_at: Mon, 23 Dec 2013 01:50:02 GMT + string: '{"subtotal":{"amount":"602.93","currency":"USD"},"fees":[{"coinbase":{"amount":"6.03","currency":"USD"}},{"bank":{"amount":"0.15","currency":"USD"}}],"total":{"amount":"609.11","currency":"USD"},"amount":"609.11","currency":"USD"}' + http_version: + recorded_at: Fri, 25 Jul 2014 17:19:44 GMT - request: method: get - uri: https://coinbase.com/api/v1/prices/sell - headers: {} + uri: https://coinbase.com/api/v1/prices/sell?qty=1 + body: + encoding: US-ASCII + string: '' + headers: + Access-Key: + - + Access-Signature: + - d85b1b9e8c7e6dea0ef3bb84b2bde44e96d768e7a398b9c34300eb1c13bc0f6f + Access-Nonce: + - '1406308784234865' + Content-Type: + - application/json response: status: code: 200 @@ -118,51 +145,59 @@ http_interactions: Server: - cloudflare-nginx Date: - - Mon, 23 Dec 2013 01:50:04 GMT + - Fri, 25 Jul 2014 17:19:45 GMT Content-Type: - application/json; charset=utf-8 Transfer-Encoding: - chunked Connection: - keep-alive - Set-Cookie: - - __cfduid=da4ea8419396ce80064daee243fa1fa351387763403732; expires=Mon, 23-Dec-2019 - 23:50:00 GMT; path=/; domain=.coinbase.com; HttpOnly - - request_method=GET; path=/; secure + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Expires: + - '-1' + Pragma: + - no-cache Status: - 200 OK Strict-Transport-Security: - max-age=31536000 - - max-age=31536000 - X-Ua-Compatible: - - IE=Edge,chrome=1 - Etag: - - '"a2bef70e39b2d17967c8ca9791524579"' - Cache-Control: - - max-age=0, private, must-revalidate - X-Request-Id: - - 62d3d1b1273638380afc79bd0d9d2525 - X-Runtime: - - '0.224874' - X-Frame-Options: - - SAMEORIGIN + Vary: + - Accept-Encoding X-Content-Type-Options: - nosniff + X-Frame-Options: + - SAMEORIGIN X-Rack-Cache: - miss - Vary: - - Accept-Encoding + X-Request-Id: + - 46d31e23-8f14-4aa6-ac50-377dccefbf3d + X-Runtime: + - '0.713108' + X-Ua-Compatible: + - IE=Edge,chrome=1 Cf-Ray: - - e116618e67f0296 + - 14fa062dff56051a-SEA body: encoding: UTF-8 - string: '{"subtotal":{"amount":"632.52","currency":"USD"},"fees":[{"coinbase":{"amount":"6.33","currency":"USD"}},{"bank":{"amount":"0.15","currency":"USD"}}],"total":{"amount":"626.04","currency":"USD"},"amount":"626.04","currency":"USD"}' - http_version: - recorded_at: Mon, 23 Dec 2013 01:50:03 GMT + string: '{"subtotal":{"amount":"601.18","currency":"USD"},"fees":[{"coinbase":{"amount":"6.01","currency":"USD"}},{"bank":{"amount":"0.15","currency":"USD"}}],"total":{"amount":"595.02","currency":"USD"},"amount":"595.02","currency":"USD"}' + http_version: + recorded_at: Fri, 25 Jul 2014 17:19:45 GMT - request: method: get - uri: https://coinbase.com/api/v1/prices/sell - headers: {} + uri: https://coinbase.com/api/v1/prices/sell?qty=1 + body: + encoding: US-ASCII + string: '' + headers: + Access-Key: + - + Access-Signature: + - 5e51b4ca5841b3d8a504bd10809838764686f1116ba96c340ccf8ad92a4e4875 + Access-Nonce: + - '1406308785513824' + Content-Type: + - application/json response: status: code: 200 @@ -171,45 +206,42 @@ http_interactions: Server: - cloudflare-nginx Date: - - Mon, 23 Dec 2013 01:50:06 GMT + - Fri, 25 Jul 2014 17:19:46 GMT Content-Type: - application/json; charset=utf-8 Transfer-Encoding: - chunked Connection: - keep-alive - Set-Cookie: - - __cfduid=d3866b19f4121fd78614bbc73b874cb1a1387763405942; expires=Mon, 23-Dec-2019 - 23:50:00 GMT; path=/; domain=.coinbase.com; HttpOnly - - request_method=GET; path=/; secure + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Expires: + - '-1' + Pragma: + - no-cache Status: - 200 OK Strict-Transport-Security: - max-age=31536000 - - max-age=31536000 - X-Ua-Compatible: - - IE=Edge,chrome=1 - Etag: - - '"a2bef70e39b2d17967c8ca9791524579"' - Cache-Control: - - max-age=0, private, must-revalidate - X-Request-Id: - - dfbf6c7596d2b6f6de5078a8d29ad4f5 - X-Runtime: - - '0.267502' - X-Frame-Options: - - SAMEORIGIN + Vary: + - Accept-Encoding X-Content-Type-Options: - nosniff + X-Frame-Options: + - SAMEORIGIN X-Rack-Cache: - miss - Vary: - - Accept-Encoding + X-Request-Id: + - bb14f405-9d5a-4c26-a5c8-60bd0c5afab8 + X-Runtime: + - '0.464737' + X-Ua-Compatible: + - IE=Edge,chrome=1 Cf-Ray: - - e116626b2b10296 + - 14fa0635ef94051a-SEA body: encoding: UTF-8 - string: '{"subtotal":{"amount":"632.52","currency":"USD"},"fees":[{"coinbase":{"amount":"6.33","currency":"USD"}},{"bank":{"amount":"0.15","currency":"USD"}}],"total":{"amount":"626.04","currency":"USD"},"amount":"626.04","currency":"USD"}' - http_version: - recorded_at: Mon, 23 Dec 2013 01:50:05 GMT + string: '{"subtotal":{"amount":"601.18","currency":"USD"},"fees":[{"coinbase":{"amount":"6.01","currency":"USD"}},{"bank":{"amount":"0.15","currency":"USD"}}],"total":{"amount":"595.02","currency":"USD"},"amount":"595.02","currency":"USD"}' + http_version: + recorded_at: Fri, 25 Jul 2014 17:19:46 GMT recorded_with: VCR 2.8.0 diff --git a/spec/support/cassettes/RbtcArbitrage_Clients_CoinbaseClient/_price/fetches_price_for_buy_correctly.yml b/spec/support/cassettes/RbtcArbitrage_Clients_CoinbaseClient/_price/fetches_price_for_buy_correctly.yml index 634f0df..9bfef3f 100644 --- a/spec/support/cassettes/RbtcArbitrage_Clients_CoinbaseClient/_price/fetches_price_for_buy_correctly.yml +++ b/spec/support/cassettes/RbtcArbitrage_Clients_CoinbaseClient/_price/fetches_price_for_buy_correctly.yml @@ -2,8 +2,19 @@ http_interactions: - request: method: get - uri: https://coinbase.com/api/v1/prices/buy - headers: {} + uri: https://coinbase.com/api/v1/prices/buy?qty=1 + body: + encoding: US-ASCII + string: '' + headers: + Access-Key: + - + Access-Signature: + - f04dbaf80cbe0217b1c167979915b075f315cf6077a472733581b16c382bfe70 + Access-Nonce: + - '1406308780089377' + Content-Type: + - application/json response: status: code: 200 @@ -12,7 +23,7 @@ http_interactions: Server: - cloudflare-nginx Date: - - Mon, 23 Dec 2013 01:46:11 GMT + - Fri, 25 Jul 2014 17:19:42 GMT Content-Type: - application/json; charset=utf-8 Transfer-Encoding: @@ -20,37 +31,40 @@ http_interactions: Connection: - keep-alive Set-Cookie: - - __cfduid=de180eda480bef28c6b1572e925ddcd721387763171524; expires=Mon, 23-Dec-2019 + - __cfduid=d3a2fa250275edf59b22bb16b92e40dc01406308781275; expires=Mon, 23-Dec-2019 23:50:00 GMT; path=/; domain=.coinbase.com; HttpOnly + - _coinbase=BAh7B0kiD3Nlc3Npb25faWQGOgZFVEkiJWUxYmQ0ODk1NmM5N2M4YTcxNjhiY2I2MmFmYmFkMjJiBjsAVEkiC2RldmljZQY7AEZJIhxEMmlwbXZvdnFGY0ZGd0ZHWDdwUURlbQY7AFQ%3D--75f5cf18d7647734b58f9f45b60eef124d35687b; + path=/; expires=Mon, 25-Jul-2016 17:19:42 GMT; secure; HttpOnly - request_method=GET; path=/; secure + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Expires: + - '-1' + Pragma: + - no-cache Status: - 200 OK Strict-Transport-Security: - max-age=31536000 - - max-age=31536000 - X-Ua-Compatible: - - IE=Edge,chrome=1 - Etag: - - '"a804177e060807151cd66a68563f9ca7"' - Cache-Control: - - max-age=0, private, must-revalidate - X-Request-Id: - - 905bf73eff8d4954c758c3c7c5032a5e - X-Runtime: - - '0.039337' - X-Frame-Options: - - SAMEORIGIN + Vary: + - Accept-Encoding X-Content-Type-Options: - nosniff + X-Frame-Options: + - SAMEORIGIN X-Rack-Cache: - miss - Vary: - - Accept-Encoding + X-Request-Id: + - 36e9ff07-ca0b-4414-835b-9aaa9fa88ef9 + X-Runtime: + - '0.892429' + X-Ua-Compatible: + - IE=Edge,chrome=1 Cf-Ray: - - e11606d945f0296 + - 14fa061afea7051a-SEA body: encoding: UTF-8 - string: '{"subtotal":{"amount":"633.49","currency":"USD"},"fees":[{"coinbase":{"amount":"6.33","currency":"USD"}},{"bank":{"amount":"0.15","currency":"USD"}}],"total":{"amount":"639.97","currency":"USD"},"amount":"639.97","currency":"USD"}' + string: '{"subtotal":{"amount":"602.93","currency":"USD"},"fees":[{"coinbase":{"amount":"6.03","currency":"USD"}},{"bank":{"amount":"0.15","currency":"USD"}}],"total":{"amount":"609.11","currency":"USD"},"amount":"609.11","currency":"USD"}' http_version: - recorded_at: Mon, 23 Dec 2013 01:46:11 GMT + recorded_at: Fri, 25 Jul 2014 17:19:42 GMT recorded_with: VCR 2.8.0 diff --git a/spec/support/cassettes/RbtcArbitrage_Clients_CoinbaseClient/_price/fetches_price_for_sell_correctly.yml b/spec/support/cassettes/RbtcArbitrage_Clients_CoinbaseClient/_price/fetches_price_for_sell_correctly.yml index c83e761..7813241 100644 --- a/spec/support/cassettes/RbtcArbitrage_Clients_CoinbaseClient/_price/fetches_price_for_sell_correctly.yml +++ b/spec/support/cassettes/RbtcArbitrage_Clients_CoinbaseClient/_price/fetches_price_for_sell_correctly.yml @@ -2,8 +2,19 @@ http_interactions: - request: method: get - uri: https://coinbase.com/api/v1/prices/sell - headers: {} + uri: https://coinbase.com/api/v1/prices/sell?qty=1 + body: + encoding: US-ASCII + string: '' + headers: + Access-Key: + - + Access-Signature: + - b1923f3993e171bfdf3dd079bc22f8a02c9e43c27afbae22597d5814184c44f0 + Access-Nonce: + - '1406308786559019' + Content-Type: + - application/json response: status: code: 200 @@ -12,7 +23,7 @@ http_interactions: Server: - cloudflare-nginx Date: - - Mon, 23 Dec 2013 01:46:12 GMT + - Fri, 25 Jul 2014 17:19:46 GMT Content-Type: - application/json; charset=utf-8 Transfer-Encoding: @@ -20,37 +31,40 @@ http_interactions: Connection: - keep-alive Set-Cookie: - - __cfduid=d2936097f4b45fff147030c15439c297f1387763172302; expires=Mon, 23-Dec-2019 + - __cfduid=d30db8f3bcc83e9b0563ae4d4f50c56b11406308786628; expires=Mon, 23-Dec-2019 23:50:00 GMT; path=/; domain=.coinbase.com; HttpOnly + - _coinbase=BAh7B0kiD3Nlc3Npb25faWQGOgZFVEkiJTQyYjg4MWExNTQ2NjhhZmI3NzAxMzQ1OTkxMDY3Yzk1BjsAVEkiC2RldmljZQY7AEZJIhxENHNXcWZZbW9hM2dEaVh2RlZNamNkZAY7AFQ%3D--e363bc50346974c49cea60d18eb631ac2798fb83; + path=/; expires=Mon, 25-Jul-2016 17:19:46 GMT; secure; HttpOnly - request_method=GET; path=/; secure + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Expires: + - '-1' + Pragma: + - no-cache Status: - 200 OK Strict-Transport-Security: - max-age=31536000 - - max-age=31536000 - X-Ua-Compatible: - - IE=Edge,chrome=1 - Etag: - - '"f6ca8cefd54471be46d774df727e0885"' - Cache-Control: - - max-age=0, private, must-revalidate - X-Request-Id: - - 5780757a2e6a97f8de4347b0a7d38234 - X-Runtime: - - '0.264541' - X-Frame-Options: - - SAMEORIGIN + Vary: + - Accept-Encoding X-Content-Type-Options: - nosniff + X-Frame-Options: + - SAMEORIGIN X-Rack-Cache: - miss - Vary: - - Accept-Encoding + X-Request-Id: + - 04ca0107-2aae-4345-8170-67a30073db54 + X-Runtime: + - '0.201177' + X-Ua-Compatible: + - IE=Edge,chrome=1 Cf-Ray: - - e11607274740296 + - 14fa063c6335051a-SEA body: encoding: UTF-8 - string: '{"subtotal":{"amount":"629.48","currency":"USD"},"fees":[{"coinbase":{"amount":"6.29","currency":"USD"}},{"bank":{"amount":"0.15","currency":"USD"}}],"total":{"amount":"623.04","currency":"USD"},"amount":"623.04","currency":"USD"}' + string: '{"subtotal":{"amount":"601.08","currency":"USD"},"fees":[{"coinbase":{"amount":"6.01","currency":"USD"}},{"bank":{"amount":"0.15","currency":"USD"}}],"total":{"amount":"594.92","currency":"USD"},"amount":"594.92","currency":"USD"}' http_version: - recorded_at: Mon, 23 Dec 2013 01:46:12 GMT + recorded_at: Fri, 25 Jul 2014 17:19:46 GMT recorded_with: VCR 2.8.0