Skip to content
This repository has been archived by the owner. It is now read-only.
Exchange information STEEM, BTC, LTC, TRY etc with exchange platforms.
Python
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
blockcoinex
LICENSE.txt
README.md
requirements.txt
setup.cfg
setup.py

README.md

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, OrderBook
>>> from blockcoinex.blocktrades import Blocktrades
>>> from blockcoinex.exchange import Exchange
>>> from blockcoinex.binance_ import Binance

The Binance class provides access to information about coins on the Binance.com platform.

>>> binan = Binance(amount:float) # default 1000 amount of steem
>>> binan.sell(symbol:str) # default "STEEMBTC"
>>> binan.steem_btc_try
{'steem': 1000, 'btc': 0.1092, 'try_': 4382.841092, 'rate': 40200.01}

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 OrderBook class provides access to information about orders book on the koinim.com platform.

>>> order_book = OrderBook(type:str) # "ltc" or "btc" default "ltc"
>>> [bid for bid in order_book.get_bids]
>>> [ask for ask in order_book.get_asks]
>>> order_book.get_length["ask"]
>>> order_book.get_length["bid"]
>>> order_book.grap(limit:float) # default 50 to see the graph
>>> order_book.grap_ask(limit:float) # default 50 to see the graph
>>> order_book.grap_bid(limit:float) # default 50 to see the graph
Grap

3.PNG

Grap_ask

1.PNG

Grap_bid

2.PNG

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}

Donate sbd/steem @hakancelik on steemit.com

You can’t perform that action at this time.