Coder Social home page Coder Social logo

coincircle / py-etherdelta Goto Github PK

View Code? Open in Web Editor NEW
21.0 6.0 12.0 61 KB

Python client for interacting with the EtherDelta API and Smart Contracts.

License: MIT License

Python 99.38% Makefile 0.62%
python etherdelta cryptocurrency exchange ethereum smart-contracts decentralized client websocket api

py-etherdelta's People

Contributors

markguo40 avatar miguelmota avatar

Stargazers

 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

py-etherdelta's Issues

<<< Did not place order because available volume too low. >>>

I spend few hours trying to post order with
client.create_order + client.post
All I get back is "Did not place order because available volume too low." message.
googling this message shows that few ppl have such error as well. Anyone was able to get past this one ?

Getting error when installing etherdelta module

All goes well, but at some moment I am getting error. Any ideas?

copying cytoolz\tests\test_utils.py -> build\lib.win-amd64-3.5\cytoolz\tests
running build_ext
building 'cytoolz.dicttoolz' extension
error: [WinError 2] The system cannot find the file specified

----------------------------------------

Command ""c:\program files\python 3.5\python.exe" -u -c "import setuptools, tokenize;file='C:\Users\Admin\AppData\Local\Temp\pip-install-kwqc1u6s\cytoolz\setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record C:\Users\Admin\AppData\Local\Temp\pip-record-qo01u2xc\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\Admin\AppData\Local\Temp\pip-install-kwqc1u6s\cytoolz\

Unable to use ForkDeltaClient

Code:
client = etherdelta.ForkDeltaClient()
token_addr = '0x0d8775f648430679a709e98d2b0cb6250d2887ef'
orders = client.get_buy_orderbook(token_addr)
print(orders)

However this gives error:
Traceback (most recent call last):
File "c:/FunProjects/Crypto/A_ForkDelta - Copy.py", line 33, in
client = etherdelta.ForkDeltaClient()
AttributeError: module 'etherdelta' has no attribute 'ForkDeltaClient'

packages incompatible

When install this package I recieve a incompatiblity error:

rlp 1.0.1 has requirement eth-utils<2,>=1.0.2, but you'll have eth-utils 1.0.1 which is incompatible. eth-account 0.2.2 has requirement eth-utils<2,>=1.0.2, but you'll have eth-utils 1.0.1 which is incompatible.

DeprecationWarning because of the rename from ethereum-utils to eth-utils

Traceback (most recent call last):
File "app.py", line 2, in
import etherdelta
File "/anaconda3/lib/python3.6/site-packages/etherdelta/init.py", line 12, in
import web3
File "/anaconda3/lib/python3.6/site-packages/web3/init.py", line 7, in
from eth_account import Account # noqa: E402
File "/anaconda3/lib/python3.6/site-packages/eth_account/init.py", line 1, in
from eth_account.account import Account # noqa: F401
File "/anaconda3/lib/python3.6/site-packages/eth_account/account.py", line 10, in
from eth_keyfile import (
File "/anaconda3/lib/python3.6/site-packages/eth_keyfile/init.py", line 7, in
from eth_keyfile.keyfile import ( # noqa: F401
File "/anaconda3/lib/python3.6/site-packages/eth_keyfile/keyfile.py", line 10, in
from eth_keys import keys
File "/anaconda3/lib/python3.6/site-packages/eth_keys/init.py", line 15, in
from .main import ( # noqa: F401
File "/anaconda3/lib/python3.6/site-packages/eth_keys/main.py", line 3, in
from eth_keys.datatypes import (
File "/anaconda3/lib/python3.6/site-packages/eth_keys/datatypes.py", line 8, in
from eth_utils import (
File "/anaconda3/lib/python3.6/site-packages/eth_utils/init.py", line 2, in
"This library has been renamed to eth-utils. The ethereum-utils "
DeprecationWarning: This library has been renamed to eth-utils. The ethereum-utils package will no longer recieve updates. Please update your dependencies accordingly.

Requirements

Hello,
I struggle with the requirements/installation process. Cant find big-red and setupfiles also not goong through or is it the wrong requirements file I am using (python 2.7, 3.5, 3,6 trief? I am on mac, but fresh ubuntu available as well, what do I need from a fresh install to get it running? Help would be very appreciated!

FileNoteFoundError: Can't find token.json

Am I missing a dependency or something here when calling the Client function? Here is the error message:

Traceback (most recent call last):
File "C:\Users\Vik\eclipse-workspace\LedgerCapital\EtherDelta_init_.py", line 2, in
client = etherdelta.Client()
File "C:\Users\Vik\AppData\Local\Programs\Python\Python36-32\lib\site-packages\etherdelta_init_.py", line 33, in init
with open(os.path.join(os.path.dirname(file), '../contracts/token.json'), 'r') as token_abi_definition:
FileNotFoundError: [Errno 2] No such file or directory: 'C:\Users\Vik\AppData\Local\Programs\Python\Python36-32\lib\site-packages\etherdelta\../contracts/token.json'

On the following simple code:

import etherdelta
client = etherdelta.Client()
account = '0x85E4B84D784eE9eEB7489F0B0c66B343AF2a0BE5'
bal = client.get_eth_balance(account)
print(bal)

Thanks for the help. Appreciate the work.

Documentation?

Hello,

Will any documentation be added, this looks to be a very promising library and I would love to know how to use it (as an ameteur).

Thanks,
Joseph.

Convert Scientific Notation to Int Precision Problem

I was using the client.trade() function to buy Cobinhood, here is the sell order:

  "sells": {
    "amount": "-2.367e+21", 
    "amountFilled": null, 
    "amountGet": "447363000000000000", 
    "amountGive": "2.367e+21", 
    "availableVolume": "2.362e+21", 
    "availableVolumeBase": "446418000000000000", 
    "ethAvailableVolume": "2362", 
    "ethAvailableVolumeBase": "0.446418", 
    "expires": "5292321", 
    "id": "11fe2d956845bb5fc2ca05b6d655f04c43b5caaaac798a95f157d3d1964a853e_sell", 
    "nonce": "3592513099", 
    "price": "0.000189", 
    "r": "0x16a39aa3d4c1494799f5130530425b989a52b82d48e007f8daa1a49e991e528c", 
    "s": "0x3084e4f66ac78795ce688451fda68840e5373e9e2fbcbc613f3208f9e03b766a", 
    "tokenGet": "0x0000000000000000000000000000000000000000", 
    "tokenGive": "0xb2f7eb1f2c37645be61d73953035360e768d81e6", 
    "updated": "2018-03-19T11:02:08.951Z", 
    "user": "0xa330a750abca19b79640ee7db1b9d06226b6486d", 
    "v": 28
  }

As you can see the amount give is 2.367e+21 which should be 2367 cobinhood (18 decimal). However when you convert this scientific notation to int. Here is result:

>>> int(float("2.367e+21"))
2367000000000000262144

This will end up with hex value: 00000000000000000000000000000000000000000000008050b94718b5a00000

The correct amount give should be 2367000000000000000000 with hex value: 00000000000000000000000000000000000000000000008050b94718b59c0000

This leads to a transaction failure.

I do the following precision test:

>>> int(float("2.367e+6"))
2367000
>>> int(float("2.367e+10"))
23670000000
>>> int(float("2.367e+20"))
236700000000000000000
>>> int(float("2.367e+21"))
2367000000000000262144
>>> int(float("2.367e+26"))
236700000000000012188647424

As you can see that starting from 10 to 21 power, the results are wrong.

Stop Print Output

Is there any way to disable this library from printing to console?

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.