coinsetter 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/coinsetter/version.rb +1 -1
- data/lib/coinsetter.rb +16 -3
- 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: 4e4f21f963b3b6bcc840ce8829ccc9e908183a45
|
4
|
+
data.tar.gz: 6a51f4322a133292beea56ecdd5d72196620a4ce
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b36e788153fd3971e46a3767c8ad318fc18b21924d132872e17feca65dc0e831d8f0dce1df67e5117ca98138f25ca1474e164c33dca78350c748287ade92f156
|
7
|
+
data.tar.gz: f7466b937d796ba90fa9ae9707a3b86b327a5b5915bcb1e4e4636991925e8b7af74c06506af7e00b4886098e9905be7e17b0aac89aaeedaf6a08ce3db124874d
|
data/lib/coinsetter/version.rb
CHANGED
data/lib/coinsetter.rb
CHANGED
@@ -41,8 +41,8 @@ module Coinsetter
|
|
41
41
|
def self.with_session
|
42
42
|
if client_session.kind_of? ClientSession
|
43
43
|
yield client_session if block_given?
|
44
|
-
destroy_client_session!
|
45
44
|
else
|
45
|
+
destroy_client_session!
|
46
46
|
{error: 'No Client Session available.'}
|
47
47
|
end
|
48
48
|
end
|
@@ -76,13 +76,26 @@ module Coinsetter
|
|
76
76
|
accounts.list
|
77
77
|
end
|
78
78
|
|
79
|
-
def self.
|
80
|
-
|
79
|
+
def self.get_order(order_uuid)
|
80
|
+
orders.get(order_uuid)
|
81
|
+
end
|
82
|
+
|
83
|
+
def self.add_order_with_new_session(side='BUY', options={})
|
84
|
+
order = with_session do |client_session|
|
81
85
|
params = default_options.merge(options)
|
82
86
|
params.merge!(side: side,
|
83
87
|
customerUuid: client_session.customer_uuid)
|
84
88
|
orders.create(params)
|
85
89
|
end
|
90
|
+
|
91
|
+
order.kind_of?(Order) ? Coinsetter.get_order(order.uuid) : nil
|
92
|
+
end
|
93
|
+
|
94
|
+
def self.add_order(side='BUY', options={})
|
95
|
+
params = default_options.merge(options)
|
96
|
+
params.merge!(side: side,
|
97
|
+
customerUuid: client_session.customer_uuid)
|
98
|
+
orders.create(params)
|
86
99
|
end
|
87
100
|
|
88
101
|
# Required Order Params
|