简体   繁体   中英

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 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.

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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