cointrader.net 0.7.0 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cointrader.net/client/order.rb +11 -1
- data/lib/cointrader.net/client/request.rb +19 -3
- data/lib/cointrader.net/version.rb +1 -1
- data/spec/client_spec.rb +51 -26
- data/spec/fixtures/vcr_cassettes/balance.yml +39 -54
- data/spec/fixtures/vcr_cassettes/cancel.yml +39 -38
- data/spec/fixtures/vcr_cassettes/limit_buy.yml +7 -6
- data/spec/fixtures/vcr_cassettes/limit_sell.yml +7 -6
- data/spec/fixtures/vcr_cassettes/list.yml +39 -58
- data/spec/fixtures/vcr_cassettes/market_buy.yml +71 -0
- data/spec/fixtures/vcr_cassettes/market_sell.yml +72 -0
- data/spec/fixtures/vcr_cassettes/orders.yml +40 -84
- data/spec/fixtures/vcr_cassettes/stats_24h.yml +40 -46
- data/spec/fixtures/vcr_cassettes/stats_7d.yml +40 -46
- data/spec/fixtures/vcr_cassettes/symbol.yml +41 -53
- data/spec/fixtures/vcr_cassettes/tradehistory.yml +39 -46
- data/spec/fixtures/vcr_cassettes/trades.yml +37 -84
- data/spec/spec_helper.rb +2 -0
- metadata +6 -2
@@ -2,10 +2,11 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: get
|
5
|
-
uri: https://
|
5
|
+
uri: https://sandbox.cointrader.net/api4/stats/daily/BTCUSD
|
6
6
|
body:
|
7
7
|
encoding: UTF-8
|
8
|
-
string: '{"secret":"
|
8
|
+
string: '{"secret":"2MlxW8mUU9MG4bvq7C6M4PSd5J8SaauW4H2dXnyJyAcN","t":"2015-06-13
|
9
|
+
23:00:16 UTC"}'
|
9
10
|
headers:
|
10
11
|
Accept:
|
11
12
|
- "*/*; q=0.5, application/xml"
|
@@ -14,11 +15,11 @@ http_interactions:
|
|
14
15
|
Content-Type:
|
15
16
|
- application/json
|
16
17
|
X-Auth:
|
17
|
-
-
|
18
|
+
- nCsNvmrxTpYFnJQyU16gq6R9ncOUA6UhF4wZnuf7IqkL
|
18
19
|
X-Auth-Hash:
|
19
|
-
-
|
20
|
+
- 3d358b56c19a608768b864dc564fdc11674df4f2e5b7e677e7752af9b6028421
|
20
21
|
Content-Length:
|
21
|
-
- '
|
22
|
+
- '87'
|
22
23
|
User-Agent:
|
23
24
|
- Ruby
|
24
25
|
response:
|
@@ -26,48 +27,41 @@ http_interactions:
|
|
26
27
|
code: 200
|
27
28
|
message: OK
|
28
29
|
headers:
|
29
|
-
Server:
|
30
|
-
- Cowboy
|
31
|
-
Connection:
|
32
|
-
- keep-alive
|
33
|
-
X-Apiary-Ratelimit-Limit:
|
34
|
-
- '120'
|
35
|
-
X-Apiary-Ratelimit-Remaining:
|
36
|
-
- '118'
|
37
|
-
Access-Control-Allow-Origin:
|
38
|
-
- "*"
|
39
|
-
Access-Control-Allow-Methods:
|
40
|
-
- OPTIONS,GET,HEAD,POST,PUT,DELETE,TRACE,CONNECT
|
41
|
-
Access-Control-Max-Age:
|
42
|
-
- '10'
|
43
|
-
X-Apiary-Transaction-Id:
|
44
|
-
- 556ab7ce1197a90300fefd01
|
45
30
|
Date:
|
46
|
-
-
|
47
|
-
|
48
|
-
-
|
49
|
-
|
50
|
-
-
|
31
|
+
- Sat, 13 Jun 2015 23:00:17 GMT
|
32
|
+
Server:
|
33
|
+
- Apache
|
34
|
+
X-Frame-Options:
|
35
|
+
- SAMEORIGIN
|
36
|
+
X-Xss-Protection:
|
37
|
+
- 1; mode=block
|
38
|
+
X-Content-Type-Options:
|
39
|
+
- nosniff
|
40
|
+
X-Powered-By:
|
41
|
+
- ''
|
42
|
+
Set-Cookie:
|
43
|
+
- CTXIDSCK=jmfrebp5ip9igcqj4ks6bmpsr2; path=/; HttpOnly
|
44
|
+
Expires:
|
45
|
+
- Thu, 19 Nov 1981 08:52:00 GMT
|
46
|
+
Cache-Control:
|
47
|
+
- no-store, no-cache, must-revalidate, post-check=0, pre-check=0
|
48
|
+
Pragma:
|
49
|
+
- no-cache
|
50
|
+
Vary:
|
51
|
+
- Accept-Encoding
|
52
|
+
Content-Encoding:
|
53
|
+
- gzip
|
54
|
+
Content-Length:
|
55
|
+
- '151'
|
56
|
+
Content-Type:
|
57
|
+
- application/json
|
51
58
|
body:
|
52
|
-
encoding:
|
53
|
-
string: |-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
{
|
59
|
-
"BTCUSD":
|
60
|
-
{
|
61
|
-
"lastTradePrice":"453.00",
|
62
|
-
"bid":"420.00",
|
63
|
-
"offer":"426.22",
|
64
|
-
"high":"453.00",
|
65
|
-
"low":"420.00",
|
66
|
-
"average":"429.88",
|
67
|
-
"volume":"38.26969417"
|
68
|
-
}
|
69
|
-
}
|
70
|
-
}
|
59
|
+
encoding: ASCII-8BIT
|
60
|
+
string: !binary |-
|
61
|
+
H4sIAAAAAAAAA6tWKi5NTk4tLlayKikqTdVRygWyE9NTlayUjEwyihScQpxD
|
62
|
+
g10UgksSS4qVdJRSEksSlayqlSDCIFZOYnFJSFFiSmpAUWYySJuBnoEBUGVS
|
63
|
+
ZgrIDGMQFwSAQvlpaalFYEFDhGBGZnoGQldOfjmCk1iWWgRxClSgLD+nNBfG
|
64
|
+
h5pQW1vLBQAqC2IQxQAAAA==
|
71
65
|
http_version:
|
72
|
-
recorded_at:
|
66
|
+
recorded_at: Sat, 13 Jun 2015 23:00:18 GMT
|
73
67
|
recorded_with: VCR 2.9.3
|
@@ -2,10 +2,11 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: get
|
5
|
-
uri: https://
|
5
|
+
uri: https://sandbox.cointrader.net/api4/stats/weekly/BTCUSD
|
6
6
|
body:
|
7
7
|
encoding: UTF-8
|
8
|
-
string: '{"secret":"
|
8
|
+
string: '{"secret":"2MlxW8mUU9MG4bvq7C6M4PSd5J8SaauW4H2dXnyJyAcN","t":"2015-06-13
|
9
|
+
23:00:18 UTC"}'
|
9
10
|
headers:
|
10
11
|
Accept:
|
11
12
|
- "*/*; q=0.5, application/xml"
|
@@ -14,11 +15,11 @@ http_interactions:
|
|
14
15
|
Content-Type:
|
15
16
|
- application/json
|
16
17
|
X-Auth:
|
17
|
-
-
|
18
|
+
- nCsNvmrxTpYFnJQyU16gq6R9ncOUA6UhF4wZnuf7IqkL
|
18
19
|
X-Auth-Hash:
|
19
|
-
-
|
20
|
+
- 06a551981b6070bc1587fe57d647356827322f1389271140772680bcac7eec68
|
20
21
|
Content-Length:
|
21
|
-
- '
|
22
|
+
- '87'
|
22
23
|
User-Agent:
|
23
24
|
- Ruby
|
24
25
|
response:
|
@@ -26,48 +27,41 @@ http_interactions:
|
|
26
27
|
code: 200
|
27
28
|
message: OK
|
28
29
|
headers:
|
29
|
-
Server:
|
30
|
-
- Cowboy
|
31
|
-
Connection:
|
32
|
-
- keep-alive
|
33
|
-
X-Apiary-Ratelimit-Limit:
|
34
|
-
- '120'
|
35
|
-
X-Apiary-Ratelimit-Remaining:
|
36
|
-
- '117'
|
37
|
-
Access-Control-Allow-Origin:
|
38
|
-
- "*"
|
39
|
-
Access-Control-Allow-Methods:
|
40
|
-
- OPTIONS,GET,HEAD,POST,PUT,DELETE,TRACE,CONNECT
|
41
|
-
Access-Control-Max-Age:
|
42
|
-
- '10'
|
43
|
-
X-Apiary-Transaction-Id:
|
44
|
-
- 556ab7cf2e7cbc030044b279
|
45
30
|
Date:
|
46
|
-
-
|
47
|
-
|
48
|
-
-
|
49
|
-
|
50
|
-
-
|
31
|
+
- Sat, 13 Jun 2015 23:00:19 GMT
|
32
|
+
Server:
|
33
|
+
- Apache
|
34
|
+
X-Frame-Options:
|
35
|
+
- SAMEORIGIN
|
36
|
+
X-Xss-Protection:
|
37
|
+
- 1; mode=block
|
38
|
+
X-Content-Type-Options:
|
39
|
+
- nosniff
|
40
|
+
X-Powered-By:
|
41
|
+
- ''
|
42
|
+
Set-Cookie:
|
43
|
+
- CTXIDSCK=u0sg20i2kf4ptora6faq0d9um1; path=/; HttpOnly
|
44
|
+
Expires:
|
45
|
+
- Thu, 19 Nov 1981 08:52:00 GMT
|
46
|
+
Cache-Control:
|
47
|
+
- no-store, no-cache, must-revalidate, post-check=0, pre-check=0
|
48
|
+
Pragma:
|
49
|
+
- no-cache
|
50
|
+
Vary:
|
51
|
+
- Accept-Encoding
|
52
|
+
Content-Encoding:
|
53
|
+
- gzip
|
54
|
+
Content-Length:
|
55
|
+
- '152'
|
56
|
+
Content-Type:
|
57
|
+
- application/json
|
51
58
|
body:
|
52
|
-
encoding:
|
53
|
-
string: |-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
{
|
59
|
-
"BTCUSD":
|
60
|
-
{
|
61
|
-
"lastTradePrice":"640.56",
|
62
|
-
"bid":"640.56",
|
63
|
-
"offer":"643.52",
|
64
|
-
"high":"690.00",
|
65
|
-
"low":"550.00",
|
66
|
-
"average":"629.55",
|
67
|
-
"volume":"616.24892785"
|
68
|
-
}
|
69
|
-
}
|
70
|
-
}
|
59
|
+
encoding: ASCII-8BIT
|
60
|
+
string: !binary |-
|
61
|
+
H4sIAAAAAAAAA6tWKi5NTk4tLlayKikqTdVRygWyE9NTlayUzBVcEisVnEKc
|
62
|
+
Q4NdFIJLEkuKlXSUUhJLEpWsqpUgwiBWTmJxSUhRYkpqQFFmMkifgZ6BAVBl
|
63
|
+
UmYKkGNkDOKCAFAoPy0ttQgsaIgQzMhMz0DoyskvR3ASy1KLIG6BCpTl55Tm
|
64
|
+
wvhQE2pra7kAhoO1qsYAAAA=
|
71
65
|
http_version:
|
72
|
-
recorded_at:
|
66
|
+
recorded_at: Sat, 13 Jun 2015 23:00:20 GMT
|
73
67
|
recorded_with: VCR 2.9.3
|
@@ -2,10 +2,11 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: get
|
5
|
-
uri: https://
|
5
|
+
uri: https://sandbox.cointrader.net/api4/stats/symbol
|
6
6
|
body:
|
7
7
|
encoding: UTF-8
|
8
|
-
string: '{"secret":"
|
8
|
+
string: '{"secret":"2MlxW8mUU9MG4bvq7C6M4PSd5J8SaauW4H2dXnyJyAcN","t":"2015-06-13
|
9
|
+
23:00:14 UTC"}'
|
9
10
|
headers:
|
10
11
|
Accept:
|
11
12
|
- "*/*; q=0.5, application/xml"
|
@@ -14,11 +15,11 @@ http_interactions:
|
|
14
15
|
Content-Type:
|
15
16
|
- application/json
|
16
17
|
X-Auth:
|
17
|
-
-
|
18
|
+
- nCsNvmrxTpYFnJQyU16gq6R9ncOUA6UhF4wZnuf7IqkL
|
18
19
|
X-Auth-Hash:
|
19
|
-
-
|
20
|
+
- cc4bde521313a2bf70d0ed0a17c67d20c95b85fa4afa0c510886c175b7c889b6
|
20
21
|
Content-Length:
|
21
|
-
- '
|
22
|
+
- '87'
|
22
23
|
User-Agent:
|
23
24
|
- Ruby
|
24
25
|
response:
|
@@ -26,55 +27,42 @@ http_interactions:
|
|
26
27
|
code: 200
|
27
28
|
message: OK
|
28
29
|
headers:
|
29
|
-
Server:
|
30
|
-
- Cowboy
|
31
|
-
Connection:
|
32
|
-
- keep-alive
|
33
|
-
X-Apiary-Ratelimit-Limit:
|
34
|
-
- '120'
|
35
|
-
X-Apiary-Ratelimit-Remaining:
|
36
|
-
- '119'
|
37
|
-
Access-Control-Allow-Origin:
|
38
|
-
- "*"
|
39
|
-
Access-Control-Allow-Methods:
|
40
|
-
- OPTIONS,GET,HEAD,POST,PUT,DELETE,TRACE,CONNECT
|
41
|
-
Access-Control-Max-Age:
|
42
|
-
- '10'
|
43
|
-
X-Apiary-Transaction-Id:
|
44
|
-
- 556ab7cd9798a803008172db
|
45
30
|
Date:
|
46
|
-
-
|
47
|
-
|
48
|
-
-
|
49
|
-
|
50
|
-
-
|
31
|
+
- Sat, 13 Jun 2015 23:00:16 GMT
|
32
|
+
Server:
|
33
|
+
- Apache
|
34
|
+
X-Frame-Options:
|
35
|
+
- SAMEORIGIN
|
36
|
+
X-Xss-Protection:
|
37
|
+
- 1; mode=block
|
38
|
+
X-Content-Type-Options:
|
39
|
+
- nosniff
|
40
|
+
X-Powered-By:
|
41
|
+
- ''
|
42
|
+
Set-Cookie:
|
43
|
+
- CTXIDSCK=36divpj83qd3mgf4pf5jakfhe1; path=/; HttpOnly
|
44
|
+
Expires:
|
45
|
+
- Thu, 19 Nov 1981 08:52:00 GMT
|
46
|
+
Cache-Control:
|
47
|
+
- no-store, no-cache, must-revalidate, post-check=0, pre-check=0
|
48
|
+
Pragma:
|
49
|
+
- no-cache
|
50
|
+
Vary:
|
51
|
+
- Accept-Encoding
|
52
|
+
Content-Encoding:
|
53
|
+
- gzip
|
54
|
+
Content-Length:
|
55
|
+
- '200'
|
56
|
+
Content-Type:
|
57
|
+
- application/json
|
51
58
|
body:
|
52
|
-
encoding:
|
53
|
-
string: |-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
{
|
60
|
-
"name":"Bitcoin (BTC)",
|
61
|
-
"symbol":"XBT",
|
62
|
-
"description":"Basic Bitcoin-demoninated account",
|
63
|
-
"decimals":"8"
|
64
|
-
},
|
65
|
-
{
|
66
|
-
"name":"U.S. Dollar (USD)",
|
67
|
-
"symbol":"USD","description":"Basic USD-denominated account",
|
68
|
-
"decimals":"2"
|
69
|
-
},
|
70
|
-
{
|
71
|
-
"name":"Canadian Dollar (CAD)",
|
72
|
-
"symbol":"CAD",
|
73
|
-
"description":"Basic CAD-denominated account",
|
74
|
-
"decimals":"2"
|
75
|
-
}
|
76
|
-
]
|
77
|
-
}
|
59
|
+
encoding: ASCII-8BIT
|
60
|
+
string: !binary |-
|
61
|
+
H4sIAAAAAAAAA43NsQqDMBAG4L1PEW6yYB06Fbdq30CFQulwTUIJmIuYOBTx
|
62
|
+
3XuRInWwdLvj/3++EfwgpfYe8tAPOgXLNz415FANXef6oJWoXvbhWg8pKAwI
|
63
|
+
+W0EQhs7hQnSGRJJUZd7zv3c5OBa1LGuvexNF4yjWEZvpPhMDkpbR4YwAiil
|
64
|
+
GyjMC2ksspXDCaZ0gZqsysTFtS32ImmqywrjfwPjhCFy9hd0/IZKJFQGacHK
|
65
|
+
8xrjfwPj5C/sPu3ekt8n5ncBAAA=
|
78
66
|
http_version:
|
79
|
-
recorded_at:
|
67
|
+
recorded_at: Sat, 13 Jun 2015 23:00:16 GMT
|
80
68
|
recorded_with: VCR 2.9.3
|
@@ -2,10 +2,11 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: post
|
5
|
-
uri: https://
|
5
|
+
uri: https://sandbox.cointrader.net/api4/account/tradehistory/BTCUSD
|
6
6
|
body:
|
7
7
|
encoding: UTF-8
|
8
|
-
string: '{"secret":"
|
8
|
+
string: '{"secret":"2MlxW8mUU9MG4bvq7C6M4PSd5J8SaauW4H2dXnyJyAcN","t":"2015-06-13
|
9
|
+
23:00:26 UTC"}'
|
9
10
|
headers:
|
10
11
|
Accept:
|
11
12
|
- "*/*; q=0.5, application/xml"
|
@@ -14,11 +15,11 @@ http_interactions:
|
|
14
15
|
Content-Type:
|
15
16
|
- application/json
|
16
17
|
X-Auth:
|
17
|
-
-
|
18
|
+
- nCsNvmrxTpYFnJQyU16gq6R9ncOUA6UhF4wZnuf7IqkL
|
18
19
|
X-Auth-Hash:
|
19
|
-
-
|
20
|
+
- df4718084a819b003d263c40e0ab07f5c3d0f323d2e8bbd4dd7f96111ea2219f
|
20
21
|
Content-Length:
|
21
|
-
- '
|
22
|
+
- '87'
|
22
23
|
User-Agent:
|
23
24
|
- Ruby
|
24
25
|
response:
|
@@ -26,48 +27,40 @@ http_interactions:
|
|
26
27
|
code: 200
|
27
28
|
message: OK
|
28
29
|
headers:
|
29
|
-
Server:
|
30
|
-
- Cowboy
|
31
|
-
Connection:
|
32
|
-
- keep-alive
|
33
|
-
X-Apiary-Ratelimit-Limit:
|
34
|
-
- '120'
|
35
|
-
X-Apiary-Ratelimit-Remaining:
|
36
|
-
- '114'
|
37
|
-
Access-Control-Allow-Origin:
|
38
|
-
- "*"
|
39
|
-
Access-Control-Allow-Methods:
|
40
|
-
- OPTIONS,GET,HEAD,POST,PUT,DELETE,TRACE,CONNECT
|
41
|
-
Access-Control-Max-Age:
|
42
|
-
- '10'
|
43
|
-
X-Apiary-Transaction-Id:
|
44
|
-
- 556ab7d17ca52603008d8362
|
45
30
|
Date:
|
46
|
-
-
|
47
|
-
|
48
|
-
-
|
49
|
-
|
50
|
-
-
|
31
|
+
- Sat, 13 Jun 2015 23:00:27 GMT
|
32
|
+
Server:
|
33
|
+
- Apache
|
34
|
+
X-Frame-Options:
|
35
|
+
- SAMEORIGIN
|
36
|
+
X-Xss-Protection:
|
37
|
+
- 1; mode=block
|
38
|
+
X-Content-Type-Options:
|
39
|
+
- nosniff
|
40
|
+
X-Powered-By:
|
41
|
+
- ''
|
42
|
+
Set-Cookie:
|
43
|
+
- CTXIDSCK=gdillhuvabvuc9994n1t8an4q7; path=/; HttpOnly
|
44
|
+
Expires:
|
45
|
+
- Thu, 19 Nov 1981 08:52:00 GMT
|
46
|
+
Cache-Control:
|
47
|
+
- no-store, no-cache, must-revalidate, post-check=0, pre-check=0
|
48
|
+
Pragma:
|
49
|
+
- no-cache
|
50
|
+
Vary:
|
51
|
+
- Accept-Encoding
|
52
|
+
Content-Encoding:
|
53
|
+
- gzip
|
54
|
+
Content-Length:
|
55
|
+
- '94'
|
56
|
+
Content-Type:
|
57
|
+
- application/json
|
51
58
|
body:
|
52
|
-
encoding:
|
53
|
-
string:
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
"message":"Showing 1 Executed BTCUSD Trades",
|
58
|
-
"data":
|
59
|
-
[{
|
60
|
-
"currency_pair":"BTCUSD",
|
61
|
-
"type":"Buy",
|
62
|
-
"trade_id":"8739",
|
63
|
-
"order_id":"2194028",
|
64
|
-
"quantity":"0.02549920",
|
65
|
-
"price":"453.00",
|
66
|
-
"total":"11.55",
|
67
|
-
"fee":"0.06",
|
68
|
-
"executed":"2014-05-06 02:56:52"
|
69
|
-
}]
|
70
|
-
}
|
59
|
+
encoding: ASCII-8BIT
|
60
|
+
string: !binary |-
|
61
|
+
H4sIAAAAAAAAA6tWKi5NTk4tLlaySkvMKU7VUSrJL0nMcc4vzStRsjLQUcoF
|
62
|
+
yiWmpypZKfnlKwQkFpcohBQlpqQWK7gBlaQo6SilJJYkKllFx9ZyAQBQ0dFf
|
63
|
+
TAAAAA==
|
71
64
|
http_version:
|
72
|
-
recorded_at:
|
65
|
+
recorded_at: Sat, 13 Jun 2015 23:00:27 GMT
|
73
66
|
recorded_with: VCR 2.9.3
|