rbtc_arbitrage_simple 1.4.4 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +16 -14
- data/Gemfile.lock +17 -21
- data/lib/rbtc_arbitrage.rb +3 -1
- data/lib/rbtc_arbitrage/campbx.rb +3 -4
- data/lib/rbtc_arbitrage/cli.rb +2 -2
- data/lib/rbtc_arbitrage/clients/coinbase_client.rb +3 -2
- data/lib/rbtc_arbitrage/trader.rb +21 -75
- data/lib/rbtc_arbitrage/trader/logger.rb +31 -0
- data/lib/rbtc_arbitrage/trader/notifier.rb +60 -0
- data/lib/rbtc_arbitrage/version.rb +1 -1
- data/rbtc_arbitrage.gemspec +1 -1
- data/spec/clients/coinbase_client_spec.rb +2 -3
- data/spec/rbtc_arbitrage_spec.rb +1 -1
- data/spec/spec_helper.rb +2 -1
- data/spec/support/cassettes/RbtcArbitrage_Trader/_execute_trade/should_raise_SecurityError_if_not_live.yml +30 -25
- data/spec/support/cassettes/RbtcArbitrage_Trader/_execute_trade/when_live/raises_SecurityError_if_not_enough_BTC.yml +38 -24
- data/spec/support/cassettes/RbtcArbitrage_Trader/_execute_trade/when_live/raises_SecurityError_if_not_enough_USD.yml +40 -26
- data/spec/support/cassettes/RbtcArbitrage_Trader/_execute_trade/when_live/should_fetch_balance.yml +30 -25
- data/spec/support/cassettes/RbtcArbitrage_Trader/_execute_trade/when_live/shouldn_t_raise_security_error.yml +72 -53
- data/spec/support/cassettes/RbtcArbitrage_Trader/_fetch_prices/gets_the_right_price_set.yml +60 -50
- data/spec/trader_spec.rb +8 -8
- metadata +10 -19
- data/lib/rbtc_arbitrage/clients/mtgox_client.rb +0 -56
- data/spec/clients/mtgox_client_spec.rb +0 -53
- data/spec/support/cassettes/RbtcArbitrage_Clients_MtGoxClient/_balance/fetches_the_balance_correctly.yml +0 -77
- data/spec/support/cassettes/RbtcArbitrage_Clients_MtGoxClient/_price/fetches_price_for_buy_correctly.yml +0 -44
- data/spec/support/cassettes/RbtcArbitrage_Clients_MtGoxClient/_price/fetches_price_for_sell_correctly.yml +0 -44
- data/spec/support/cassettes/RbtcArbitrage_Clients_MtGoxClient/_price/fetches_prices_correctly.yml +0 -85
@@ -7,9 +7,8 @@ describe RbtcArbitrage::Clients::CoinbaseClient do
|
|
7
7
|
it { client.exchange.should == :coinbase }
|
8
8
|
|
9
9
|
describe "#balance" do
|
10
|
-
it "fetches the balance correctly"
|
11
|
-
|
12
|
-
expected = [balance, Float::MAX]
|
10
|
+
it "fetches the balance correctly" do
|
11
|
+
expected = [Float::MAX, Float::MAX]
|
13
12
|
client.balance.should eql(expected)
|
14
13
|
client.balance.each do |b|
|
15
14
|
b.should be_a(Float)
|
data/spec/rbtc_arbitrage_spec.rb
CHANGED
@@ -4,8 +4,8 @@ describe RbtcArbitrage do
|
|
4
4
|
describe ".clients" do
|
5
5
|
it "includes clients" do
|
6
6
|
clients = RbtcArbitrage.clients
|
7
|
-
clients.should include(RbtcArbitrage::Clients::MtGoxClient)
|
8
7
|
clients.should include(RbtcArbitrage::Clients::BtceClient)
|
8
|
+
clients.should include(RbtcArbitrage::Clients::CampbxClient)
|
9
9
|
end
|
10
10
|
end
|
11
11
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -10,11 +10,12 @@ SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
|
|
10
10
|
SimpleCov.start do
|
11
11
|
add_filter "/spec/"
|
12
12
|
add_filter "/lib/rbtc_arbitrage/campbx.rb"
|
13
|
+
add_filter "/bitstamp/"
|
13
14
|
end
|
14
15
|
|
15
16
|
require 'bundler'
|
16
17
|
require './lib/rbtc_arbitrage'
|
17
|
-
Bundler.require
|
18
|
+
Bundler.require(:default, :development)
|
18
19
|
|
19
20
|
VCR.configure do |c|
|
20
21
|
c.cassette_library_dir = 'spec/support/cassettes'
|
@@ -21,7 +21,7 @@ http_interactions:
|
|
21
21
|
Server:
|
22
22
|
- cloudflare-nginx
|
23
23
|
Date:
|
24
|
-
- Mon,
|
24
|
+
- Mon, 24 Mar 2014 01:13:01 GMT
|
25
25
|
Content-Type:
|
26
26
|
- application/json
|
27
27
|
Transfer-Encoding:
|
@@ -29,7 +29,7 @@ http_interactions:
|
|
29
29
|
Connection:
|
30
30
|
- keep-alive
|
31
31
|
Set-Cookie:
|
32
|
-
- __cfduid=
|
32
|
+
- __cfduid=d9ccfbc02e8e56296d3a44d48d5228e2d1395623580725; expires=Mon, 23-Dec-2019
|
33
33
|
23:50:00 GMT; path=/; domain=.campbx.com; HttpOnly
|
34
34
|
X-Frame-Options:
|
35
35
|
- SAMEORIGIN
|
@@ -38,51 +38,56 @@ http_interactions:
|
|
38
38
|
Vary:
|
39
39
|
- Accept-Encoding
|
40
40
|
Expires:
|
41
|
-
- Mon,
|
41
|
+
- Mon, 24 Mar 2014 02:12:55 GMT
|
42
42
|
Cf-Ray:
|
43
|
-
-
|
43
|
+
- 10ff00f38c860657-SJC
|
44
44
|
body:
|
45
45
|
encoding: UTF-8
|
46
|
-
string: '{"Last Trade":"
|
46
|
+
string: '{"Last Trade":"588.64","Best Bid":"581.87","Best Ask":"592.71"}'
|
47
47
|
http_version:
|
48
|
-
recorded_at: Mon,
|
48
|
+
recorded_at: Mon, 24 Mar 2014 01:13:01 GMT
|
49
49
|
- request:
|
50
50
|
method: get
|
51
|
-
uri: https://
|
51
|
+
uri: https://btc-e.com/api/2/btc_usd/ticker
|
52
52
|
body:
|
53
53
|
encoding: US-ASCII
|
54
54
|
string: ''
|
55
55
|
headers:
|
56
|
-
Accept:
|
57
|
-
- application/json
|
58
|
-
User-Agent:
|
59
|
-
- mtgox gem 1.1.0
|
60
56
|
Accept-Encoding:
|
61
57
|
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
58
|
+
Accept:
|
59
|
+
- '*/*'
|
60
|
+
User-Agent:
|
61
|
+
- Ruby
|
62
62
|
response:
|
63
63
|
status:
|
64
64
|
code: 200
|
65
65
|
message: OK
|
66
66
|
headers:
|
67
67
|
Server:
|
68
|
-
- nginx
|
69
|
-
Content-Type:
|
70
|
-
- application/json; charset=utf-8
|
71
|
-
Access-Control-Allow-Origin:
|
72
|
-
- '*'
|
73
|
-
Content-Length:
|
74
|
-
- '1377'
|
75
|
-
Cache-Control:
|
76
|
-
- public, max-age=21
|
77
|
-
Expires:
|
78
|
-
- Mon, 23 Dec 2013 16:50:59 GMT
|
68
|
+
- cloudflare-nginx
|
79
69
|
Date:
|
80
|
-
- Mon,
|
70
|
+
- Mon, 24 Mar 2014 01:13:01 GMT
|
71
|
+
Content-Type:
|
72
|
+
- text/html; charset=utf-8
|
73
|
+
Transfer-Encoding:
|
74
|
+
- chunked
|
81
75
|
Connection:
|
82
76
|
- keep-alive
|
77
|
+
Set-Cookie:
|
78
|
+
- __cfduid=dbe9ea8ca02ca24f921f0272eae89823c1395623581448; expires=Mon, 23-Dec-2019
|
79
|
+
23:50:00 GMT; path=/; domain=.btc-e.com; HttpOnly
|
80
|
+
X-Frame-Options:
|
81
|
+
- DENY
|
82
|
+
Expires:
|
83
|
+
- Thu, 01 Jan 1970 00:00:01 GMT
|
84
|
+
Cache-Control:
|
85
|
+
- no-cache
|
86
|
+
Cf-Ray:
|
87
|
+
- 10ff00f80a290701-SJC
|
83
88
|
body:
|
84
89
|
encoding: UTF-8
|
85
|
-
string: '{"
|
90
|
+
string: '{"ticker":{"high":577,"low":561.21503,"avg":569.107515,"vol":1378796.15736,"vol_cur":2423.35249,"last":563.988,"buy":564.989,"sell":563.988,"updated":1395623580,"server_time":1395623581}}'
|
86
91
|
http_version:
|
87
|
-
recorded_at: Mon,
|
92
|
+
recorded_at: Mon, 24 Mar 2014 01:13:01 GMT
|
88
93
|
recorded_with: VCR 2.8.0
|
@@ -2,36 +2,50 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: post
|
5
|
-
uri: https://
|
5
|
+
uri: https://btc-e.com/tapi
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: method=getInfo&nonce=1395624101
|
9
|
+
headers:
|
10
|
+
Accept-Encoding:
|
11
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
12
|
+
Accept:
|
13
|
+
- '*/*'
|
14
|
+
User-Agent:
|
15
|
+
- Ruby
|
16
|
+
Content-Type:
|
17
|
+
- application/x-www-form-urlencoded
|
6
18
|
response:
|
7
19
|
status:
|
8
20
|
code: 200
|
9
21
|
message: OK
|
10
22
|
headers:
|
11
23
|
Server:
|
12
|
-
- nginx
|
24
|
+
- cloudflare-nginx
|
25
|
+
Date:
|
26
|
+
- Mon, 24 Mar 2014 01:21:41 GMT
|
13
27
|
Content-Type:
|
14
|
-
-
|
15
|
-
|
16
|
-
-
|
17
|
-
|
18
|
-
-
|
28
|
+
- text/html; charset=utf-8
|
29
|
+
Transfer-Encoding:
|
30
|
+
- chunked
|
31
|
+
Connection:
|
32
|
+
- keep-alive
|
33
|
+
Set-Cookie:
|
34
|
+
- __cfduid=d0cc647fc907074b1b948005348143a7a1395624101391; expires=Mon, 23-Dec-2019
|
35
|
+
23:50:00 GMT; path=/; domain=.btc-e.com; HttpOnly
|
36
|
+
X-Frame-Options:
|
37
|
+
- DENY
|
19
38
|
Expires:
|
20
|
-
-
|
39
|
+
- Thu, 01 Jan 1970 00:00:01 GMT
|
21
40
|
Cache-Control:
|
22
|
-
- max-age=0, no-cache, no-store
|
23
|
-
Pragma:
|
24
41
|
- no-cache
|
25
|
-
|
26
|
-
-
|
27
|
-
Connection:
|
28
|
-
- keep-alive
|
42
|
+
Cf-Ray:
|
43
|
+
- 10ff0da9143b0701-SJC
|
29
44
|
body:
|
30
45
|
encoding: UTF-8
|
31
|
-
string: '{"
|
32
|
-
|
33
|
-
|
34
|
-
recorded_at: Mon, 23 Dec 2013 16:52:19 GMT
|
46
|
+
string: '{"success":1,"return":{"funds":{"usd":0,"btc":0,"ltc":0,"nmc":0,"rur":0,"eur":0,"nvc":0,"trc":0,"ppc":0,"ftc":0,"xpm":0},"rights":{"info":1,"trade":1,"withdraw":0},"transaction_count":0,"open_orders":0,"server_time":1395624101}}'
|
47
|
+
http_version:
|
48
|
+
recorded_at: Mon, 24 Mar 2014 01:21:41 GMT
|
35
49
|
- request:
|
36
50
|
method: post
|
37
51
|
uri: https://campbx.com/api/myfunds.php
|
@@ -52,7 +66,7 @@ http_interactions:
|
|
52
66
|
Server:
|
53
67
|
- cloudflare-nginx
|
54
68
|
Date:
|
55
|
-
- Mon,
|
69
|
+
- Mon, 24 Mar 2014 01:21:42 GMT
|
56
70
|
Content-Type:
|
57
71
|
- application/json
|
58
72
|
Transfer-Encoding:
|
@@ -60,7 +74,7 @@ http_interactions:
|
|
60
74
|
Connection:
|
61
75
|
- keep-alive
|
62
76
|
Set-Cookie:
|
63
|
-
- __cfduid=
|
77
|
+
- __cfduid=d868c00c39bae7657fd15e92a3f09616d1395624102072; expires=Mon, 23-Dec-2019
|
64
78
|
23:50:00 GMT; path=/; domain=.campbx.com; HttpOnly
|
65
79
|
X-Frame-Options:
|
66
80
|
- SAMEORIGIN
|
@@ -69,13 +83,13 @@ http_interactions:
|
|
69
83
|
Vary:
|
70
84
|
- Accept-Encoding
|
71
85
|
Expires:
|
72
|
-
- Mon,
|
86
|
+
- Mon, 24 Mar 2014 02:21:36 GMT
|
73
87
|
Cf-Ray:
|
74
|
-
-
|
88
|
+
- 10ff0dad65cb012b-SJC
|
75
89
|
body:
|
76
90
|
encoding: UTF-8
|
77
91
|
string: '{"Total USD":"1.41","Total BTC":"0.00790000","Liquid USD":"1.41","Liquid
|
78
92
|
BTC":"0.00790000","Margin Account USD":"0.00","Margin Account BTC":"0.00000000"}'
|
79
|
-
http_version:
|
80
|
-
recorded_at: Mon,
|
93
|
+
http_version:
|
94
|
+
recorded_at: Mon, 24 Mar 2014 01:21:42 GMT
|
81
95
|
recorded_with: VCR 2.8.0
|
@@ -2,36 +2,50 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: post
|
5
|
-
uri: https://
|
5
|
+
uri: https://btc-e.com/tapi
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: method=getInfo&nonce=1395624054
|
9
|
+
headers:
|
10
|
+
Accept-Encoding:
|
11
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
12
|
+
Accept:
|
13
|
+
- '*/*'
|
14
|
+
User-Agent:
|
15
|
+
- Ruby
|
16
|
+
Content-Type:
|
17
|
+
- application/x-www-form-urlencoded
|
6
18
|
response:
|
7
19
|
status:
|
8
20
|
code: 200
|
9
21
|
message: OK
|
10
22
|
headers:
|
11
23
|
Server:
|
12
|
-
- nginx
|
24
|
+
- cloudflare-nginx
|
25
|
+
Date:
|
26
|
+
- Mon, 24 Mar 2014 01:20:54 GMT
|
13
27
|
Content-Type:
|
14
|
-
-
|
15
|
-
|
16
|
-
-
|
17
|
-
|
18
|
-
-
|
28
|
+
- text/html; charset=utf-8
|
29
|
+
Transfer-Encoding:
|
30
|
+
- chunked
|
31
|
+
Connection:
|
32
|
+
- keep-alive
|
33
|
+
Set-Cookie:
|
34
|
+
- __cfduid=daedd562d62bc3ded064487bcdcf373ee1395624054845; expires=Mon, 23-Dec-2019
|
35
|
+
23:50:00 GMT; path=/; domain=.btc-e.com; HttpOnly
|
36
|
+
X-Frame-Options:
|
37
|
+
- DENY
|
19
38
|
Expires:
|
20
|
-
-
|
39
|
+
- Thu, 01 Jan 1970 00:00:01 GMT
|
21
40
|
Cache-Control:
|
22
|
-
- max-age=0, no-cache, no-store
|
23
|
-
Pragma:
|
24
41
|
- no-cache
|
25
|
-
|
26
|
-
-
|
27
|
-
Connection:
|
28
|
-
- keep-alive
|
42
|
+
Cf-Ray:
|
43
|
+
- 10ff0c865b850129-SJC
|
29
44
|
body:
|
30
45
|
encoding: UTF-8
|
31
|
-
string: '{"
|
32
|
-
|
33
|
-
|
34
|
-
recorded_at: Mon, 23 Dec 2013 16:51:11 GMT
|
46
|
+
string: '{"success":1,"return":{"funds":{"usd":0,"btc":0,"ltc":0,"nmc":0,"rur":0,"eur":0,"nvc":0,"trc":0,"ppc":0,"ftc":0,"xpm":0},"rights":{"info":1,"trade":1,"withdraw":0},"transaction_count":0,"open_orders":0,"server_time":1395624054}}'
|
47
|
+
http_version:
|
48
|
+
recorded_at: Mon, 24 Mar 2014 01:20:54 GMT
|
35
49
|
- request:
|
36
50
|
method: post
|
37
51
|
uri: https://campbx.com/api/myfunds.php
|
@@ -52,7 +66,7 @@ http_interactions:
|
|
52
66
|
Server:
|
53
67
|
- cloudflare-nginx
|
54
68
|
Date:
|
55
|
-
- Mon,
|
69
|
+
- Mon, 24 Mar 2014 01:20:55 GMT
|
56
70
|
Content-Type:
|
57
71
|
- application/json
|
58
72
|
Transfer-Encoding:
|
@@ -60,7 +74,7 @@ http_interactions:
|
|
60
74
|
Connection:
|
61
75
|
- keep-alive
|
62
76
|
Set-Cookie:
|
63
|
-
- __cfduid=
|
77
|
+
- __cfduid=d3910086127b9b197855ec7c9236f3c681395624055468; expires=Mon, 23-Dec-2019
|
64
78
|
23:50:00 GMT; path=/; domain=.campbx.com; HttpOnly
|
65
79
|
X-Frame-Options:
|
66
80
|
- SAMEORIGIN
|
@@ -69,13 +83,13 @@ http_interactions:
|
|
69
83
|
Vary:
|
70
84
|
- Accept-Encoding
|
71
85
|
Expires:
|
72
|
-
- Mon,
|
86
|
+
- Mon, 24 Mar 2014 02:20:50 GMT
|
73
87
|
Cf-Ray:
|
74
|
-
-
|
88
|
+
- 10ff0c8a316f012b-SJC
|
75
89
|
body:
|
76
90
|
encoding: UTF-8
|
77
|
-
string:
|
78
|
-
BTC
|
79
|
-
http_version:
|
80
|
-
recorded_at: Mon,
|
91
|
+
string: '{"Total USD":"1.41","Total BTC":"0.00790000","Liquid USD":"1.41","Liquid
|
92
|
+
BTC":"0.00790000","Margin Account USD":"0.00","Margin Account BTC":"0.00000000"}'
|
93
|
+
http_version:
|
94
|
+
recorded_at: Mon, 24 Mar 2014 01:20:55 GMT
|
81
95
|
recorded_with: VCR 2.8.0
|
data/spec/support/cassettes/RbtcArbitrage_Trader/_execute_trade/when_live/should_fetch_balance.yml
CHANGED
@@ -21,7 +21,7 @@ http_interactions:
|
|
21
21
|
Server:
|
22
22
|
- cloudflare-nginx
|
23
23
|
Date:
|
24
|
-
- Mon,
|
24
|
+
- Mon, 24 Mar 2014 01:21:36 GMT
|
25
25
|
Content-Type:
|
26
26
|
- application/json
|
27
27
|
Transfer-Encoding:
|
@@ -29,7 +29,7 @@ http_interactions:
|
|
29
29
|
Connection:
|
30
30
|
- keep-alive
|
31
31
|
Set-Cookie:
|
32
|
-
- __cfduid=
|
32
|
+
- __cfduid=d9283230678b5bfe878acd868015fef501395624095839; expires=Mon, 23-Dec-2019
|
33
33
|
23:50:00 GMT; path=/; domain=.campbx.com; HttpOnly
|
34
34
|
X-Frame-Options:
|
35
35
|
- SAMEORIGIN
|
@@ -38,51 +38,56 @@ http_interactions:
|
|
38
38
|
Vary:
|
39
39
|
- Accept-Encoding
|
40
40
|
Expires:
|
41
|
-
- Mon,
|
41
|
+
- Mon, 24 Mar 2014 02:21:30 GMT
|
42
42
|
Cf-Ray:
|
43
|
-
-
|
43
|
+
- 10ff0d86fe3b0657-SJC
|
44
44
|
body:
|
45
45
|
encoding: UTF-8
|
46
|
-
string: '{"Last Trade":"
|
46
|
+
string: '{"Last Trade":"588.64","Best Bid":"581.87","Best Ask":"595.02"}'
|
47
47
|
http_version:
|
48
|
-
recorded_at: Mon,
|
48
|
+
recorded_at: Mon, 24 Mar 2014 01:21:36 GMT
|
49
49
|
- request:
|
50
50
|
method: get
|
51
|
-
uri: https://
|
51
|
+
uri: https://btc-e.com/api/2/btc_usd/ticker
|
52
52
|
body:
|
53
53
|
encoding: US-ASCII
|
54
54
|
string: ''
|
55
55
|
headers:
|
56
|
-
Accept:
|
57
|
-
- application/json
|
58
|
-
User-Agent:
|
59
|
-
- mtgox gem 1.1.0
|
60
56
|
Accept-Encoding:
|
61
57
|
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
58
|
+
Accept:
|
59
|
+
- '*/*'
|
60
|
+
User-Agent:
|
61
|
+
- Ruby
|
62
62
|
response:
|
63
63
|
status:
|
64
64
|
code: 200
|
65
65
|
message: OK
|
66
66
|
headers:
|
67
67
|
Server:
|
68
|
-
- nginx
|
69
|
-
Content-Type:
|
70
|
-
- application/json; charset=utf-8
|
71
|
-
Access-Control-Allow-Origin:
|
72
|
-
- '*'
|
73
|
-
Content-Length:
|
74
|
-
- '1377'
|
75
|
-
Cache-Control:
|
76
|
-
- public, max-age=17
|
77
|
-
Expires:
|
78
|
-
- Mon, 23 Dec 2013 16:53:00 GMT
|
68
|
+
- cloudflare-nginx
|
79
69
|
Date:
|
80
|
-
- Mon,
|
70
|
+
- Mon, 24 Mar 2014 01:21:36 GMT
|
71
|
+
Content-Type:
|
72
|
+
- text/html; charset=utf-8
|
73
|
+
Transfer-Encoding:
|
74
|
+
- chunked
|
81
75
|
Connection:
|
82
76
|
- keep-alive
|
77
|
+
Set-Cookie:
|
78
|
+
- __cfduid=d8c3646db5b40b611f2f3d25f8434bee81395624096677; expires=Mon, 23-Dec-2019
|
79
|
+
23:50:00 GMT; path=/; domain=.btc-e.com; HttpOnly
|
80
|
+
X-Frame-Options:
|
81
|
+
- DENY
|
82
|
+
Expires:
|
83
|
+
- Thu, 01 Jan 1970 00:00:01 GMT
|
84
|
+
Cache-Control:
|
85
|
+
- no-cache
|
86
|
+
Cf-Ray:
|
87
|
+
- 10ff0d8c320d0701-SJC
|
83
88
|
body:
|
84
89
|
encoding: UTF-8
|
85
|
-
string: '{"
|
90
|
+
string: '{"ticker":{"high":577,"low":561.01001,"avg":569.005005,"vol":1400936.05639,"vol_cur":2462.82808,"last":561.288,"buy":561.882,"sell":561.288,"updated":1395624094,"server_time":1395624096}}'
|
86
91
|
http_version:
|
87
|
-
recorded_at: Mon,
|
92
|
+
recorded_at: Mon, 24 Mar 2014 01:21:37 GMT
|
88
93
|
recorded_with: VCR 2.8.0
|
@@ -21,7 +21,7 @@ http_interactions:
|
|
21
21
|
Server:
|
22
22
|
- cloudflare-nginx
|
23
23
|
Date:
|
24
|
-
- Mon,
|
24
|
+
- Mon, 24 Mar 2014 01:21:44 GMT
|
25
25
|
Content-Type:
|
26
26
|
- application/json
|
27
27
|
Transfer-Encoding:
|
@@ -29,7 +29,7 @@ http_interactions:
|
|
29
29
|
Connection:
|
30
30
|
- keep-alive
|
31
31
|
Set-Cookie:
|
32
|
-
- __cfduid=
|
32
|
+
- __cfduid=d45238e17ceb6ee684e9ed3bafee828471395624103601; expires=Mon, 23-Dec-2019
|
33
33
|
23:50:00 GMT; path=/; domain=.campbx.com; HttpOnly
|
34
34
|
X-Frame-Options:
|
35
35
|
- SAMEORIGIN
|
@@ -38,85 +38,104 @@ http_interactions:
|
|
38
38
|
Vary:
|
39
39
|
- Accept-Encoding
|
40
40
|
Expires:
|
41
|
-
- Mon,
|
41
|
+
- Mon, 24 Mar 2014 02:21:38 GMT
|
42
42
|
Cf-Ray:
|
43
|
-
-
|
43
|
+
- 10ff0db785db012b-SJC
|
44
44
|
body:
|
45
45
|
encoding: UTF-8
|
46
|
-
string: '{"Last Trade":"
|
47
|
-
http_version:
|
48
|
-
recorded_at: Mon,
|
46
|
+
string: '{"Last Trade":"588.64","Best Bid":"581.87","Best Ask":"595.01"}'
|
47
|
+
http_version:
|
48
|
+
recorded_at: Mon, 24 Mar 2014 01:21:44 GMT
|
49
49
|
- request:
|
50
50
|
method: get
|
51
|
-
uri: https://
|
51
|
+
uri: https://btc-e.com/api/2/btc_usd/ticker
|
52
52
|
body:
|
53
53
|
encoding: US-ASCII
|
54
54
|
string: ''
|
55
55
|
headers:
|
56
|
-
Accept:
|
57
|
-
- application/json
|
58
|
-
User-Agent:
|
59
|
-
- mtgox gem 1.1.0
|
60
56
|
Accept-Encoding:
|
61
57
|
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
58
|
+
Accept:
|
59
|
+
- '*/*'
|
60
|
+
User-Agent:
|
61
|
+
- Ruby
|
62
62
|
response:
|
63
63
|
status:
|
64
64
|
code: 200
|
65
65
|
message: OK
|
66
66
|
headers:
|
67
67
|
Server:
|
68
|
-
- nginx
|
69
|
-
Content-Type:
|
70
|
-
- application/json; charset=utf-8
|
71
|
-
Access-Control-Allow-Origin:
|
72
|
-
- '*'
|
73
|
-
Content-Length:
|
74
|
-
- '1387'
|
75
|
-
Cache-Control:
|
76
|
-
- public, max-age=10
|
77
|
-
Expires:
|
78
|
-
- Mon, 23 Dec 2013 16:52:33 GMT
|
68
|
+
- cloudflare-nginx
|
79
69
|
Date:
|
80
|
-
- Mon,
|
70
|
+
- Mon, 24 Mar 2014 01:21:45 GMT
|
71
|
+
Content-Type:
|
72
|
+
- text/html; charset=utf-8
|
73
|
+
Transfer-Encoding:
|
74
|
+
- chunked
|
81
75
|
Connection:
|
82
76
|
- keep-alive
|
77
|
+
Set-Cookie:
|
78
|
+
- __cfduid=dbefbb482c999a6850d15b9bd9d87616d1395624105369; expires=Mon, 23-Dec-2019
|
79
|
+
23:50:00 GMT; path=/; domain=.btc-e.com; HttpOnly
|
80
|
+
X-Frame-Options:
|
81
|
+
- DENY
|
82
|
+
Expires:
|
83
|
+
- Thu, 01 Jan 1970 00:00:01 GMT
|
84
|
+
Cache-Control:
|
85
|
+
- no-cache
|
86
|
+
Cf-Ray:
|
87
|
+
- 10ff0dc288dd0701-SJC
|
83
88
|
body:
|
84
89
|
encoding: UTF-8
|
85
|
-
string: '{"
|
86
|
-
http_version:
|
87
|
-
recorded_at: Mon,
|
90
|
+
string: '{"ticker":{"high":577,"low":561.01001,"avg":569.005005,"vol":1400936.05639,"vol_cur":2462.82808,"last":561.882,"buy":561.882,"sell":561.288,"updated":1395624104,"server_time":1395624105}}'
|
91
|
+
http_version:
|
92
|
+
recorded_at: Mon, 24 Mar 2014 01:21:45 GMT
|
88
93
|
- request:
|
89
94
|
method: post
|
90
|
-
uri: https://
|
95
|
+
uri: https://btc-e.com/tapi
|
96
|
+
body:
|
97
|
+
encoding: US-ASCII
|
98
|
+
string: method=getInfo&nonce=1395624105
|
99
|
+
headers:
|
100
|
+
Accept-Encoding:
|
101
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
102
|
+
Accept:
|
103
|
+
- '*/*'
|
104
|
+
User-Agent:
|
105
|
+
- Ruby
|
106
|
+
Content-Type:
|
107
|
+
- application/x-www-form-urlencoded
|
91
108
|
response:
|
92
109
|
status:
|
93
110
|
code: 200
|
94
111
|
message: OK
|
95
112
|
headers:
|
96
113
|
Server:
|
97
|
-
- nginx
|
114
|
+
- cloudflare-nginx
|
115
|
+
Date:
|
116
|
+
- Mon, 24 Mar 2014 01:21:45 GMT
|
98
117
|
Content-Type:
|
99
|
-
-
|
100
|
-
|
101
|
-
-
|
102
|
-
|
103
|
-
-
|
118
|
+
- text/html; charset=utf-8
|
119
|
+
Transfer-Encoding:
|
120
|
+
- chunked
|
121
|
+
Connection:
|
122
|
+
- keep-alive
|
123
|
+
Set-Cookie:
|
124
|
+
- __cfduid=dda67cb1620704a4220047d5ecc0c10f71395624105706; expires=Mon, 23-Dec-2019
|
125
|
+
23:50:00 GMT; path=/; domain=.btc-e.com; HttpOnly
|
126
|
+
X-Frame-Options:
|
127
|
+
- DENY
|
104
128
|
Expires:
|
105
|
-
-
|
129
|
+
- Thu, 01 Jan 1970 00:00:01 GMT
|
106
130
|
Cache-Control:
|
107
|
-
- max-age=0, no-cache, no-store
|
108
|
-
Pragma:
|
109
131
|
- no-cache
|
110
|
-
|
111
|
-
-
|
112
|
-
Connection:
|
113
|
-
- keep-alive
|
132
|
+
Cf-Ray:
|
133
|
+
- 10ff0dc41d990701-SJC
|
114
134
|
body:
|
115
135
|
encoding: UTF-8
|
116
|
-
string: '{"
|
117
|
-
|
118
|
-
|
119
|
-
recorded_at: Mon, 23 Dec 2013 16:52:22 GMT
|
136
|
+
string: '{"success":1,"return":{"funds":{"usd":0,"btc":0,"ltc":0,"nmc":0,"rur":0,"eur":0,"nvc":0,"trc":0,"ppc":0,"ftc":0,"xpm":0},"rights":{"info":1,"trade":1,"withdraw":0},"transaction_count":0,"open_orders":0,"server_time":1395624105}}'
|
137
|
+
http_version:
|
138
|
+
recorded_at: Mon, 24 Mar 2014 01:21:45 GMT
|
120
139
|
- request:
|
121
140
|
method: post
|
122
141
|
uri: https://campbx.com/api/myfunds.php
|
@@ -137,7 +156,7 @@ http_interactions:
|
|
137
156
|
Server:
|
138
157
|
- cloudflare-nginx
|
139
158
|
Date:
|
140
|
-
- Mon,
|
159
|
+
- Mon, 24 Mar 2014 01:21:46 GMT
|
141
160
|
Content-Type:
|
142
161
|
- application/json
|
143
162
|
Transfer-Encoding:
|
@@ -145,7 +164,7 @@ http_interactions:
|
|
145
164
|
Connection:
|
146
165
|
- keep-alive
|
147
166
|
Set-Cookie:
|
148
|
-
- __cfduid=
|
167
|
+
- __cfduid=da275613e0baee065fa7271f31df929a91395624106027; expires=Mon, 23-Dec-2019
|
149
168
|
23:50:00 GMT; path=/; domain=.campbx.com; HttpOnly
|
150
169
|
X-Frame-Options:
|
151
170
|
- SAMEORIGIN
|
@@ -154,13 +173,13 @@ http_interactions:
|
|
154
173
|
Vary:
|
155
174
|
- Accept-Encoding
|
156
175
|
Expires:
|
157
|
-
- Mon,
|
176
|
+
- Mon, 24 Mar 2014 02:21:40 GMT
|
158
177
|
Cf-Ray:
|
159
|
-
-
|
178
|
+
- 10ff0dc63050012b-SJC
|
160
179
|
body:
|
161
180
|
encoding: UTF-8
|
162
|
-
string:
|
163
|
-
BTC
|
164
|
-
http_version:
|
165
|
-
recorded_at: Mon,
|
181
|
+
string: '{"Total USD":"1.41","Total BTC":"0.00790000","Liquid USD":"1.41","Liquid
|
182
|
+
BTC":"0.00790000","Margin Account USD":"0.00","Margin Account BTC":"0.00000000"}'
|
183
|
+
http_version:
|
184
|
+
recorded_at: Mon, 24 Mar 2014 01:21:46 GMT
|
166
185
|
recorded_with: VCR 2.8.0
|