Skip to main content

Balancer V2 Python API

Project description

balpy

Python tools for interacting with Balancer Protocol V2 in Python.

DISCLAIMER: While balpy is intended to be a useful tool to simplify interacting with Balancer V2 Smart Contracts, this package is an ALPHA-build and should be considered as such. Use at your own risk! This package is capable of sending Ethereum (or EVM compatible) tokens controlled by whatever private key you provide. User assumes all liability for using this software; contributors to this package are not liable for any undesirable results. Users are STRONGLY encouraged to experiment with this package on testnets before using it on mainnet with valuable assets.

Usage

balpy has been tested on:

  • MacOS using Python 3.9.0
  • Linux using Python 3.9-dev
  • Windows using Python 3.9.5

Install

I recommend using a virtual environment:

python3 -m venv ./venv
source ./venv/bin/activate
python3 -m pip install balpy

See release on PyPI: https://pypi.org/project/balpy/

Build from source

git clone https://github.com/balancer-labs/balpy.git
cd balpy
python3 -m build
python3 -m pip install dist/<your_build>.whl

Environment Variables

You must set these two environment variables in order to use the balpy module

  • KEY_API_ETHERSCAN: API key for Etherscan for gas prices
  • KEY_PRIVATE: Plain text private key for signing transactions

You also must set AT LEAST one of these environment variables to connect to the network

  • KEY_API_INFURA: API key for Infura for sending transactions
  • BALPY_CUSTOM_RPC: Custom RPC URL (like localhost or Polygon RPC)

Samples

See README.md in samples/ for more information.

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

balpy-0.0.0a34.tar.gz (27.3 MB view details)

Uploaded Source

Built Distribution

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

balpy-0.0.0a34-py3-none-any.whl (29.0 MB view details)

Uploaded Python 3

File details

Details for the file balpy-0.0.0a34.tar.gz.

File metadata

  • Download URL: balpy-0.0.0a34.tar.gz
  • Upload date:
  • Size: 27.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.0

File hashes

Hashes for balpy-0.0.0a34.tar.gz
Algorithm Hash digest
SHA256 9ccb382e23fcb630a1c2c8914101c648ca8660f1eb3002a4f150b76e7a75dd76
MD5 b010005a6c2ab67d329e70c68cc5c263
BLAKE2b-256 6ad65c58cc28bf4eed871d995b4af23e82cda30d1cf5f53eda6befedf103d8db

See more details on using hashes here.

File details

Details for the file balpy-0.0.0a34-py3-none-any.whl.

File metadata

  • Download URL: balpy-0.0.0a34-py3-none-any.whl
  • Upload date:
  • Size: 29.0 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.0

File hashes

Hashes for balpy-0.0.0a34-py3-none-any.whl
Algorithm Hash digest
SHA256 5473b0a3114f0c9128a710fc638b6ad9a6fd6ac9dc51d3d1867ce0a3bf5f0a45
MD5 98d6bc942a793cb441e94f15f5bb0389
BLAKE2b-256 1f009f5d0677c2d0e365a03ca0711f4e493b964b2a30a21c6120658b0b2189f6

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