atlasats 1.0.6 → 1.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/atlasats.rb +10 -6
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
YjBkNGUxNjA3ZjAwODFiMTcwZDM4YzZjYWI3MzNlYjcyYzRhOTY0ZA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NGE1YjEzYWFmMzNmNzM0MmY0M2Y0MjU3YjI2ZTdkZDg3M2M2ZTBlYQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MjA4ZWFmYTFkODlkNmRhZWZhYjUwN2QzNDkxMjc4ZWMwZWZjNDBjOTJlZjM2
|
10
|
+
NmQ5Y2VjNjNiOWI3MzEyNzY0OTUyNzRjZjI5YmE0ZTQ2ZmNhOGY3MDFlODFh
|
11
|
+
YzdmNzEzODgzZDBhMmZiMGM1ZmIxN2RjZDQzOTQ3YTQ5YjU5Mjg=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MTAxNTkxOGIyOTY4MmM2ZWE1MjI0YjNkOGJkODVkZDFiNzg4ZDYwYTAwNzcy
|
14
|
+
NzI3NWUyNDZmNWRlZmZjYTJjYmI3NzBkYTllYjg0NGQzZjZmZDVkOTE0ZmNi
|
15
|
+
MGI5N2Y0MGU0ZWRjNWFlY2YzNWIxMmQ0MDFjYTZmYjk5M2JjNTI=
|
data/lib/atlasats.rb
CHANGED
@@ -26,6 +26,10 @@ class AtlasClient
|
|
26
26
|
r = block.call(body.nil? ? @options : @options.merge(:body => body))
|
27
27
|
r.parsed_response
|
28
28
|
end
|
29
|
+
|
30
|
+
def with_auth_query(body=nil, &block)
|
31
|
+
r = block.call(body.nil? ? @options : @options.merge(:query => body))
|
32
|
+
end
|
29
33
|
|
30
34
|
def place_market_order(item, currency, side, quantity)
|
31
35
|
with_auth :item => item, :currency => currency, :side => side, :quantity => quantity, :type => "market" do |options|
|
@@ -40,7 +44,7 @@ class AtlasClient
|
|
40
44
|
end
|
41
45
|
|
42
46
|
def order_info(orderid)
|
43
|
-
|
47
|
+
with_auth_query nil do |options|
|
44
48
|
self.class.get("/api/v1/orders/#{orderid}", options)
|
45
49
|
end
|
46
50
|
end
|
@@ -53,21 +57,21 @@ class AtlasClient
|
|
53
57
|
|
54
58
|
# account
|
55
59
|
def account_info()
|
56
|
-
|
60
|
+
with_auth_query nil do |options|
|
57
61
|
self.class.get('/api/v1/account', options)
|
58
62
|
end
|
59
63
|
end
|
60
64
|
|
61
65
|
# market data
|
62
66
|
def book(item, currency)
|
63
|
-
|
64
|
-
self.class.get('/api/v1/market/book')
|
67
|
+
with_auth_query :item => item, :currency => currency do |options|
|
68
|
+
self.class.get('/api/v1/market/book', options)
|
65
69
|
end
|
66
70
|
end
|
67
71
|
|
68
72
|
def recent_trades(item, currency)
|
69
|
-
|
70
|
-
self.class.get('/api/v1/market/trades/recent')
|
73
|
+
with_auth_query :item => item, :currency => currency do |options|
|
74
|
+
self.class.get('/api/v1/market/trades/recent', options)
|
71
75
|
end
|
72
76
|
end
|
73
77
|
|