terra-money / terra.py

Python SDK for Terra

Home Page:https://terra-money.github.io/terra.py/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

how can add cosmos chain_id into terra sdk?

SheydaAshoorian opened this issue · comments

I want integrate transfer uluna and uatom with each of terra or cosmos sdk. it is posible transfer atom with terra sdk. but I need to add cosmos chain_id to lcdclint of terra for checking in get_defualt method(from terra_sdk.client.lcd.lcdclient import get_default
). how can do it?

def get_default(chain_id: str) -> [Coins, Numeric]:
if chain_id == "columbus-5":
return [Coins.from_str("0.15uusd"), Numeric.parse(1.75)]
if chain_id == "bombay-12":
return [Coins.from_str("0.15uusd"), Numeric.parse(1.75)]
if chain_id == "localterra":
return [Coins.from_str("0.15uusd"), Numeric.parse(1.75)]

raise ValueError("chain_id is invalid")

you can create LCDClient with our chain_id and then you can replace chain_id to whatever you want.
but it's not our official usage of this SDK. i have no idea of side effects and i can't guarantee it works.