Giter Site home page Giter Site logo

chrdevmar / balpy Goto Github PK

View Code? Open in Web Editor NEW

This project forked from balancer/balpy

0.0 1.0 0.0 10.28 MB

Tools for interacting with Balancer Protocol V2 in Python.

License: GNU General Public License v3.0

Python 96.12% Jupyter Notebook 3.88%

balpy's Introduction

balpy

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

Install from PiP

Local installation of the latest balpy release can be done simply using:

pip install balpy

However, for reliability and isolation, we recommend creating a package through poetry

# If you do not have poetry installed, install it using the following commands:
# pip install poetry
poetry new package-name
cd package-name
poetry add balpy

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

Install from source

# Install in virtual environment using poetry
git clone https://github.com/balancer-labs/balpy.git
cd balpy
poetry install # Install dependencies and package
# You can enter the virtual environment using
poetry shell
# You can run a file using the environment
poetry run ./samples/misc/vaultWethRead.py

Locally building wheels

You can also create a wheel (.whl) file to build the library for platform-specific distribution

git clone https://github.com/balancer-labs/balpy.git
cd balpy
poetry build
# You can find the wheels here
cd dist/
# Wheel name will depend on version
pip install ./balpy-X.X.X.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.

balpy's People

Contributors

endymionjkb avatar gerrrg avatar kumar-ish avatar mitpitt avatar officialnico avatar rabmarut avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.