Giter VIP home page Giter VIP logo

python-binance-chain's Introduction

Welcome to python-binance-chain v0.1.20

This is an unofficial Python3 wrapper for the Binance Chain API. I am in no way affiliated with Binance, use at your own risk.

PyPi
https://pypi.python.org/pypi/python-binance-chain
Source code
https://github.com/sammchardy/python-binance-chain

Features

Read the Changelog

Recommended Resources

Quick Start

pip install python-binance-chain

If having issues with secp256k1 check the Installation instructions for the sec256k1-py library

If using the production server there is no need to pass the environment variable.

from binance_chain.http import HttpApiClient
from binance_chain.constants import KlineInterval
from binance_chain.environment import BinanceEnvironment

# initialise with Testnet environment
testnet_env = BinanceEnvironment.get_testnet_env()
client = HttpApiClient(env=testnet_env)

# Alternatively pass no env to get production
prod_client = HttpApiClient()

# connect client to different URL using custom environments, see below

# get node time
time = client.get_time()

# get node info
node_info = client.get_node_info()

# get validators
validators = client.get_validators()

# get peers
peers = client.get_peers()

# get account
account = client.get_account('tbnb185tqzq3j6y7yep85lncaz9qeectjxqe5054cgn')

# get account sequence
account_seq = client.get_account_sequence('tbnb185tqzq3j6y7yep85lncaz9qeectjxqe5054cgn')

# get markets
markets = client.get_markets()

# get fees
fees = client.get_fees()

# get order book
order_book = client.get_order_book('NNB-0AD_BNB')

# get klines
klines = client.get_klines('NNB-338_BNB', KlineInterval.ONE_DAY)

# get closed orders
closed_orders = client.get_closed_orders('tbnb185tqzq3j6y7yep85lncaz9qeectjxqe5054cgn')

# get open orders
open_orders = client.get_open_orders('tbnb185tqzq3j6y7yep85lncaz9qeectjxqe5054cgn')

# get ticker
ticker = client.get_ticker('NNB-0AD_BNB')

# get trades
trades = client.get_trades(limit=2)

# get order
order = client.get_order('9D0537108883C68B8F43811B780327CE97D8E01D-2')

# get trades
trades = client.get_trades()

# get transactions
transactions = client.get_transactions(address='tbnb1n5znwyygs0rghr6rsydhsqe8e6ta3cqatucsqp')

# get transaction
transaction = client.get_transaction('95DD6921370D74D0459590268B439F3DD49F6B1D090121AFE4B2183C040236F3')

See API docs for more information.

Async HTTP Client

An implementation of the HTTP Client above using aiohttp instead of requests

Use the async create classmethod to initialise an instance of the class.

All methods are otherwise the same as the HttpApiClient

from binance_chain.http import AsyncHttpApiClient
from binance_chain.environment import BinanceEnvironment
import asyncio

loop = None

async def main():
    global loop

    env = BinanceEnvironment.get_testnet_env()

    # initialise the class using the classmethod
    client = await AsyncHttpApiClient.create(env)
    wallet = Wallet(private_key=priv_key, env=env)

    print(json.dumps(await client.get_time(), indent=2))

    while True:
        print("doing a sleep")
        await asyncio.sleep(20, loop=loop)


if __name__ == "__main__":

    loop = asyncio.get_event_loop()
    loop.run_until_complete(main())

Environments

Binance Chain offers a Production system and Testnet.

If using the Production system there is no need to pass an environment as this is the default.

To create and use the Testnet environment is as easy as

from binance_chain.environment import BinanceEnvironment

# initialise with Testnet environment
testnet_env = BinanceEnvironment.get_testnet_env()

You may also create your own custom environments, this may be useful such as connecting to a Node RPC client

from binance_chain.environment import BinanceEnvironment

# create custom environment
my_env = BinanceEnvironment(api_url="<api_url>", wss_url="<wss_url>", hrp="<hrp>")

See API docs for more information.

Wallet

See API docs for more information.

The wallet is required if you want to place orders, transfer funds or freeze and unfreeze tokens.

You may also use the Ledger Wallet class to utilise your Ledger Hardware Wallet for signing.

It can be initialised with your private key or your mnemonic phrase.

You can additionally provide BIP39 passphrase and derived wallet id.

Note that the BinanceEnvironment used for the wallet must match that of the HttpApiClient, testnet addresses will not work on the production system.

The Wallet class can also create a new account for you by calling the Wallet.create_random_wallet() function, see examples below

Initialise from Private Key

from binance_chain.wallet import Wallet
from binance_chain.environment import BinanceEnvironment

testnet_env = BinanceEnvironment.get_testnet_env()
wallet = Wallet('private_key_string', env=testnet_env)
print(wallet.address)
print(wallet.private_key)
print(wallet.public_key_hex)

Initialise from Mnemonic

from binance_chain.wallet import Wallet
from binance_chain.environment import BinanceEnvironment

testnet_env = BinanceEnvironment.get_testnet_env()
wallet = Wallet.create_wallet_from_mnemonic('mnemonic word string',
                                             passphrase='optional passphrase',
                                             child=0,
                                             env=testnet_env)
print(wallet.address)
print(wallet.private_key)
print(wallet.public_key_hex)

Initialise by generating a random Mneomonic

from binance_chain.wallet import Wallet
from binance_chain.environment import BinanceEnvironment

testnet_env = BinanceEnvironment.get_testnet_env(, env=testnet_env)
wallet = Wallet.create_random_wallet(env=env)
print(wallet.address)
print(wallet.private_key)
print(wallet.public_key_hex)

Broadcast Messages on HttpApiClient

See API docs for more information.

Requires a Wallet to have been created.

The Wallet will increment the request sequence when broadcasting messages through the HttpApiClient.

If the sequence gets out of sync call wallet.reload_account_sequence(client), where client is an instance of HttpApiClient.

Place Order

General case

from binance_chain.http import HttpApiClient
from binance_chain.messages import NewOrderMsg
from binance_chain.wallet import Wallet
from binance_chain.constants import TimeInForce, OrderSide, OrderType
from decimal import Decimal

wallet = Wallet('private_key_string')
client = HttpApiClient()

# construct the message
new_order_msg = NewOrderMsg(
    wallet=wallet,
    symbol="ANN-457_BNB",
    time_in_force=TimeInForce.GOOD_TILL_EXPIRE,
    order_type=OrderType.LIMIT,
    side=OrderSide.BUY,
    price=Decimal(0.000396000),
    quantity=Decimal(12)
)
# then broadcast it
res = client.broadcast_msg(new_order_msg, sync=True)

Limit Order Buy

from binance_chain.messages import LimitOrderBuyMsg

limit_order_msg = LimitOrderBuyMsg(
    wallet=wallet,
    symbol='ANN-457_BNB',
    price=0.000396000,
    quantity=12
)

Limit Order Sell

from binance_chain.messages import LimitOrderSellMsg

limit_order_msg = LimitOrderSellMsg(
    wallet=wallet,
    symbol='ANN-457_BNB',
    price=0.000396000,
    quantity=12
)

Cancel Order

from binance_chain.http import HttpApiClient
from binance_chain.messages import CancelOrderMsg
from binance_chain.wallet import Wallet

wallet = Wallet('private_key_string')
client = HttpApiClient()

# construct the message
cancel_order_msg = CancelOrderMsg(
    wallet=wallet,
    order_id="order_id_string",
    symbol='ANN-457_BNB',
)
# then broadcast it
res = client.broadcast_msg(cancel_order_msg, sync=True)

Freeze Tokens

from binance_chain.http import HttpApiClient
from binance_chain.messages import FreezeMsg
from binance_chain.wallet import Wallet
from decimal import Decimal

wallet = Wallet('private_key_string')
client = HttpApiClient()

# construct the message
freeze_msg = FreezeMsg(
    wallet=wallet,
    symbol='BNB',
    amount=Decimal(10)
)
# then broadcast it
res = client.broadcast_msg(freeze_msg, sync=True)

Unfreeze Tokens

from binance_chain.http import HttpApiClient
from binance_chain.messages import UnFreezeMsg
from binance_chain.wallet import Wallet
from decimal import Decimal

wallet = Wallet('private_key_string')
client = HttpApiClient()

# construct the message
unfreeze_msg = UnFreezeMsg(
    wallet=wallet,
    symbol='BNB',
    amount=Decimal(10)
)
# then broadcast it
res = client.broadcast_msg(unfreeze_msg, sync=True)

Transfer Tokens

from binance_chain.http import HttpApiClient
from binance_chain.messages import TransferMsg
from binance_chain.wallet import Wallet

wallet = Wallet('private_key_string')
client = HttpApiClient()

transfer_msg = TransferMsg(
    wallet=wallet,
    symbol='BNB',
    amount=1,
    to_address='<to address>',
    memo='Thanks for the beer'
)
res = client.broadcast_msg(transfer_msg, sync=True)

Transfer Multiple Tokens

from binance_chain.http import HttpApiClient
from binance_chain.messages import TransferMsg, Transfer
from binance_chain.wallet import Wallet

wallet = Wallet('private_key_string')
client = HttpApiClient()

multi_transfer_msg = TransferMsg(
    wallet=wallet,
    transfers=[
        Transfer(symbol='ETH.B', amount=1),
        Transfer(symbol='BNB', amount=1),
    ],
    to_address='<to address>',
    memo='Thanks for the beer'
)
res = client.broadcast_msg(multi_transfer_msg, sync=True)

Vote for proposal

from binance_chain.http import HttpApiClient
from binance_chain.messages import VoteMsg
from binance_chain.wallet import Wallet
from binance_chain.constants import VoteOption

wallet = Wallet('private_key_string')
client = HttpApiClient()

vote_msg = VoteMsg(
    wallet=wallet,
    proposal_id=1,
    vote_option=VoteOption.YES
)
res = client.broadcast_msg(vote_msg, sync=True)

Sign Transaction

If you want to simply sign a transaction you can do that as well.

This is a transfer example

from binance_chain.messages import TransferMsg, Signature
from binance_chain.wallet import Wallet

wallet = Wallet('private_key_string')

transfer_msg = TransferMsg(
    wallet=wallet,
    symbol='BNB',
    amount=1,
    to_address='<to address>'
)
signed_msg = Signature(transfer_msg).sign()

Websockets

See API docs for more information.

import asyncio

from binance_chain.websockets import BinanceChainSocketManager
from binance_chain.environment import BinanceEnvironment

testnet_env = BinanceEnvironment.get_testnet_env()

address = 'tbnb...'
loop = None

async def main():
    global loop

    async def handle_evt(msg):
        """Function to handle websocket messages
        """
        print(msg)

    # connect to testnet env
    bcsm = await BinanceChainSocketManager.create(loop, handle_evt, address, env=testnet_env)

    # subscribe to relevant endpoints
    await bcsm.subscribe_orders(address)
    await bcsm.subscribe_market_depth(["FCT-B60_BNB", "0KI-0AF_BNB"])
    await bcsm.subscribe_market_delta(["FCT-B60_BNB", "0KI-0AF_BNB"])
    await bcsm.subscribe_trades(["FCT-B60_BNB", "0KI-0AF_BNB"])
    await bcsm.subscribe_ticker(["FCT-B60_BNB", "0KI-0AF_BNB"])

    while True:
        print("sleeping to keep loop open")
        await asyncio.sleep(20, loop=loop)


if __name__ == "__main__":

    loop = asyncio.get_event_loop()
    loop.run_until_complete(main())

Unsubscribe

# with an existing BinanceChainSocketManager instance

await bcsm.unsubscribe_orders()

# can unsubscribe from a particular symbol, after subscribing to multiple
await bcsm.subscribe_market_depth(["0KI-0AF_BNB"])

Close Connection

# with an existing BinanceChainSocketManager instance

await bcsm.close_connection()

Node RPC HTTP

See API docs for more information.

The binance_chain.http.HttpApiClient has a helper function get_node_peers() which returns a list of peers with Node RPC functionality

from binance_chain.http import HttpApiClient, PeerType
from binance_chain.node_rpc import HttpRpcClient

httpapiclient = HttpApiClient()

# get a peer that support node requests
peers = httpapiclient.get_node_peers()
listen_addr = peers[0]['listen_addr']

# connect to this peer
rpc_client = HttpRpcClient(listen_addr)

# test some endpoints
abci_info = rpc_client.get_abci_info()
consensus_state = rpc_client.dump_consensus_state()
genesis = rpc_client.get_genesis()
net_info = rpc_client.get_net_info()
num_unconfirmed_txs = rpc_client.get_num_unconfirmed_txs()
status = rpc_client.get_status()
health = rpc_client.get_health()
unconfirmed_txs = rpc_client.get_unconfirmed_txs()
validators = rpc_client.get_validators()

block_height = rpc_client.get_block_height(10)

Node RPC HTTP Async

An aiohttp implementation of the Node RPC HTTP API.

Use the async create classmethod to initialise an instance of the class.

All methods are the same as the binance_chain.node_rpc.http.HttpRpcClient.

from binance_chain.node_rpc.http import AsyncHttpRpcClient
from binance_chain.http import AsyncHttpApiClient, PeerType
from binance_chain.environment import BinanceEnvironment
import asyncio

loop = None

async def main():
    global loop

    testnet_env = BinanceEnvironment.get_testnet_env()

    # create the client using the classmethod
    http_client = await AsyncHttpApiClient.create(env=testnet_env)

    peers = await http_client.get_node_peers()
    listen_addr = peers[0]['listen_addr']

    rcp_client = await AsyncHttpRpcClient.create(listen_addr)

    print(json.dumps(await rcp_client.get_abci_info(), indent=2))

    while True:
        print("doing a sleep")
        await asyncio.sleep(20, loop=loop)


if __name__ == "__main__":

    loop = asyncio.get_event_loop()
    loop.run_until_complete(main())

Broadcast Messages on Node RPC HTTP Client

Requires a Wallet to have been created

The Wallet will increment the request sequence when broadcasting messages through the HttpApiClient.

If the sequence gets out of sync call wallet.reload_account_sequence(client), where client is an instance of HttpApiClient.

Place Order

from binance_chain.node_rpc import HttpRpcClient
from binance_chain.messages import LimitOrderBuyMsg
from binance_chain.wallet import Wallet
from binance_chain.constants import RpcBroadcastRequestType

wallet = Wallet('private_key_string')
rpc_client = HttpRpcClient(listen_addr)

limit_order_msg = LimitOrderBuyMsg(
    wallet=wallet,
    symbol='ANN-457_BNB',
    price=0.000396000,
    quantity=12
)

# then broadcast it, by default in synchronous mode
res = rpc_client.broadcast_msg(limit_order_msg)

# alternative async request
res = rpc_client.broadcast_msg(new_order_msg, request_type=RpcBroadcastRequestType.ASYNC)

# or commit request
res = rpc_client.broadcast_msg(new_order_msg, request_type=RpcBroadcastRequestType.COMMIT)

Other messages can be constructed similar to examples above

Pooled Node RPC Client

This client connects to all available peer nodes in the network and spreads requests across them.

This helps reduce API rate limit errors.

The interface is the same as the above HttpRpcClient and AsyncHttpRpcClient classes for consistency.

Requests can be sent using asyncio gather note to check the number of clients connected to and not exceed that amount

import asyncio
from binance_chain.node_rpc.pooled_client import PooledRpcClient


async def main():

    # initialise the client, default production environment
    client = await PooledRpcClient.create()

    # optionally include an environment
    testnet_env = BinanceEnvironment.get_testnet_env()
    client = await PooledRpcClient.create(env=testnet_env)

    # show the number of peers connected with the num_peers property
    print(f"Connected to {client.num_peers} peers")

    # requests can be send in bulk using asyncio gather
    for i in range(0, 5):
        res = await asyncio.gather(
            client.get_abci_info(),
            client.get_consensus_state(),
            client.get_net_info(),
            client.get_status(),
            client.get_health(),
        )
        print(f'{i}: {res}')

    print(await client.get_block(1000))

    print(await client.get_blockchain_info(1000, 2000))

if __name__ == "__main__":

    loop = asyncio.get_event_loop()
    loop.run_until_complete(main())

To keep the peer connections up to date you may re-initialise the list of peers by calling the initialise_peers function

client.initialise_peers()

Node RPC Websockets

See API docs for more information.

For subscribe query examples see the documentation here

import asyncio

from binance_chain.http import HttpApiClient
from binance_chain.environment import BinanceEnvironment
from binance_chain.node_rpc.websockets import WebsocketRpcClient

loop = None

async def main():
    global loop

    async def handle_evt(msg):
        print(msg)

    # find node peers on testnet
    testnet_env = BinanceEnvironment.get_testnet_env()
    client = HttpApiClient(testnet_env)

    peers = client.get_node_peers()

    # construct websocket listen address - may not be correct
    listen_addr = re.sub(r"^https?:\/\/", "tcp://", peers[0]['listen_addr'])

    # create custom environment for RPC Websocket
    node_env = BinanceEnvironment(
        api_url=testnet_env.api_url,
        wss_url=listen_addr,
        hrp=testnet_env.hrp
    )

    wrc = await WebsocketRpcClient.create(loop, handle_evt, env=node_env)

    await wrc.subscribe("tm.event = 'NewBlock'")
    await wrc.abci_info()

    while True:
        print("sleeping to keep loop open")
        await asyncio.sleep(20, loop=loop)


if __name__ == "__main__":

    loop = asyncio.get_event_loop()
    loop.run_until_complete(main())

Unsubscribe

# with an existing WebsocketRpcClient instance

await wrc.unsubscribe("tm.event = 'NewBlock'")

Unsubscribe All

# with an existing WebsocketRpcClient instance

await wrc.unsubscribe_all()

Depth Cache

Follow the order book for a specified trading pair.

Note: This may not be 100% reliable as the response info available from Binance Chain may not always match up

from binance_chain.depthcache import DepthCacheManager
from binance_chain.environment import BinanceEnvironment
from binance_chain.http import HttpApiClient

dcm = None
loop = None


async def main():
    global dcm1, loop

    async def process_depth(depth_cache):
        print("symbol {}".format(depth_cache.symbol))
        print("1: top 5 asks")
        print(depth_cache.get_asks()[:5])
        print("1: top 5 bids")
        print(depth_cache.get_bids()[:5])

    env = BinanceEnvironment.get_testnet_env()
    client = HttpApiClient(env=env)

    dcm = await DepthCacheManager.create(client, loop, "100K-9BC_BNB", process_depth, env=env)

    while True:
        print("doing a sleep")
        await asyncio.sleep(20, loop=loop)


if __name__ == "__main__":

    loop = asyncio.get_event_loop()
    loop.run_until_complete(main())

Signing Service

A Service to sign and optionally also broadcast messages for you.

The service holds the private keys of the accounts and supplies a username and password to interact with these accounts.

This client re-uses the binance_chain.messages types. In this case no wallet parameter is required.

This client interacts with the binance-chain-signing-service read the docs there to create our own signing service.

Signing and then broadcasting

from binance_chain.messages import NewOrderMsg
from binance_chain.signing.http import HttpApiSigningClient
from binance_chain.constants import TimeInForce, OrderSide, OrderType

signing_client = HttpApiSigningClient('http://localhost:8000', username='sam', password='mypass')

# print(client.signing_service_auth())

new_order_msg = NewOrderMsg(
    symbol='ANN-457_BNB',
    order_type=OrderType.LIMIT,
    side=OrderSide.BUY,
    price=0.000396000,
    quantity=10,
    time_in_force=TimeInForce.GOOD_TILL_EXPIRE
)
new_order_hex = signing_client.sign_order(new_order_msg, wallet_name='wallet_1')

the sign_order method can also take a binance_chain.messages.LimitOrderBuyMsg or binance_chain.messages.LimitOrderSellMsg instance.

This hex can then be broadcast using the normal HTTP Client like so

from binance_chain.http import HttpApiClient
from binance_chain.environment import BinanceEnvironment

# initialise with environment that is supported by the signing service wallet
testnet_env = BinanceEnvironment.get_testnet_env()
client = HttpApiClient(env=testnet_env)

res = client.broadcast_hex_msg(new_order_hex['signed_msg'], sync=True)

The signing service supports binance_chain.messages types NewOrderMsg, CancelOrderMsg, FreezeMsg, UnFreezeMsg and TransferMsg

Signing and broadcasting in one

To sign and broadcast an order use the broadcast_order method. This returns the response from the Binance Chain exchange.

from binance_chain.messages import NewOrderMsg
from binance_chain.signing.http import HttpApiSigningClient
from binance_chain.constants import TimeInForce, OrderSide, OrderType

signing_client = HttpApiSigningClient('http://localhost:8000', username='sam', password='mypass')

# print(client.signing_service_auth())

new_order_msg = NewOrderMsg(
    symbol='ANN-457_BNB',
    order_type=OrderType.LIMIT,
    side=OrderSide.BUY,
    price=0.000396000,
    quantity=10,
    time_in_force=TimeInForce.GOOD_TILL_EXPIRE
)
res = signing_client.broadcast_order(new_order_msg, wallet_name='wallet_1')

Async Signing Service

Like all other libraries there is an async version.

from binance_chain.signing.http import AsyncHttpApiSigningClient
from binance_chain.http import AsyncHttpApiClient, PeerType
from binance_chain.environment import BinanceEnvironment
from binance_chain.constants import TimeInForce, OrderSide, OrderType
import asyncio

loop = None

async def main():
    global loop

    # create the client using the classmethod
    signing_client = await AsyncHttpApiSigningClient.create('http://localhost:8000', username='sam', password='mypass')

    new_order_msg = NewOrderMsg(
        symbol='ANN-457_BNB',
        order_type=OrderType.LIMIT,
        side=OrderSide.BUY,
        price=0.000396000,
        quantity=10,
        time_in_force=TimeInForce.GOOD_TILL_EXPIRE
    )

    # simply sign the message
    sign_res = await signing_client.sign_order(new_order_msg, wallet_name='wallet_1')

    # or broadcast it as well
    broadcast_res = await signing_client.broadcast_order(new_order_msg, wallet_name='wallet_1')

    print(json.dumps(await rcp_client.get_abci_info(), indent=2))

    while True:
        print("doing a sleep")
        await asyncio.sleep(20, loop=loop)


if __name__ == "__main__":

    loop = asyncio.get_event_loop()
    loop.run_until_complete(main())

Ledger

Sign transactions with your Ledger wallet, supports Ledger Blue, Nano S and Nano X.

Make sure you have registered on Binance Chain with your Ledger address.

Make sure that you have connected your Ledger and are in the Binance Chain app.

Install python-binance-chain with this optional library like so pip install python-binance-chain[ledger]

Uses the btchip-python library if having issues installing check their github page

from binance_chain.ledger import getDongle, LedgerApp, LedgerWallet
from binance_chain.environment import BinanceEnvironment

dongle = getDongle(debug=True)

testnet_env = BinanceEnvironment.get_testnet_env()
app = LedgerApp(dongle, env=testnet_env)

# get the Ledger Binance app version
print(app.get_version())

# Show your address on the Ledger
print(app.show_address())

# Get your address and public key from the Ledger
print(app.get_address())

# Get your public key from the Ledger
print(app.get_public_key())

Create a Wallet to use with the HTTP and Node RPC clients

# this will prompt you on your Ledger to confirm the address you want to use
wallet = LedgerWallet(app, env=testnet_env)


# now create messages and sign them with this wallet
from binance_chain.http import HttpApiClient
from binance_chain.messages import NewOrderMsg, OrderType, OrderSide, TimeInForce

client = HttpApiClient(env=testnet_env)
new_order_msg = NewOrderMsg(
    wallet=wallet,
    symbol='ANN-457_BNB',
    order_type=OrderType.LIMIT,
    side=OrderSide.BUY,
    price=0.000396000,
    quantity=10,
    time_in_force=TimeInForce.GOOD_TILL_EXPIRE
)
new_order_res = client.broadcast_msg(new_order_msg, sync=True)

print(new_order_res)

Requests and AioHTTP Settings

python-binance-chain uses requests and aiohttp libraries.

You can set custom requests parameters for all API calls when creating any of the http clients.

client = HttpApiClient(request_params={"verify": False, "timeout": 20})

Check out either the requests documentation or aiohttp documentation for all options.

Proxy Settings

You can use the settings method above

proxies = {
    'http': 'http://10.10.1.10:3128',
    'https': 'http://10.10.1.10:1080'
}

# in the Client instantiation
client = HttpApiClient(request_params={'proxies': proxies})

Or set an environment variable for your proxy if required to work across all requests.

An example for Linux environments from the requests Proxies documentation is as follows.

$ export HTTP_PROXY="http://10.10.1.10:3128"
$ export HTTPS_PROXY="http://10.10.1.10:1080"

For Windows environments

C:\>set HTTP_PROXY=http://10.10.1.10:3128
C:\>set HTTPS_PROXY=http://10.10.1.10:1080

Running Tests

git clone https://github.com/sammchardy/python-binance-chain.git
cd python-binance-chain
pip install -r test-requirements.txt

python -m pytest tests/

Donate

If this library helped you out feel free to donate.

  • ETH: 0xD7a7fDdCfA687073d7cC93E9E51829a727f9fE70
  • NEO: AVJB4ZgN7VgSUtArCt94y7ZYT6d5NDfpBo
  • LTC: LPC5vw9ajR1YndE1hYVeo3kJ9LdHjcRCUZ
  • BTC: 1Dknp6L6oRZrHDECRedihPzx2sSfmvEBys

Thanks

Sipa <https://github.com/sipa/bech32> for python reference implementation for Bech32 and segwit addresses

Other Exchanges

If you use Binance check out my python-binance library.

If you use Kucoin check out my python-kucoin library.

If you use IDEX check out my python-idex library.

python-binance-chain's People

Contributors

cheeseandcereal avatar mistdale avatar oliver-zehentleitner avatar sammchardy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

python-binance-chain's Issues

Conflicting dependencies issue

This package requires the pip package pywallet, which in turn requires a package called two1.

This package has a very strict (and not to mention, unnecessary) set of requirement dependencies (see: https://github.com/21dotco/two1-python/blob/master/setup.py#L13) which causes dependency conflicts when installing this python-binance-chain package.

Considering that pywallet is literally only used to get a private key out of a seed via BIP32 standards, I would recommend using a lighter dependency, or at least a dependency that doesn't result in conflicts.

If you would agree @sammchardy (or anyone else who maintains this repository), I could probably put together a PR for this, I just don't want to do the work before I know you'd be willing to accept this change. Please let me know.

problem at installing python-binance-chain

Hi. I'm using ubuntu 16.04 and python 3.7 and when I run the following code python3.7 -m pip install python-binance-chain I get :
Defaulting to user installation because normal site-packages is not writeable
Collecting python-binance-chain
Using cached python_binance_chain-0.1.20-py2.py3-none-any.whl (51 kB)
Collecting secp256k1>=0.13.2
Using cached secp256k1-0.13.2.tar.gz (156 kB)
...
and in this point installation gets stuck and nothing happens. I searched a lot but couldn't find how to solve this.

KeyError: 'message' in using signing service for signing a transferMsg

Hi. I'm running the following code :
signing_client = HttpApiSigningClient('http://127.0.0.1:8000', username='sam', password='mypass')
client = HttpApiClient(env=testnet_env)
transfer_msg = TransferMsg(
symbol='BNB',
amount=1,
to_address='tbnb15lq6x48g3pvaqjwhqfg4nygx63q03zsvk9rlxs')
signed_msg = signing_client.sign_transfer(transfer_msg, wallet_name='wallet_3')
res = signing_client.broadcast_transfer(signed_msg, wallet_name="wallet_3")

and I get this error raised from signed_msg = signing_client.sign_transfer(transfer_msg, wallet_name='wallet_3') :

"File "sendBNB.py", line 23, in
signed_msg = signing_client.sign_transfer(transfer_msg, wallet_name='wallet_3')
File "/home/mahsa/.local/lib/python3.6/site-packages/binance_chain/signing/http.py", line 266, in sign_transfer
return self._post('transfer/sign', json=data)
File "/home/mahsa/.local/lib/python3.6/site-packages/binance_chain/signing/http.py", line 122, in _post
return self._request('post', path, **kwargs)
File "/home/mahsa/.local/lib/python3.6/site-packages/binance_chain/signing/http.py", line 93, in _request
return self._handle_response(response)
File "/home/mahsa/.local/lib/python3.6/site-packages/binance_chain/signing/http.py", line 104, in _handle_response
raise BinanceChainAPIException(response, response.status_code)
File "/home/mahsa/.local/lib/python3.6/site-packages/binance_chain/exceptions.py", line 17, in init
self.message = json_res['message']
KeyError: 'message'"

my uvicorn server also prints :
INFO: 127.0.0.1:46392 - "POST /api/auth/login HTTP/1.1" 200 OK
INFO: 127.0.0.1:46394 - "POST /api/auth/login HTTP/1.1" 200 OK
INFO: 127.0.0.1:46394 - "POST /api/transfer/broadcast HTTP/1.1" 422 Unprocessable Entity

the weird fact is that when I use signing service for NewOrderMsg it works without any problem!
what should I do?

โ€œWallet environment doesn't match HttpApiClient environmentโ€ Issue

Hi @sammchardy ,
congratulations and your well structured codes looks really awesome!

I have a small question while running your codes, here are my codes:

from binance_chain.http import HttpApiClient
from binance_chain.messages import TransferMsg
from binance_chain.wallet import Wallet
from binance_chain.environment import BinanceEnvironment

wallet = Wallet('<my private key>')
testnet_env = BinanceEnvironment.get_testnet_env()
client = HttpApiClient(env=testnet_env)

transfer_msg = TransferMsg(
    wallet=wallet,
    symbol='<my symbol>',
    amount=0.08,
    to_address='<my address>'
)
res = client.broadcast_msg(transfer_msg, sync=True)
print(res)

And i got a "Wallet environment doesn't match HttpApiClient environment" error.
Not sure if you would have time to fix that prob to enable running on test-net?
Thanks in advance.

get_tx()

get_tx('hash') ๆ€ปๆ˜ฏๆŠฅ Invalid params ?

APIError(code=401): signature verification failed because of / in the memo

Hello,
I have an issue when broadcasting my transactions with the following error : "APIError(code=401): signature verification failed"
After investigation, I've found that the "/" in my memo is responsible of it (the broadcast works when I delete the slash)
Do you know how what should I do to broadcast this transaction with the "/" in the memo ?

Can't install in Ubuntu 18

I have tried in my local computer to install with Python 3.7 and I got an anaconda error:

error: command '/home/x/anaconda3/bin/x86_64-conda_cos6-linux-gnu-cc' failed with exit status 1

I tried with the solution of using sudo apt-get install libsecp256k1-dev instead but it also didn't work.

Finally, I tried to install it in a computer that has Python 3.5 to use the built libraries but the requirements.txt needs websockets>=7.0 and got the following error :

Exception: websockets requires Python >= 3.6.1.

Any help here would be appreciated. Thank you

Broadcast error. tx parse error

Enviroment

binance chain full node version: 0.6.0
env: linux

code

transfer_msg = TransferMsg(  
        wallet=wallet,  
        symbol='BNB',  
        amount=0.12345,  
        to_address='tbnb15cwx4kh8qcgr0uumm4hf20a4lsd7znpdjykevc',  
        memo='Transfer one BNB'  
    )  
    transfer_msg.wallet.initialise_wallet()  
    data = transfer_msg.to_hex_data()   

then I broadcast tx data with rpc broadcast_tx_commit & broadcast_tx_sync

Response:

{ "jsonrpc": "2.0", "id": "", "result": { "check_tx": { "code": 65538, "log": "{\"codespace\":1,\"code\":2,\"abci_code\":65538,\"message\":\"tx parse error\"}" }, "deliver_tx": {}, "hash": "80273E69A422A5F083EAF20B3401C16BB067AF5CAFD7FC535BC8ED431D284FA0", "height": "0" } }

Python crashes when importing HttpApiClient

Just wanted to play a little bit with this python binance chain library on macOS Catalina (10.15.4) using Python 3.7.6 but i canโ€™t get it running. Keep getting an error that my python crashed with error code 134 and the system logs show:

Clients should not load the unversioned libcrypto dylib as it does not have a stable ABI.

decode Amino-encoded node-rpc response

Hi,
I use python-binance-chain library. when I request to node-RPC server to get balance or anything else, I get response in Amino-encoded format.
Does anybody know how to decode this format?

Thanks,

PRODUCTION: Wallet environment doesn't match HttpApiClient environment

Hi friend,
I'm not passing any environment but am still getting this message:

  File "test.py", line 21, in <module>
    res = client.broadcast_msg(new_order_msg, sync=True)
  File "/usr/local/lib/python3.7/site-packages/binance_chain/http.py", line 367, in broadcast_msg
    raise BinanceChainBroadcastException("Wallet environment doesn't match HttpApiClient environment")
binance_chain.exceptions.BinanceChainBroadcastException: Wallet environment doesn't match HttpApiClient environment

Thanks for your help and I can offer to pay for support if it helps get this problem resolved quicker

from binance_chain.http import HttpApiClient
from binance_chain.messages import NewOrderMsg, CancelOrderMsg, LimitOrderSellMsg
from binance_chain.constants import KlineInterval, TimeInForce, OrderSide, OrderType
from binance_chain.wallet import Wallet
from decimal import *

wallet = Wallet("privateKey")
client = HttpApiClient()

new_order_msg = NewOrderMsg(
    wallet=wallet,
    symbol="LTO-BDF_BNB",
    time_in_force=TimeInForce.GOOD_TILL_EXPIRE,
    order_type=OrderType.LIMIT,
    side=OrderSide.BUY,
    price=Decimal(0.00350009),
    quantity=Decimal(1),
)
res = client.broadcast_msg(new_order_msg, sync=True)

binance.us

please help get client from binance.us, I want to get orders, and make orders

Is this library supported on Windows?

I see "For Windows environments" in the Documentation, however I also see:

If having issues with secp256k1 check the Installation instructions for the sec256k1-py library

Which I indeed run into. And when I go check said installation instructions, there are no instructions for Windows, it appears that only Mac and Linux are supported?

websockets don't seem to work.

So I tried implementing the websockets code from here

But I get some strange error messages.

First this code

bcsm = await BinanceChainSocketManager.create(loop, handle_evt, address2, env=testnet_env)

Does not work because address2 does not exists.
I get a NameError: name 'address2' is not defined error

When I remove the 2 in address2 I get the next error.

TypeError: create() got multiple values for argument 'env'

I'm not really sure how to solve this issue.

Did anyone get the websockets to work?

"Wallet environment doesn't match HttpApiClient environment" on main-net

Dear @sammchardy

I saw "Wallet environment doesn't match HttpApiClient environment" issue again, but this time on main-net.

Python 3.6.5 (v3.6.5:f59c0932b4, Mar 28 2018, 05:52:31)
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>
>>> from binance_chain.http import HttpApiClient
>>> from binance_chain.messages import TransferMsg
>>> from binance_chain.wallet import Wallet
>>> wallet = Wallet('ef5b7ba4eb6a7add623315e1edc90b3fc24ff107bc874e168d188ab9bd4_____')
>>> client = HttpApiClient()
>>> transfer_msg = TransferMsg(
...     wallet=wallet,
...     symbol='BNB',
...     amount=1,
...     to_address='bnb1r4gc5ftrkr9ez2khph4h5xxd0mf0hd75uux7gl',
...     memo='Thanks for the beer'
... )
>>>
>>> res = client.broadcast_msg(transfer_msg, sync=True)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/yuwally/Documents/venv/p30/lib/python3.6/site-packages/binance_chain/http.py", line 367, in broadcast_msg
    raise BinanceChainBroadcastException("Wallet environment doesn't match HttpApiClient environment")
binance_chain.exceptions.BinanceChainBroadcastException: Wallet environment doesn't match HttpApiClient environment

this happens for version 0.1.19 as well as 0.1.10.

Could you please help give any suggestion on how to avoid this issue?

Thanks in advance.

HttpApiClient._handle_response handle response error

When I call the client.get_transaction method, I get a BinanceChainAPIException error. However, the status code of http is 200, and the code in the response result is 0. After I flip through the api document, I found the result to be correct. After I looked at the source code, I found that HttpApiClient. _handle_response when parsing the result, if 'code' in res and res['code'] != "200000": This code is inconsistent with the definition of api.

Can't install on Windows 10 with Python 3.9.1

I can't install on a virtual environment on Windows 10.

Python 3.9.1
Windows 10 Pro
OS build: 19042.867

This is my error log

ERROR: Command errored out with exit status 1:
     command: 'C:\dev\tradingview-webhook\env\Scripts\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Karl\\AppData\\Local\\Temp\\pip-install-uxgktap4\\cffi_91d6bfdc32eb44db870e8fbf31464736\\setup.py'"'"'; __file__='"'"'C:\\Users\\Karl\\AppData\\Local\\Temp\\pip-install-uxgktap4\\cffi_91d6bfdc32eb44db870e8fbf31464736\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\Karl\AppData\Local\Temp\pip-pip-egg-info-vur8zr6q'
         cwd: C:\Users\Karl\AppData\Local\Temp\pip-install-uxgktap4\cffi_91d6bfdc32eb44db870e8fbf31464736\
    Complete output (19 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\Karl\AppData\Local\Temp\pip-install-uxgktap4\cffi_91d6bfdc32eb44db870e8fbf31464736\setup.py", line 131, in <module>
        if sys.platform == 'win32' and uses_msvc():
      File "C:\Users\Karl\AppData\Local\Temp\pip-install-uxgktap4\cffi_91d6bfdc32eb44db870e8fbf31464736\setup.py", line 109, in uses_msvc
        return config.try_compile('#ifndef _MSC_VER\n#error "not MSVC"\n#endif')
      File "c:\python39\lib\distutils\command\config.py", line 225, in try_compile
        self._compile(body, headers, include_dirs, lang)
      File "c:\python39\lib\distutils\command\config.py", line 132, in _compile
        self.compiler.compile([src], include_dirs=include_dirs)
      File "c:\python39\lib\distutils\_msvccompiler.py", line 323, in compile
        self.initialize()
      File "c:\python39\lib\distutils\_msvccompiler.py", line 220, in initialize
        vc_env = _get_vc_env(plat_spec)
      File "C:\dev\tradingview-webhook\env\lib\site-packages\setuptools\msvc.py", line 313, in msvc14_get_vc_env
        return _msvc14_get_vc_env(plat_spec)
      File "C:\dev\tradingview-webhook\env\lib\site-packages\setuptools\msvc.py", line 267, in _msvc14_get_vc_env
        raise distutils.errors.DistutilsPlatformError(
    distutils.errors.DistutilsPlatformError: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
    ----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/f7/09/88bbe20b76ca76be052c366fe77aa5e3cd6e5f932766e5597fecdd95b2a8/cffi-1.14.2.tar.gz#sha256=ae8f34d50af2c2154035984b8b5fc5d9ed63f32fe615646ab435b05b132ca91b (from https://pypi.org/simple/cffi/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
  Downloading cffi-1.14.1.tar.gz (468 kB)
     |โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 468 kB 3.3 MB/s
    ERROR: Command errored out with exit status 1:
     command: 'C:\dev\tradingview-webhook\env\Scripts\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Karl\\AppData\\Local\\Temp\\pip-install-uxgktap4\\cffi_c8c9e98260e34bdd976ae24e509d76f6\\setup.py'"'"'; __file__='"'"'C:\\Users\\Karl\\AppData\\Local\\Temp\\pip-install-uxgktap4\\cffi_c8c9e98260e34bdd976ae24e509d76f6\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\Karl\AppData\Local\Temp\pip-pip-egg-info-i110wsyo'
         cwd: C:\Users\Karl\AppData\Local\Temp\pip-install-uxgktap4\cffi_c8c9e98260e34bdd976ae24e509d76f6\
    Complete output (19 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\Karl\AppData\Local\Temp\pip-install-uxgktap4\cffi_c8c9e98260e34bdd976ae24e509d76f6\setup.py", line 131, in <module>
        if sys.platform == 'win32' and uses_msvc():
      File "C:\Users\Karl\AppData\Local\Temp\pip-install-uxgktap4\cffi_c8c9e98260e34bdd976ae24e509d76f6\setup.py", line 109, in uses_msvc
        return config.try_compile('#ifndef _MSC_VER\n#error "not MSVC"\n#endif')
      File "c:\python39\lib\distutils\command\config.py", line 225, in try_compile
        self._compile(body, headers, include_dirs, lang)
      File "c:\python39\lib\distutils\command\config.py", line 132, in _compile
        self.compiler.compile([src], include_dirs=include_dirs)
      File "c:\python39\lib\distutils\_msvccompiler.py", line 323, in compile
        self.initialize()
      File "c:\python39\lib\distutils\_msvccompiler.py", line 220, in initialize
        vc_env = _get_vc_env(plat_spec)
      File "C:\dev\tradingview-webhook\env\lib\site-packages\setuptools\msvc.py", line 313, in msvc14_get_vc_env
        return _msvc14_get_vc_env(plat_spec)
      File "C:\dev\tradingview-webhook\env\lib\site-packages\setuptools\msvc.py", line 267, in _msvc14_get_vc_env
        raise distutils.errors.DistutilsPlatformError(
    distutils.errors.DistutilsPlatformError: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
    ----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/54/1d/15eae71ab444bd88a1d69f19592dcf32b9e3166ecf427dd9243ef0d3b7bc/cffi-1.14.1.tar.gz#sha256=b2a2b0d276a136146e012154baefaea2758ef1f56ae9f4e01c612b0831e0bd2f (from https://pypi.org/simple/cffi/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
  Downloading cffi-1.14.0.tar.gz (463 kB)
     |โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 463 kB 6.4 MB/s
    ERROR: Command errored out with exit status 1:
     command: 'C:\dev\tradingview-webhook\env\Scripts\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Karl\\AppData\\Local\\Temp\\pip-install-uxgktap4\\cffi_1899b1076fb44a9982b8598b83f8cd0f\\setup.py'"'"'; __file__='"'"'C:\\Users\\Karl\\AppData\\Local\\Temp\\pip-install-uxgktap4\\cffi_1899b1076fb44a9982b8598b83f8cd0f\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\Karl\AppData\Local\Temp\pip-pip-egg-info-i6obeegm'
         cwd: C:\Users\Karl\AppData\Local\Temp\pip-install-uxgktap4\cffi_1899b1076fb44a9982b8598b83f8cd0f\
    Complete output (19 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\Karl\AppData\Local\Temp\pip-install-uxgktap4\cffi_1899b1076fb44a9982b8598b83f8cd0f\setup.py", line 127, in <module>
        if sys.platform == 'win32' and uses_msvc():
      File "C:\Users\Karl\AppData\Local\Temp\pip-install-uxgktap4\cffi_1899b1076fb44a9982b8598b83f8cd0f\setup.py", line 105, in uses_msvc
        return config.try_compile('#ifndef _MSC_VER\n#error "not MSVC"\n#endif')
      File "c:\python39\lib\distutils\command\config.py", line 225, in try_compile
        self._compile(body, headers, include_dirs, lang)
      File "c:\python39\lib\distutils\command\config.py", line 132, in _compile
        self.compiler.compile([src], include_dirs=include_dirs)
      File "c:\python39\lib\distutils\_msvccompiler.py", line 323, in compile
        self.initialize()
      File "c:\python39\lib\distutils\_msvccompiler.py", line 220, in initialize
        vc_env = _get_vc_env(plat_spec)
      File "C:\dev\tradingview-webhook\env\lib\site-packages\setuptools\msvc.py", line 313, in msvc14_get_vc_env
        return _msvc14_get_vc_env(plat_spec)
      File "C:\dev\tradingview-webhook\env\lib\site-packages\setuptools\msvc.py", line 267, in _msvc14_get_vc_env
        raise distutils.errors.DistutilsPlatformError(
    distutils.errors.DistutilsPlatformError: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
    ----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/05/54/3324b0c46340c31b909fcec598696aaec7ddc8c18a63f2db352562d3354c/cffi-1.14.0.tar.gz#sha256=2d384f4a127a15ba701207f7639d94106693b6cd64173d6c8988e2c25f3ac2b6 (from https://pypi.org/simple/cffi/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
  Downloading cffi-1.13.2.tar.gz (460 kB)
     |โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 460 kB 3.3 MB/s
    ERROR: Command errored out with exit status 1:
     command: 'C:\dev\tradingview-webhook\env\Scripts\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Karl\\AppData\\Local\\Temp\\pip-install-uxgktap4\\cffi_74e0817708cf446ab208aa82bbb90e6a\\setup.py'"'"'; __file__='"'"'C:\\Users\\Karl\\AppData\\Local\\Temp\\pip-install-uxgktap4\\cffi_74e0817708cf446ab208aa82bbb90e6a\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\Karl\AppData\Local\Temp\pip-pip-egg-info-_misw0mi'
         cwd: C:\Users\Karl\AppData\Local\Temp\pip-install-uxgktap4\cffi_74e0817708cf446ab208aa82bbb90e6a\
    Complete output (19 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\Karl\AppData\Local\Temp\pip-install-uxgktap4\cffi_74e0817708cf446ab208aa82bbb90e6a\setup.py", line 127, in <module>
        if sys.platform == 'win32' and uses_msvc():
      File "C:\Users\Karl\AppData\Local\Temp\pip-install-uxgktap4\cffi_74e0817708cf446ab208aa82bbb90e6a\setup.py", line 105, in uses_msvc
        return config.try_compile('#ifndef _MSC_VER\n#error "not MSVC"\n#endif')
      File "c:\python39\lib\distutils\command\config.py", line 225, in try_compile
        self._compile(body, headers, include_dirs, lang)
      File "c:\python39\lib\distutils\command\config.py", line 132, in _compile
        self.compiler.compile([src], include_dirs=include_dirs)
      File "c:\python39\lib\distutils\_msvccompiler.py", line 323, in compile
        self.initialize()
      File "c:\python39\lib\distutils\_msvccompiler.py", line 220, in initialize
        vc_env = _get_vc_env(plat_spec)
      File "C:\dev\tradingview-webhook\env\lib\site-packages\setuptools\msvc.py", line 313, in msvc14_get_vc_env
        return _msvc14_get_vc_env(plat_spec)
      File "C:\dev\tradingview-webhook\env\lib\site-packages\setuptools\msvc.py", line 267, in _msvc14_get_vc_env
        raise distutils.errors.DistutilsPlatformError(
    distutils.errors.DistutilsPlatformError: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
    ----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/2d/bf/960e5a422db3ac1a5e612cb35ca436c3fc985ed4b7ed13a1b4879006f450/cffi-1.13.2.tar.gz#sha256=599a1e8ff057ac530c9ad1778293c665cb81a791421f46922d80a86473c13346 (from https://pypi.org/simple/cffi/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
  Downloading cffi-1.13.1.tar.gz (460 kB)
     |โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 460 kB 437 kB/s
    ERROR: Command errored out with exit status 1:
     command: 'C:\dev\tradingview-webhook\env\Scripts\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Karl\\AppData\\Local\\Temp\\pip-install-uxgktap4\\cffi_113f27f032d34b05bb78ad75303360fc\\setup.py'"'"'; __file__='"'"'C:\\Users\\Karl\\AppData\\Local\\Temp\\pip-install-uxgktap4\\cffi_113f27f032d34b05bb78ad75303360fc\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\Karl\AppData\Local\Temp\pip-pip-egg-info-2vqsvg2f'
         cwd: C:\Users\Karl\AppData\Local\Temp\pip-install-uxgktap4\cffi_113f27f032d34b05bb78ad75303360fc\
    Complete output (19 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\Karl\AppData\Local\Temp\pip-install-uxgktap4\cffi_113f27f032d34b05bb78ad75303360fc\setup.py", line 127, in <module>
        if sys.platform == 'win32' and uses_msvc():
      File "C:\Users\Karl\AppData\Local\Temp\pip-install-uxgktap4\cffi_113f27f032d34b05bb78ad75303360fc\setup.py", line 105, in uses_msvc
        return config.try_compile('#ifndef _MSC_VER\n#error "not MSVC"\n#endif')
      File "c:\python39\lib\distutils\command\config.py", line 225, in try_compile
        self._compile(body, headers, include_dirs, lang)
      File "c:\python39\lib\distutils\command\config.py", line 132, in _compile
        self.compiler.compile([src], include_dirs=include_dirs)
      File "c:\python39\lib\distutils\_msvccompiler.py", line 323, in compile
        self.initialize()
      File "c:\python39\lib\distutils\_msvccompiler.py", line 220, in initialize
        vc_env = _get_vc_env(plat_spec)
      File "C:\dev\tradingview-webhook\env\lib\site-packages\setuptools\msvc.py", line 313, in msvc14_get_vc_env
        return _msvc14_get_vc_env(plat_spec)
      File "C:\dev\tradingview-webhook\env\lib\site-packages\setuptools\msvc.py", line 267, in _msvc14_get_vc_env
        raise distutils.errors.DistutilsPlatformError(
    distutils.errors.DistutilsPlatformError: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
    ----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/0d/aa/c5ac2f337d9a10ee95d160d47beb8d9400e1b2a46bb94990a0409fe6d133/cffi-1.13.1.tar.gz#sha256=558b3afef987cf4b17abd849e7bedf64ee12b28175d564d05b628a0f9355599b (from https://pypi.org/simple/cffi/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
  Downloading cffi-1.13.0.tar.gz (459 kB)
     |โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 459 kB 1.6 MB/s
    ERROR: Command errored out with exit status 1:
     command: 'C:\dev\tradingview-webhook\env\Scripts\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Karl\\AppData\\Local\\Temp\\pip-install-uxgktap4\\cffi_f03d708b4a9c40d8a4f74506b2f28525\\setup.py'"'"'; __file__='"'"'C:\\Users\\Karl\\AppData\\Local\\Temp\\pip-install-uxgktap4\\cffi_f03d708b4a9c40d8a4f74506b2f28525\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\Karl\AppData\Local\Temp\pip-pip-egg-info-3nbflmxs'
         cwd: C:\Users\Karl\AppData\Local\Temp\pip-install-uxgktap4\cffi_f03d708b4a9c40d8a4f74506b2f28525\
    Complete output (19 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\Karl\AppData\Local\Temp\pip-install-uxgktap4\cffi_f03d708b4a9c40d8a4f74506b2f28525\setup.py", line 127, in <module>
        if sys.platform == 'win32' and uses_msvc():
      File "C:\Users\Karl\AppData\Local\Temp\pip-install-uxgktap4\cffi_f03d708b4a9c40d8a4f74506b2f28525\setup.py", line 105, in uses_msvc
        return config.try_compile('#ifndef _MSC_VER\n#error "not MSVC"\n#endif')
      File "c:\python39\lib\distutils\command\config.py", line 225, in try_compile
        self._compile(body, headers, include_dirs, lang)
      File "c:\python39\lib\distutils\command\config.py", line 132, in _compile
        self.compiler.compile([src], include_dirs=include_dirs)
      File "c:\python39\lib\distutils\_msvccompiler.py", line 323, in compile
        self.initialize()
      File "c:\python39\lib\distutils\_msvccompiler.py", line 220, in initialize
        vc_env = _get_vc_env(plat_spec)
      File "C:\dev\tradingview-webhook\env\lib\site-packages\setuptools\msvc.py", line 313, in msvc14_get_vc_env
        return _msvc14_get_vc_env(plat_spec)
      File "C:\dev\tradingview-webhook\env\lib\site-packages\setuptools\msvc.py", line 267, in _msvc14_get_vc_env
        raise distutils.errors.DistutilsPlatformError(
    distutils.errors.DistutilsPlatformError: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
    ----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/d6/cf/ba7e2df852a2fc807d48b3f7bea46f741830be4f047a0712e6de3e95fb6a/cffi-1.13.0.tar.gz#sha256=8fe230f612c18af1df6f348d02d682fe2c28ca0a6c3856c99599cdacae7cf226 (from https://pypi.org/simple/cffi/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
  Downloading cffi-1.12.3.tar.gz (456 kB)
     |โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 456 kB 2.2 MB/s
    ERROR: Command errored out with exit status 1:
     command: 'C:\dev\tradingview-webhook\env\Scripts\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Karl\\AppData\\Local\\Temp\\pip-install-uxgktap4\\cffi_09f79b52852748a7ab35c894efeba2fd\\setup.py'"'"'; __file__='"'"'C:\\Users\\Karl\\AppData\\Local\\Temp\\pip-install-uxgktap4\\cffi_09f79b52852748a7ab35c894efeba2fd\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\Karl\AppData\Local\Temp\pip-pip-egg-info-40ufg8hi'
         cwd: C:\Users\Karl\AppData\Local\Temp\pip-install-uxgktap4\cffi_09f79b52852748a7ab35c894efeba2fd\
    Complete output (19 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\Karl\AppData\Local\Temp\pip-install-uxgktap4\cffi_09f79b52852748a7ab35c894efeba2fd\setup.py", line 127, in <module>
        if sys.platform == 'win32' and uses_msvc():
      File "C:\Users\Karl\AppData\Local\Temp\pip-install-uxgktap4\cffi_09f79b52852748a7ab35c894efeba2fd\setup.py", line 105, in uses_msvc
        return config.try_compile('#ifndef _MSC_VER\n#error "not MSVC"\n#endif')
      File "c:\python39\lib\distutils\command\config.py", line 225, in try_compile
        self._compile(body, headers, include_dirs, lang)
      File "c:\python39\lib\distutils\command\config.py", line 132, in _compile
        self.compiler.compile([src], include_dirs=include_dirs)
      File "c:\python39\lib\distutils\_msvccompiler.py", line 323, in compile
        self.initialize()
      File "c:\python39\lib\distutils\_msvccompiler.py", line 220, in initialize
        vc_env = _get_vc_env(plat_spec)
      File "C:\dev\tradingview-webhook\env\lib\site-packages\setuptools\msvc.py", line 313, in msvc14_get_vc_env
        return _msvc14_get_vc_env(plat_spec)
      File "C:\dev\tradingview-webhook\env\lib\site-packages\setuptools\msvc.py", line 267, in _msvc14_get_vc_env
        raise distutils.errors.DistutilsPlatformError(
    distutils.errors.DistutilsPlatformError: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
    ----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/93/1a/ab8c62b5838722f29f3daffcc8d4bd61844aa9b5f437341cc890ceee483b/cffi-1.12.3.tar.gz#sha256=041c81822e9f84b1d9c401182e174996f0bae9991f33725d059b771744290774 (from https://pypi.org/simple/cffi/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
  Downloading cffi-1.12.2.tar.gz (453 kB)
     |โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 453 kB 2.2 MB/s
    ERROR: Command errored out with exit status 1:
     command: 'C:\dev\tradingview-webhook\env\Scripts\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Karl\\AppData\\Local\\Temp\\pip-install-uxgktap4\\cffi_c1d617d741f84ea483d522eb44a75428\\setup.py'"'"'; __file__='"'"'C:\\Users\\Karl\\AppData\\Local\\Temp\\pip-install-uxgktap4\\cffi_c1d617d741f84ea483d522eb44a75428\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\Karl\AppData\Local\Temp\pip-pip-egg-info-ntl12zig'
         cwd: C:\Users\Karl\AppData\Local\Temp\pip-install-uxgktap4\cffi_c1d617d741f84ea483d522eb44a75428\
    Complete output (19 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\Karl\AppData\Local\Temp\pip-install-uxgktap4\cffi_c1d617d741f84ea483d522eb44a75428\setup.py", line 127, in <module>
        if sys.platform == 'win32' and uses_msvc():
      File "C:\Users\Karl\AppData\Local\Temp\pip-install-uxgktap4\cffi_c1d617d741f84ea483d522eb44a75428\setup.py", line 105, in uses_msvc
        return config.try_compile('#ifndef _MSC_VER\n#error "not MSVC"\n#endif')
      File "c:\python39\lib\distutils\command\config.py", line 225, in try_compile
        self._compile(body, headers, include_dirs, lang)
      File "c:\python39\lib\distutils\command\config.py", line 132, in _compile
        self.compiler.compile([src], include_dirs=include_dirs)
      File "c:\python39\lib\distutils\_msvccompiler.py", line 323, in compile
        self.initialize()
      File "c:\python39\lib\distutils\_msvccompiler.py", line 220, in initialize
        vc_env = _get_vc_env(plat_spec)
      File "C:\dev\tradingview-webhook\env\lib\site-packages\setuptools\msvc.py", line 313, in msvc14_get_vc_env
        return _msvc14_get_vc_env(plat_spec)
      File "C:\dev\tradingview-webhook\env\lib\site-packages\setuptools\msvc.py", line 267, in _msvc14_get_vc_env
        raise distutils.errors.DistutilsPlatformError(
    distutils.errors.DistutilsPlatformError: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
    ----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/64/7c/27367b38e6cc3e1f49f193deb761fe75cda9f95da37b67b422e62281fcac/cffi-1.12.2.tar.gz#sha256=e113878a446c6228669144ae8a56e268c91b7f1fafae927adc4879d9849e0ea7 (from https://pypi.org/simple/cffi/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
  Downloading cffi-1.12.1.tar.gz (453 kB)
     |โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 453 kB 2.2 MB/s
    ERROR: Command errored out with exit status 1:
     command: 'C:\dev\tradingview-webhook\env\Scripts\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Karl\\AppData\\Local\\Temp\\pip-install-uxgktap4\\cffi_becaee2767fc4d2ca4255ed8a0663ca9\\setup.py'"'"'; __file__='"'"'C:\\Users\\Karl\\AppData\\Local\\Temp\\pip-install-uxgktap4\\cffi_becaee2767fc4d2ca4255ed8a0663ca9\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\Karl\AppData\Local\Temp\pip-pip-egg-info-0o6xecpm'
         cwd: C:\Users\Karl\AppData\Local\Temp\pip-install-uxgktap4\cffi_becaee2767fc4d2ca4255ed8a0663ca9\
    Complete output (19 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\Karl\AppData\Local\Temp\pip-install-uxgktap4\cffi_becaee2767fc4d2ca4255ed8a0663ca9\setup.py", line 127, in <module>
        if sys.platform == 'win32' and uses_msvc():
      File "C:\Users\Karl\AppData\Local\Temp\pip-install-uxgktap4\cffi_becaee2767fc4d2ca4255ed8a0663ca9\setup.py", line 105, in uses_msvc
        return config.try_compile('#ifndef _MSC_VER\n#error "not MSVC"\n#endif')
      File "c:\python39\lib\distutils\command\config.py", line 225, in try_compile
        self._compile(body, headers, include_dirs, lang)
      File "c:\python39\lib\distutils\command\config.py", line 132, in _compile
        self.compiler.compile([src], include_dirs=include_dirs)
      File "c:\python39\lib\distutils\_msvccompiler.py", line 323, in compile
        self.initialize()
      File "c:\python39\lib\distutils\_msvccompiler.py", line 220, in initialize
        vc_env = _get_vc_env(plat_spec)
      File "C:\dev\tradingview-webhook\env\lib\site-packages\setuptools\msvc.py", line 313, in msvc14_get_vc_env
        return _msvc14_get_vc_env(plat_spec)
      File "C:\dev\tradingview-webhook\env\lib\site-packages\setuptools\msvc.py", line 267, in _msvc14_get_vc_env
        raise distutils.errors.DistutilsPlatformError(
    distutils.errors.DistutilsPlatformError: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
    ----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/bc/81/47bd0404f2cb5363edb371e3b15da6387b5e9b80122e5b81be8b8f411e9b/cffi-1.12.1.tar.gz#sha256=9b6f7ba4e78c52c1a291d0c0c0bd745d19adde1a9e1c03cb899f0c6efd6f8033 (from https://pypi.org/simple/cffi/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
  Downloading cffi-1.12.0.tar.gz (453 kB)
     |โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 453 kB 2.2 MB/s
    ERROR: Command errored out with exit status 1:
     command: 'C:\dev\tradingview-webhook\env\Scripts\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Karl\\AppData\\Local\\Temp\\pip-install-uxgktap4\\cffi_92dc84cb399a47ffba097e8f61c6ec30\\setup.py'"'"'; __file__='"'"'C:\\Users\\Karl\\AppData\\Local\\Temp\\pip-install-uxgktap4\\cffi_92dc84cb399a47ffba097e8f61c6ec30\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\Karl\AppData\Local\Temp\pip-pip-egg-info-kp6a7t76'
         cwd: C:\Users\Karl\AppData\Local\Temp\pip-install-uxgktap4\cffi_92dc84cb399a47ffba097e8f61c6ec30\
    Complete output (19 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\Karl\AppData\Local\Temp\pip-install-uxgktap4\cffi_92dc84cb399a47ffba097e8f61c6ec30\setup.py", line 127, in <module>
        if sys.platform == 'win32' and uses_msvc():
      File "C:\Users\Karl\AppData\Local\Temp\pip-install-uxgktap4\cffi_92dc84cb399a47ffba097e8f61c6ec30\setup.py", line 105, in uses_msvc
        return config.try_compile('#ifndef _MSC_VER\n#error "not MSVC"\n#endif')
      File "c:\python39\lib\distutils\command\config.py", line 225, in try_compile
        self._compile(body, headers, include_dirs, lang)
      File "c:\python39\lib\distutils\command\config.py", line 132, in _compile
        self.compiler.compile([src], include_dirs=include_dirs)
      File "c:\python39\lib\distutils\_msvccompiler.py", line 323, in compile
        self.initialize()
      File "c:\python39\lib\distutils\_msvccompiler.py", line 220, in initialize
        vc_env = _get_vc_env(plat_spec)
      File "C:\dev\tradingview-webhook\env\lib\site-packages\setuptools\msvc.py", line 313, in msvc14_get_vc_env
        return _msvc14_get_vc_env(plat_spec)
      File "C:\dev\tradingview-webhook\env\lib\site-packages\setuptools\msvc.py", line 267, in _msvc14_get_vc_env
        raise distutils.errors.DistutilsPlatformError(
    distutils.errors.DistutilsPlatformError: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
    ----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/10/fe/b6362c613a70ac29cf7cac36307d85f08ebe4a96d9d54b895b10a807e39b/cffi-1.12.0.tar.gz#sha256=08090454ff236239e583a9119d0502a6b9817594c0a3714dd1d8593f2350ba11 (from https://pypi.org/simple/cffi/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
  Downloading cffi-1.11.5.tar.gz (438 kB)
     |โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 438 kB 3.3 MB/s
    ERROR: Command errored out with exit status 1:
     command: 'C:\dev\tradingview-webhook\env\Scripts\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Karl\\AppData\\Local\\Temp\\pip-install-uxgktap4\\cffi_68eaf4d6fe2f430b9973e87e7cd6df6c\\setup.py'"'"'; __file__='"'"'C:\\Users\\Karl\\AppData\\Local\\Temp\\pip-install-uxgktap4\\cffi_68eaf4d6fe2f430b9973e87e7cd6df6c\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\Karl\AppData\Local\Temp\pip-pip-egg-info-fq8oocxn'
         cwd: C:\Users\Karl\AppData\Local\Temp\pip-install-uxgktap4\cffi_68eaf4d6fe2f430b9973e87e7cd6df6c\
    Complete output (19 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\Karl\AppData\Local\Temp\pip-install-uxgktap4\cffi_68eaf4d6fe2f430b9973e87e7cd6df6c\setup.py", line 120, in <module>
        if sys.platform == 'win32' and uses_msvc():
      File "C:\Users\Karl\AppData\Local\Temp\pip-install-uxgktap4\cffi_68eaf4d6fe2f430b9973e87e7cd6df6c\setup.py", line 98, in uses_msvc
        return config.try_compile('#ifndef _MSC_VER\n#error "not MSVC"\n#endif')
      File "c:\python39\lib\distutils\command\config.py", line 225, in try_compile
        self._compile(body, headers, include_dirs, lang)
      File "c:\python39\lib\distutils\command\config.py", line 132, in _compile
        self.compiler.compile([src], include_dirs=include_dirs)
      File "c:\python39\lib\distutils\_msvccompiler.py", line 323, in compile
        self.initialize()
      File "c:\python39\lib\distutils\_msvccompiler.py", line 220, in initialize
        vc_env = _get_vc_env(plat_spec)
      File "C:\dev\tradingview-webhook\env\lib\site-packages\setuptools\msvc.py", line 313, in msvc14_get_vc_env
        return _msvc14_get_vc_env(plat_spec)
      File "C:\dev\tradingview-webhook\env\lib\site-packages\setuptools\msvc.py", line 267, in _msvc14_get_vc_env
        raise distutils.errors.DistutilsPlatformError(
    distutils.errors.DistutilsPlatformError: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
    ----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/e7/a7/4cd50e57cc6f436f1cc3a7e8fa700ff9b8b4d471620629074913e3735fb2/cffi-1.11.5.tar.gz#sha256=e90f17980e6ab0f3c2f3730e56d1fe9bcba1891eeea58966e89d352492cc74f4 (from https://pypi.org/simple/cffi/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
  Downloading cffi-1.11.4.tar.gz (436 kB)
     |โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 436 kB 2.2 MB/s
    ERROR: Command errored out with exit status 1:
     command: 'C:\dev\tradingview-webhook\env\Scripts\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Karl\\AppData\\Local\\Temp\\pip-install-uxgktap4\\cffi_706e680ec05d49b7abb2fb19c1267ce1\\setup.py'"'"'; __file__='"'"'C:\\Users\\Karl\\AppData\\Local\\Temp\\pip-install-uxgktap4\\cffi_706e680ec05d49b7abb2fb19c1267ce1\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\Karl\AppData\Local\Temp\pip-pip-egg-info-id6vrx4z'
         cwd: C:\Users\Karl\AppData\Local\Temp\pip-install-uxgktap4\cffi_706e680ec05d49b7abb2fb19c1267ce1\
    Complete output (19 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\Karl\AppData\Local\Temp\pip-install-uxgktap4\cffi_706e680ec05d49b7abb2fb19c1267ce1\setup.py", line 116, in <module>
        if sys.platform == 'win32' and uses_msvc():
      File "C:\Users\Karl\AppData\Local\Temp\pip-install-uxgktap4\cffi_706e680ec05d49b7abb2fb19c1267ce1\setup.py", line 94, in uses_msvc
        return config.try_compile('#ifndef _MSC_VER\n#error "not MSVC"\n#endif')
      File "c:\python39\lib\distutils\command\config.py", line 225, in try_compile
        self._compile(body, headers, include_dirs, lang)
      File "c:\python39\lib\distutils\command\config.py", line 132, in _compile
        self.compiler.compile([src], include_dirs=include_dirs)
      File "c:\python39\lib\distutils\_msvccompiler.py", line 323, in compile
        self.initialize()
      File "c:\python39\lib\distutils\_msvccompiler.py", line 220, in initialize
        vc_env = _get_vc_env(plat_spec)
      File "C:\dev\tradingview-webhook\env\lib\site-packages\setuptools\msvc.py", line 313, in msvc14_get_vc_env
        return _msvc14_get_vc_env(plat_spec)
      File "C:\dev\tradingview-webhook\env\lib\site-packages\setuptools\msvc.py", line 267, in _msvc14_get_vc_env
        raise distutils.errors.DistutilsPlatformError(
    distutils.errors.DistutilsPlatformError: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
    ----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/10/f7/3b302ff34045f25065091d40e074479d6893882faef135c96f181a57ed06/cffi-1.11.4.tar.gz#sha256=df9083a992b17a28cd4251a3f5c879e0198bb26c9e808c4647e0a18739f1d11d (from https://pypi.org/simple/cffi/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
  Downloading cffi-1.11.3.tar.gz (436 kB)
     |โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 436 kB 3.3 MB/s
    ERROR: Command errored out with exit status 1:
     command: 'C:\dev\tradingview-webhook\env\Scripts\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Karl\\AppData\\Local\\Temp\\pip-install-uxgktap4\\cffi_29bd35f4f0ef4360b942e9aa89807eab\\setup.py'"'"'; __file__='"'"'C:\\Users\\Karl\\AppData\\Local\\Temp\\pip-install-uxgktap4\\cffi_29bd35f4f0ef4360b942e9aa89807eab\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\Karl\AppData\Local\Temp\pip-pip-egg-info-36mrh9xk'
         cwd: C:\Users\Karl\AppData\Local\Temp\pip-install-uxgktap4\cffi_29bd35f4f0ef4360b942e9aa89807eab\
    Complete output (19 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\Karl\AppData\Local\Temp\pip-install-uxgktap4\cffi_29bd35f4f0ef4360b942e9aa89807eab\setup.py", line 116, in <module>
        if sys.platform == 'win32' and uses_msvc():
      File "C:\Users\Karl\AppData\Local\Temp\pip-install-uxgktap4\cffi_29bd35f4f0ef4360b942e9aa89807eab\setup.py", line 94, in uses_msvc
        return config.try_compile('#ifndef _MSC_VER\n#error "not MSVC"\n#endif')
      File "c:\python39\lib\distutils\command\config.py", line 225, in try_compile
        self._compile(body, headers, include_dirs, lang)
      File "c:\python39\lib\distutils\command\config.py", line 132, in _compile
        self.compiler.compile([src], include_dirs=include_dirs)
      File "c:\python39\lib\distutils\_msvccompiler.py", line 323, in compile
        self.initialize()
      File "c:\python39\lib\distutils\_msvccompiler.py", line 220, in initialize
        vc_env = _get_vc_env(plat_spec)
      File "C:\dev\tradingview-webhook\env\lib\site-packages\setuptools\msvc.py", line 313, in msvc14_get_vc_env
        return _msvc14_get_vc_env(plat_spec)
      File "C:\dev\tradingview-webhook\env\lib\site-packages\setuptools\msvc.py", line 267, in _msvc14_get_vc_env
        raise distutils.errors.DistutilsPlatformError(
    distutils.errors.DistutilsPlatformError: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
    ----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/62/ea/f41d44e0a4222fe8317ffe1fe7a5c75ec71ca233b4067850567922f8b7be/cffi-1.11.3.tar.gz#sha256=8456abb0f892eb7d545f9ce94f4ba78d651365b1a59f9ce9ae7b5325a95dc698 (from https://pypi.org/simple/cffi/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
  Downloading cffi-1.11.2.tar.gz (435 kB)
     |โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 435 kB 3.3 MB/s
    ERROR: Command errored out with exit status 1:
     command: 'C:\dev\tradingview-webhook\env\Scripts\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Karl\\AppData\\Local\\Temp\\pip-install-uxgktap4\\cffi_370ab462a91543949feb7984b5f0eba7\\setup.py'"'"'; __file__='"'"'C:\\Users\\Karl\\AppData\\Local\\Temp\\pip-install-uxgktap4\\cffi_370ab462a91543949feb7984b5f0eba7\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\Karl\AppData\Local\Temp\pip-pip-egg-info-bjhn71x9'
         cwd: C:\Users\Karl\AppData\Local\Temp\pip-install-uxgktap4\cffi_370ab462a91543949feb7984b5f0eba7\
    Complete output (19 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\Karl\AppData\Local\Temp\pip-install-uxgktap4\cffi_370ab462a91543949feb7984b5f0eba7\setup.py", line 116, in <module>
        if sys.platform == 'win32' and uses_msvc():
      File "C:\Users\Karl\AppData\Local\Temp\pip-install-uxgktap4\cffi_370ab462a91543949feb7984b5f0eba7\setup.py", line 94, in uses_msvc
        return config.try_compile('#ifndef _MSC_VER\n#error "not MSVC"\n#endif')
      File "c:\python39\lib\distutils\command\config.py", line 225, in try_compile
        self._compile(body, headers, include_dirs, lang)
      File "c:\python39\lib\distutils\command\config.py", line 132, in _compile
        self.compiler.compile([src], include_dirs=include_dirs)
      File "c:\python39\lib\distutils\_msvccompiler.py", line 323, in compile
        self.initialize()
      File "c:\python39\lib\distutils\_msvccompiler.py", line 220, in initialize
        vc_env = _get_vc_env(plat_spec)
      File "C:\dev\tradingview-webhook\env\lib\site-packages\setuptools\msvc.py", line 313, in msvc14_get_vc_env
        return _msvc14_get_vc_env(plat_spec)
      File "C:\dev\tradingview-webhook\env\lib\site-packages\setuptools\msvc.py", line 267, in _msvc14_get_vc_env
        raise distutils.errors.DistutilsPlatformError(
    distutils.errors.DistutilsPlatformError: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
    ----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/c9/70/89b68b6600d479034276fed316e14b9107d50a62f5627da37fafe083fde3/cffi-1.11.2.tar.gz#sha256=ab87dd91c0c4073758d07334c1e5f712ce8fe48f007b86f8238773963ee700a6 (from https://pypi.org/simple/cffi/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
  Downloading cffi-1.11.1.tar.gz (435 kB)
     |โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 435 kB 3.3 MB/s
    ERROR: Command errored out with exit status 1:
     command: 'C:\dev\tradingview-webhook\env\Scripts\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Karl\\AppData\\Local\\Temp\\pip-install-uxgktap4\\cffi_7185a2c83a79484996c75886105dd548\\setup.py'"'"'; __file__='"'"'C:\\Users\\Karl\\AppData\\Local\\Temp\\pip-install-uxgktap4\\cffi_7185a2c83a79484996c75886105dd548\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\Karl\AppData\Local\Temp\pip-pip-egg-info-hhmif8ta'
         cwd: C:\Users\Karl\AppData\Local\Temp\pip-install-uxgktap4\cffi_7185a2c83a79484996c75886105dd548\
    Complete output (19 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\Karl\AppData\Local\Temp\pip-install-uxgktap4\cffi_7185a2c83a79484996c75886105dd548\setup.py", line 116, in <module>
        if sys.platform == 'win32' and uses_msvc():
      File "C:\Users\Karl\AppData\Local\Temp\pip-install-uxgktap4\cffi_7185a2c83a79484996c75886105dd548\setup.py", line 94, in uses_msvc
        return config.try_compile('#ifndef _MSC_VER\n#error "not MSVC"\n#endif')
      File "c:\python39\lib\distutils\command\config.py", line 225, in try_compile
        self._compile(body, headers, include_dirs, lang)
      File "c:\python39\lib\distutils\command\config.py", line 132, in _compile
        self.compiler.compile([src], include_dirs=include_dirs)
      File "c:\python39\lib\distutils\_msvccompiler.py", line 323, in compile
        self.initialize()
      File "c:\python39\lib\distutils\_msvccompiler.py", line 220, in initialize
        vc_env = _get_vc_env(plat_spec)
      File "C:\dev\tradingview-webhook\env\lib\site-packages\setuptools\msvc.py", line 313, in msvc14_get_vc_env
        return _msvc14_get_vc_env(plat_spec)
      File "C:\dev\tradingview-webhook\env\lib\site-packages\setuptools\msvc.py", line 267, in _msvc14_get_vc_env
        raise distutils.errors.DistutilsPlatformError(
    distutils.errors.DistutilsPlatformError: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
    ----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/70/72/c825b14b212fe61791c88e09cca65b26ea0b5e7ef6a4a2f979d338fbe38d/cffi-1.11.1.tar.gz#sha256=4c40817cc0f71b5351eb0bdd0b585db4a285c2bcc03fbcb961b79bb8086b7576 (from https://pypi.org/simple/cffi/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
  Downloading cffi-1.11.0.tar.gz (434 kB)
     |โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 434 kB 3.3 MB/s
    ERROR: Command errored out with exit status 1:
     command: 'C:\dev\tradingview-webhook\env\Scripts\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Karl\\AppData\\Local\\Temp\\pip-install-uxgktap4\\cffi_d745774ba03644cf92f55c535bfbe60a\\setup.py'"'"'; __file__='"'"'C:\\Users\\Karl\\AppData\\Local\\Temp\\pip-install-uxgktap4\\cffi_d745774ba03644cf92f55c535bfbe60a\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\Karl\AppData\Local\Temp\pip-pip-egg-info-y5rfc_hs'
         cwd: C:\Users\Karl\AppData\Local\Temp\pip-install-uxgktap4\cffi_d745774ba03644cf92f55c535bfbe60a\
    Complete output (19 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\Karl\AppData\Local\Temp\pip-install-uxgktap4\cffi_d745774ba03644cf92f55c535bfbe60a\setup.py", line 116, in <module>
        if sys.platform == 'win32' and uses_msvc():
      File "C:\Users\Karl\AppData\Local\Temp\pip-install-uxgktap4\cffi_d745774ba03644cf92f55c535bfbe60a\setup.py", line 94, in uses_msvc
        return config.try_compile('#ifndef _MSC_VER\n#error "not MSVC"\n#endif')
      File "c:\python39\lib\distutils\command\config.py", line 225, in try_compile
        self._compile(body, headers, include_dirs, lang)
      File "c:\python39\lib\distutils\command\config.py", line 132, in _compile
        self.compiler.compile([src], include_dirs=include_dirs)
      File "c:\python39\lib\distutils\_msvccompiler.py", line 323, in compile
        self.initialize()
      File "c:\python39\lib\distutils\_msvccompiler.py", line 220, in initialize
        vc_env = _get_vc_env(plat_spec)
      File "C:\dev\tradingview-webhook\env\lib\site-packages\setuptools\msvc.py", line 313, in msvc14_get_vc_env
        return _msvc14_get_vc_env(plat_spec)
      File "C:\dev\tradingview-webhook\env\lib\site-packages\setuptools\msvc.py", line 267, in _msvc14_get_vc_env
        raise distutils.errors.DistutilsPlatformError(
    distutils.errors.DistutilsPlatformError: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
    ----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/4e/32/4070bdf32812c89eb635c80880a5caa2e0189aa7999994c265577e5154f3/cffi-1.11.0.tar.gz#sha256=5f4ff33371c6969b39b293d9771ee91e81d26f9129be093ca1b7be357fcefd15 (from https://pypi.org/simple/cffi/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
  Downloading cffi-1.10.0.tar.gz (418 kB)
     |โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 418 kB 3.3 MB/s
    ERROR: Command errored out with exit status 1:
     command: 'C:\dev\tradingview-webhook\env\Scripts\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Karl\\AppData\\Local\\Temp\\pip-install-uxgktap4\\cffi_546a51711f7240dab08ffaec87da7439\\setup.py'"'"'; __file__='"'"'C:\\Users\\Karl\\AppData\\Local\\Temp\\pip-install-uxgktap4\\cffi_546a51711f7240dab08ffaec87da7439\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\Karl\AppData\Local\Temp\pip-pip-egg-info-b2uvepgh'
         cwd: C:\Users\Karl\AppData\Local\Temp\pip-install-uxgktap4\cffi_546a51711f7240dab08ffaec87da7439\
    Complete output (19 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\Karl\AppData\Local\Temp\pip-install-uxgktap4\cffi_546a51711f7240dab08ffaec87da7439\setup.py", line 113, in <module>
        if sys.platform == 'win32' and uses_msvc():
      File "C:\Users\Karl\AppData\Local\Temp\pip-install-uxgktap4\cffi_546a51711f7240dab08ffaec87da7439\setup.py", line 91, in uses_msvc
        return config.try_compile('#ifndef _MSC_VER\n#error "not MSVC"\n#endif')
      File "c:\python39\lib\distutils\command\config.py", line 225, in try_compile
        self._compile(body, headers, include_dirs, lang)
      File "c:\python39\lib\distutils\command\config.py", line 132, in _compile
        self.compiler.compile([src], include_dirs=include_dirs)
      File "c:\python39\lib\distutils\_msvccompiler.py", line 323, in compile
        self.initialize()
      File "c:\python39\lib\distutils\_msvccompiler.py", line 220, in initialize
        vc_env = _get_vc_env(plat_spec)
      File "C:\dev\tradingview-webhook\env\lib\site-packages\setuptools\msvc.py", line 313, in msvc14_get_vc_env
        return _msvc14_get_vc_env(plat_spec)
      File "C:\dev\tradingview-webhook\env\lib\site-packages\setuptools\msvc.py", line 267, in _msvc14_get_vc_env
        raise distutils.errors.DistutilsPlatformError(
    distutils.errors.DistutilsPlatformError: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
    ----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/5b/b9/790f8eafcdab455bcd3bd908161f802c9ce5adbf702a83aa7712fcc345b7/cffi-1.10.0.tar.gz#sha256=b3b02911eb1f6ada203b0763ba924234629b51586f72a21faacc638269f4ced5 (from https://pypi.org/simple/cffi/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
  Downloading cffi-1.9.1.tar.gz (407 kB)
     |โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 407 kB 3.2 MB/s
    ERROR: Command errored out with exit status 1:
     command: 'C:\dev\tradingview-webhook\env\Scripts\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Karl\\AppData\\Local\\Temp\\pip-install-uxgktap4\\cffi_8d2654cde2ca45659154ae1045805aa9\\setup.py'"'"'; __file__='"'"'C:\\Users\\Karl\\AppData\\Local\\Temp\\pip-install-uxgktap4\\cffi_8d2654cde2ca45659154ae1045805aa9\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\Karl\AppData\Local\Temp\pip-pip-egg-info-6b3i16ph'
         cwd: C:\Users\Karl\AppData\Local\Temp\pip-install-uxgktap4\cffi_8d2654cde2ca45659154ae1045805aa9\
    Complete output (19 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\Karl\AppData\Local\Temp\pip-install-uxgktap4\cffi_8d2654cde2ca45659154ae1045805aa9\setup.py", line 98, in <module>
        if sys.platform == 'win32' and uses_msvc():
      File "C:\Users\Karl\AppData\Local\Temp\pip-install-uxgktap4\cffi_8d2654cde2ca45659154ae1045805aa9\setup.py", line 76, in uses_msvc
        return config.try_compile('#ifndef _MSC_VER\n#error "not MSVC"\n#endif')
      File "c:\python39\lib\distutils\command\config.py", line 225, in try_compile
        self._compile(body, headers, include_dirs, lang)
      File "c:\python39\lib\distutils\command\config.py", line 132, in _compile
        self.compiler.compile([src], include_dirs=include_dirs)
      File "c:\python39\lib\distutils\_msvccompiler.py", line 323, in compile
        self.initialize()
      File "c:\python39\lib\distutils\_msvccompiler.py", line 220, in initialize
        vc_env = _get_vc_env(plat_spec)
      File "C:\dev\tradingview-webhook\env\lib\site-packages\setuptools\msvc.py", line 313, in msvc14_get_vc_env
        return _msvc14_get_vc_env(plat_spec)
      File "C:\dev\tradingview-webhook\env\lib\site-packages\setuptools\msvc.py", line 267, in _msvc14_get_vc_env
        raise distutils.errors.DistutilsPlatformError(
    distutils.errors.DistutilsPlatformError: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
    ----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/a1/32/e3d6c3a8b5461b903651dd6ce958ed03c093d2e00128e3f33ea69f1d7965/cffi-1.9.1.tar.gz#sha256=563e0bd53fda03c151573217b3a49b3abad8813de9dd0632e10090f6190fdaf8 (from https://pypi.org/simple/cffi/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
  Downloading cffi-1.9.0.tar.gz (407 kB)
     |โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 407 kB 3.2 MB/s
    ERROR: Command errored out with exit status 1:
     command: 'C:\dev\tradingview-webhook\env\Scripts\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Karl\\AppData\\Local\\Temp\\pip-install-uxgktap4\\cffi_589ca6a50f3b4cd98dd5f3b1f49074ee\\setup.py'"'"'; __file__='"'"'C:\\Users\\Karl\\AppData\\Local\\Temp\\pip-install-uxgktap4\\cffi_589ca6a50f3b4cd98dd5f3b1f49074ee\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\Karl\AppData\Local\Temp\pip-pip-egg-info-wcvp1ieb'
         cwd: C:\Users\Karl\AppData\Local\Temp\pip-install-uxgktap4\cffi_589ca6a50f3b4cd98dd5f3b1f49074ee\
    Complete output (19 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\Karl\AppData\Local\Temp\pip-install-uxgktap4\cffi_589ca6a50f3b4cd98dd5f3b1f49074ee\setup.py", line 98, in <module>
        if sys.platform == 'win32' and uses_msvc():
      File "C:\Users\Karl\AppData\Local\Temp\pip-install-uxgktap4\cffi_589ca6a50f3b4cd98dd5f3b1f49074ee\setup.py", line 76, in uses_msvc
        return config.try_compile('#ifndef _MSC_VER\n#error "not MSVC"\n#endif')
      File "c:\python39\lib\distutils\command\config.py", line 225, in try_compile
        self._compile(body, headers, include_dirs, lang)
      File "c:\python39\lib\distutils\command\config.py", line 132, in _compile
        self.compiler.compile([src], include_dirs=include_dirs)
      File "c:\python39\lib\distutils\_msvccompiler.py", line 323, in compile
        self.initialize()
      File "c:\python39\lib\distutils\_msvccompiler.py", line 220, in initialize
        vc_env = _get_vc_env(plat_spec)
      File "C:\dev\tradingview-webhook\env\lib\site-packages\setuptools\msvc.py", line 313, in msvc14_get_vc_env
        return _msvc14_get_vc_env(plat_spec)
      File "C:\dev\tradingview-webhook\env\lib\site-packages\setuptools\msvc.py", line 267, in _msvc14_get_vc_env
        raise distutils.errors.DistutilsPlatformError(
    distutils.errors.DistutilsPlatformError: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
    ----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/be/ff/f8508db9c857c45ce0c909809db7e6c952f37776173d88bcb8404f44c574/cffi-1.9.0.tar.gz#sha256=ef98626610d1c9b409da6529970a584cf88f0d1e9f3e902a569eddc1332d7864 (from https://pypi.org/simple/cffi/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
  Downloading cffi-1.8.3.tar.gz (403 kB)
     |โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 403 kB 6.4 MB/s
  Downloading cffi-1.8.2.tar.gz (403 kB)
     |โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 403 kB 2.2 MB/s
  Downloading cffi-1.7.0.tar.gz (400 kB)
     |โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 400 kB 3.3 MB/s
  Downloading cffi-1.6.0.tar.gz (397 kB)
     |โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 397 kB 3.3 MB/s
  Downloading cffi-1.5.2.tar.gz (388 kB)
     |โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 388 kB 656 kB/s
  Downloading cffi-1.5.1.tar.gz (388 kB)
     |โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 388 kB 1.1 MB/s
  Downloading cffi-1.5.0.tar.gz (385 kB)
     |โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 385 kB 1.3 MB/s
  Downloading cffi-1.4.2.tar.gz (365 kB)
     |โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 365 kB 1.3 MB/s
  Downloading cffi-1.4.1.tar.gz (365 kB)
     |โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 365 kB 1.6 MB/s
  Downloading cffi-1.4.0.tar.gz (365 kB)
     |โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 365 kB 1.7 MB/s
  Downloading cffi-1.3.1.tar.gz (351 kB)
     |โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 351 kB 2.2 MB/s
  Downloading cffi-1.3.0.tar.gz (347 kB)
     |โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 347 kB 2.2 MB/s
INFO: pip is looking at multiple versions of six to determine which version is compatible with other requirements. This could take a while.
INFO: This is taking longer than usual. You might need to provide the dependency resolver with stricter constraints to reduce runtime. If you want to abort this run, you can press Ctrl + C to 
do so. To improve how pip performs, tell us what happened here: https://pip.pypa.io/surveys/backtracking
INFO: pip is looking at multiple versions of cffi to determine which version is compatible with other requirements. This could take a while.
INFO: This is taking longer than usual. You might need to provide the dependency resolver with stricter constraints to reduce runtime. If you want to abort this run, you can press Ctrl + C to 
do so. To improve how pip performs, tell us what happened here: https://pip.pypa.io/surveys/backtracking
INFO: pip is looking at multiple versions of secp256k1 to determine which version is compatible with other requirements. This could take a while.
INFO: pip is looking at multiple versions of idna to determine which version is compatible with other requirements. This could take a while.
Collecting idna<3,>=2.5
  Downloading idna-2.9-py2.py3-none-any.whl (58 kB)
     |โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 58 kB 1.6 MB/s
  Downloading idna-2.8-py2.py3-none-any.whl (58 kB)
     |โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 58 kB 1.9 MB/s
  Downloading idna-2.7-py2.py3-none-any.whl (58 kB)
     |โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 58 kB 1.6 MB/s
  Downloading idna-2.6-py2.py3-none-any.whl (56 kB)
     |โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 56 kB 1.3 MB/s
  Downloading idna-2.5-py2.py3-none-any.whl (55 kB)
     |โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 55 kB 1.1 MB/s
INFO: pip is looking at multiple versions of certifi to determine which version is compatible with other requirements. This could take a while.
Collecting certifi
  Downloading certifi-2020.11.8-py2.py3-none-any.whl (155 kB)
     |โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 155 kB 2.2 MB/s
  Using cached certifi-2020.6.20-py2.py3-none-any.whl (156 kB)
  Downloading certifi-2020.4.5.2-py2.py3-none-any.whl (157 kB)
     |โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 157 kB 2.2 MB/s
  Downloading certifi-2020.4.5.1-py2.py3-none-any.whl (157 kB)
     |โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 157 kB 3.2 MB/s
  Downloading certifi-2020.4.5-py2.py3-none-any.whl (156 kB)
     |โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 156 kB 2.2 MB/s
  Downloading certifi-2019.11.28-py2.py3-none-any.whl (156 kB)
     |โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 156 kB 2.2 MB/s
  Downloading certifi-2019.9.11-py2.py3-none-any.whl (154 kB)
     |โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 154 kB 3.3 MB/s
  Downloading certifi-2019.6.16-py2.py3-none-any.whl (157 kB)
     |โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 157 kB 3.3 MB/s
  Downloading certifi-2019.3.9-py2.py3-none-any.whl (158 kB)
     |โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 158 kB 3.3 MB/s
  Downloading certifi-2018.11.29-py2.py3-none-any.whl (154 kB)
     |โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 154 kB 3.3 MB/s
  Downloading certifi-2018.10.15-py2.py3-none-any.whl (146 kB)
     |โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 146 kB 3.2 MB/s
  Downloading certifi-2018.8.24-py2.py3-none-any.whl (147 kB)
     |โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 147 kB 2.2 MB/s
  Downloading certifi-2018.8.13-py2.py3-none-any.whl (146 kB)
     |โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 146 kB 3.3 MB/s
  Downloading certifi-2018.4.16-py2.py3-none-any.whl (150 kB)
     |โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 150 kB 2.2 MB/s
  Downloading certifi-2018.1.18-py2.py3-none-any.whl (151 kB)
     |โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 151 kB 3.3 MB/s
  Downloading certifi-2017.11.5-py2.py3-none-any.whl (330 kB)
     |โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 330 kB 2.2 MB/s
  Downloading certifi-2017.7.27.1-py2.py3-none-any.whl (349 kB)
     |โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 349 kB 2.2 MB/s
  Downloading certifi-2017.7.27-py2.py3-none-any.whl (349 kB)
     |โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 349 kB 3.2 MB/s
  Downloading certifi-2017.4.17-py2.py3-none-any.whl (375 kB)
     |โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 375 kB 3.3 MB/s
INFO: pip is looking at multiple versions of secp256k1 to determine which version is compatible with other requirements. This could take a while.
INFO: pip is looking at multiple versions of idna to determine which version is compatible with other requirements. This could take a while.
INFO: This is taking longer than usual. You might need to provide the dependency resolver with stricter constraints to reduce runtime. If you want to abort this run, you can press Ctrl + C to 
do so. To improve how pip performs, tell us what happened here: https://pip.pypa.io/surveys/backtracking
INFO: This is taking longer than usual. You might need to provide the dependency resolver with stricter constraints to reduce runtime. If you want to abort this run, you can press Ctrl + C to 
do so. To improve how pip performs, tell us what happened here: https://pip.pypa.io/surveys/backtracking
INFO: pip is looking at multiple versions of certifi to determine which version is compatible with other requirements. This could take a while.
INFO: This is taking longer than usual. You might need to provide the dependency resolver with stricter constraints to reduce runtime. If you want to abort this run, you can press Ctrl + C to 
do so. To improve how pip performs, tell us what happened here: https://pip.pypa.io/surveys/backtracking
INFO: pip is looking at multiple versions of requests to determine which version is compatible with other requirements. This could take a while.
Collecting requests
  Downloading requests-2.25.0-py2.py3-none-any.whl (61 kB)
     |โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 61 kB 1.9 MB/s
  Using cached requests-2.24.0-py2.py3-none-any.whl (61 kB)
  Downloading requests-2.23.0-py2.py3-none-any.whl (58 kB)
     |โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 58 kB 4.1 MB/s
  Downloading requests-2.22.0-py2.py3-none-any.whl (57 kB)
     |โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 57 kB 3.8 MB/s
  Downloading requests-2.21.0-py2.py3-none-any.whl (57 kB)
     |โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 57 kB 3.8 MB/s
Collecting chardet<5.0,>=2.0
  Using cached chardet-3.0.4-py2.py3-none-any.whl (133 kB)
INFO: pip is looking at multiple versions of chardet to determine which version is compatible with other requirements. This could take a while.
  Downloading chardet-3.0.3-py2.py3-none-any.whl (133 kB)
     |โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 133 kB 2.2 MB/s
  Downloading chardet-3.0.2-py2.py3-none-any.whl (133 kB)
     |โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 133 kB 3.3 MB/s
INFO: pip is looking at multiple versions of chardet to determine which version is compatible with other requirements. This could take a while.
INFO: This is taking longer than usual. You might need to provide the dependency resolver with stricter constraints to reduce runtime. If you want to abort this run, you can press Ctrl + C to 
do so. To improve how pip performs, tell us what happened here: https://pip.pypa.io/surveys/backtracking

get_transactions always empty in mainnet and testnet

I am trying to retrieve the list of transactions for a specific address but it always returns an empty list.

 prod_env = BinanceEnvironment.get_production_env()
 client = HttpApiClient(env=prod_env)
 client.get_transactions(address='bnb17pd7wd7xp5636vtnsyld8x8ec4dv5t0d0y9xc7')

problem seems to happen when requesting from an address with only TRANFER type transactions, I always get an empty list.

TypeError: broadcast_msg() missing 1 required positional argument: 'msg'

res = client.broadcast_msg(transfer_msg, sync=True)
TypeError: broadcast_msg() missing 1 required positional argument: 'msg'

Any idea how to fix this error?

from binance_chain.http import HttpApiClient
from binance_chain.messages import TransferMsg
from binance_chain.wallet import Wallet
from binance_chain.environment import BinanceEnvironment

env = BinanceEnvironment.get_production_env()
wallet = Wallet('my private key')
client = HttpApiClient

transfer_msg = TransferMsg(
wallet=wallet,
symbol='BNB',
amount=1,
to_address='address',
)
res = client.broadcast_msg(transfer_msg, sync=True)

Error when trying to import from binance_chain.environment import BinanceEnvironment

After installing the library on my environment with Python 3.5.3, I try to import the library as follows (in Python shell):

from binance_chain.environment import BinanceEnvironment

But I get this error:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/vagrant/.local/lib/python3.5/site-packages/binance_chain/environment.py", line 45
    return hash(f"{self.api_url}{self.wss_url}{self.hrp}")
                                                        ^
SyntaxError: invalid syntax

Any idea why?

UPDATE: it is apparently due to f'' string not supported on python 3.5.3, can you confirm this? could you please add support for python 3.5 as well?

UPDATE2: trying it with Python 3.7 but there is an error during the package installation due to libsecp256k1 library. Then I tried to install the package here (as suggested in the readme) https://github.com/ludbb/secp256k1-py#installation but this is not compatible with python 3.7!

I am currently still not able to use the library.

ๅฆ‚ไฝ•่งฃ็ txsๆ•ฐๆฎ

่ฏท้—ฎๅฆ‚ไฝ•่ฟ›่กŒ่งฃ็ txsๆ•ฐๆฎ๏ผŒ่Žทๅ–ๅฎŒๅ—ๆ•ฐๆฎๅŽ๏ผŒไบคๆ˜“ๆ•ฐๆฎๆ˜ฏ็ผ–็ ่ฟ‡็š„๏ผŒๆฒกๆœ‰ๆ‰พๅˆฐ่งฃ็ ๆ–นๆณ•ใ€‚

'data': {'txs': ['xwHwYl3uCk4qLIf6CiMKFI6nDX0uqKFLorM9GNXfvW+uCm6oEgsKA0JOQhCCzc/zGBIjChSRk3Ug9ARY9bQU0meWG0bBl4ndcBILCgNCTkIQgs3P8xgSbwom61rphyECY27UXl6gX6oOXbLxltBEgO2x6zsGPFXz0d+AgMFWU7YSQFPEqcBxlWj3u96l92HKZBzIMZJCFpHf0SOUW39s0dkHeZtKjODyL3lspQHf7EwpZtEPdv8+eq7OncifaKICMnsYMiDQGiAC']}

้žๅธธๆ„Ÿ่ฐขไบ†ใ€‚

HttpApiClient does not use provided api_url

I try to initiate http client: client = HttpApiClient(api_url='https://custom-url.com')

but it doesn't use https://custom-url.com, it uses PROD env, how can I provide my custom api url?

ValueError: invalid literal for int() with base 10: '{id}'

Hi,

I am using latest source from: https://github.com/sammchardy/python-binance-chain.git

`from binance_chain.wallet import Wallet
from binance_chain.environment import BinanceEnvironment

if name == 'main':
# initialise with Testnet environment
env = BinanceEnvironment.get_testnet_env()
wallet = Wallet.create_random_wallet(env=env)
print(wallet.address)
print(wallet.private_key)
print(wallet.public_key_hex)`

And I get the following error:

`Traceback (most recent call last):
File "/Users/ken/Documents/GitHub/BSC/main.py", line 9, in
wallet = Wallet.create_random_wallet(env=env)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/ken/Documents/GitHub/BSC/binance_chain/wallet.py", line 137, in create_random_wallet
return cls.create_wallet_from_mnemonic(phrase, env=env)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/ken/Documents/GitHub/BSC/binance_chain/wallet.py", line 153, in create_wallet_from_mnemonic
child_wallet = new_wallet.subkey_for_path(Wallet.HD_PATH)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/ken/Documents/GitHub/BSC/ENV/lib/python3.12/site-packages/pycoin/key/BIP32Node.py", line 208, in subkey_for_path
v = int(v)
^^^^^^
ValueError: invalid literal for int() with base 10: '{id}'

Process finished with exit code 1`

Any idea of what the problem is?

get_transactions is always empty w/ testnet env

Installed through pip, running shell

>>> from binance_chain.http import HttpApiClient
>>> from binance_chain.constants import KlineInterval
>>> from binance_chain.environment import BinanceEnvironment
>>> testnet_env = BinanceEnvironment.get_testnet_env()
>>> client = HttpApiClient(env=testnet_env)
>>> testnet_env._api_url
'https://testnet-dex.binance.org'
>>> testnet_env.wss_url
'wss://testnet-dex.binance.org/api/'
>>> client.env._api_url
'https://testnet-dex.binance.org'
>>> client.get_node_info()
{'node_info': {'protocol_version': {'p2p': 7, 'block': 10, 'app': 0}, 'id': '1bca643058c56f9c20ebaaad1739522ee7d11cd6', 'listen_addr': '10.201.41.106:27146', 'network': 'Binance-Chain-Nile', 'version': '0.30.1', 'channels': '3540202122233038', 'moniker': 'Fuji', 'other': {'tx_index': 'on', 'rpc_address': 'tcp://0.0.0.0:27147'}}, 'sync_info': {'latest_block_hash': '44B24923743EF044CEE7A47C7FFAF4C800749C2A37D8AD6567DCE57AD3D46771', 'latest_app_hash': 'B929CEF204C3615470AC27020917D03A553E8B22924CA9DB3654C8FEE7ED2895', 'latest_block_height': 22531119, 'latest_block_time': '2019-06-19T17:10:25.457142303Z', 'catching_up': False}, 'validator_info': {'address': '7B343E041CA130000A8BC00C35152BD7E7740037', 'pub_key': [74, 93, 71, 83, 235, 121, 249, 46, 128, 239, 226, 45, 247, 172, 164, 246, 102, 164, 244, 75, 248, 28, 83, 108, 74, 9, 212, 185, 197, 182, 84, 181], 'voting_power': 100000000000}}
>>> client.get_transactions('tbnb1j537plrhs3ndqrxxsyv69nm9u96cuqlqhcapqc')
{'tx': [], 'total': 0}

Its not pulling proper transaction history for this address on testnet.
https://testnet-explorer.binance.org/address/tbnb1j537plrhs3ndqrxxsyv69nm9u96cuqlqhcapqc

Can anyone replicate?

Error running pip install python-binance-chain

Hi,

I am creating a new ENV and running pip install fails.

These are the commands I run:
python3 -m venv ENV
source ENV/bin/activate
pip install --upgrade pip
pip install python-binance-chain

Then after running several lines I get the following error:
`Collecting protobuf (from python-binance-chain)
Using cached protobuf-3.0.0a3.tar.gz (88 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... error
error: subprocess-exited-with-error

ร— Getting requirements to build wheel did not run successfully.`

I don't know how to troubleshoot this. Thanks!

Issue while importing HttpApiClient

@sammchardy

  File "##/binance_chain/client.py", line 3, in <module>
    from binance_chain.http import HttpApiClient
  File "##/lib/python3.6/site-packages/binance_chain/http.py", line 8, in <module>
    import binance_chain.messages
  File "##/lib/python3.6/site-packages/binance_chain/messages.py", line 9, in <module>
    from binance_chain.protobuf.dex_pb2 import (
  File "##/lib/python3.6/site-packages/binance_chain/protobuf/dex_pb2.py", line 22, in <module>
    serialized_pb=_b('\n\tdex.proto\x12\x0btransaction\"U\n\x05StdTx\x12\x0c\n\x04msgs\x18\x01 \x03(\x0c\x12\x12\n\nsignatures\x18\x02 \x03(\x0c\x12\x0c\n\x04memo\x18\x03 \x01(\t\x12\x0e\n\x06source\x18\x04 \x01(\x03\x12\x0c\n\x04\x64\x61ta\x18\x05 \x01(\x0c\"f\n\x0cStdSignature\x12\x0f\n\x07pub_key\x18\x01 \x01(\x0c\x12\x11\n\tsignature\x18\x02 \x01(\x0c\x12\x16\n\x0e\x61\x63\x63ount_number\x18\x03 \x01(\x03\x12\x10\n\x08sequence\x18\x04 \x01(\x03\x1a\x08\n\x06PubKey\"\x8d\x01\n\x08NewOrder\x12\x0e\n\x06sender\x18\x01 \x01(\x0c\x12\n\n\x02id\x18\x02 \x01(\t\x12\x0e\n\x06symbol\x18\x03 \x01(\t\x12\x11\n\tordertype\x18\x04 \x01(\x03\x12\x0c\n\x04side\x18\x05 \x01(\x03\x12\r\n\x05price\x18\x06 \x01(\x03\x12\x10\n\x08quantity\x18\x07 \x01(\x03\x12\x13\n\x0btimeinforce\x18\x08 \x01(\x03\"<\n\x0b\x43\x61ncelOrder\x12\x0e\n\x06sender\x18\x01 \x01(\x0c\x12\x0e\n\x06symbol\x18\x02 \x01(\t\x12\r\n\x05refid\x18\x03 \x01(\t\";\n\x0bTokenFreeze\x12\x0c\n\x04\x66rom\x18\x01 \x01(\x0c\x12\x0e\n\x06symbol\x18\x02 \x01(\t\x12\x0e\n\x06\x61mount\x18\x03 \x01(\x03\"=\n\rTokenUnfreeze\x12\x0c\n\x04\x66rom\x18\x01 \x01(\x0c\x12\x0e\n\x06symbol\x18\x02 \x01(\t\x12\x0e\n\x06\x61mount\x18\x03 \x01(\x03\"&\n\x05Token\x12\r\n\x05\x64\x65nom\x18\x01 \x01(\t\x12\x0e\n\x06\x61mount\x18\x02 \x01(\x03\";\n\x05Input\x12\x0f\n\x07\x61\x64\x64ress\x18\x01 \x01(\x0c\x12!\n\x05\x63oins\x18\x02 \x03(\x0b\x32\x12.transaction.Token\"<\n\x06Output\x12\x0f\n\x07\x61\x64\x64ress\x18\x01 \x01(\x0c\x12!\n\x05\x63oins\x18\x02 \x03(\x0b\x32\x12.transaction.Token\"P\n\x04Send\x12\"\n\x06inputs\x18\x01 \x03(\x0b\x32\x12.transaction.Input\x12$\n\x07outputs\x18\x02 \x03(\x0b\x32\x13.transaction.OutputB*\n\x19\x63om.binance.dex.api.protoB\x0bTransactionP\x01\x62\x06proto3')
TypeError: __init__() got an unexpected keyword argument 'serialized_options'

How to send coins, get balance, create address using HttpRpcClient

@sammchardy Is it available to send coins, get balance, create address, get addresses, get transactions using HttpRpcClient. I am running my own full node and need to have this functionality from a remote server.

If it is, could you please provide one example how to do that as I feel lost and don't know how to do it.

Thanks!

Improper handling of 404 I suppose

@sammchardy I am seeing error on querying with a fresh account with zero balance/transactions. I suppose you are handling 404s opaquely.

Traceback (most recent call last):
  File "##/binance_chain/http.py", line 228, in get_account
    return self._get(f"account/{address}")
  File "##/binance_chain/http.py", line 124, in _get
    return self._request('get', path, **kwargs)
  File "##/binance_chain/http.py", line 96, in _request
    return self._handle_response(response)
  File "##/binance_chain/http.py", line 105, in _handle_response
    raise BinanceChainAPIException(response, response.status_code)
binance_chain.exceptions.BinanceChainAPIException: APIError(code=0): Invalid JSON error message from Binance Chain: 

HttpApiClitent didn't work

Hi! I would like to ask you why I always fail to use getaccount method in HttpApiClient, indicating that the default API service cannot be connected, and the official network test network is not available.

pip install fails on ubuntu

Tried apt install build-essential automake pkg-config libtool libffi-dev libgmp-dev as adviced in #5

config.status: executing libtool commands
      CC       src/libsecp256k1_la-secp256k1.lo
    In file included from /tmp/pip-build-t2jgn0l8/secp256k1/libsecp256k1/src/secp256k1.c:14:0:
    /tmp/pip-build-t2jgn0l8/secp256k1/libsecp256k1/src/ecmult_impl.h: In function โ€˜secp256k1_ecmult_context_cloneโ€™:
    /tmp/pip-build-t2jgn0l8/secp256k1/libsecp256k1/src/ecmult_impl.h:186:9: warning: implicit declaration of function โ€˜memcpyโ€™ [-Wimplicit-function-declaration]
             memcpy(dst->pre_g, src->pre_g, size);
             ^~~~~~
    /tmp/pip-build-t2jgn0l8/secp256k1/libsecp256k1/src/ecmult_impl.h:186:9: warning: incompatible implicit declaration of built-in function โ€˜memcpyโ€™
    /tmp/pip-build-t2jgn0l8/secp256k1/libsecp256k1/src/ecmult_impl.h:186:9: note: include โ€˜<string.h>โ€™ or provide a declaration of โ€˜memcpyโ€™
    /tmp/pip-build-t2jgn0l8/secp256k1/libsecp256k1/src/ecmult_impl.h: In function โ€˜secp256k1_ecmult_wnafโ€™:
    /tmp/pip-build-t2jgn0l8/secp256k1/libsecp256k1/src/ecmult_impl.h:230:5: warning: implicit declaration of function โ€˜memsetโ€™ [-Wimplicit-function-declaration]
         memset(wnaf, 0, len * sizeof(wnaf[0]));
         ^~~~~~
    /tmp/pip-build-t2jgn0l8/secp256k1/libsecp256k1/src/ecmult_impl.h:230:5: warning: incompatible implicit declaration of built-in function โ€˜memsetโ€™
    /tmp/pip-build-t2jgn0l8/secp256k1/libsecp256k1/src/ecmult_impl.h:230:5: note: include โ€˜<string.h>โ€™ or provide a declaration of โ€˜memsetโ€™
      CCLD     libsecp256k1.la
    /usr/bin/ar: `u' modifier ignored since `D' is the default (see `U')
      CC       src/tests-tests.o
    In file included from /tmp/pip-build-t2jgn0l8/secp256k1/libsecp256k1/src/secp256k1.c:14:0,
                     from /tmp/pip-build-t2jgn0l8/secp256k1/libsecp256k1/src/tests.c:16:
    /tmp/pip-build-t2jgn0l8/secp256k1/libsecp256k1/src/ecmult_impl.h: In function โ€˜secp256k1_ecmult_context_cloneโ€™:
    /tmp/pip-build-t2jgn0l8/secp256k1/libsecp256k1/src/ecmult_impl.h:186:9: warning: implicit declaration of function โ€˜memcpyโ€™ [-Wimplicit-function-declaration]
             memcpy(dst->pre_g, src->pre_g, size);
             ^~~~~~
    /tmp/pip-build-t2jgn0l8/secp256k1/libsecp256k1/src/ecmult_impl.h:186:9: warning: incompatible implicit declaration of built-in function โ€˜memcpyโ€™
    /tmp/pip-build-t2jgn0l8/secp256k1/libsecp256k1/src/ecmult_impl.h:186:9: note: include โ€˜<string.h>โ€™ or provide a declaration of โ€˜memcpyโ€™
    /tmp/pip-build-t2jgn0l8/secp256k1/libsecp256k1/src/ecmult_impl.h: In function โ€˜secp256k1_ecmult_wnafโ€™:
    /tmp/pip-build-t2jgn0l8/secp256k1/libsecp256k1/src/ecmult_impl.h:230:5: warning: implicit declaration of function โ€˜memsetโ€™ [-Wimplicit-function-declaration]
         memset(wnaf, 0, len * sizeof(wnaf[0]));
         ^~~~~~
    /tmp/pip-build-t2jgn0l8/secp256k1/libsecp256k1/src/ecmult_impl.h:230:5: warning: incompatible implicit declaration of built-in function โ€˜memsetโ€™
    /tmp/pip-build-t2jgn0l8/secp256k1/libsecp256k1/src/ecmult_impl.h:230:5: note: include โ€˜<string.h>โ€™ or provide a declaration of โ€˜memsetโ€™
    /tmp/pip-build-t2jgn0l8/secp256k1/libsecp256k1/src/tests.c: In function โ€˜test_ecdsa_der_parseโ€™:
    /tmp/pip-build-t2jgn0l8/secp256k1/libsecp256k1/src/tests.c:3702:52: error: dereferencing pointer to incomplete type โ€˜ECDSA_SIG {aka struct ECDSA_SIG_st}โ€™
             valid_openssl = !BN_is_negative(sig_openssl->r) && !BN_is_negative(sig_openssl->s) && BN_num_bits(sig_openssl->r) > 0 && BN_num_bits(sig_openssl->r) <= 256 && BN_num_bits(sig_openssl->s) > 0 && BN_num_bits(sig_openssl->s) <= 256;
                                                        ^~
    Makefile:1049: recipe for target 'src/tests-tests.o' failed
    make: *** [src/tests-tests.o] Error 1
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-t2jgn0l8/secp256k1/setup.py", line 295, in <module>
        "Topic :: Security :: Cryptography"
      File "/usr/local/lib/python3.6/distutils/core.py", line 148, in setup
        dist.run_commands()
      File "/usr/local/lib/python3.6/distutils/dist.py", line 955, in run_commands
        self.run_command(cmd)
      File "/usr/local/lib/python3.6/distutils/dist.py", line 974, in run_command
        cmd_obj.run()
      File "/usr/local/lib/python3.6/site-packages/setuptools/command/install.py", line 61, in run
        return orig.install.run(self)
      File "/usr/local/lib/python3.6/distutils/command/install.py", line 545, in run
        self.run_command('build')
      File "/usr/local/lib/python3.6/distutils/cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "/usr/local/lib/python3.6/distutils/dist.py", line 974, in run_command
        cmd_obj.run()
      File "/usr/local/lib/python3.6/distutils/command/build.py", line 135, in run
        self.run_command(cmd_name)
      File "/usr/local/lib/python3.6/distutils/cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "/usr/local/lib/python3.6/distutils/dist.py", line 974, in run_command
        cmd_obj.run()
      File "/tmp/pip-build-t2jgn0l8/secp256k1/setup.py", line 217, in run
        subprocess.check_call(["make"], cwd=build_temp)
      File "/usr/local/lib/python3.6/subprocess.py", line 291, in check_call
        raise CalledProcessError(retcode, cmd)
    subprocess.CalledProcessError: Command '['make']' returned non-zero exit status 2.
    

Command "/usr/local/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-5i9clii7/secp256k1/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-vdhx1ivf-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-5i9clii7/secp256k1/

APIError(code=401): signature verification failed

Python Version: 3.7
Environment: Mac OS

Method:
`
wallet = Wallet('privkey', env=BinanceEnvironment.get_testnet_env())

transfer_msg = TransferMsg(
wallet=wallet,
symbol='BNB',
amount=1,
to_address='tbnb15cwx4kh8qcgr0uumm4hf20a4lsd7znpdjykevc',
memo='good luck'
)

transfer_msg.wallet.initialise_wallet()

data = transfer_msg.to_hex_data()

res = client.broadcast_hex_msg(hex_msg=data, sync=True)
`

Error:
exceptions.BinanceChainAPIException: APIError(code=401): signature verification failed
How to fix ? Thanks

APIError(code=401):signature verification failed

  1. secp256k1 precompiled binary wheels is available for Python 2.7, 3.3, 3.4, and 3.5.
    No 3.6, I tried many ways to setup secp256k1 for 3.6, but no way. So I used 3.5

  2. I changed some f''string to .format() for python-binance-chain in Python 3.5

Then I put a Limit Order Buy as follows:
limit_order_msg = LimitOrderBuyMsg(
wallet=wallet,
symbol='ONE-5F9_BNB',
price=0.000396000,
quantity=20
)
res = client.broadcast_msg(limit_order_msg, sync=True)
print(res)

the result is:
Traceback (most recent call last):
File "/Users/sayid/PycharmProjects/coin/DEX1.2_ONE_acc.py", line 104, in
res = client.broadcast_msg(limit_order_msg, sync=True)
File "/anaconda3/envs/python35/lib/python3.5/site-packages/binance_chain/http.py", line 379, in broadcast_msg
res = self._post(req_path, data=data)
File "/anaconda3/envs/python35/lib/python3.5/site-packages/binance_chain/http.py", line 132, in _post
return self._request('post', path, **kwargs)
File "/anaconda3/envs/python35/lib/python3.5/site-packages/binance_chain/http.py", line 100, in _request
return self._handle_response(response)
File "/anaconda3/envs/python35/lib/python3.5/site-packages/binance_chain/http.py", line 110, in _handle_response
raise BinanceChainAPIException(response, response.status_code)
binance_chain.exceptions.BinanceChainAPIException: APIError(code=401):signature verification failed

Is the python3.5 problem? or the signature verification problem?
Thanks a lot!

Replace secp256k1-py lib

Hello everyone,

This wrapper should use a better library instead of secp256k1-py because it depended on the native secp256k1, which its installation is hard for some devs (most likely in windows and macOS). So I would recommend this to be replaced with other libs that support secp256k1 too, like electrumsv-secp256k1 or cryptography

pip install fails on linux

@sammchardy can you check this log during pip installation?

Collecting protobuf>=3.6.1 (from python-binance-chain==0.1.8->-r requirements.txt (line 48))
09:22:51   Using cached https://files.pythonhosted.org/packages/5a/aa/a858df367b464f5e9452e1c538aa47754d467023850c00b000287750fa77/protobuf-3.7.1-cp36-cp36m-manylinux1_x86_64.whl
09:22:51 Collecting secp256k1>=0.13.2 (from python-binance-chain==0.1.8->-r requirements.txt (line 48))
09:22:51   Using cached https://files.pythonhosted.org/packages/52/62/d7bf3829e126e517e253d2e22a63511c54bbaac34d7ddea316cde040fc49/secp256k1-0.13.2.tar.gz
09:22:51     Complete output from command python setup.py egg_info:
09:22:51     'pkg-config' is required to install this package. Please see the README for details.
09:22:51     
09:22:51     ----------------------------------------
09:22:51 Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-lk9kvjwk/secp256k1/

binance chain testnet faucet

Hi. I searched a lot to find the binance chain testnet faucet but all I could find was binance smart chain faucet that obviously doesn't fund binance chain testnet wallets. where I can get test BNB for development purpose?
or is there any way to communicate with binance smart chain using this library?
my binance chain testnet address is tbnb1uxgesw2ktt524t29zytdjjm3kv3mkuczzmjz4x

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.