I wanted to get my Tron(TRC20) Address from my Binance Account vie API using Python, but all i got was my (Eth) Network Address.
**This is my code below.**
rom lib2to3.pygram import Symbols
import os
import config, csv
#and then import it in your python file with
from binance.client import Client
client = Client(config.api_key, config.api_secret)
address = client.get_deposit_address(tag='', coin='USDT')\
USDTron = (address.get('TRC20'))\
Results:
print(address)
Output: {'coin': 'USDT', 'address': '0x1892e6d25a9d91dea9f9caac549261e601af97f8', 'tag': '', 'url': 'https://etherscan.io/address/0x1892e6d25a9d91dea9f9caac549261e601af97f8'}
***(I got my Eth Network Address as the output)***
print(USDTron)
Output: None
**The output was (None)**
CodePudding user response:
I believe you might not quite understand what the python dictionary get()
method does.