rbtc_arbitrage 0.1.0 → 1.0.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.
Files changed (38) hide show
  1. checksums.yaml +6 -6
  2. data/.rspec +1 -1
  3. data/.travis.yml +13 -3
  4. data/Gemfile +10 -0
  5. data/Guardfile +8 -0
  6. data/README.md +41 -3
  7. data/btce-api-key.yml +2 -0
  8. data/lib/rbtc_arbitrage/campbx.rb +98 -0
  9. data/lib/rbtc_arbitrage/cli.rb +3 -1
  10. data/lib/rbtc_arbitrage/client.rb +45 -0
  11. data/lib/rbtc_arbitrage/clients/bitstamp_client.rb +52 -0
  12. data/lib/rbtc_arbitrage/clients/mtgox_client.rb +45 -0
  13. data/lib/rbtc_arbitrage/trader.rb +62 -66
  14. data/lib/rbtc_arbitrage/version.rb +1 -1
  15. data/lib/rbtc_arbitrage.rb +3 -1
  16. data/rbtc_arbitrage.gemspec +2 -0
  17. data/spec/cli_spec.rb +8 -0
  18. data/spec/client_spec.rb +18 -0
  19. data/spec/clients/bitstamp_client_spec.rb +53 -0
  20. data/spec/clients/mtgox_client_spec.rb +52 -0
  21. data/spec/spec_helper.rb +27 -12
  22. data/spec/support/cassettes/RbtcArbitrage_Clients_BitstampClient/_balance/fetches_the_balance_correctly.yml +96 -0
  23. data/spec/support/cassettes/RbtcArbitrage_Clients_BitstampClient/_price/fetches_price_for_buy_correctly.yml +52 -0
  24. data/spec/support/cassettes/RbtcArbitrage_Clients_BitstampClient/_price/fetches_price_for_sell_correctly.yml +52 -0
  25. data/spec/support/cassettes/RbtcArbitrage_Clients_BitstampClient/_price/fetches_prices_correctly.yml +44 -0
  26. data/spec/support/cassettes/RbtcArbitrage_Clients_MtGoxClient/_balance/fetches_the_balance_correctly.yml +77 -0
  27. data/spec/support/cassettes/RbtcArbitrage_Clients_MtGoxClient/_price/fetches_price_for_buy_correctly.yml +44 -0
  28. data/spec/support/cassettes/RbtcArbitrage_Clients_MtGoxClient/_price/fetches_price_for_sell_correctly.yml +44 -0
  29. data/spec/support/cassettes/RbtcArbitrage_Clients_MtGoxClient/_price/fetches_prices_correctly.yml +85 -0
  30. data/spec/support/cassettes/RbtcArbitrage_Trader/_execute_trade/should_raise_SecurityError_if_not_live.yml +93 -0
  31. data/spec/support/cassettes/RbtcArbitrage_Trader/_execute_trade/when_live/raises_SecurityError_if_not_enough_BTC.yml +86 -0
  32. data/spec/support/cassettes/RbtcArbitrage_Trader/_execute_trade/when_live/raises_SecurityError_if_not_enough_USD.yml +80 -0
  33. data/spec/support/cassettes/RbtcArbitrage_Trader/_execute_trade/when_live/should_fetch_balance.yml +225 -0
  34. data/spec/support/cassettes/RbtcArbitrage_Trader/_execute_trade/when_live/shouldn_t_raise_security_error.yml +262 -0
  35. data/spec/support/cassettes/RbtcArbitrage_Trader/_fetch_prices/gets_the_right_price_set.yml +176 -0
  36. data/spec/support/cassettes/RbtcArbitrage_Trader/_get_balance/fetches_the_right_balance.yml +166 -0
  37. data/spec/trader_spec.rb +156 -19
  38. metadata +89 -18
@@ -0,0 +1,93 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://data.mtgox.com/api/1/BTCUSD/ticker
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept:
11
+ - application/json
12
+ User-Agent:
13
+ - mtgox gem 1.1.0
14
+ Accept-Encoding:
15
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
16
+ response:
17
+ status:
18
+ code: 200
19
+ message: OK
20
+ headers:
21
+ Server:
22
+ - nginx/1.4.4
23
+ Content-Type:
24
+ - application/json; charset=utf-8
25
+ X-Powered-By:
26
+ - PHP/5.5.4
27
+ Access-Control-Allow-Origin:
28
+ - '*'
29
+ Content-Length:
30
+ - '1377'
31
+ Cache-Control:
32
+ - public, max-age=23
33
+ Expires:
34
+ - Fri, 13 Dec 2013 23:46:23 GMT
35
+ Date:
36
+ - Fri, 13 Dec 2013 23:46:00 GMT
37
+ Connection:
38
+ - keep-alive
39
+ body:
40
+ encoding: UTF-8
41
+ string: '{"result":"success","return":{"high":{"value":"990.00000","value_int":"99000000","display":"$990.00","display_short":"$990.00","currency":"USD"},"low":{"value":"882.15864","value_int":"88215864","display":"$882.16","display_short":"$882.16","currency":"USD"},"avg":{"value":"929.35648","value_int":"92935648","display":"$929.36","display_short":"$929.36","currency":"USD"},"vwap":{"value":"930.71887","value_int":"93071887","display":"$930.72","display_short":"$930.72","currency":"USD"},"vol":{"value":"16658.49512372","value_int":"1665849512372","display":"16,658.50\u00a0BTC","display_short":"16,658.50\u00a0BTC","currency":"BTC"},"last_local":{"value":"933.00000","value_int":"93300000","display":"$933.00","display_short":"$933.00","currency":"USD"},"last_orig":{"value":"933.00000","value_int":"93300000","display":"$933.00","display_short":"$933.00","currency":"USD"},"last_all":{"value":"933.00000","value_int":"93300000","display":"$933.00","display_short":"$933.00","currency":"USD"},"last":{"value":"933.00000","value_int":"93300000","display":"$933.00","display_short":"$933.00","currency":"USD"},"buy":{"value":"923.01500","value_int":"92301500","display":"$923.02","display_short":"$923.02","currency":"USD"},"sell":{"value":"932.99500","value_int":"93299500","display":"$933.00","display_short":"$933.00","currency":"USD"},"item":"BTC","now":"1386978350330653"}}'
42
+ http_version:
43
+ recorded_at: Fri, 13 Dec 2013 23:45:59 GMT
44
+ - request:
45
+ method: get
46
+ uri: https://www.bitstamp.net/api/ticker/
47
+ body:
48
+ encoding: US-ASCII
49
+ string: ''
50
+ headers: {}
51
+ response:
52
+ status:
53
+ code: 200
54
+ message: OK
55
+ headers:
56
+ Date:
57
+ - Fri, 13 Dec 2013 23:46:01 GMT
58
+ Server:
59
+ - Apache
60
+ Content-Language:
61
+ - en
62
+ Expires:
63
+ - Fri, 13 Dec 2013 23:46:01 GMT
64
+ Vary:
65
+ - Accept-Language
66
+ Cache-Control:
67
+ - max-age=0
68
+ Last-Modified:
69
+ - Fri, 13 Dec 2013 23:46:01 GMT
70
+ Connection:
71
+ - close
72
+ Transfer-Encoding:
73
+ - chunked
74
+ Content-Type:
75
+ - application/json
76
+ Set-Cookie:
77
+ - incap_ses_124_99025=1AGJPcUZxAWETOnVAYq4ATmcq1IAAAAAsPOre1PyXZcqEJH1uY4Qfg==;
78
+ path=/; Domain=.bitstamp.net
79
+ - nlbi_99025=/DSMfH+W5Ew2ED96Itob8gAAAAAGzFr9JBde9Z+4ZeBXJbWF; path=/; Domain=.bitstamp.net
80
+ - visid_incap_99025=QgG3duHHS6OybwUjvo9t3Ticq1IAAAAAQUIPAAAAAABm3P8tzeXhQXHryTzg9Y1Y;
81
+ expires=Sun, 13 Dec 2015 10:19:32 GMT; path=/; Domain=.bitstamp.net
82
+ X-Iinfo:
83
+ - 5-187947047-187947137 NNNY CT(197 197 0) RT(1386978360501 172) q(0 0 4 0)
84
+ r(4 6) U6
85
+ X-Cdn:
86
+ - Incapsula
87
+ body:
88
+ encoding: ASCII-8BIT
89
+ string: '{"high": "920.42", "last": "883.00", "timestamp": "1386978349", "bid":
90
+ "879.36", "volume": "14666.53257818", "low": "850.00", "ask": "883.00"}'
91
+ http_version:
92
+ recorded_at: Fri, 13 Dec 2013 23:46:00 GMT
93
+ recorded_with: VCR 2.7.0
@@ -0,0 +1,86 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://data.mtgox.com/api/1/generic/info
6
+ body:
7
+ encoding: US-ASCII
8
+ string: nonce=1386980225106143
9
+ response:
10
+ status:
11
+ code: 200
12
+ message: OK
13
+ headers:
14
+ Server:
15
+ - nginx/1.4.4
16
+ Content-Type:
17
+ - application/json; charset=utf-8
18
+ X-Powered-By:
19
+ - PHP/5.5.4
20
+ Access-Control-Allow-Origin:
21
+ - '*'
22
+ Content-Length:
23
+ - '1731'
24
+ Expires:
25
+ - Sat, 14 Dec 2013 00:17:07 GMT
26
+ Cache-Control:
27
+ - max-age=0, no-cache, no-store
28
+ Pragma:
29
+ - no-cache
30
+ Date:
31
+ - Sat, 14 Dec 2013 00:17:07 GMT
32
+ Connection:
33
+ - keep-alive
34
+ body:
35
+ encoding: UTF-8
36
+ string: '{"result":"success","return":{"Login":"heynk","Index":"141119","Id":"84fdd298-4386-4d7c-86c0-af74f2e0d0ec","Link":"M82141119X","Rights":["deposit","get_info","merchant","trade","withdraw"],"Language":"en_US","Created":"2012-04-07
37
+ 13:52:16","Last_Login":"2013-10-15 20:52:29","Wallets":{"BTC":{"Balance":{"value":"0.00000133","value_int":"133","display":"0.00000133\u00a0BTC","display_short":"0.00\u00a0BTC","currency":"BTC"},"Operations":1,"Daily_Withdraw_Limit":{"value":"100.00000000","value_int":"10000000000","display":"100.00000000\u00a0BTC","display_short":"100.00\u00a0BTC","currency":"BTC"},"Monthly_Withdraw_Limit":null,"Max_Withdraw":{"value":"100.00000000","value_int":"10000000000","display":"100.00000000\u00a0BTC","display_short":"100.00\u00a0BTC","currency":"BTC"},"Open_Orders":{"value":"0.00000000","value_int":"0","display":"0.00000000\u00a0BTC","display_short":"0.00\u00a0BTC","currency":"BTC"}},"USD":{"Balance":{"value":"0.00000","value_int":"0","display":"$0.00000","display_short":"$0.00","currency":"USD"},"Operations":0,"Daily_Withdraw_Limit":{"value":"1000.00000","value_int":"100000000","display":"$1,000.00000","display_short":"$1,000.00","currency":"USD"},"Monthly_Withdraw_Limit":{"value":"10000.00000","value_int":"1000000000","display":"$10,000.00000","display_short":"$10,000.00","currency":"USD"},"Max_Withdraw":{"value":"1000.00000","value_int":"100000000","display":"$1,000.00000","display_short":"$1,000.00","currency":"USD"},"Open_Orders":{"value":"0.00000","value_int":"0","display":"$0.00000","display_short":"$0.00","currency":"USD"}}},"Monthly_Volume":{"value":"0.00000000","value_int":"0","display":"0.00000000\u00a0BTC","display_short":"0.00\u00a0BTC","currency":"BTC"},"Trade_Fee":0.6}}'
38
+ http_version:
39
+ recorded_at: Sat, 14 Dec 2013 00:17:06 GMT
40
+ - request:
41
+ method: post
42
+ uri: https://www.bitstamp.net/api/balance/
43
+ headers: {}
44
+ response:
45
+ status:
46
+ code: 200
47
+ message: OK
48
+ headers:
49
+ Date:
50
+ - Sat, 14 Dec 2013 00:17:07 GMT
51
+ Server:
52
+ - Apache
53
+ Content-Language:
54
+ - en
55
+ Expires:
56
+ - Sat, 14 Dec 2013 00:17:07 GMT
57
+ Vary:
58
+ - Accept-Language
59
+ Cache-Control:
60
+ - max-age=0
61
+ Last-Modified:
62
+ - Sat, 14 Dec 2013 00:17:07 GMT
63
+ Connection:
64
+ - close
65
+ Transfer-Encoding:
66
+ - chunked
67
+ Content-Type:
68
+ - application/json
69
+ Set-Cookie:
70
+ - incap_ses_124_99025=O3m7Kz/MC04KwPzVAYq4AYOjq1IAAAAAfDk2b/F6kBfIQwDVnCGO2A==;
71
+ path=/; Domain=.bitstamp.net
72
+ - nlbi_99025=QWPIb6QJUU+tfj/lItob8gAAAABz58hxYcyMAq8NOZwu88/Z; path=/; Domain=.bitstamp.net
73
+ - visid_incap_99025=VWTzXgzgTp27iq0VfB+qP4Ojq1IAAAAAQUIPAAAAAADn8ypsx2ewMTEZEmGVnHs7;
74
+ expires=Sun, 13 Dec 2015 10:19:32 GMT; path=/; Domain=.bitstamp.net
75
+ X-Iinfo:
76
+ - 5-188816541-188816625 NNNY CT(193 193 0) RT(1386980227146 185) q(0 0 4 -1)
77
+ r(4 6) U6
78
+ X-Cdn:
79
+ - Incapsula
80
+ body:
81
+ encoding: ASCII-8BIT
82
+ string: '{"btc_reserved": "0", "fee": "0.5000", "btc_available": "0", "usd_reserved":
83
+ "0", "btc_balance": "0", "usd_balance": "0.00", "usd_available": "0.00"}'
84
+ http_version:
85
+ recorded_at: Sat, 14 Dec 2013 00:17:07 GMT
86
+ recorded_with: VCR 2.7.0
@@ -0,0 +1,80 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://data.mtgox.com/api/1/generic/info
6
+ body:
7
+ encoding: US-ASCII
8
+ string: nonce=1386979416499181
9
+ response:
10
+ status:
11
+ code: 200
12
+ message: OK
13
+ headers:
14
+ Server:
15
+ - nginx/1.4.4
16
+ Content-Type:
17
+ - application/json; charset=utf-8
18
+ X-Powered-By:
19
+ - PHP/5.5.4
20
+ Access-Control-Allow-Origin:
21
+ - '*'
22
+ Content-Length:
23
+ - '1731'
24
+ Expires:
25
+ - Sat, 14 Dec 2013 00:03:38 GMT
26
+ Cache-Control:
27
+ - max-age=0, no-cache, no-store
28
+ Pragma:
29
+ - no-cache
30
+ Date:
31
+ - Sat, 14 Dec 2013 00:03:38 GMT
32
+ Connection:
33
+ - keep-alive
34
+ body:
35
+ encoding: UTF-8
36
+ string: '{"result":"success","return":{"Login":"heynk","Index":"141119","Id":"84fdd298-4386-4d7c-86c0-af74f2e0d0ec","Link":"M82141119X","Rights":["deposit","get_info","merchant","trade","withdraw"],"Language":"en_US","Created":"2012-04-07
37
+ 13:52:16","Last_Login":"2013-10-15 20:52:29","Wallets":{"BTC":{"Balance":{"value":"0.00000133","value_int":"133","display":"0.00000133\u00a0BTC","display_short":"0.00\u00a0BTC","currency":"BTC"},"Operations":1,"Daily_Withdraw_Limit":{"value":"100.00000000","value_int":"10000000000","display":"100.00000000\u00a0BTC","display_short":"100.00\u00a0BTC","currency":"BTC"},"Monthly_Withdraw_Limit":null,"Max_Withdraw":{"value":"100.00000000","value_int":"10000000000","display":"100.00000000\u00a0BTC","display_short":"100.00\u00a0BTC","currency":"BTC"},"Open_Orders":{"value":"0.00000000","value_int":"0","display":"0.00000000\u00a0BTC","display_short":"0.00\u00a0BTC","currency":"BTC"}},"USD":{"Balance":{"value":"0.00000","value_int":"0","display":"$0.00000","display_short":"$0.00","currency":"USD"},"Operations":0,"Daily_Withdraw_Limit":{"value":"1000.00000","value_int":"100000000","display":"$1,000.00000","display_short":"$1,000.00","currency":"USD"},"Monthly_Withdraw_Limit":{"value":"10000.00000","value_int":"1000000000","display":"$10,000.00000","display_short":"$10,000.00","currency":"USD"},"Max_Withdraw":{"value":"1000.00000","value_int":"100000000","display":"$1,000.00000","display_short":"$1,000.00","currency":"USD"},"Open_Orders":{"value":"0.00000","value_int":"0","display":"$0.00000","display_short":"$0.00","currency":"USD"}}},"Monthly_Volume":{"value":"0.00000000","value_int":"0","display":"0.00000000\u00a0BTC","display_short":"0.00\u00a0BTC","currency":"BTC"},"Trade_Fee":0.6}}'
38
+ http_version:
39
+ recorded_at: Sat, 14 Dec 2013 00:03:37 GMT
40
+ - request:
41
+ method: post
42
+ uri: https://www.bitstamp.net/api/balance/
43
+ headers: {}
44
+ response:
45
+ status:
46
+ code: 200
47
+ message: OK
48
+ headers:
49
+ Date:
50
+ - Sat, 14 Dec 2013 00:03:39 GMT
51
+ Server:
52
+ - Apache
53
+ Content-Language:
54
+ - en
55
+ Expires:
56
+ - Sat, 14 Dec 2013 00:03:39 GMT
57
+ Vary:
58
+ - Accept-Language
59
+ Cache-Control:
60
+ - max-age=0
61
+ Last-Modified:
62
+ - Sat, 14 Dec 2013 00:03:39 GMT
63
+ Connection:
64
+ - close
65
+ Transfer-Encoding:
66
+ - chunked
67
+ Content-Type:
68
+ - application/json
69
+ X-Iinfo:
70
+ - 5-188432674-188432763 NNNY CT(195 195 0) RT(1386979419006 170) q(0 0 4 -1)
71
+ r(4 7) U6
72
+ X-Cdn:
73
+ - Incapsula
74
+ body:
75
+ encoding: ASCII-8BIT
76
+ string: '{"btc_reserved": "0", "fee": "0.5000", "btc_available": "0", "usd_reserved":
77
+ "0", "btc_balance": "0", "usd_balance": "0.00", "usd_available": "0.00"}'
78
+ http_version:
79
+ recorded_at: Sat, 14 Dec 2013 00:03:38 GMT
80
+ recorded_with: VCR 2.7.0
@@ -0,0 +1,225 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://data.mtgox.com/api/1/BTCUSD/ticker
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept:
11
+ - application/json
12
+ User-Agent:
13
+ - mtgox gem 1.1.0
14
+ Accept-Encoding:
15
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
16
+ response:
17
+ status:
18
+ code: 200
19
+ message: OK
20
+ headers:
21
+ Server:
22
+ - nginx/1.4.4
23
+ Content-Type:
24
+ - application/json; charset=utf-8
25
+ X-Powered-By:
26
+ - PHP/5.5.4
27
+ Access-Control-Allow-Origin:
28
+ - '*'
29
+ Content-Length:
30
+ - '1377'
31
+ Cache-Control:
32
+ - public, max-age=3
33
+ Expires:
34
+ - Sat, 14 Dec 2013 00:00:09 GMT
35
+ Date:
36
+ - Sat, 14 Dec 2013 00:00:06 GMT
37
+ Connection:
38
+ - keep-alive
39
+ body:
40
+ encoding: UTF-8
41
+ string: '{"result":"success","return":{"high":{"value":"990.00000","value_int":"99000000","display":"$990.00","display_short":"$990.00","currency":"USD"},"low":{"value":"882.15864","value_int":"88215864","display":"$882.16","display_short":"$882.16","currency":"USD"},"avg":{"value":"929.68816","value_int":"92968816","display":"$929.69","display_short":"$929.69","currency":"USD"},"vwap":{"value":"931.05989","value_int":"93105989","display":"$931.06","display_short":"$931.06","currency":"USD"},"vol":{"value":"17088.88588852","value_int":"1708888588852","display":"17,088.89\u00a0BTC","display_short":"17,088.89\u00a0BTC","currency":"BTC"},"last_local":{"value":"949.00000","value_int":"94900000","display":"$949.00","display_short":"$949.00","currency":"USD"},"last_orig":{"value":"949.00000","value_int":"94900000","display":"$949.00","display_short":"$949.00","currency":"USD"},"last_all":{"value":"949.00000","value_int":"94900000","display":"$949.00","display_short":"$949.00","currency":"USD"},"last":{"value":"949.00000","value_int":"94900000","display":"$949.00","display_short":"$949.00","currency":"USD"},"buy":{"value":"936.50000","value_int":"93650000","display":"$936.50","display_short":"$936.50","currency":"USD"},"sell":{"value":"945.49500","value_int":"94549500","display":"$945.50","display_short":"$945.50","currency":"USD"},"item":"BTC","now":"1386979177267333"}}'
42
+ http_version:
43
+ recorded_at: Sat, 14 Dec 2013 00:00:05 GMT
44
+ - request:
45
+ method: get
46
+ uri: https://www.bitstamp.net/api/ticker/
47
+ body:
48
+ encoding: US-ASCII
49
+ string: ''
50
+ headers: {}
51
+ response:
52
+ status:
53
+ code: 200
54
+ message: OK
55
+ headers:
56
+ Date:
57
+ - Sat, 14 Dec 2013 00:00:07 GMT
58
+ Server:
59
+ - Apache
60
+ Content-Language:
61
+ - en
62
+ Expires:
63
+ - Sat, 14 Dec 2013 00:00:07 GMT
64
+ Vary:
65
+ - Accept-Language
66
+ Cache-Control:
67
+ - max-age=0
68
+ Last-Modified:
69
+ - Sat, 14 Dec 2013 00:00:07 GMT
70
+ Connection:
71
+ - close
72
+ Transfer-Encoding:
73
+ - chunked
74
+ Content-Type:
75
+ - application/json
76
+ Set-Cookie:
77
+ - incap_ses_124_99025=V6zRKs6P0ht3zfHVAYq4AYefq1IAAAAAZ3eoqzH8bSsXIbUQwY6buQ==;
78
+ path=/; Domain=.bitstamp.net
79
+ - nlbi_99025=9/NPD/J9hR0GpzQvItob8gAAAABUv4Oja7VOuMb/pWUoOs30; path=/; Domain=.bitstamp.net
80
+ - visid_incap_99025=H2PtDSNARViFDY7OB+zl9oefq1IAAAAAQUIPAAAAAAABXqlO2L/J4LJ1Tvy3Gd5d;
81
+ expires=Sun, 13 Dec 2015 10:19:32 GMT; path=/; Domain=.bitstamp.net
82
+ X-Iinfo:
83
+ - 5-188331129-188331195 NNNY CT(191 194 0) RT(1386979206891 179) q(0 0 4 -1)
84
+ r(4 6) U6
85
+ X-Cdn:
86
+ - Incapsula
87
+ body:
88
+ encoding: ASCII-8BIT
89
+ string: '{"high": "920.42", "last": "888.47", "timestamp": "1386979201", "bid":
90
+ "885.98", "volume": "14768.13051071", "low": "850.00", "ask": "888.47"}'
91
+ http_version:
92
+ recorded_at: Sat, 14 Dec 2013 00:00:06 GMT
93
+ - request:
94
+ method: post
95
+ uri: https://data.mtgox.com/api/1/generic/info
96
+ body:
97
+ encoding: US-ASCII
98
+ string: nonce=1386979206589124
99
+ response:
100
+ status:
101
+ code: 200
102
+ message: OK
103
+ headers:
104
+ Server:
105
+ - nginx/1.4.4
106
+ Content-Type:
107
+ - application/json; charset=utf-8
108
+ X-Powered-By:
109
+ - PHP/5.5.4
110
+ Access-Control-Allow-Origin:
111
+ - '*'
112
+ Content-Length:
113
+ - '1731'
114
+ Expires:
115
+ - Sat, 14 Dec 2013 00:00:07 GMT
116
+ Cache-Control:
117
+ - max-age=0, no-cache, no-store
118
+ Pragma:
119
+ - no-cache
120
+ Date:
121
+ - Sat, 14 Dec 2013 00:00:07 GMT
122
+ Connection:
123
+ - keep-alive
124
+ body:
125
+ encoding: UTF-8
126
+ string: '{"result":"success","return":{"Login":"heynk","Index":"141119","Id":"84fdd298-4386-4d7c-86c0-af74f2e0d0ec","Link":"M82141119X","Rights":["deposit","get_info","merchant","trade","withdraw"],"Language":"en_US","Created":"2012-04-07
127
+ 13:52:16","Last_Login":"2013-10-15 20:52:29","Wallets":{"BTC":{"Balance":{"value":"0.00000133","value_int":"133","display":"0.00000133\u00a0BTC","display_short":"0.00\u00a0BTC","currency":"BTC"},"Operations":1,"Daily_Withdraw_Limit":{"value":"100.00000000","value_int":"10000000000","display":"100.00000000\u00a0BTC","display_short":"100.00\u00a0BTC","currency":"BTC"},"Monthly_Withdraw_Limit":null,"Max_Withdraw":{"value":"100.00000000","value_int":"10000000000","display":"100.00000000\u00a0BTC","display_short":"100.00\u00a0BTC","currency":"BTC"},"Open_Orders":{"value":"0.00000000","value_int":"0","display":"0.00000000\u00a0BTC","display_short":"0.00\u00a0BTC","currency":"BTC"}},"USD":{"Balance":{"value":"0.00000","value_int":"0","display":"$0.00000","display_short":"$0.00","currency":"USD"},"Operations":0,"Daily_Withdraw_Limit":{"value":"1000.00000","value_int":"100000000","display":"$1,000.00000","display_short":"$1,000.00","currency":"USD"},"Monthly_Withdraw_Limit":{"value":"10000.00000","value_int":"1000000000","display":"$10,000.00000","display_short":"$10,000.00","currency":"USD"},"Max_Withdraw":{"value":"1000.00000","value_int":"100000000","display":"$1,000.00000","display_short":"$1,000.00","currency":"USD"},"Open_Orders":{"value":"0.00000","value_int":"0","display":"$0.00000","display_short":"$0.00","currency":"USD"}}},"Monthly_Volume":{"value":"0.00000000","value_int":"0","display":"0.00000000\u00a0BTC","display_short":"0.00\u00a0BTC","currency":"BTC"},"Trade_Fee":0.6}}'
128
+ http_version:
129
+ recorded_at: Sat, 14 Dec 2013 00:00:06 GMT
130
+ - request:
131
+ method: post
132
+ uri: https://www.bitstamp.net/api/balance/
133
+ headers: {}
134
+ response:
135
+ status:
136
+ code: 200
137
+ message: OK
138
+ headers:
139
+ Date:
140
+ - Sat, 14 Dec 2013 00:00:08 GMT
141
+ Server:
142
+ - Apache
143
+ Content-Language:
144
+ - en
145
+ Expires:
146
+ - Sat, 14 Dec 2013 00:00:08 GMT
147
+ Vary:
148
+ - Accept-Language
149
+ Cache-Control:
150
+ - max-age=0
151
+ Last-Modified:
152
+ - Sat, 14 Dec 2013 00:00:08 GMT
153
+ Connection:
154
+ - close
155
+ Transfer-Encoding:
156
+ - chunked
157
+ Content-Type:
158
+ - application/json
159
+ Set-Cookie:
160
+ - incap_ses_124_99025=/ANsPRUMc29n0PHVAYq4AYifq1IAAAAA8841aDYUfRDpmzrqRsswgA==;
161
+ path=/; Domain=.bitstamp.net
162
+ - nlbi_99025=gVBCPUmq6VlTQfVeItob8gAAAADC/0JQuCY+KuO+nTMRSpDW; path=/; Domain=.bitstamp.net
163
+ - visid_incap_99025=FwHYIb2hQ8OvfT/2QOOSQIifq1IAAAAAQUIPAAAAAAAMF03HOYtMsOtUOTrIN1sG;
164
+ expires=Sun, 13 Dec 2015 10:19:32 GMT; path=/; Domain=.bitstamp.net
165
+ X-Iinfo:
166
+ - 5-188331624-188331712 NNNY CT(200 197 0) RT(1386979207982 172) q(0 0 4 -1)
167
+ r(4 7) U6
168
+ X-Cdn:
169
+ - Incapsula
170
+ body:
171
+ encoding: ASCII-8BIT
172
+ string: '{"btc_reserved": "0", "fee": "0.5000", "btc_available": "0", "usd_reserved":
173
+ "0", "btc_balance": "0", "usd_balance": "0.00", "usd_available": "0.00"}'
174
+ http_version:
175
+ recorded_at: Sat, 14 Dec 2013 00:00:07 GMT
176
+ - request:
177
+ method: get
178
+ uri: https://www.bitstamp.net/api/ticker/
179
+ body:
180
+ encoding: US-ASCII
181
+ string: ''
182
+ headers: {}
183
+ response:
184
+ status:
185
+ code: 200
186
+ message: OK
187
+ headers:
188
+ Date:
189
+ - Sat, 14 Dec 2013 00:48:53 GMT
190
+ Server:
191
+ - Apache
192
+ Content-Language:
193
+ - en
194
+ Expires:
195
+ - Sat, 14 Dec 2013 00:48:53 GMT
196
+ Vary:
197
+ - Accept-Language
198
+ Cache-Control:
199
+ - max-age=0
200
+ Last-Modified:
201
+ - Sat, 14 Dec 2013 00:48:53 GMT
202
+ Connection:
203
+ - close
204
+ Transfer-Encoding:
205
+ - chunked
206
+ Content-Type:
207
+ - application/json
208
+ Set-Cookie:
209
+ - incap_ses_124_99025=zsGuW7RGQDxw9RHWAYq4AfWqq1IAAAAAfsFg+BIZxzF5l2PVrn2bfA==;
210
+ path=/; Domain=.bitstamp.net
211
+ - nlbi_99025=qDgDBYzCWmLz/EAkItob8gAAAACBfos6/qSwqFk6NjBfdJMi; path=/; Domain=.bitstamp.net
212
+ - visid_incap_99025=QvP7s1ijQJmI7ybDI9WNevSqq1IAAAAAQUIPAAAAAADH8BHBNL2MTBGgv2GGIKuk;
213
+ expires=Sun, 13 Dec 2015 10:19:32 GMT; path=/; Domain=.bitstamp.net
214
+ X-Iinfo:
215
+ - 5-189795304-189795403 NNNY CT(195 409 0) RT(1386982132215 179) q(0 0 6 0)
216
+ r(6 9) U6
217
+ X-Cdn:
218
+ - Incapsula
219
+ body:
220
+ encoding: ASCII-8BIT
221
+ string: '{"high": "920.42", "last": "880.00", "timestamp": "1386982129", "bid":
222
+ "873.43", "volume": "14636.90472559", "low": "850.00", "ask": "878.77"}'
223
+ http_version:
224
+ recorded_at: Sat, 14 Dec 2013 00:48:52 GMT
225
+ recorded_with: VCR 2.7.0