cointrader.net 0.2.0 → 0.2.1
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 +2 -2
- data/lib/cointrader.net/version.rb +1 -1
- data/spec/client_spec.rb +2 -2
- data/spec/fixtures/vcr_cassettes/balance.yml +5 -5
- data/spec/fixtures/vcr_cassettes/limit_buy.yml +6 -6
- data/spec/fixtures/vcr_cassettes/limit_sell.yml +6 -6
- data/spec/fixtures/vcr_cassettes/orders.yml +4 -4
- data/spec/fixtures/vcr_cassettes/stats_24h.yml +5 -5
- data/spec/fixtures/vcr_cassettes/stats_7d.yml +5 -5
- data/spec/fixtures/vcr_cassettes/symbol.yml +5 -5
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0db047b9510178796a4b3f9d6ae52cff01682a44
|
4
|
+
data.tar.gz: 485566802cecd4162c616178d1ee90c990c59dfb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 961a51857e64557facbb4c01b815f61e54293c2fd0b594744a8dd5fa55d0fb2cd10a47bc4684d0217405f3e4d81a87270c9cba97c709f740d48311d1f301e5d7
|
7
|
+
data.tar.gz: 95a53f0f29847b136554caa8efc3f98bb24974f391f8bf67ab748416baad89fc4425ded0329b1440706ca511abf3a5dd9727153281654a9c3f08444631129d8f
|
@@ -2,12 +2,12 @@ module Cointrader
|
|
2
2
|
module Order
|
3
3
|
def limit_buy params={}
|
4
4
|
params = get_defaults(params)
|
5
|
-
request(:post, "/order/#{params[:currency_pair]}/buy")
|
5
|
+
request(:post, "/order/#{params[:currency_pair]}/buy", total_quantity: params[:total_quantity], price: params[:price])
|
6
6
|
end
|
7
7
|
|
8
8
|
def limit_sell params={}
|
9
9
|
params = get_defaults(params)
|
10
|
-
request(:post, "/order/#{params[:currency_pair]}/sell")
|
10
|
+
request(:post, "/order/#{params[:currency_pair]}/sell", total_quantity: params[:total_quantity], price: params[:price])
|
11
11
|
end
|
12
12
|
end
|
13
13
|
end
|
data/spec/client_spec.rb
CHANGED
@@ -61,7 +61,7 @@ describe Cointrader::Client do
|
|
61
61
|
describe '#limit_buy' do
|
62
62
|
it 'returns an order' do
|
63
63
|
VCR.use_cassette('limit_buy') do
|
64
|
-
response = subject.limit_buy
|
64
|
+
response = subject.limit_buy(total_quantity: 10, price: 1)
|
65
65
|
|
66
66
|
expect_success(response)
|
67
67
|
expect(response['data']['id']).not_to be_nil
|
@@ -72,7 +72,7 @@ describe Cointrader::Client do
|
|
72
72
|
describe '#limit_sell' do
|
73
73
|
it 'returns an order' do
|
74
74
|
VCR.use_cassette('limit_sell') do
|
75
|
-
response = subject.limit_sell
|
75
|
+
response = subject.limit_sell(total_quantity: 10, price: 1)
|
76
76
|
|
77
77
|
expect_success(response)
|
78
78
|
expect(response['data']['id']).not_to be_nil
|
@@ -5,7 +5,7 @@ http_interactions:
|
|
5
5
|
uri: https://private-anon-e01e290b7-cointrader.apiary-mock.com/api4/account/balance
|
6
6
|
body:
|
7
7
|
encoding: UTF-8
|
8
|
-
string: '{"secret":"l33lpBPqrNazDz5bgOpQkaerFtpOBqw8wjLTK3sbEcSK","t":"
|
8
|
+
string: '{"secret":"l33lpBPqrNazDz5bgOpQkaerFtpOBqw8wjLTK3sbEcSK","t":"1432345445508"}'
|
9
9
|
headers:
|
10
10
|
Accept:
|
11
11
|
- "*/*; q=0.5, application/xml"
|
@@ -16,7 +16,7 @@ http_interactions:
|
|
16
16
|
X-Auth:
|
17
17
|
- hCkVvzR4Nuc6dbuN0biMFSqMqSfc1f1grhXqoaQAlq1y
|
18
18
|
X-Auth-Hash:
|
19
|
-
-
|
19
|
+
- 24645e009d7c521b01f49b5b9a3737923237ccddcb4d4b8d982879d4047680d8
|
20
20
|
Content-Length:
|
21
21
|
- '77'
|
22
22
|
User-Agent:
|
@@ -41,9 +41,9 @@ http_interactions:
|
|
41
41
|
Access-Control-Max-Age:
|
42
42
|
- '10'
|
43
43
|
X-Apiary-Transaction-Id:
|
44
|
-
-
|
44
|
+
- 555fdab3759c2d030016a114
|
45
45
|
Date:
|
46
|
-
- Sat, 23 May 2015 01:
|
46
|
+
- Sat, 23 May 2015 01:41:07 GMT
|
47
47
|
Transfer-Encoding:
|
48
48
|
- chunked
|
49
49
|
Via:
|
@@ -77,5 +77,5 @@ http_interactions:
|
|
77
77
|
}
|
78
78
|
}
|
79
79
|
http_version:
|
80
|
-
recorded_at: Sat, 23 May 2015 01:
|
80
|
+
recorded_at: Sat, 23 May 2015 01:44:05 GMT
|
81
81
|
recorded_with: VCR 2.9.3
|
@@ -5,7 +5,7 @@ http_interactions:
|
|
5
5
|
uri: https://private-anon-e01e290b7-cointrader.apiary-mock.com/api4/order/BTCUSD/buy
|
6
6
|
body:
|
7
7
|
encoding: UTF-8
|
8
|
-
string: '{"secret":"l33lpBPqrNazDz5bgOpQkaerFtpOBqw8wjLTK3sbEcSK","t":"
|
8
|
+
string: '{"total_quantity":10,"price":1,"secret":"l33lpBPqrNazDz5bgOpQkaerFtpOBqw8wjLTK3sbEcSK","t":"1432345445832"}'
|
9
9
|
headers:
|
10
10
|
Accept:
|
11
11
|
- "*/*; q=0.5, application/xml"
|
@@ -16,9 +16,9 @@ http_interactions:
|
|
16
16
|
X-Auth:
|
17
17
|
- hCkVvzR4Nuc6dbuN0biMFSqMqSfc1f1grhXqoaQAlq1y
|
18
18
|
X-Auth-Hash:
|
19
|
-
-
|
19
|
+
- c872ef62da714fc21b62b488642e9cc985dfa79c7bf74cadfc42465b69ad01a2
|
20
20
|
Content-Length:
|
21
|
-
- '
|
21
|
+
- '107'
|
22
22
|
User-Agent:
|
23
23
|
- Ruby
|
24
24
|
response:
|
@@ -41,9 +41,9 @@ http_interactions:
|
|
41
41
|
Access-Control-Max-Age:
|
42
42
|
- '10'
|
43
43
|
X-Apiary-Transaction-Id:
|
44
|
-
-
|
44
|
+
- 555fdab4d00c36030031803b
|
45
45
|
Date:
|
46
|
-
- Sat, 23 May 2015 01:
|
46
|
+
- Sat, 23 May 2015 01:41:08 GMT
|
47
47
|
Transfer-Encoding:
|
48
48
|
- chunked
|
49
49
|
Via:
|
@@ -60,5 +60,5 @@ http_interactions:
|
|
60
60
|
}
|
61
61
|
}
|
62
62
|
http_version:
|
63
|
-
recorded_at: Sat, 23 May 2015 01:
|
63
|
+
recorded_at: Sat, 23 May 2015 01:44:06 GMT
|
64
64
|
recorded_with: VCR 2.9.3
|
@@ -5,7 +5,7 @@ http_interactions:
|
|
5
5
|
uri: https://private-anon-e01e290b7-cointrader.apiary-mock.com/api4/order/BTCUSD/sell
|
6
6
|
body:
|
7
7
|
encoding: UTF-8
|
8
|
-
string: '{"secret":"l33lpBPqrNazDz5bgOpQkaerFtpOBqw8wjLTK3sbEcSK","t":"
|
8
|
+
string: '{"total_quantity":10,"price":1,"secret":"l33lpBPqrNazDz5bgOpQkaerFtpOBqw8wjLTK3sbEcSK","t":"1432345446127"}'
|
9
9
|
headers:
|
10
10
|
Accept:
|
11
11
|
- "*/*; q=0.5, application/xml"
|
@@ -16,9 +16,9 @@ http_interactions:
|
|
16
16
|
X-Auth:
|
17
17
|
- hCkVvzR4Nuc6dbuN0biMFSqMqSfc1f1grhXqoaQAlq1y
|
18
18
|
X-Auth-Hash:
|
19
|
-
-
|
19
|
+
- 7acd255a7f4952cd9263278accef8dba47d6549542671d6e15e54ab1b369e0fc
|
20
20
|
Content-Length:
|
21
|
-
- '
|
21
|
+
- '107'
|
22
22
|
User-Agent:
|
23
23
|
- Ruby
|
24
24
|
response:
|
@@ -41,9 +41,9 @@ http_interactions:
|
|
41
41
|
Access-Control-Max-Age:
|
42
42
|
- '10'
|
43
43
|
X-Apiary-Transaction-Id:
|
44
|
-
-
|
44
|
+
- 555fdab4759c2d030016a116
|
45
45
|
Date:
|
46
|
-
- Sat, 23 May 2015 01:
|
46
|
+
- Sat, 23 May 2015 01:41:08 GMT
|
47
47
|
Transfer-Encoding:
|
48
48
|
- chunked
|
49
49
|
Via:
|
@@ -53,5 +53,5 @@ http_interactions:
|
|
53
53
|
string: "{\n \"success\":true,\n \"message\":\"Sell Order Created\",\n
|
54
54
|
\ \"data\":\n {\n \"id\":\"2221132\"\n }\n} "
|
55
55
|
http_version:
|
56
|
-
recorded_at: Sat, 23 May 2015 01:
|
56
|
+
recorded_at: Sat, 23 May 2015 01:44:06 GMT
|
57
57
|
recorded_with: VCR 2.9.3
|
@@ -5,7 +5,7 @@ http_interactions:
|
|
5
5
|
uri: https://private-anon-e01e290b7-cointrader.apiary-mock.com/api4/stats/orders/BTCUSD/all/20
|
6
6
|
body:
|
7
7
|
encoding: UTF-8
|
8
|
-
string: '{"secret":"l33lpBPqrNazDz5bgOpQkaerFtpOBqw8wjLTK3sbEcSK","t":"
|
8
|
+
string: '{"secret":"l33lpBPqrNazDz5bgOpQkaerFtpOBqw8wjLTK3sbEcSK","t":"1432345443518"}'
|
9
9
|
headers:
|
10
10
|
Accept:
|
11
11
|
- "*/*; q=0.5, application/xml"
|
@@ -16,7 +16,7 @@ http_interactions:
|
|
16
16
|
X-Auth:
|
17
17
|
- hCkVvzR4Nuc6dbuN0biMFSqMqSfc1f1grhXqoaQAlq1y
|
18
18
|
X-Auth-Hash:
|
19
|
-
-
|
19
|
+
- de70251702ddcdaf77da568b9db5257d5fc39bfdcc361a2c4f48c7c014fae1ba
|
20
20
|
Content-Length:
|
21
21
|
- '77'
|
22
22
|
User-Agent:
|
@@ -41,7 +41,7 @@ http_interactions:
|
|
41
41
|
Etag:
|
42
42
|
- W/"zVuw45vE0DsxkZqn5802FQ=="
|
43
43
|
Date:
|
44
|
-
- Sat, 23 May 2015 01:
|
44
|
+
- Sat, 23 May 2015 01:41:07 GMT
|
45
45
|
Via:
|
46
46
|
- 1.1 vegur
|
47
47
|
body:
|
@@ -108,5 +108,5 @@ http_interactions:
|
|
108
108
|
ICA8L3NlY3Rpb24+CiAgICAgIDwvb2w+CiAgPC9kaXY+CjwvYm9keT4KPC9o
|
109
109
|
dG1sPgo=
|
110
110
|
http_version:
|
111
|
-
recorded_at: Sat, 23 May 2015 01:
|
111
|
+
recorded_at: Sat, 23 May 2015 01:44:05 GMT
|
112
112
|
recorded_with: VCR 2.9.3
|
@@ -5,7 +5,7 @@ http_interactions:
|
|
5
5
|
uri: https://private-anon-e01e290b7-cointrader.apiary-mock.com/api4/stats/daily/BTCUSD
|
6
6
|
body:
|
7
7
|
encoding: UTF-8
|
8
|
-
string: '{"secret":"l33lpBPqrNazDz5bgOpQkaerFtpOBqw8wjLTK3sbEcSK","t":"
|
8
|
+
string: '{"secret":"l33lpBPqrNazDz5bgOpQkaerFtpOBqw8wjLTK3sbEcSK","t":"1432345442867"}'
|
9
9
|
headers:
|
10
10
|
Accept:
|
11
11
|
- "*/*; q=0.5, application/xml"
|
@@ -16,7 +16,7 @@ http_interactions:
|
|
16
16
|
X-Auth:
|
17
17
|
- hCkVvzR4Nuc6dbuN0biMFSqMqSfc1f1grhXqoaQAlq1y
|
18
18
|
X-Auth-Hash:
|
19
|
-
-
|
19
|
+
- 5ebeefd0e7dac526a9fdd878d575c2ca8bcb23763c19a02c696de162b056edac
|
20
20
|
Content-Length:
|
21
21
|
- '77'
|
22
22
|
User-Agent:
|
@@ -41,9 +41,9 @@ http_interactions:
|
|
41
41
|
Access-Control-Max-Age:
|
42
42
|
- '10'
|
43
43
|
X-Apiary-Transaction-Id:
|
44
|
-
-
|
44
|
+
- 555fdab1759c2d030016a111
|
45
45
|
Date:
|
46
|
-
- Sat, 23 May 2015 01:
|
46
|
+
- Sat, 23 May 2015 01:41:05 GMT
|
47
47
|
Transfer-Encoding:
|
48
48
|
- chunked
|
49
49
|
Via:
|
@@ -69,5 +69,5 @@ http_interactions:
|
|
69
69
|
}
|
70
70
|
}
|
71
71
|
http_version:
|
72
|
-
recorded_at: Sat, 23 May 2015 01:
|
72
|
+
recorded_at: Sat, 23 May 2015 01:44:03 GMT
|
73
73
|
recorded_with: VCR 2.9.3
|
@@ -5,7 +5,7 @@ http_interactions:
|
|
5
5
|
uri: https://private-anon-e01e290b7-cointrader.apiary-mock.com/api4/stats/weekly/BTCUSD
|
6
6
|
body:
|
7
7
|
encoding: UTF-8
|
8
|
-
string: '{"secret":"l33lpBPqrNazDz5bgOpQkaerFtpOBqw8wjLTK3sbEcSK","t":"
|
8
|
+
string: '{"secret":"l33lpBPqrNazDz5bgOpQkaerFtpOBqw8wjLTK3sbEcSK","t":"1432345443186"}'
|
9
9
|
headers:
|
10
10
|
Accept:
|
11
11
|
- "*/*; q=0.5, application/xml"
|
@@ -16,7 +16,7 @@ http_interactions:
|
|
16
16
|
X-Auth:
|
17
17
|
- hCkVvzR4Nuc6dbuN0biMFSqMqSfc1f1grhXqoaQAlq1y
|
18
18
|
X-Auth-Hash:
|
19
|
-
-
|
19
|
+
- b89dfdc1dd225754f06ca6a8e343851ac7414c1ec2831a1716cacd8fedf89e33
|
20
20
|
Content-Length:
|
21
21
|
- '77'
|
22
22
|
User-Agent:
|
@@ -41,9 +41,9 @@ http_interactions:
|
|
41
41
|
Access-Control-Max-Age:
|
42
42
|
- '10'
|
43
43
|
X-Apiary-Transaction-Id:
|
44
|
-
-
|
44
|
+
- 555fdab1759c2d030016a112
|
45
45
|
Date:
|
46
|
-
- Sat, 23 May 2015 01:
|
46
|
+
- Sat, 23 May 2015 01:41:05 GMT
|
47
47
|
Transfer-Encoding:
|
48
48
|
- chunked
|
49
49
|
Via:
|
@@ -69,5 +69,5 @@ http_interactions:
|
|
69
69
|
}
|
70
70
|
}
|
71
71
|
http_version:
|
72
|
-
recorded_at: Sat, 23 May 2015 01:
|
72
|
+
recorded_at: Sat, 23 May 2015 01:44:03 GMT
|
73
73
|
recorded_with: VCR 2.9.3
|
@@ -5,7 +5,7 @@ http_interactions:
|
|
5
5
|
uri: https://private-anon-e01e290b7-cointrader.apiary-mock.com/api4/stats/symbol
|
6
6
|
body:
|
7
7
|
encoding: UTF-8
|
8
|
-
string: '{"secret":"l33lpBPqrNazDz5bgOpQkaerFtpOBqw8wjLTK3sbEcSK","t":"
|
8
|
+
string: '{"secret":"l33lpBPqrNazDz5bgOpQkaerFtpOBqw8wjLTK3sbEcSK","t":"1432345442031"}'
|
9
9
|
headers:
|
10
10
|
Accept:
|
11
11
|
- "*/*; q=0.5, application/xml"
|
@@ -16,7 +16,7 @@ http_interactions:
|
|
16
16
|
X-Auth:
|
17
17
|
- hCkVvzR4Nuc6dbuN0biMFSqMqSfc1f1grhXqoaQAlq1y
|
18
18
|
X-Auth-Hash:
|
19
|
-
-
|
19
|
+
- 00d394e2c6800fea9d1757c463367b47f92cc6b53290ca312acee9a531c9420e
|
20
20
|
Content-Length:
|
21
21
|
- '77'
|
22
22
|
User-Agent:
|
@@ -41,9 +41,9 @@ http_interactions:
|
|
41
41
|
Access-Control-Max-Age:
|
42
42
|
- '10'
|
43
43
|
X-Apiary-Transaction-Id:
|
44
|
-
-
|
44
|
+
- 555fdab03edda90300f69d59
|
45
45
|
Date:
|
46
|
-
- Sat, 23 May 2015 01:
|
46
|
+
- Sat, 23 May 2015 01:41:04 GMT
|
47
47
|
Transfer-Encoding:
|
48
48
|
- chunked
|
49
49
|
Via:
|
@@ -76,5 +76,5 @@ http_interactions:
|
|
76
76
|
]
|
77
77
|
}
|
78
78
|
http_version:
|
79
|
-
recorded_at: Sat, 23 May 2015 01:
|
79
|
+
recorded_at: Sat, 23 May 2015 01:44:02 GMT
|
80
80
|
recorded_with: VCR 2.9.3
|