“Wallet environment doesn't match HttpApiClient environment” Issue
wally-yu opened this issue · comments
Hi @sammchardy ,
congratulations and your well structured codes looks really awesome!
I have a small question while running your codes, here are my codes:
from binance_chain.http import HttpApiClient
from binance_chain.messages import TransferMsg
from binance_chain.wallet import Wallet
from binance_chain.environment import BinanceEnvironment
wallet = Wallet('<my private key>')
testnet_env = BinanceEnvironment.get_testnet_env()
client = HttpApiClient(env=testnet_env)
transfer_msg = TransferMsg(
wallet=wallet,
symbol='<my symbol>',
amount=0.08,
to_address='<my address>'
)
res = client.broadcast_msg(transfer_msg, sync=True)
print(res)
And i got a "Wallet environment doesn't match HttpApiClient environment" error.
Not sure if you would have time to fix that prob to enable running on test-net?
Thanks in advance.
Hi @wally-yu, thanks and congrats on your win too.
You just need to pass the same environment when you initialise the wallet object. If you're using the production system you don't need to worry about setting any environment.
works perfectly!
thanks for your quick reply :)