简体   繁体   English

web3py python 获取确切价值交换令牌

[英]web3py python get exact value swap tokens

I'm using web3py to swap tokens, using the " swapExactETHForTokens " function, it's working perfectly, with the return hash I use the " web3.eth.get_transaction_receipt " function to get the transaction details, but I couldn't find how get the exact amount of tokens that went into my wallet. I'm using web3py to swap tokens, using the " swapExactETHForTokens " function, it's working perfectly, with the return hash I use the " web3.eth.get_transaction_receipt " function to get the transaction details, but I couldn't find how get the进入我钱包的确切数量的代币。

I found this other topic answered with the same question, but I didn't understand the answer or I'm too new to web3py for this.我发现这个其他主题回答了同样的问题,但我不明白答案,或者我对 web3py 太陌生了。

what I really want is to get the final value of the token obtained in the swap as shown in the image below我真正想要的是获得交换中获得的令牌的最终值,如下图所示

在此处输入图像描述

I don't know if I'm looking for this information the wrong way, but I haven't found any other material on the subject on web3py.我不知道我是否以错误的方式寻找这些信息,但我没有在 web3py 上找到任何关于该主题的其他材料。

You can use the event logs in the transaction, from that you should be able to calculate the amount of Bomber Coins that were transferred.您可以使用交易中的事件日志,从中您应该能够计算出被转移的 Bomber Coins 的数量。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM