Skip to main content

Python library for Terra Core

Project description

Terra-py

CircleCI codecov

Python library for Terra Core

NOTE: This is an early version and interface changes could occure until v1.0.0.

Please heads-up to the documentation for complete modules description and more details.

Installation

Virtualenv:

virtualenv -p python3.6 .venv  # if not already created
source .venv/bin/activate
pip install terra-core

Poetry:

poetry add terra-core

Pipenv

pipenv install terra-core

Example

import os

from terra import Account
from terra import api
from terra import msg

acc = Account(os.getenv('MNEMONIC'))
# or generate a new one
# acc = Account.generate()

delegate = msg.staking.MsgDelegate(
    delegator_address=acc.account_address,
    validator_address='terravaloper1p54hc4yy2ajg67j645dn73w3378j6k05vmx9r2',
    amount=msg.Coin(amount='10000', denom='uluna')
)

tx = msg.Tx(
    fee=msg.Fee('10000', [msg.Coin('2000', 'uluna')]),
    memo='Delegating my LUNA tokens',
    msg=[delegate],
)

tx.sign_with(acc)

res = tx.broadcast()

Complete api in the documentation.

Develop

To contribute to terra-py developement, please check how to contribute in the documentation

Project details


Download files

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

Files for terra-core, version 0.8.0
Filename, size File type Python version Upload date Hashes
Filename, size terra_core-0.8.0-py3-none-any.whl (20.4 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size terra-core-0.8.0.tar.gz (10.9 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page