Documentation
¶
Overview ¶
Package blockscout provides Go bindings to the blockscout.com API. Example can be found at https://github.com/PositiveSecurity/blockscout-go-api/
Index ¶
Constants ¶
View Source
const ( // EthMainnetBase is the base explorer URL for Ethereum mainnet. EthMainnetBase = "https://eth.blockscout.com" // EthMainnet is the legacy Etherscan-compatible API URL for Ethereum mainnet. EthMainnet = "https://eth.blockscout.com/api" // EthMainnetV2 is the REST API v2 URL for Ethereum mainnet. EthMainnetV2 = "https://eth.blockscout.com/api/v2/" // Gnosis is the base explorer URL for Gnosis Chain. Gnosis = "https://gnosis.blockscout.com" // GnosisV2 is the REST API v2 URL for Gnosis Chain. GnosisV2 = "https://gnosis.blockscout.com/api/v2/" )
Variables ¶
View Source
var KnownExplorers = map[string]ExplorerURLs{
"1": explorer("1", "Ethereum", "https://eth.blockscout.com"),
"10": explorer("10", "OP Mainnet", "https://explorer.optimism.io"),
"30": explorer("30", "Rootstock", "https://rootstock.blockscout.com"),
"61": explorer("61", "Ethereum Classic", "https://etc.blockscout.com"),
"100": explorer("100", "Gnosis", "https://gnosis.blockscout.com"),
"130": explorer("130", "Unichain", "https://unichain.blockscout.com"),
"137": explorer("137", "Polygon PoS", "https://polygon.blockscout.com"),
"169": explorer("169", "Manta Pacific", "https://pacific-explorer.manta.network"),
"1868": explorer("1868", "Soneium", "https://soneium.blockscout.com"),
"314": explorer("314", "Filecoin Virtual Machine", "https://filecoin.blockscout.com"),
"324": explorer("324", "ZKsync Era", "https://zksync.blockscout.com"),
"480": explorer("480", "World Chain", "https://worldchain-mainnet.explorer.alchemy.com"),
"1088": explorer("1088", "Metis", "https://andromeda-explorer.metis.io"),
"1135": explorer("1135", "Lisk", "https://blockscout.lisk.com"),
"8453": explorer("8453", "Base", "https://base.blockscout.com"),
"34443": explorer("34443", "Mode", "https://explorer.mode.network"),
"42161": explorer("42161", "Arbitrum One", "https://arbitrum.blockscout.com"),
"42170": explorer("42170", "Arbitrum Nova", "https://arbitrum-nova.blockscout.com"),
"42220": explorer("42220", "Celo", "https://celo.blockscout.com"),
"534352": explorer("534352", "Scroll", "https://scroll.blockscout.com"),
}
KnownExplorers keeps the built-in catalog intentionally small: popular mainnets only.
Functions ¶
This section is empty.
Types ¶
type Client ¶ added in v0.2.0
type Client = client.BlockScoutAPIClient
Client is the Blockscout API client exposed from the client package.
type ExplorerURLs ¶ added in v0.2.0
ExplorerURLs contains a small curated list of popular Blockscout-compatible explorers.
type Option ¶ added in v0.2.0
Option configures a Client.
func WithAPIKey ¶ added in v0.2.0
WithAPIKey adds an API key query parameter to requests.
func WithHTTPClient ¶ added in v0.2.0
WithHTTPClient uses a caller-provided HTTP client.
func WithTimeout ¶ added in v0.2.0
WithTimeout sets the HTTP client timeout.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package client provides clients and typed data for Blockscout legacy, REST API v2, and ETH RPC endpoints.
|
Package client provides clients and typed data for Blockscout legacy, REST API v2, and ETH RPC endpoints. |
|
cmd
|
|
|
blockscout-e2e
command
|
|
|
Package common provides legacy Blockscout response types and conversion helpers.
|
Package common provides legacy Blockscout response types and conversion helpers. |
Click to show internal directories.
Click to hide internal directories.