coincircle / py-etherdelta Goto Github PK
View Code? Open in Web Editor NEWPython client for interacting with the EtherDelta API and Smart Contracts.
License: MIT License
Python client for interacting with the EtherDelta API and Smart Contracts.
License: MIT License
I don't see myTrades api. This exchange haven't implemented this one yet
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 ?
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\
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'
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.
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.
It will be nice to have deposit and withdraw feature
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!
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.
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.
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.
Is it possible to use with ForkDelta, what would be needed to change?
Fresh install doesnt work anymore, import errors. anyone has a working python and packages version list that works?
Is there any way to disable this library from printing to console?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.