cosgrove 0.0.1rc4 → 0.0.1rc5
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 +4 -4
- data/Gemfile.lock +3 -3
- data/lib/cosgrove/market.rb +12 -12
- data/lib/cosgrove/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: 347eb54785a8826aa2087eb8aa62c35e8527d3b1
|
|
4
|
+
data.tar.gz: cc59ca6f45837e7e8693980ef923282afdba5e08
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8543794bc7f9d0ed98f71843f1d010093aa208070153e70109ec83daae60b2d1079cb96d01cbc0c833df8aa2457d4cbc9eeac6c38d2c8603bfc8e2653a0e35c7
|
|
7
|
+
data.tar.gz: c480142a29f14dbad7654c016f61ff98dec1c2551d6e5c83f85668764c3d86f6130d8c45dcbcaf415d09c3a44840b87803b0e2436778c5ded965d5215c87bce9
|
data/Gemfile.lock
CHANGED
|
@@ -17,7 +17,7 @@ GIT
|
|
|
17
17
|
PATH
|
|
18
18
|
remote: .
|
|
19
19
|
specs:
|
|
20
|
-
cosgrove (0.0.
|
|
20
|
+
cosgrove (0.0.1rc5)
|
|
21
21
|
activesupport (~> 5.1, >= 5.1.1)
|
|
22
22
|
ai4r (~> 1.13, >= 1.13)
|
|
23
23
|
discordrb (~> 3.2, >= 3.2.1)
|
|
@@ -82,7 +82,7 @@ GEM
|
|
|
82
82
|
erubi (1.6.1)
|
|
83
83
|
ethon (0.10.1)
|
|
84
84
|
ffi (>= 1.3.0)
|
|
85
|
-
event_emitter (0.2.
|
|
85
|
+
event_emitter (0.2.6)
|
|
86
86
|
faraday (0.12.1)
|
|
87
87
|
multipart-post (>= 1.2, < 3)
|
|
88
88
|
ffi (1.9.18)
|
|
@@ -177,7 +177,7 @@ GEM
|
|
|
177
177
|
simplecov-html (0.10.1)
|
|
178
178
|
slop (3.6.0)
|
|
179
179
|
steem-slap (0.0.2)
|
|
180
|
-
thor (0.
|
|
180
|
+
thor (0.20.0)
|
|
181
181
|
thread_safe (0.3.6)
|
|
182
182
|
typhoeus (1.1.2)
|
|
183
183
|
ethon (>= 0.9.0)
|
data/lib/cosgrove/market.rb
CHANGED
|
@@ -71,12 +71,12 @@ module Cosgrove
|
|
|
71
71
|
end
|
|
72
72
|
|
|
73
73
|
def mvests(chain = :steem, account_names = [])
|
|
74
|
-
pol_usdt_steem, _pol_usdt_sbd, btx_usdt_golos, _btx_usdt_gbg = market_data
|
|
74
|
+
pol_usdt_steem, _pol_usdt_sbd, btx_usdt_golos, _btx_usdt_gbg, btx_usdt_steem, btx_usdt_sbd = market_data
|
|
75
75
|
base_per_mvest, base_per_debt = price_feed(chain)
|
|
76
76
|
|
|
77
77
|
if account_names.none?
|
|
78
|
-
|
|
79
|
-
|
|
78
|
+
btx_base_per_dept_as_usdt = base_per_mvest * btx_usdt_steem
|
|
79
|
+
btx_base_per_dept_as_usdt = number_to_currency(btx_base_per_dept_as_usdt, precision: 3)
|
|
80
80
|
|
|
81
81
|
base_per_mvest = number_with_precision(base_per_mvest, precision: 3, delimiter: ',', separator: '.')
|
|
82
82
|
|
|
@@ -92,7 +92,7 @@ module Cosgrove
|
|
|
92
92
|
|
|
93
93
|
# E.g. from 2016/11/25: 1 MV = 1M VESTS = 459.680 STEEM = $50.147
|
|
94
94
|
return case chain
|
|
95
|
-
when :steem then "`1 MV = 1M VESTS = #{base_per_mvest} STEEM = #{base_per_debt} = #{
|
|
95
|
+
when :steem then "`1 MV = 1M VESTS = #{base_per_mvest} STEEM = #{base_per_debt} = #{btx_base_per_dept_as_usdt} on Bittrex`"
|
|
96
96
|
when :golos then "`1 MG = 1M GESTS = #{base_per_mvest} GOLOS = #{base_per_debt} GBG = #{base_per_debt_as_usdt}`"
|
|
97
97
|
when :test then "`1 MT = 1M TESTS = #{base_per_mvest} TEST = #{base_per_debt}`"
|
|
98
98
|
end
|
|
@@ -152,24 +152,24 @@ module Cosgrove
|
|
|
152
152
|
delegated_vests = (received_vests - delegated_vests) / 1000000
|
|
153
153
|
steem = base_per_mvest * mvests
|
|
154
154
|
sbd = base_per_debt * mvests
|
|
155
|
-
|
|
155
|
+
btx_sbd = base_per_mvest * mvests * btx_usdt_steem
|
|
156
156
|
|
|
157
157
|
mvests = number_with_precision(mvests, precision: 3, delimiter: ',', separator: '.')
|
|
158
158
|
delegated_sign = delegated_vests >= 0.0 ? '+' : '-'
|
|
159
159
|
delegated_vests = number_with_precision(delegated_vests.abs, precision: 3, delimiter: ',', separator: '.')
|
|
160
160
|
steem = number_with_precision(steem, precision: 3, delimiter: ',', separator: '.')
|
|
161
161
|
sbd = number_to_currency(sbd, precision: 3)
|
|
162
|
-
|
|
162
|
+
btx_sbd = number_to_currency(btx_sbd, precision: 3)
|
|
163
163
|
|
|
164
164
|
if accounts.size == 1
|
|
165
|
-
balance = ["#{mvests} MVESTS = #{steem} STEEM = #{sbd} = #{
|
|
165
|
+
balance = ["#{mvests} MVESTS = #{steem} STEEM = #{sbd} = #{btx_sbd} on Bittrex"]
|
|
166
166
|
unless delegated_vests == '0.000'
|
|
167
167
|
balance << "(#{delegated_sign}#{delegated_vests} MVESTS delegated)"
|
|
168
168
|
end
|
|
169
169
|
|
|
170
170
|
"**#{account.name}:** `#{balance.join(' ')}`"
|
|
171
171
|
else
|
|
172
|
-
balance = ["#{mvests} MVESTS = #{steem} STEEM = #{sbd} = #{
|
|
172
|
+
balance = ["#{mvests} MVESTS = #{steem} STEEM = #{sbd} = #{btx_sbd} on Bittrex"]
|
|
173
173
|
unless delegated_vests == '0.000'
|
|
174
174
|
balance << "(#{delegated_sign}#{delegated_vests} MVESTS delegated)"
|
|
175
175
|
end
|
|
@@ -198,7 +198,7 @@ module Cosgrove
|
|
|
198
198
|
end
|
|
199
199
|
|
|
200
200
|
def rewardpool(chain = :steem)
|
|
201
|
-
pol_usdt_steem, _pol_usdt_sbd, btx_usdt_golos, _btx_usdt_gbg = market_data
|
|
201
|
+
pol_usdt_steem, _pol_usdt_sbd, btx_usdt_golos, _btx_usdt_gbg, btx_usdt_steem, btx_usdt_sbd = market_data
|
|
202
202
|
base_per_mvest, base_per_debt = price_feed(chain)
|
|
203
203
|
|
|
204
204
|
case chain
|
|
@@ -208,13 +208,13 @@ module Cosgrove
|
|
|
208
208
|
total = reward_fund.reward_balance
|
|
209
209
|
total = total.split(' ').first.to_f
|
|
210
210
|
total_usd = (total / base_per_mvest) * base_per_debt
|
|
211
|
-
|
|
211
|
+
btx_total_usd = total * btx_usdt_steem
|
|
212
212
|
|
|
213
213
|
total = number_with_precision(total, precision: 0, delimiter: ',', separator: '.')
|
|
214
214
|
total_usd = number_to_currency(total_usd, precision: 0)
|
|
215
|
-
|
|
215
|
+
btx_total_usd = number_to_currency(btx_total_usd, precision: 0)
|
|
216
216
|
|
|
217
|
-
"Total Reward Fund: `#{total} STEEM (Worth: #{total_usd} internally; #{
|
|
217
|
+
"Total Reward Fund: `#{total} STEEM (Worth: #{total_usd} internally; #{btx_total_usd} on Bittrex)`"
|
|
218
218
|
when :golos
|
|
219
219
|
response = api(chain).get_dynamic_global_properties
|
|
220
220
|
properties = response.result
|
data/lib/cosgrove/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: cosgrove
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.1rc5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Anthony Martin
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2017-08-
|
|
11
|
+
date: 2017-08-22 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|