Blockcoinex | Exchange information STEEM, BTC, LTC, TRY etc with exchange platforms.
Repository
https://github.com/hakancelik96/blockcoinex
New Projects
What is Blockcoinex python library?
As you know, we use sites for coin transfers, such as Blocktrades, Binance etc, and these sites receive a certain commission for their services.
Users can learn how much steem, bitcoin, litecoin etc they will get to themselves at the end of the transfer process because of to this python library.
They can even make their profits with other coins comparable and most profitable.
This comparison can be done not only on the coins but also on the platforms, is it the most profitable way to use binance or use the koinim.com ?
Technology Stack
- Python 3.5 and more
- requests # pip install requests
Roadmap
Other platforms and coins used for the transfer will be added.
How to contribute?
- You can help me with things I have written on the roadmap
- You can open the issue if you find an error.
GitHub Account
https://github.com/hakancelik96
How to use it?
Installation
pip install blockcoinex
Update
pip install blockcoinex -U
We include our classes of the library in the project.
>>> from blockcoinex.koinim import Koinim
>>> from blockcoinex.blocktrades import Blocktrades
>>> from blockcoinex.exchange import Exchange
The Koinim class provides access to information about coins on the koinim.com platform.
For example btc buying, selling - ltc buying and selling cost, review the codes below.
>>> k = Koinim(inputCoinType:str | btc or ltc) # default btc
>>> k.r
>>> k.json
>>> k.text
>>> k.buy
>>> k.sell
Let's do an example
>>> k = Koinim(inputCoinType = "ltc")
>>> k.r # r means that requests() result
<Response [200]>
>>> k.r.text
'{"sell": 408.05000000, "high": 411.98000000, "buy": 396.01000000, "change_rate": -1.4372, "bid": 396.01000000, "wavg": 401.2859104342266828375196589, "last_order": 400.00000000, "volume": 577.68641752, "low": 395.12000000, "ask": 408.05000000, "avg": 402.429770992366}'
>>> k.r.json()
{'sell': 408.05, 'high': 411.98, 'buy': 396.01, 'change_rate': -1.4372, 'bid': 396.01, 'wavg': 401.2859104342267, 'last_order': 400.0, 'volume': 577.68641752, 'low': 395.12, 'ask': 408.05, 'avg': 402.429770992366}
>>> k.json
{'sell': 408.05, 'high': 411.98, 'buy': 396.01, 'change_rate': -1.4372, 'bid': 396.01, 'wavg': 401.2859104342267, 'last_order': 400.0, 'volume': 577.68641752, 'low': 395.12, 'ask': 408.05, 'avg': 402.429770992366}
>>> k.text
'{"sell": 408.05000000, "high": 411.98000000, "buy": 396.01000000, "change_rate": -1.4372, "bid": 396.01000000, "wavg": 401.2859104342266828375196589, "last_order": 400.00000000, "volume": 577.68641752, "low": 395.12000000, "ask": 408.05000000, "avg": 402.429770992366}'
>>> k.buy
408.05 # try
>>> k.sell
396.01 # try
The Blocktrades class provides access to information about coins on the blocktrades.us platform.
For example steem btc,steem ltc,ltc steem etc exchange price, review the codes below.
>>> b = Blocktrades(
Amount:float,
inputCoinType:str,
outputCoinType:str,reverse:bool
)
>>> b.json
>>> b.text
>>> b.amount
I will briefly explain the meaning of the reverse parameter, how many STEEM should I sell as to earn BTC?
Let's do an example
>>> b = Blocktrades(
Amount = 100,
inputCoinType = "steem",
outputCoinType = "btc",reverse = False) # reverse default False
>>> b.api
https://blocktrades.us/api/v2/estimate-output-amount?inputAmount=100&inputCoinType=steem&outputCoinType=btc
>>> b.r
<Response [200]>
>>> b.json
{'inputAmount': '100', 'inputCoinType': 'steem',
'outputAmount': '0.01676151', 'outputCoinType': 'btc'}
>>> b.text
'{"inputAmount":"100","inputCoinType":"steem",
"outputAmount":"0.01676151","outputCoinType":"btc"}'
>>> b.amount
0.01676151 # outputCoinType so, it is btc
The Exchange class provides access to information about coins exchange on the platforms.
For example steem try btc,steem ltc try,try steem btc etc exchange price, review the codes below.
>>> e = Exchange(amount:float,
withdraw_btc_fee = 0.001, # default
withdraw_ltc_fee = 0.015, # default
withdraw_try_fee = 3, # default
exchange_fee = 4 # default
)
>>> e.try_btc_steem
>>> e.try_ltc_steem
>>> e.steem_btc_try
>>> e.steem_ltc_try
>>> e.try_btc_steem_reverse
>>> e.try_ltc_steem_reverse
Let’s do an example
>>> e = Exchange(amount = 100)
>>> e.__dict__
{'amount': 100, 'withdraw_btc_fee': 0.001, 'withdraw_ltc_fee': 0.015, 'withdraw_try_fee': 3, 'exchange_fee': 4}
>>> e.try_btc_steem
{'try': 100, 'btc': 0.001439645, 'steem': 7.877, 'rate': 39349.99}
>>> e.try_ltc_steem
{'try': 100, 'ltc': 0.220294118, 'steem': 12.359, 'rate': 408.0}
>>> e.steem_btc_try
{'steem': 100, 'btc': 0.01676151, 'try': 646.91678963, 'rate': 39013.0}
>>> e.steem_ltc_try
{'steem': 100, 'ltc': 1.69304035, 'try': 663.4439786, 'rate': 396.0}
>>> e.try_btc_steem_reverse
{'steem': 18.138, 'btc': 0.002742676, 'try': 100, 'rate': 39013.0}
>>> e.try_ltc_steem_reverse
{'steem': 16.213, 'ltc': 0.27020202, 'try': 100, 'rate': 396.0}
Thanks for the contribution, @hakancelik! I'm not sure how useful something like this is, to be honest. Would you mind explaining why someone would use this Python package over other ones and give an example? (I know you gave examples of how to use the code, but not why and in what capacity someone could use it for).
Some other thoughts:
:
,,
withdraw_btc_fee = 0.001
->withdraw_btc_fee=0.001
). Also the parameters are under-indented.Most of these things could be solved by installing a linter like
pep8
orpylint
. I also think you could improve the formatting and presentation of your post (here's a good example).Your contribution has been evaluated according to Utopian policies and guidelines, as well as a predefined set of questions pertaining to the category.
To view those questions and the relevant answers related to your post, click here.
Need help? Write a ticket on https://support.utopian.io/.
Chat with us on Discord.
[utopian-moderator]
Hi, @amosbastian thanks for review.
What is Blockcoinex python library?
I thought I was talking about why it should be used under this heading.
Thanks for your advice, I follow the advice and this is helping me in development.
Very interesting tool: I'll try it as soon as I can.
A huge hug from @amico!
Thanks :)
🌈 Thank you ! 🙏🏻
Congratulations @hakancelik! You have completed the following achievement on Steemit and have been rewarded with new badge(s) :
Award for the number of upvotes received
Click on the badge to view your Board of Honor.
If you no longer want to receive notifications, reply to this comment with the word
STOP
To support your work, I also upvoted your post!
Hey @hakancelik
Thanks for contributing on Utopian.
We’re already looking forward to your next contribution!
Want to chat? Join us on Discord https://discord.gg/h52nFrV.
Vote for Utopian Witness!