Skip to main content

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.

Metadata

Release files for LNMarkets 1.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for LNMarkets 1.4.0
File Size Uploaded
LNMarkets-1.4.0.tar.gz 6.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for LNMarkets 1.4.0
File Interpreter ABI Platform
LNMarkets-1.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 15.1 kB

Release files / LNMarkets-1.4.0.tar.gz

Download URL LNMarkets-1.4.0.tar.gz
Size 6.5 kB
Tags Source
SHA-256 checksum
How to use checksums
177c0506362bd664f60f920eca63be25f921ff6a44d68e998f7eb0839cd14855
BLAKE2b-256 checksum
How to use checksums
32b705fe34458ec22cbc257af24d0f80b39e5da6b53eaf462cf4aa94db1dd51b
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / LNMarkets-1.4.0-py3-none-any.whl

Download URL LNMarkets-1.4.0-py3-none-any.whl
Size 8.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9578eb7ab2c211875f18ea7ccd7bd8cfc88505142b023537ff2003590f97b290
BLAKE2b-256 checksum
How to use checksums
c6e7da44bb0d06ea550e30da88b85f73765cfd4db8d1fd980d7f52d44f54e298
Upload date
Uploaded using Trusted Publishing?
What is 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

Release history Release notifications | RSS feed

This release

1.4.0 This release

2 release files

1.2.0

2 release files

1.1.0

1 release file

1.0.0

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page