bitex 0.5.0 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/bitex.rb +4 -0
- data/lib/bitex/base_order.rb +7 -4
- data/lib/bitex/kyc_profile.rb +0 -2
- data/lib/bitex/match.rb +3 -3
- data/lib/bitex/payment.rb +2 -2
- data/lib/bitex/version.rb +1 -1
- data/spec/support/order_shared_examples.rb +6 -0
- 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: 7504b1d05131be725c8c685085de3dd783cd6c19
|
4
|
+
data.tar.gz: 015ab1434b6fb8fc3fb6723293d4c3251a652ac6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d2ac3d5ac05de9bb8edd92ab6d4c96aacc7c890d714949f1b65bf52f09ec9350887f9abe6566c087c3396eecb93ccf157a65cd8937f792dbc38c77898c56962e
|
7
|
+
data.tar.gz: 8cfac85e42a66e6a53744ebfdc478612801fb745703e13db5bc3222a623cb89451785dd246fed03361bd53da8e84900d1befc21b8f6cd721de0fa9dec3ea1793
|
data/lib/bitex.rb
CHANGED
data/lib/bitex/base_order.rb
CHANGED
@@ -53,7 +53,10 @@ module Bitex
|
|
53
53
|
|
54
54
|
# @visibility private
|
55
55
|
def self.create!(order_book, amount, price, wait = false)
|
56
|
-
|
56
|
+
order_book_id = ORDER_BOOKS[order_book]
|
57
|
+
raise UnknownOrderBook, "Could not find order book #{order_book}" unless order_book_id
|
58
|
+
|
59
|
+
params = { amount: amount, price: price, orderbook: order_book_id }
|
57
60
|
|
58
61
|
order = from_json(Api.private(:post, "/private#{base_path}", params))
|
59
62
|
retries = 0
|
@@ -83,8 +86,6 @@ module Bitex
|
|
83
86
|
end
|
84
87
|
end
|
85
88
|
|
86
|
-
private_class_method
|
87
|
-
|
88
89
|
def self.find_order(order)
|
89
90
|
find(order.id)
|
90
91
|
rescue StandardError
|
@@ -92,7 +93,7 @@ module Bitex
|
|
92
93
|
end
|
93
94
|
|
94
95
|
def self.order_books
|
95
|
-
|
96
|
+
ORDER_BOOKS.invert
|
96
97
|
end
|
97
98
|
|
98
99
|
def self.reasons
|
@@ -102,5 +103,7 @@ module Bitex
|
|
102
103
|
def self.statuses
|
103
104
|
{ 1 => :received, 2 => :executing, 3 => :cancelling, 4 => :cancelled, 5 => :completed }
|
104
105
|
end
|
106
|
+
|
107
|
+
private_class_method :find_order, :order_books, :reasons, :statuses
|
105
108
|
end
|
106
109
|
end
|
data/lib/bitex/kyc_profile.rb
CHANGED
data/lib/bitex/match.rb
CHANGED
@@ -18,12 +18,12 @@ module Bitex
|
|
18
18
|
end
|
19
19
|
# rubocop:enable Metrics/AbcSize
|
20
20
|
|
21
|
-
private_class_method
|
22
|
-
|
23
21
|
def self.order_books
|
24
|
-
|
22
|
+
ORDER_BOOKS.invert
|
25
23
|
end
|
26
24
|
|
25
|
+
private_class_method :order_books
|
26
|
+
|
27
27
|
def base_currency
|
28
28
|
base_quote[0]
|
29
29
|
end
|
data/lib/bitex/payment.rb
CHANGED
data/lib/bitex/version.rb
CHANGED
@@ -35,4 +35,10 @@ shared_examples_for 'Order' do |api_path|
|
|
35
35
|
order.cancel!
|
36
36
|
order.status.should == :cancelling
|
37
37
|
end
|
38
|
+
|
39
|
+
it 'blows up when unknown order book is requested' do
|
40
|
+
expect do
|
41
|
+
subject.class.create!(:bogus_order_book, 100.50, 1_000.00)
|
42
|
+
end.to raise_error Bitex::UnknownOrderBook
|
43
|
+
end
|
38
44
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bitex
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nubis
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2018-
|
12
|
+
date: 2018-08-09 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|