Skip to main content

Injective Python SDK, with Exchange API client

Project description

Injective Python SDK

Dependencies

Ubuntu

sudo apt install python3.X-dev autoconf automake build-essential libffi-dev libtool pkg-config

Fedora

sudo dnf install python3-devel autoconf automake gcc gcc-c++ libffi-devel libtool make pkgconfig

macOS

brew install autoconf automake libtool

Quick Start

Installation

pip install injective-py

Usage

Requires Python 3.7+

Examples

$ pipenv shell
$ pipenv install

# connecting to Injective Exchange API
# and listening for new orders from a specific spot market
$ python examples/exchange_client/spot_exchange_rpc/8_StreamOrders.py

# sending a msg with bank transfer
# signs and posts a transaction to the Injective Chain
$ python examples/chain_client/1_MsgSend.py

Upgrade pip to the latest version, if you see these warnings:

WARNING: Value for scheme.platlib does not match. Please report this to <https://github.com/pypa/pip/issues/10151>
WARNING: Additional context:   user = True   home = None   root = None   prefix = None

Development

  1. Generate proto binding & build
make gen
python -m build
  1. Enable dev env
pipenv shell
pipenv install --dev
  1. Install pkg
# from local build
pip uninstall injective-py
pip install injective-py --no-index --find-links /path/to/injective/sdk-python/dist

# from pypi
pip uninstall injective-py
pip install injective-py
  1. Fetch latest denom config
python pyinjective/fetch_metadata.py

Note that the sync client has been deprecated as of April 18, 2022. If you are using the sync client please make sure to transition to the async client, for more information read here

Changelogs

0.6.1.8

  • Add MsgCreateInsuranceFund in Composer
  • Re-gen mainnet denoms

0.6.1.5

  • Add MsgExecuteContract in Composer

0.6.1.4

  • Add wMATIC

0.6.1.2

  • Add OrderbookV2 method in async client

0.6.1.1

  • Add ARB/USDT

0.6.0.9

  • Deprecate K8S and set LB as default
  • Proto re-gen

0.6.0.8

  • Add USDCfr

0.6.0.7

  • Add LDO

0.6.0.6

  • Set default testnet endpoints to K8S
  • Remove LB config for testnet
  • Fix relative imports in composer
  • Add AccountPortfolio & StreamAccountPortfolio

0.6.0.5

  • Add new testnet endpoints
  • Re-gen mainnet denoms

0.6.0.4

  • Remove explicit versions from protobuf and grpcio-tools dependencies

0.6.0.2

  • Re-gen mainnet denoms

0.6.0.0

  • Change default network to LB
  • Re-gen mainnet denoms

0.5.9.7

  • Re-gen mainnet denoms

0.5.9.6

  • Re-gen proto

0.5.9.5

  • Add orderbook snaphot methods

0.5.9.4

  • Re-gen mainnet denoms

0.5.9.4

  • Re-gen mainnet denoms

0.5.9.2

  • Fix margin conversion for binary options

0.5.9.1

  • Add skip/limit to BinaryOptionsMarketsRequest

0.5.9.0

  • Re-gen proto
  • Fix MsgRewardsOptOut
  • Remove pysha3 dependency

0.5.8.8

  • Add grpc_explorer_endpoint in Network
  • Add explorer channel and stub

BREAKING CHANGES

  • Clients using Custom Network must now set grpc_explorer_endpoint during init

License

Copyright © 2021 - 2022 Injective Labs Inc. (https://injectivelabs.org/)

Originally released by Injective Labs Inc. under:
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/

Project details


Release history Release notifications | RSS feed

Download files

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

Source Distribution

injective-py-0.6.1.8.tar.gz (279.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

injective_py-0.6.1.8-py3-none-any.whl (514.8 kB view details)

Uploaded Python 3

File details

Details for the file injective-py-0.6.1.8.tar.gz.

File metadata

  • Download URL: injective-py-0.6.1.8.tar.gz
  • Upload date:
  • Size: 279.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.7.16

File hashes

Hashes for injective-py-0.6.1.8.tar.gz
Algorithm Hash digest
SHA256 90c1b63a8a2ea88266cab2fbf805955baac8afcf1b72f8ec3b87b03f7cf76dca
MD5 19974a3f3b451ed5be378ef098e6315e
BLAKE2b-256 55705c44aa16f7fbcc5ca7ac5594e6a1dc9aaa498d2363eaca5717740fb5825d

See more details on using hashes here.

File details

Details for the file injective_py-0.6.1.8-py3-none-any.whl.

File metadata

  • Download URL: injective_py-0.6.1.8-py3-none-any.whl
  • Upload date:
  • Size: 514.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.7.16

File hashes

Hashes for injective_py-0.6.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 1a186f348f247bcdd05947bb31a9fccd3428d713c4501f85808750a37077615a
MD5 1f5bfbbf5d232b1f683c623345fe0c3f
BLAKE2b-256 20805a6bb78a209becb917d52e93dc1a0a4d8804946265f859c9152b49349d01

See more details on using hashes here.

Supported by

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