Account Endpoints

These functions use the wallet address passed in the constructor.

class idex.client.Client(api_key, address=None, private_key=None)[source]

These functions take an address, typically it’s simpler to use the above functions.

class idex.client.Client(api_key, address=None, private_key=None)[source]
get_balances(address, complete=False)[source]

Get available balances for an address (total deposited minus amount in open orders) indexed by token symbol.

https://github.com/AuroraDAO/idex-api-docs#returnbalances

Parameters:
  • address (address string) – Address to query balances of
  • complete – Include available balances along with the amount you have in open orders for each token (Default False)
  • complete – bool
balances = client.get_balances('0xca82b7b95604f70b3ff5c6ede797a28b11b47d63')
Returns:API Response
# Without complete details
{
    REP: '25.55306545',
    DVIP: '200000000.31012358'
}

# With complete details
{
    REP: {
        available: '25.55306545',
        onOrders: '0'
    },
    DVIP: {
        available: '200000000.31012358',
        onOrders: '0'
    }
}
Raises:IdexResponseException, IdexAPIException
get_transfers(address, start=None, end=None)[source]

Returns the deposit and withdrawal history for an address within a range, specified by the “start” and “end” properties of the JSON input, both of which must be UNIX timestamps. Withdrawals can be marked as “PENDING” if they are queued for dispatch, “PROCESSING” if the transaction has been dispatched, and “COMPLETE” if the transaction has been mined.

https://github.com/AuroraDAO/idex-api-docs#returndepositswithdrawals

Parameters:
  • address (address string) – Address to query deposit/withdrawal history for
  • start (int) – optional - Inclusive starting UNIX timestamp of returned results (Default - 0)
  • end (int) – optional - Inclusive ending UNIX timestamp of returned results (Default - current timestamp)
transfers = client.get_transfers('0xca82b7b95604f70b3ff5c6ede797a28b11b47d63')
Returns:API Response
{
    deposits: [
        {
            depositNumber: 265,
            currency: 'ETH',
            amount: '4.5',
            timestamp: 1506550595,
            transactionHash: '0x52897291dba0a7b255ee7a27a8ca44a9e8d6919ca14f917616444bf974c48897'
        }
    ],
    withdrawals: [
        {
            withdrawalNumber: 174,
            currency: 'ETH',
            amount: '4.5',
            timestamp: 1506552152,
            transactionHash: '0xe52e9c569fe659556d1e56d8cca2084db0b452cd889f55ec3b4e2f3af61faa57',
            status: 'COMPLETE'
        }
    ]
}
Raises:IdexResponseException, IdexAPIException
get_next_nonce(address)[source]

Get the lowest nonce that you can use from the given address in one of the trade functions

https://github.com/AuroraDAO/idex-api-docs#returnnextnonce

Parameters:address (address string) – The address to query for the next nonce to use
nonce = client.get_next_nonce('0xf59fad2879fb8380ffa6049a48abf9c9959b3b5c')
Returns:API Response
{
    nonce: 2650
}
Raises:IdexResponseException, IdexAPIException