11use crate :: { Message , Request as KiRequest } ;
2- pub use alloy:: rpc:: client:: Authorization ;
32pub use alloy:: rpc:: json_rpc:: ErrorPayload ;
43pub use alloy:: rpc:: types:: eth:: pubsub:: SubscriptionResult ;
54pub use alloy:: rpc:: types:: pubsub:: Params ;
@@ -8,6 +7,7 @@ pub use alloy::rpc::types::{
87 Block , BlockId , BlockNumberOrTag , FeeHistory , Filter , FilterBlockOption , Log , Transaction ,
98 TransactionReceipt ,
109} ;
10+ pub use alloy:: transports:: Authorization as AlloyAuthorization ;
1111pub use alloy_primitives:: { Address , BlockHash , BlockNumber , Bytes , TxHash , U128 , U256 , U64 , U8 } ;
1212use serde:: { Deserialize , Serialize } ;
1313use std:: collections:: { HashMap , HashSet } ;
@@ -220,6 +220,23 @@ pub struct ProviderConfig {
220220 pub provider : NodeOrRpcUrl ,
221221}
222222
223+ #[ derive( Clone , Debug , Deserialize , Serialize , Hash , Eq , PartialEq ) ]
224+ pub enum Authorization {
225+ Basic ( String ) ,
226+ Bearer ( String ) ,
227+ Raw ( String ) ,
228+ }
229+
230+ impl From < Authorization > for AlloyAuthorization {
231+ fn from ( auth : Authorization ) -> AlloyAuthorization {
232+ match auth {
233+ Authorization :: Basic ( value) => AlloyAuthorization :: Basic ( value) ,
234+ Authorization :: Bearer ( value) => AlloyAuthorization :: Bearer ( value) ,
235+ Authorization :: Raw ( value) => AlloyAuthorization :: Raw ( value) ,
236+ }
237+ }
238+ }
239+
223240#[ derive( Clone , Debug , Serialize , Hash , Eq , PartialEq ) ]
224241pub enum NodeOrRpcUrl {
225242 Node {
@@ -242,7 +259,7 @@ impl std::cmp::PartialEq<str> for NodeOrRpcUrl {
242259}
243260
244261impl < ' de > Deserialize < ' de > for NodeOrRpcUrl {
245- fn deserialize < D > ( serde :: deserializer: D ) -> Result < Self , D :: Error >
262+ fn deserialize < D > ( deserializer : D ) -> Result < Self , D :: Error >
246263 where
247264 D : serde:: Deserializer < ' de > ,
248265 {
@@ -257,10 +274,9 @@ impl<'de> Deserialize<'de> for NodeOrRpcUrl {
257274 }
258275
259276 #[ derive( Deserialize ) ]
260- #[ serde( tag = "type" ) ]
261277 enum Helper {
262278 Node {
263- kns_update : crate :: core :: KnsUpdate ,
279+ kns_update : crate :: net :: KnsUpdate ,
264280 use_as_provider : bool ,
265281 } ,
266282 RpcUrl ( RpcUrlHelper ) ,
0 commit comments