diff --git a/ethers-providers/src/provider.rs b/ethers-providers/src/provider.rs index e2d19b4d..bd306c3c 100644 --- a/ethers-providers/src/provider.rs +++ b/ethers-providers/src/provider.rs @@ -1345,6 +1345,18 @@ impl Provider { } } +impl Provider { + /// The Url to which requests are made + pub fn url(&self) -> &Url { + self.inner.url() + } + + /// Mutable access to the Url to which requests are made + pub fn url_mut(&mut self) -> &mut Url { + self.inner.url_mut() + } +} + impl Provider> where Read: JsonRpcClient + 'static, diff --git a/ethers-providers/src/transports/http.rs b/ethers-providers/src/transports/http.rs index 533ee2c4..4753cc2b 100644 --- a/ethers-providers/src/transports/http.rs +++ b/ethers-providers/src/transports/http.rs @@ -115,6 +115,16 @@ impl Provider { Self::new_with_client(url, Client::new()) } + /// The Url to which requests are made + pub fn url(&self) -> &Url { + &self.url + } + + /// Mutable access to the Url to which requests are made + pub fn url_mut(&mut self) -> &mut Url { + &mut self.url + } + /// Initializes a new HTTP Client with authentication /// /// # Example