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)
| File | Size | Uploaded | |
|---|---|---|---|
| LNMarkets-1.4.0.tar.gz | 6.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| 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
|