Struct ethers_etherscan::Client [−][src]
pub struct Client { /* fields omitted */ }
Expand description
The Etherscan.io API client.
Implementations
pub async fn submit_contract_verification(
&self,
contract: &VerifyContract
) -> Result<Response<String>, EtherscanError>
pub async fn submit_contract_verification(
&self,
contract: &VerifyContract
) -> Result<Response<String>, EtherscanError>
Submit Source Code for Verification
pub async fn check_contract_verification_status(
&self,
guid: impl AsRef<str>
) -> Result<Response<String>, EtherscanError>
pub async fn check_contract_verification_status(
&self,
guid: impl AsRef<str>
) -> Result<Response<String>, EtherscanError>
Check Source Code Verification Status with receipt received from
[Self::submit_contract_verification]
Returns the contract ABI of a verified contract
let client = Client::new(Chain::Mainnet, "API_KEY").unwrap();
let abi = client
.contract_abi("0xBB9bc244D798123fDe783fCc1C72d3Bb8C189413".parse().unwrap())
.await.unwrap();
pub async fn contract_source_code(
&self,
address: Address
) -> Result<ContractMetadata, EtherscanError>
pub async fn contract_source_code(
&self,
address: Address
) -> Result<ContractMetadata, EtherscanError>
Get Contract Source Code for Verified Contract Source Codes
let client = Client::new(Chain::Mainnet, "API_KEY").unwrap();
let meta = client
.contract_source_code("0xBB9bc244D798123fDe783fCc1C72d3Bb8C189413".parse().unwrap())
.await.unwrap();
let code = meta.source_code();
Returns the estimated time, in seconds, for a transaction to be confirmed on the blockchain for the specified gas price
Returns the current Safe, Proposed and Fast gas prices Post EIP-1559 changes:
- Safe/Proposed/Fast gas price recommendations are now modeled as Priority Fees.
- New field
suggestBaseFee
, the baseFee of the next pending block - New field
gasUsedRatio
, to estimate how busy the network is
pub async fn check_contract_execution_status(
&self,
tx_hash: impl AsRef<str>
) -> Result<(), EtherscanError>
pub async fn check_contract_execution_status(
&self,
tx_hash: impl AsRef<str>
) -> Result<(), EtherscanError>
Returns the status of a contract execution
pub async fn check_transaction_receipt_status(
&self,
tx_hash: impl AsRef<str>
) -> Result<(), EtherscanError>
pub async fn check_transaction_receipt_status(
&self,
tx_hash: impl AsRef<str>
) -> Result<(), EtherscanError>
Returns the status of a transaction execution: false
for failed and true
for successful
Create a new client with the correct endpoints based on the chain and provided API key
Create a new client with the correct endpoints based on the chain and API key from ETHERSCAN_API_KEY environment variable
Return the URL for the given address
Return the URL for the given transaction hash
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Client
impl !UnwindSafe for Client
Blanket Implementations
Mutably borrows from an owned value. Read more
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more