quoinex 0.1.4 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/quoinex/quoinex.rb +18 -17
- data/lib/quoinex/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 68dd86d49a25b65fe7f654d24462b2c464a19e4d
|
4
|
+
data.tar.gz: 1b366b6861b6c7990f37c6e617be062953ce512f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4d1ede02e6c26467d3908d2707ca76e6ee0e3e69837abb486459cbc696625905024458ce1e0df98ea12549e14a69b7ed1f76da98b36e0a6144d010f171b4dd7b
|
7
|
+
data.tar.gz: e56d19b830e012f53b30d6361ba88f1877bdf521a2c332a7dc6baaf2422702be472fd04467c49d413db51d732fa419817cd26c7248282b3d731ec432138f77aa
|
data/lib/quoinex/quoinex.rb
CHANGED
@@ -10,12 +10,16 @@ module Quoinex
|
|
10
10
|
:secret,
|
11
11
|
:url
|
12
12
|
|
13
|
-
def initialize(key:, secret:, url: 'https://api.quoine.com
|
13
|
+
def initialize(key:, secret:, url: 'https://api.quoine.com')
|
14
14
|
@key = key
|
15
15
|
@secret = secret
|
16
16
|
@url = url
|
17
17
|
end
|
18
18
|
|
19
|
+
def crypto_accounts
|
20
|
+
get('/crypto_accounts')
|
21
|
+
end
|
22
|
+
|
19
23
|
def balances
|
20
24
|
get('/accounts/balance')
|
21
25
|
end
|
@@ -28,28 +32,25 @@ module Quoinex
|
|
28
32
|
get('/orders')
|
29
33
|
end
|
30
34
|
|
31
|
-
def
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
if status['responseStatus'] && status['responseStatus']['errorCode']
|
36
|
-
error = status['responseStatus']['message']
|
37
|
-
error ||= status['responseStatus']
|
38
|
-
raise Quoinex::CancelOrderException.new(error)
|
39
|
-
end
|
35
|
+
def products
|
36
|
+
get('/products')
|
37
|
+
end
|
40
38
|
|
41
|
-
|
39
|
+
def cancel_order(id)
|
40
|
+
put("/orders/#{id}/cancel")
|
42
41
|
rescue => e
|
43
42
|
raise Quoinex::CancelOrderException.new(e.message)
|
44
43
|
end
|
45
44
|
|
46
45
|
def create_order(side:, size:, price:, product_id:)
|
47
46
|
opts = {
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
47
|
+
order: {
|
48
|
+
order_type: :limit,
|
49
|
+
product_id: product_id,
|
50
|
+
side: side,
|
51
|
+
quantity: size.to_f.to_s,
|
52
|
+
price: price.to_f.to_s,
|
53
|
+
}
|
53
54
|
}
|
54
55
|
order = post('/orders', opts)
|
55
56
|
|
@@ -100,7 +101,7 @@ module Quoinex
|
|
100
101
|
end
|
101
102
|
|
102
103
|
def put(path, opts = {})
|
103
|
-
response = RestClient.put("#{@url}#{path}", auth_headers(path))
|
104
|
+
response = RestClient.put("#{@url}#{path}", nil, auth_headers(path))
|
104
105
|
|
105
106
|
if !opts[:skip_json]
|
106
107
|
JSON.parse(response.body)
|
data/lib/quoinex/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: quoinex
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pablo Fernandez
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-03-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|