etherscan-api | Golang client for Ethereum Etherscan API | Blockchain library
kandi X-RAY | etherscan-api Summary
kandi X-RAY | etherscan-api Summary
:guitar: Golang client for Ethereum Etherscan API (and its families like BscScan) / Golang Ethereum Etherscan API library (and its families like BscScan)
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- CERC20Transfers returns all transactions for the given contract address .
- NewCustomized creates a new customized client
- compose a struct
- extractValue extracts a slice of strings
- Convert reflect . Value to string
- wrapfErr wraps an error with an additional context
- wrapErr wraps an error with a new message .
- New creates a new client with the specified network and API key .
- direct returns the first element of v .
etherscan-api Key Features
etherscan-api Examples and Code Snippets
Community Discussions
Trending Discussions on etherscan-api
QUESTION
I am using the etherscan-api here: (https://sebs.github.io/etherscan-api/#txlist) to get the list of transactions for a user (given public key), and I am getting the list of cleared transactions only, even though on etherscan.io I can see all pending transactions as well, so the information is "there". Digging into the source https://github.com/sebs/etherscan-api/blob/master/lib/account.js#L122, I find no indication of where I can look to find pending transactions. Code below:
...ANSWER
Answered 2021-Mar-29 at 07:07Etherscan doesn't provide pending transactions in their API.
It's probably because of the nature of how pending transactions are collected and displayed. All pending transactions are collected together in the Ethereum mempool. My guess is that Etherscan adds each entry from mempool to some kind of quickly searchable database such as ElasticSearch, and removes the DB entry when the transaction is taken off the mempool. The address detail page then performs a simple search in ES, filtering only transactions from/to this particular address.
If your web3 provider allows websocket connections and subscriptions, you can subscribe to the pendingTransactions
event.
It fires an event everytime a new transaction is added to the mempool. The event contains only the transaction hash (and no additional data such as the sender and receiver).
Because the event contains only tx hash, it's not very effecient to always perform a new query on the tx details, but it's useful in some other cases such as when you know the tx hash beforehand and you only want to know when it has been successfully broadcasted.
There's also BlockCypher REST API that has a limited free plan (and somewhat less limited paid plans) that returns all pending transactions including the tx details so that you can perform your own search on the result. See their docs if this fits your use case.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install etherscan-api
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page