Getting Started¶
Register on IDEX¶
Firstly register an account with IDEX.
Make sure you save your private key as you will need it to sign trades.
Wallet Address¶
Your Wallet Address can be found in the top right under the account menu.
This is used to query the exchange for your balances, orders and trade history etc.
Some calls will throw an IdexException unless the wallet address and private key have been set.
Private Key¶
To perform and trading you will need both your wallet address and private key.
Note: Your private key is in the form ‘0x4efd9306gf134f9ee432d7415fb385029db50e7bce1682b2442beba24cf0a91f’
Initialise the client¶
Pass your Wallet Address and Private Key
from idex.client import Client
client = Client()
# add your wallet address later
client.set_wallet_address(address)
# change or add wallet address and private key
client.set_wallet_address(address, private_key)
# initialise the client with wallet address and private key
client = Client(address, private_key)
API Rate Limit¶
Unknown
Requests Settings¶
python-idex uses the requests library and the aiohttp library.
You can set custom requests parameters for all API calls when creating the client.
# for non-asyncio
client = Client(address, private_key, {"verify": False, "timeout": 20})
# for asyncio
client = Client(address, private_key, {"verify_ssl": False, "timeout": 20})
You may also pass custom requests parameters through any API call to override default settings or the above settingsspecify new ones like the example below.
# this would result in verify: False and timeout: 5 for the get_ticker call
client = Client(address, private_key, {"verify": False, "timeout": 20})
client.get_ticker('ETH_SAN', requests_params={'timeout': 5})
Check out the requests documentation for all options.
Proxy Settings
You can use the Requests Settings method above
proxies = {
'http': 'http://10.10.1.10:3128',
'https': 'http://10.10.1.10:1080'
}
# in the Client instantiation
client = Client(address, private_key, {'proxies': proxies})
# or on an individual call
client.get_ticker('ETH_SAN', requests_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