The Python SDK for Terra
Project description
About
Terra python sdk
Installation
pip install terra_sdk
Usage
1. Creating, Signing, Broadcasting tx
2. Exposes the Terra API through LCDClient
Example
-
Transfer
from terra_sdk.core.common.coin import Coin from terra_sdk.client import Terra, wallet from terra_sdk.key.mnemonic import MnemonicKey from terra_sdk.core.bank import MsgSend LCD_URI = "http://localhost:1317" CHAIN_ID = "localterra" MNEMONIC = "satisfy adjust timber high purchase tuition stool faith fine install that you unaware feed domain license impose boss human eager hat rent enjoy dawn" # Recover key from mnemonic key = MnemonicKey(MNEMONIC) # terra client terra = Terra(chain_id=CHAIN_ID, lcd_url=LCD_URI) # get user wallet wallet = terra.wallet(key) # Build Msg send_msg = MsgSend( from_address=wallet.address, to_address="terra1dcegyrekltswvyy0xy69ydgxn9x8x32zdtapd8", amount=[Coin(denom="uluna", amount="100000000")], ) # Sign tx signed_tx = wallet.create_and_sign_tx(send_msg, memo="Hi from Terra") # Broadcast tx resp = wallet.broadcast(signed_tx) # Print txhash print(resp.txhash)
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
terra-sdk-0.0.2.tar.gz
(38.3 kB
view hashes)
Built Distribution
terra_sdk-0.0.2-py3-none-any.whl
(81.7 kB
view hashes)
Close
Hashes for terra_sdk-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 532920e6d384b621cf464c4358e30d2873dc85c8b406475a8a72c6ff824ff932 |
|
MD5 | bab39b9a78e8326859a6f1e0d5a1ef77 |
|
BLAKE2b-256 | b1c2dffbc899504606c1b4f0779e7a3f360de05b02ef976856abe580b1984856 |