Skip to main content

LNMarkets API Wrapper

Project description

LNMarkets API Wrapper

This is a Python wrapper for LNMarkets API.

To install: pip install LNMarkets

Documentation: help(LNMarkets) To access documentation on idividual module, eg User: help(LNMarkets.User)

Example Usage:

import LNMarkets

LNMToken = '<YOUR TOKEN>'
apiState = LNMarkets.State.getState()
openPositions = LNMarkets.Positions.getPositions(LNMToken)['open'] #Token must have position scope
userInfo = LNMarkets.User.userInformation(LNMToken) #Token must have user scope
buyInfo = LNMarkets.Positions.buy(LNMToken,leverage,quantity=quantity)

Note:

  • It is recommended that you use token with only 'positions' scope, as leaking it cannot result in loss of funds through withdrawal.
  • Methods in Lnmarkets.User need token with 'user' scope.

Running Unit Tests

To run unit tests, run the following command in main directory, where setup.py is present.

$ python3 setup.py test --token '<Your Token>'

You need a token with both 'positions' and 'user' scope to run test. One of the test will buy and sell one contract, hence your account need small amount of balance.

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

LNMarkets-1.4.0.tar.gz (6.5 kB view details)

Uploaded Source

Built Distribution

LNMarkets-1.4.0-py3-none-any.whl (8.7 kB view details)

Uploaded Python 3

File details

Details for the file LNMarkets-1.4.0.tar.gz.

File metadata

  • Download URL: LNMarkets-1.4.0.tar.gz
  • Upload date:
  • Size: 6.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.7.9

File hashes

Hashes for LNMarkets-1.4.0.tar.gz
Algorithm Hash digest
SHA256 177c0506362bd664f60f920eca63be25f921ff6a44d68e998f7eb0839cd14855
MD5 641dc2f6bad3c4807497b33b0545df10
BLAKE2b-256 32b705fe34458ec22cbc257af24d0f80b39e5da6b53eaf462cf4aa94db1dd51b

See more details on using hashes here.

File details

Details for the file LNMarkets-1.4.0-py3-none-any.whl.

File metadata

  • Download URL: LNMarkets-1.4.0-py3-none-any.whl
  • Upload date:
  • Size: 8.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.7.9

File hashes

Hashes for LNMarkets-1.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9578eb7ab2c211875f18ea7ccd7bd8cfc88505142b023537ff2003590f97b290
MD5 422159f86efbab08c7704f0661551bd6
BLAKE2b-256 c6e7da44bb0d06ea550e30da88b85f73765cfd4db8d1fd980d7f52d44f54e298

See more details on using hashes here.

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