vertpig 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/vertpig/order.rb +21 -5
- data/lib/vertpig/version.rb +1 -1
- 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: ba397f3dd4af995ba7dc8715c189bcd004c6eb89
|
4
|
+
data.tar.gz: 9d5902e8197d1e261f1d7c256868d74fef969e7e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5ca41fc0a9cf795b798c532048c6efafaf45aae80652b277e8789a83530b71accb251a8c9e62cff9a1171e17ffec32f93c07d24affb2b6181dbb7888ebc4ed60
|
7
|
+
data.tar.gz: 5de3af2e44dcdcdeb0b2ac5eb33ceeb24df96f37e2e46a97cf2dd25071df6c7f43b9e125f973ea3a7ff3200bf27dbbe0b49bda2e9b1aa2049f5e274d0df24b63
|
data/lib/vertpig/order.rb
CHANGED
@@ -42,11 +42,27 @@ module Vertpig
|
|
42
42
|
end
|
43
43
|
|
44
44
|
def self.buy(market, amount, price)
|
45
|
-
client.get('/market/buylimit', {
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
})
|
45
|
+
# client.get('/market/buylimit', {
|
46
|
+
# market: market,
|
47
|
+
# quantity: amount,
|
48
|
+
# rate: price
|
49
|
+
# })
|
50
|
+
|
51
|
+
puts "====> Buy with Amount: #{amount} at Price: #{'%.8f' % price} at #{Time.now}"
|
52
|
+
result = nil
|
53
|
+
|
54
|
+
begin
|
55
|
+
result = @client.get('/market/buylimit', {
|
56
|
+
market: market,
|
57
|
+
quantity: amount,
|
58
|
+
rate: price
|
59
|
+
})
|
60
|
+
puts "======> BUY FINISH at price: #{'%.8f' % price} - amount: #{amount}"
|
61
|
+
rescue Exception => e
|
62
|
+
puts "======> BUY ERROR #{e}"
|
63
|
+
end
|
64
|
+
|
65
|
+
result
|
50
66
|
end
|
51
67
|
|
52
68
|
def self.sell(market, amount, price)
|
data/lib/vertpig/version.rb
CHANGED