Skip to main content
Join the official 2020 Python Developers SurveyStart the survey!

Query, trade and manage funds on Oceanex.

Project description

oceanex_py3 is a Python SDK to query, trade and manage funds on Oceanex.

Installation

pip3 install oceanex_py3

Some examples

Get all trading pairs supported on Oceanex.

from oceanex_py3 import public

markets = public.get_markets()

for each in markets:
    print(each.identifier, each.left, each.right)

# etcusdt ETC USDT
# ltcusdt LTC USDT
# dashusdt DASH USDT

Get current buy/sell orderbook status on the market.

from oceanex_py3 import public

asks, bids, timestamp = public.get_orderbook('btcusdt', 10) # limit result to 10 orders.

Post an order to the market on behalf of user.

from oceanex_py3 import personal

test_config = {
    'uid': 'IDxxxxx',
    'apikey_id': 'Kxxxxxxx',
    'private_key_location': '/xxx/xxx/xxx/key.pem'
}

p = personal.Personal(
    test_config['uid'],
    test_config['apikey_id'],
    test_config['private_key_location']
)

order = p.new_sell_limit_order('vet', 'btc', 600000, 10000)

Cancel all the orders.

from oceanex_py3 import personal

test_config = {
    'uid': 'IDxxxxx',
    'apikey_id': 'Kxxxxxxx',
    'private_key_location': '/xxx/xxx/xxx/key.pem'
}

p = personal.Personal(
    test_config['uid'],
    test_config['apikey_id'],
    test_config['private_key_location']
)

p.cancel_all_orders()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for oceanex-py3, version 1.0.2
Filename, size File type Python version Upload date Hashes
Filename, size oceanex_py3-1.0.2.tar.gz (5.6 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page