Skip to main content

A wrapper for the Komodo DeFi Framework API

Project description

KomoDeFi Framework wrapper for Python

pykomodifi is a simple wrapper around Komodo Platform's DeFi Framework.

Basic usage:

   >>> import komodefi
   >>> dexapi = komodefi.KomoDeFi_API(config="path/to/MM2.json")
   >>> dexapi.version
   '1.0.7-beta_afe2e08'

Simple RPC call:

   >>> r = dexapi.rpc("get_enabled_coins")
   >>> r
   <Response [200]>
   >>> r.status_code
   200
   >>> r.json()
   {'result': [{'ticker': 'KMD', 'address': 'RMC1cWXngQf2117apEKoLh3x27NoG88yzd'}, {'ticker': 'LTC', 'address': 'LQyzwFtf8HU7VYQMhop5bv857uMao4jnKX'}]}

RPC call with parameters:

   >>> params = {"coin": "KMD"}
   >>> r = dexapi.rpc("my_balance", params)
   >>> r.json()
   {'coin': 'KMD', 'balance': '20', 'unspendable_balance': '0', 'address': 'RMC1cWXngQf2117apEKoLh3x27NoG88yzd'}

v2 RPC call:

   >>> r = dexapi.rpc("get_public_key", v2=True)
   >>> r.json()
   {'mmrpc': '2.0', 'result': {'public_key': '0371792f7a6846a0da28f3422501927ae103355c02750bc4c4d8430375329a09ac'}, 'id': None}

For documentation about available methods and parameters, refer to: https://developers.komodoplatform.com/basic-docs/atomicdex/introduction-to-atomicdex.html

Project details


Download files

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

Source Distribution

pykomodefi-0.2.0.tar.gz (15.6 kB view hashes)

Uploaded Source

Built Distribution

pykomodefi-0.2.0-py3-none-any.whl (29.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page