Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
beem
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
hive
beem
Commits
146ddb54
Commit
146ddb54
authored
5 years ago
by
Michael D. Garcia
Browse files
Options
Downloads
Patches
Plain Diff
fixes to market data retrieval / minor cleanup
parent
5c82f431
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
beem/market.py
+14
-9
14 additions, 9 deletions
beem/market.py
beemgraphenebase/chains.py
+2
-2
2 additions, 2 deletions
beemgraphenebase/chains.py
with
16 additions
and
11 deletions
beem/market.py
+
14
−
9
View file @
146ddb54
...
...
@@ -10,13 +10,13 @@ import logging
from
datetime
import
datetime
,
timedelta
from
beem.instance
import
shared_hive_instance
from
.utils
import
(
formatTimeFromNow
,
formatTime
,
formatTimeString
,
assets_from_string
,
parse_time
,
addTzInfo
)
formatTimeFromNow
,
formatTimeString
,
assets_from_string
,
parse_time
,
addTzInfo
)
from
.asset
import
Asset
from
.amount
import
Amount
from
.price
import
Price
,
Order
,
FilledOrder
from
.account
import
Account
from
beembase
import
operations
from
beemgraphenebase.py23
import
bytes_types
,
integer_types
,
string_types
,
text_type
from
beemgraphenebase.py23
import
integer_types
,
string_types
,
text_type
REQUEST_MODULE
=
None
if
not
REQUEST_MODULE
:
try
:
...
...
@@ -145,7 +145,6 @@ class Market(dict):
# Core Exchange rate
self
.
hive
.
rpc
.
set_next_node_on_empty_reply
(
True
)
ticker
=
self
.
hive
.
rpc
.
get_ticker
(
api
=
"
market_history
"
)
if
raw_data
:
return
ticker
...
...
@@ -168,8 +167,8 @@ class Market(dict):
hive_instance
=
self
.
hive
)
data
[
"
percent_change
"
]
=
float
(
ticker
[
"
percent_change
"
])
data
[
"
h
bd_volume
"
]
=
Amount
(
ticker
[
"
h
bd_volume
"
],
hive_instance
=
self
.
hive
)
data
[
"
hive
_volume
"
]
=
Amount
(
ticker
[
"
hive
_volume
"
],
hive_instance
=
self
.
hive
)
data
[
"
s
bd_volume
"
]
=
Amount
(
ticker
[
"
s
bd_volume
"
],
hive_instance
=
self
.
hive
)
data
[
"
steem
_volume
"
]
=
Amount
(
ticker
[
"
steem
_volume
"
],
hive_instance
=
self
.
hive
)
return
data
...
...
@@ -786,11 +785,12 @@ class Market(dict):
prices
=
{}
responses
=
[]
urls
=
[
"
https://ionomy.com/api/v1/public/market-summary?market=btc-hive
"
,
# "https://poloniex.com/public?command=returnTicker",
"
https://bittrex.com/api/v1.1/public/getmarketsummary?market=BTC-HIVE
"
,
"
https://api.binance.com/api/v1/ticker/24hr
"
,
"
https://api.huobi.pro/market/history/kline?period=1day&size=1&symbol=hivebtc
"
,
"
https://crix-api.upbit.com/v1/crix/trades/ticks?code=CRIX.UPBIT.BTC-HIVE&count=1
"
,
#
"https://bittrex.com/api/v1.1/public/getmarketsummary?market=BTC-HIVE",
#
"https://api.binance.com/api/v1/ticker/24hr",
#
"https://api.huobi.pro/market/history/kline?period=1day&size=1&symbol=hivebtc",
#
"https://crix-api.upbit.com/v1/crix/trades/ticks?code=CRIX.UPBIT.BTC-HIVE&count=1",
]
headers
=
{
'
Content-type
'
:
'
application/x-www-form-urlencoded
'
,
'
User-Agent
'
:
'
Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.71 Safari/537.36
'
}
...
...
@@ -821,6 +821,11 @@ class Market(dict):
prices
[
'
huobi
'
]
=
{
'
price
'
:
float
(
data
[
'
close
'
]),
'
volume
'
:
float
(
data
[
'
vol
'
])}
elif
"
ionomy
"
in
r
.
url
:
data
=
r
.
json
()[
'
data
'
]
prices
[
'
ionomy
'
]
=
{
'
price
'
:
float
(
data
[
'
price
'
]),
'
volume
'
:
float
(
data
[
'
volume
'
])}
elif
"
upbit
"
in
r
.
url
:
data
=
r
.
json
()[
-
1
]
prices
[
'
upbit
'
]
=
{
...
...
This diff is collapsed.
Click to expand it.
beemgraphenebase/chains.py
+
2
−
2
View file @
146ddb54
...
...
@@ -6,7 +6,7 @@ default_prefix = "STM"
known_chains
=
{
"
HIVEAPPBASE
"
:
{
"
chain_id
"
:
"
0
"
*
int
(
256
/
4
),
"
min_version
"
:
'
0.
19.1
0
'
,
"
min_version
"
:
'
0.
23.
0
'
,
"
prefix
"
:
"
STM
"
,
"
chain_assets
"
:
[
{
"
asset
"
:
"
@@000000013
"
,
"
symbol
"
:
"
HBD
"
,
"
precision
"
:
3
,
"
id
"
:
0
},
...
...
@@ -16,7 +16,7 @@ known_chains = {
},
"
HIVE
"
:
{
"
chain_id
"
:
"
0
"
*
int
(
256
/
4
),
"
min_version
"
:
'
0.
19.5
'
,
"
min_version
"
:
'
0.
23.0
'
,
"
prefix
"
:
"
STM
"
,
"
chain_assets
"
:
[
{
"
asset
"
:
"
HBD
"
,
"
symbol
"
:
"
HBD
"
,
"
precision
"
:
3
,
"
id
"
:
0
},
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment