honeymaker 0.9.4 → 0.9.5
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
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 69e45233bef585a60e1dfc06d139aebbfefd2d5f39264a6890df53314dc17991
|
|
4
|
+
data.tar.gz: 223eb0d6e9dc4a0d0fbda81f21a6bb3db62b8e07ee5a1622b224330c50f25953
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 02ea3cba844521f5710d79c80f9316c222ca167a70e08c690822e483738bba4f2b283719c7c209b3cb21ba81f4cd1d4b4b0dea09c12c38066f9e3ff27892c280
|
|
7
|
+
data.tar.gz: 43175c9aef0356ac764ceb5492ae574b7e0b6b96846027ddbc5a8e41e095d34477877aa903338721eb89f70eb77321d10e7ea677cb2fe96da20c909af0be03ee
|
|
@@ -21,9 +21,9 @@ module Honeymaker
|
|
|
21
21
|
minimum_quote_size: product["minOrderInQuoteAsset"],
|
|
22
22
|
maximum_base_size: nil,
|
|
23
23
|
maximum_quote_size: nil,
|
|
24
|
-
base_decimals: product["
|
|
25
|
-
quote_decimals: product["
|
|
26
|
-
price_decimals: product
|
|
24
|
+
base_decimals: product["quantityDecimals"] || 8,
|
|
25
|
+
quote_decimals: product["notionalDecimals"] || 8,
|
|
26
|
+
price_decimals: count_decimals(product.fetch("tickSize")),
|
|
27
27
|
available: true,
|
|
28
28
|
trading_enabled: product["status"] == "trading"
|
|
29
29
|
}
|
|
@@ -46,6 +46,17 @@ module Honeymaker
|
|
|
46
46
|
|
|
47
47
|
private
|
|
48
48
|
|
|
49
|
+
# Bitvavo's tickSize is always a power of ten (e.g. "1.00", "0.0000100"),
|
|
50
|
+
# so the count of significant decimal places is the price precision.
|
|
51
|
+
def count_decimals(value)
|
|
52
|
+
# Strip trailing zeros AND a dangling dot so whole-number ticks like
|
|
53
|
+
# "1.00" -> "1" yield 0 (Ruby's "1.".split(".") would wrongly give ["1"]).
|
|
54
|
+
str = value.to_s.sub(/\.?0+$/, "")
|
|
55
|
+
return 0 unless str.include?(".")
|
|
56
|
+
|
|
57
|
+
str.split(".").last.length
|
|
58
|
+
end
|
|
59
|
+
|
|
49
60
|
def connection
|
|
50
61
|
@connection ||= build_connection(BASE_URL)
|
|
51
62
|
end
|
data/lib/honeymaker/version.rb
CHANGED
|
@@ -2,15 +2,29 @@
|
|
|
2
2
|
{
|
|
3
3
|
"market": "BTC-EUR",
|
|
4
4
|
"status": "trading",
|
|
5
|
+
"base": "BTC",
|
|
6
|
+
"quote": "EUR",
|
|
5
7
|
"minOrderInBaseAsset": "0.00001",
|
|
6
8
|
"minOrderInQuoteAsset": "5",
|
|
7
|
-
"
|
|
9
|
+
"maxOrderInBaseAsset": "1000",
|
|
10
|
+
"maxOrderInQuoteAsset": "1000000",
|
|
11
|
+
"pricePrecision": null,
|
|
12
|
+
"tickSize": "1.00",
|
|
13
|
+
"quantityDecimals": 8,
|
|
14
|
+
"notionalDecimals": 2,
|
|
15
|
+
"orderTypes": ["market", "limit"]
|
|
8
16
|
},
|
|
9
17
|
{
|
|
10
18
|
"market": "ETH-EUR",
|
|
11
19
|
"status": "halted",
|
|
12
|
-
"
|
|
20
|
+
"base": "ETH",
|
|
21
|
+
"quote": "EUR",
|
|
22
|
+
"minOrderInBaseAsset": "0.0001",
|
|
13
23
|
"minOrderInQuoteAsset": "5",
|
|
14
|
-
"pricePrecision":
|
|
24
|
+
"pricePrecision": null,
|
|
25
|
+
"tickSize": "0.01",
|
|
26
|
+
"quantityDecimals": 6,
|
|
27
|
+
"notionalDecimals": 2,
|
|
28
|
+
"orderTypes": ["market", "limit"]
|
|
15
29
|
}
|
|
16
30
|
]
|
|
@@ -25,9 +25,9 @@ class Honeymaker::Exchanges::BitvavoTest < Minitest::Test
|
|
|
25
25
|
assert_equal "0.00001", ticker[:minimum_base_size]
|
|
26
26
|
assert_equal "5", ticker[:minimum_quote_size]
|
|
27
27
|
assert_nil ticker[:maximum_base_size]
|
|
28
|
-
assert_equal
|
|
29
|
-
assert_equal
|
|
30
|
-
assert_equal
|
|
28
|
+
assert_equal 8, ticker[:base_decimals]
|
|
29
|
+
assert_equal 2, ticker[:quote_decimals]
|
|
30
|
+
assert_equal 0, ticker[:price_decimals] # tickSize "1.00" -> whole-number prices
|
|
31
31
|
assert ticker[:available]
|
|
32
32
|
assert ticker[:trading_enabled]
|
|
33
33
|
end
|