atlasats 1.0.9 → 1.1.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.
- checksums.yaml +8 -8
- data/lib/atlasats.rb +25 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
YTUwYjA4YWUzZDRjN2FhNjhmMTEzMjJmMWZiYTQ2MTQ1OGI5NGM1MQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MmJlNmJjYzgwZDE0M2JmZTJiZmFmZDRiNTA3ODMyMmQyMGE0MjUwYg==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZTAxNWViNjM2OWFhZTMzZDllMzc3NGNlNDI0OWNmN2RhYmI2NTVmNWEwYTFi
|
10
|
+
Nzk4YTQ2NzdlZjI4OWZjZWNhOGE1NzFmNTczNjg2ZWQzNzYzNDE5Y2Q5OTRh
|
11
|
+
ZmRmZjJjOTFjZGJhYjJlNjkwZTUzNGI3MDAxMjI5NmIwMDYyOTA=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ODMxMTNlMjM4MDY1ZjYwYjEwZTYxNTUyNzEzN2YyYjljZDYyNzViY2ExNDRm
|
14
|
+
OTg1MGIzMTliZjcwYTBhMmZmYWU4NTQ4NDhkZWYxZDA5MGM4ZTA1ZDg2OTBh
|
15
|
+
NzYxZTc1ZDM4MDZhMTI5NWVmNWJmNmY0OTZjMjViZmEzNWJhOTc=
|
data/lib/atlasats.rb
CHANGED
@@ -63,7 +63,30 @@ class AtlasClient
|
|
63
63
|
end
|
64
64
|
end
|
65
65
|
|
66
|
-
#
|
66
|
+
# get all crypto-currency/coins
|
67
|
+
def coins ()
|
68
|
+
res = with_auth_query nil do |options|
|
69
|
+
self.class.get('/api/v1/market/symbols', options)
|
70
|
+
end
|
71
|
+
coins = []
|
72
|
+
res.each do |symbol|
|
73
|
+
coins.push symbol if symbol["market_id"] == 0
|
74
|
+
end
|
75
|
+
coins
|
76
|
+
end
|
77
|
+
|
78
|
+
# get all option contracts
|
79
|
+
def options ()
|
80
|
+
res = with_auth_query nil do |options|
|
81
|
+
self.class.get('/api/v1/market/symbols', options)
|
82
|
+
end
|
83
|
+
contracts = []
|
84
|
+
res.each do |symbol|
|
85
|
+
contracts.push symbol if symbol["exp"]
|
86
|
+
end
|
87
|
+
contracts
|
88
|
+
end
|
89
|
+
|
67
90
|
def book(item, currency)
|
68
91
|
with_auth_query :item => item, :currency => currency do |options|
|
69
92
|
self.class.get('/api/v1/market/book', options)
|
@@ -77,7 +100,7 @@ class AtlasClient
|
|
77
100
|
end
|
78
101
|
|
79
102
|
# market data
|
80
|
-
def
|
103
|
+
def subscribe_all_trades(&block)
|
81
104
|
Thread.new do
|
82
105
|
EM.run {
|
83
106
|
client = Faye::Client.new("#{@baseuri}:4000/api")
|