@@ -26,6 +26,7 @@ pub enum PoolError {
2626
2727pub struct SolanaConnectionManager < R : Rpc + ' static > {
2828 url : String ,
29+ photon_url : Option < String > ,
2930 commitment : CommitmentConfig ,
3031 // TODO: implement Rpc for SolanaConnectionManager and rate limit requests.
3132 _rpc_rate_limiter : Option < RateLimiter > ,
@@ -36,12 +37,14 @@ pub struct SolanaConnectionManager<R: Rpc + 'static> {
3637impl < R : Rpc + ' static > SolanaConnectionManager < R > {
3738 pub fn new (
3839 url : String ,
40+ photon_url : Option < String > ,
3941 commitment : CommitmentConfig ,
4042 rpc_rate_limiter : Option < RateLimiter > ,
4143 send_tx_rate_limiter : Option < RateLimiter > ,
4244 ) -> Self {
4345 Self {
4446 url,
47+ photon_url,
4548 commitment,
4649 _rpc_rate_limiter : rpc_rate_limiter,
4750 _send_tx_rate_limiter : send_tx_rate_limiter,
@@ -58,7 +61,7 @@ impl<R: Rpc + 'static> bb8::ManageConnection for SolanaConnectionManager<R> {
5861 async fn connect ( & self ) -> Result < Self :: Connection , Self :: Error > {
5962 let config = LightClientConfig {
6063 url : self . url . to_string ( ) ,
61- photon_url : None ,
64+ photon_url : self . photon_url . clone ( ) ,
6265 commitment_config : Some ( self . commitment ) ,
6366 fetch_active_tree : false ,
6467 } ;
@@ -86,6 +89,8 @@ pub struct SolanaRpcPool<R: Rpc + 'static> {
8689#[ derive( Debug ) ]
8790pub struct SolanaRpcPoolBuilder < R : Rpc > {
8891 url : Option < String > ,
92+ photon_url : Option < String > ,
93+
8994 commitment : Option < CommitmentConfig > ,
9095
9196 max_size : u32 ,
@@ -110,6 +115,7 @@ impl<R: Rpc> SolanaRpcPoolBuilder<R> {
110115 pub fn new ( ) -> Self {
111116 Self {
112117 url : None ,
118+ photon_url : None ,
113119 commitment : None ,
114120 max_size : 50 ,
115121 connection_timeout_secs : 15 ,
@@ -128,6 +134,11 @@ impl<R: Rpc> SolanaRpcPoolBuilder<R> {
128134 self
129135 }
130136
137+ pub fn photon_url ( mut self , url : Option < String > ) -> Self {
138+ self . photon_url = url;
139+ self
140+ }
141+
131142 pub fn commitment ( mut self , commitment : CommitmentConfig ) -> Self {
132143 self . commitment = Some ( commitment) ;
133144 self
@@ -183,6 +194,7 @@ impl<R: Rpc> SolanaRpcPoolBuilder<R> {
183194
184195 let manager = SolanaConnectionManager :: new (
185196 url,
197+ self . photon_url ,
186198 commitment,
187199 self . rpc_rate_limiter ,
188200 self . send_tx_rate_limiter ,
0 commit comments