-
-
Notifications
You must be signed in to change notification settings - Fork 189
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to get transaction log, please give some help, thank you! #154
Comments
You can use the getLogs function like this:
This would get all event logs for the topics given on the specified block.
What exactly are you trying to do? |
@Florian-S-A-W hello, |
Yes this is correct. So basically the inner array acts as an AND filter and the outer array acts as an OR filter. |
@Florian-S-A-W Thank you! |
@dengbangquan What do you mean? Logs are always emitted during transactions. So eth_getLogs searches for logs emitted during transactions in the range of blocks you define. Each log entry has a transaction hash property that shows which transaction the log belongs to. |
@Florian-S-A-W @koraykoska At present, I use getLogs according to the current writing method, and I can only get tokens, such as usdt transaction logs, but not original coins, such as BTC and ETH transaction logs. I don't know what the problem is, can you give me some instance codes? |
@dengbangquan You cannot track ETH transfers with logs (and BTC is another blockchain). For ETH transfers you will need to manually check the transactions. An indexer is good for those use cases. Or you use the Etherscan API. |
@dengbangquan as Koray mentioned, you cannot track ETH transfers with logs. Logs (or Events) are emitted by smart contracts when certain criteria are met, for example a transfer function being triggered. What are you actually trying to achieve? |
@Florian-S-A-W @koraykoska |
@Florian-S-A-W @koraykoska |
You have to use Websocket provider. It’s part of Web3.swift so it should be
a drag & drop replacement. Just use the initializer of Web3 with wsURL
instead of rpcURL and pass a Websocket url. If your provider doesn’t
support Websocket you can use Chainnodes:
https://www.chainnodes.org
…On Mon, 27 Mar 2023 at 04:30, dengbangquan ***@***.***> wrote:
@Florian-S-A-W <https://github.com/Florian-S-A-W> @koraykoska
<https://github.com/koraykoska>
[image: image]
<https://user-images.githubusercontent.com/16422981/227833912-2d7ee2f4-c689-496e-84f5-9c62ad702cbb.png>
error:providerDoesNotSupportSubscriptions
—
Reply to this email directly, view it on GitHub
<#154 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACWUTTODQJ3W7XU2Q6VKXHLW6ECT3ANCNFSM6AAAAAAVLQ4OY4>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
How do I get all the transaction logs in my wallet? I don't know if that's the right way to write it.
The text was updated successfully, but these errors were encountered: