如何检查Python中USDT(系绳)的余额?
我最近正在研究我的Python加密项目,但是我必须制作一种检查绳索钱包平衡的方法。有没有办法检查与Python的系绳的平衡? 这是我的代码:
class wallet_Tether:
#Tether shares same blockchain with bitcoin
def __init__(self,wallet_address,wallet_privatekey,wallet_balance,wallet_history,wallet_public_key,wallet_name,wallet):
self.wallet_address = wallet_address
self.wallet_privatekey = wallet_privatekey
self.wallet_balance = wallet_balance
self.wallet_history = wallet_history
self.wallet_public_key = wallet_public_key
self.wallet_name = wallet_name
self.wallet = wallet
def create_address(self):
self.wallet = Wallet.create(self.wallet_name)
key_usdt = self.wallet.get_key()
self.wallet_address = key_usdt.get_address
return self.wallet_address
def check_balance(self):
return self.wallet_balance
I was working on my python crypto project recently, but I had to make a method that checks balance of Tether wallet. Is there a way to check balance of tether with python?
this is my code:
class wallet_Tether:
#Tether shares same blockchain with bitcoin
def __init__(self,wallet_address,wallet_privatekey,wallet_balance,wallet_history,wallet_public_key,wallet_name,wallet):
self.wallet_address = wallet_address
self.wallet_privatekey = wallet_privatekey
self.wallet_balance = wallet_balance
self.wallet_history = wallet_history
self.wallet_public_key = wallet_public_key
self.wallet_name = wallet_name
self.wallet = wallet
def create_address(self):
self.wallet = Wallet.create(self.wallet_name)
key_usdt = self.wallet.get_key()
self.wallet_address = key_usdt.get_address
return self.wallet_address
def check_balance(self):
return self.wallet_balance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Explorer API获取平衡信息。
您可以使用Tether
它允许您每天免费发送100,000个请求,每秒免费发送5个请求。
https://docs.etherscan.io/getting started-started-started/creating-creating-an--an---an---an---an---an---an--an---帐户 - >某些API DOC
变量响应包含带有平衡数据的字典。
示例:
结果在WEI中返回。因此,我们需要将结果除以10^18的
总计balance -tether Wallet Balance
You can use tether explorer api to get balance information.
For example, etherscan.io api ->
It allows you to send 100,000 requests per day and 5 requests per second for free.
https://docs.etherscan.io/getting-started/creating-an-account -> Some api docs
Variable response contains a dictionary with balance data.
Example:
The result is returned in wei. So, we need to divide result by 10^18
Where total_balance - your tether wallet balance